Sunday, 6 March 2016

OSPF over DMVPN

OSPF over DMVPN

What we need to keep in mind here is that mGRE is a non-broadcast multi-access network (NBMA) how OSPF works. In order for OSPF to operate properly, the DMVPN hub router must be the OSPF DR and all the other routers should not be allowed to be a DR/BDR.  The only way you could have a DR/BDR design if this was a multi-hub DMVPN network – and that is beyond the scope of this post (due to hardware limitation in my lab). Also, the mGRE tunnel on the hub router must be set to a OSPF broadcast network via the ip ospf network broadcast command.


R1 -====( DMVPN  ))========R5

First thing we will do is add a Loopback interface to the DMVPN hub router.R5
The reason we are doing this here, and every other router, is to give us something to route!







crypto isakmp policy 10
 encr aes
 hash md5
 authentication pre-share
 group 5
crypto isakmp key cisco address 0.0.0.0       
!
!
crypto ipsec transform-set ESP_AES_SHA esp-aes esp-sha-hmac
 mode tunnel
!
crypto ipsec profile DMVPN_PROFILE
 set transform-set ESP_AES_SHA
!



interface Loopback0
 ip address 150.1.5.5 255.255.255.255
 ipv6 address 2001:150:5:5::5/128


Now onto the Tunnel interface.  Keep in mind I will only be notating the OSPF related commands.

interface Tunnel0
 ip address 155.1.0.5 255.255.255.0
 no ip redirects

I will notate the MTU.  This must be the same on all interfaces in order for OSPF to work.  Worst case, you might be able to use the ip ospf mt-ignore command.
 ip mtu 1400
 ip nhrp authentication NHRPPASS
You will need to configure NHRP mapping for Multicast traffic
 ip nhrp map multicast dynamic
 ip nhrp network-id 1
 ip tcp adjust-mss 1360
 delay 1000
The hub should be configured as OSPF network-type broadcast (the same from R1 to R5)
interface Tunnel0
ip ospf network type broadcast
ip ospf 1 area 0

!
Set the OSPF priority high to make sure this is the DR
ip ospf priority 255
 tunnel source Ethernet0/0.100
 tunnel mode gre multipoint
 tunnel key 150
 tunnel protection ipsec profile DMVPN_PROFILE
!
Now we need to configure the OSPF routing process, here ID 1
router ospf 1 

now the other routers
example 

R1
!
crypto isakmp policy 10
 encr aes
 hash md5
 authentication pre-share
 group 5
crypto isakmp key cisco address 0.0.0.0       
!
!
crypto ipsec transform-set ESP_AES_SHA esp-aes esp-sha-hmac
 mode tunnel
!
crypto ipsec profile DMVPN_PROFILE
 set transform-set ESP_AES_SHA
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 150.1.1.1 255.255.255.255
 ipv6 address 2001:150:1:1::1/128
!
interface Tunnel0
 ip address 155.1.0.1 255.255.255.0
 no ip redirects
 ip mtu 1400
 ip nhrp authentication NHRPPASS
 ip nhrp map 155.1.0.5 169.254.100.5
 ip nhrp map multicast 169.254.100.5
 ip nhrp network-id 1
 ip nhrp holdtime 300
 ip nhrp nhs 155.1.0.5
 ip tcp adjust-mss 1360


ip ospf network type broadcast
ip ospf 1 area 0

!
Set the OSPF priority high to make sure this is not DR or BDR.
ip ospf priority0
 tunnel source Ethernet0/0.100
 tunnel mode gre multipoint
 tunnel key 150
 tunnel protection ipsec profile DMVPN_PROFILE
!

 -===========

OSPF DR manipulation has been already presented in this part. 
Router with higher priority will win. 

Diffserv and PHB

Differentiated services

From Wikipedia, the free encyclopedia
This article is about communication networks. For the design pattern for business applications, see Differentiated service (design pattern).
Differentiated services or DiffServ is a computer networking architecture that specifies a simple, scalable and coarse-grained mechanism for classifying and managing network traffic and providing quality of service (QoS) on modern IP networks. DiffServ can, for example, be used to provide low-latency to critical network traffic such as voice or streaming media while providing simple best-effort service to non-critical services such as web traffic or file transfers.
DiffServ uses a 6-bit differentiated services code point (DSCP) in the 8-bit differentiated services field (DS field) in the IP header for packet classification purposes. The DS field and ECN field replace the outdated IPv4 TOS field.[1]

 


Contents

Background

Since modern data networks carry many different types of services, including voice, video, streaming music, web pages and email, many of the proposed QoS mechanisms that allowed these services to co-exist were both complex and failed to scale to meet the demands of the public Internet. In December 1998, the IETF published RFC 2474 - Definition of the Differentiated services field (DS field) in the IPv4 and IPv6 headers, which replaced the IPv4 TOS field with the DS field. In the DS field, a range of eight values (Class Selectors) is used for backward compatibility with the IP precedence specification in the former TOS field. Today, DiffServ has largely supplanted TOS and other layer-3 QoS mechanisms, such as integrated services (IntServ), as the primary architecture routers use to provide different levels of service.

Traffic management mechanisms

DiffServ is a coarse-grained, class-based mechanism for traffic management. In contrast, IntServ is a fine-grained, flow-based mechanism. DiffServ relies on a mechanism to classify and mark packets as belonging to a specific class. DiffServ-aware routers implement per-hop behaviors (PHBs), which define the packet-forwarding properties associated with a class of traffic. Different PHBs may be defined to offer, for example, low-loss or low-latency.
DiffServ operates on the principle of traffic classification, where each data packet is placed into a limited number of traffic classes, rather than differentiating network traffic based on the requirements of an individual flow. Each router on the network is configured to differentiate traffic based on its class. Each traffic class can be managed differently, ensuring preferential treatment for higher-priority traffic on the network. The premise of Diffserv is that complicated functions such as packet classification and policing can be carried out at the edge of the network by edge routers who then mark the packet to receive a particular type of per-hop behavior. Core router functionality can then be kept simple. No classification and policing is required. Such routers simply apply PHB treatment to packets based on the marking. PHB treatment is achieved by core routers using a combination of scheduling policy and queue management policy.
While DiffServ does recommend a standardized set of traffic classes,[2] the DiffServ architecture does not incorporate predetermined judgements of what types of traffic should be given priority treatment. DiffServ simply provides a framework to allow classification and differentiated treatment. The standard traffic classes (discussed below) serve to simplify interoperability between different networks and different vendors' equipment.

DiffServ domain

A group of routers that implement common, administratively defined DiffServ policies are referred to as a DiffServ domain.

Classification and marking

Network traffic entering a DiffServ domain is subjected to classification and conditioning. Traffic may be classified by many different parameters, such as source address, destination address or traffic type and assigned to a specific traffic class. Traffic classifiers may honor any DiffServ markings in received packets or may elect to ignore or override those markings. Because network operators want tight control over volumes and type of traffic in a given class, it is very rare that the network honors markings at the ingress to the DiffServ domain.[citation needed] Traffic in each class may be further conditioned by subjecting the traffic to rate limiters, traffic policers or shapers.[3]
The Per-Hop Behavior is determined by the DS field of the IP header. The DS field contains a 6-bit Differentiated Services Code Point (DSCP) value.[4] Explicit Congestion Notification (ECN) occupies the least-significant 2 bits of the IPv4 Type of Service field (TOS) and IPv6 Traffic Class field (TC).[5][6][7]
In theory, a network could have up to 64 (i.e. 26) different traffic classes using different DSCPs. The DiffServ RFCs recommend, but do not require, certain encodings. This gives a network operator great flexibility in defining traffic classes. In practice, however, most networks use the following commonly defined Per-Hop Behaviors:
  • Default PHB—which is typically best-effort traffic
  • Expedited Forwarding (EF) PHB—dedicated to low-loss, low-latency traffic
  • Assured Forwarding (AF) PHB—gives assurance of delivery under prescribed conditions
  • Class Selector PHBs—which maintain backward compatibility with the IP Precedence field.

Default Forwarding

A Default PHB (a.k.a. Default Forwarding (DF) PHB[8]) is the only required behavior. Essentially, any traffic that does not meet the requirements of any of the other defined classes is placed in the default PHB. Typically, the default PHB has best-effort forwarding characteristics. The recommended DSCP for the default PHB is 000000B (0).

Expedited Forwarding

The IETF defines Expedited Forwarding behavior in RFC 3246. The EF PHB has the characteristics of low delay, low loss and low jitter. These characteristics are suitable for voice, video and other realtime services. EF traffic is often given strict priority queuing above all other traffic classes. Because an overload of EF traffic will cause queuing delays and affect the jitter and delay tolerances within the class, EF traffic is often strictly controlled through admission control, policing and other mechanisms. Typical networks will limit EF traffic to no more than 30%—and often much less—of the capacity of a link[citation needed]. The recommended DSCP for expedited forwarding is 101110B (46 or 2EH).

Voice Admit

The IETF defines Voice Admit behavior in RFC 5865. The Voice Admit PHB has identical characteristics to the Expedited Forwarding PHB. However Voice Admit traffic is also admitted by the network using a Call Admission Control (CAC) procedure. The recommended DSCP for voice admit is 101100B (44 or 2CH).

Assured Forwarding

The IETF defines the Assured Forwarding behavior in RFC 2597 and RFC 3260. Assured forwarding allows the operator to provide assurance of delivery as long as the traffic does not exceed some subscribed rate. Traffic that exceeds the subscription rate faces a higher probability of being dropped if congestion occurs.
The AF behavior group defines four separate AF classes where all have the same priority. Within each class, packets are given a drop precedence (high, medium or low, where higher precedence means more dropping). The combination of classes and drop precedence yields twelve separate DSCP encodings from AF11 through AF43 (see table).
Assured Forwarding (AF) behavior group

Class 1 Class 2 Class 3 Class 4
Low drop probability AF11 (DSCP 10) AF21 (DSCP 18) AF31 (DSCP 26) AF41 (DSCP 34)
Med drop probability AF12 (DSCP 12) AF22 (DSCP 20) AF32 (DSCP 28) AF42 (DSCP 36)
High drop probability AF13 (DSCP 14) AF23 (DSCP 22) AF33 (DSCP 30) AF43 (DSCP 38)
Some measure of priority and proportional fairness is defined between traffic in different classes. Should congestion occur between classes, the traffic in the higher class is given priority. Rather than using strict priority queuing, more balanced queue servicing algorithms such as fair queuing or weighted fair queuing (WFQ) are likely to be used. If congestion occurs within a class, the packets with the higher drop precedence are discarded first. To prevent issues associated with tail drop, more sophisticated drop selection algorithms such as random early detection (RED) are often used.

Class Selector

Prior to DiffServ, IPv4 networks could use the Precedence field in the TOS byte of the IPv4 header to mark priority traffic. The TOS octet and IP precedence were not widely used. The IETF agreed to reuse the TOS octet as the DS field for DiffServ networks. In order to maintain backward compatibility with network devices that still use the Precedence field, DiffServ defines the Class Selector PHB.
The Class Selector code points are of the form 'xxx000'. The first three bits are the IP precedence bits. Each IP precedence value can be mapped into a DiffServ class. CS0 equals to IP precedence 0, CS1 to IP precedence 1, and so on. If a packet is received from a non-DiffServ aware router that used IP precedence markings, the DiffServ router can still understand the encoding as a Class Selector code point.
Class selector values
DSCP Binary Decimal Typical application Examples
CS0 (Default) 000 000 0

CS1 001 000 8 Scavenger YouTube, Gaming, P2P
CS2 010 000 16 OAM SNMP,SSH,Syslog
CS3 011 000 24 Signaling SCCP,SIP,H.323
CS4 100 000 32 Realtime TelePresence
CS5 101 000 40 Broadcast video Cisco IPVS
CS6 110 000 48 Network control EIGRP,OSPF,HSRP,IKE
CS7 111 000 56

Commonly used DSCP values

List of the commonly used DSCP values described in RFC 2475.
Commonly used DSCP values
DSCP value Decimal value Meaning Drop probability Equivalent IP precedence value
101 110 46 Expedited forwarding (EF) N/A 101 Critical
000 000 0 Best effort N/A 000 - Routine
001 010 10 AF11 Low 001 - Priority
001 100 12 AF12 Medium 001 - Priority
001 110 14 AF13 High 001 - Priority
010 010 18 AF21 Low 010 - Immediate
010 100 20 AF22 Medium 010 - Immediate
010 110 22 AF23 High 010 - Immediate
011 010 26 AF31 Low 011 - Flash
011 100 28 AF32 Medium 011 - Flash
011 110 30 AF33 High 011 - Flash
100 010 34 AF41 Low 100 - Flash override
100 100 36 AF42 Medium 100 - Flash override
100 110 38 AF43 High 100 - Flash override

Design considerations

Under DiffServ, all the policing and classifying is done at the boundaries between DiffServ domains. This means that in the core of the Internet, routers are unhindered by the complexities of collecting payment or enforcing agreements. That is, in contrast to IntServ, DiffServ requires no advance setup, no reservation, and no time-consuming end-to-end negotiation for each flow.
The details of how individual routers deal with the DS field is configuration specific, therefore it is difficult to predict end-to-end behaviour. This is complicated further if a packet crosses two or more DiffServ domains before reaching its destination. From a commercial viewpoint this means that it is impossible to sell different classes of end-to-end connectivity to end users, as one provider's Gold packet may be another's Bronze. DiffServ or any other IP based QoS marking does not ensure quality of the service or a specified service-level agreement (SLA). By marking the packets, the sender indicates that it wants the packets to be treated as a specific service, but it can only hope that this happens. It is up to all the service providers and their routers in the path to ensure that their policies will take care of the packets in an appropriate fashion.
The problem addressed by DiffServ does not exist in a system that has enough capacity to carry all traffic.

Bandwidth broker

RFC 2638 from IETF defines the entity of the Bandwidth Broker in the framework of DiffServ. A Bandwidth Broker is an agent that has some knowledge of an organization's priorities and policies and allocates bandwidth with respect to those policies. In order to achieve an end-to-end allocation of resources across separate domains, the Bandwidth Broker managing a domain will have to communicate with its adjacent peers, which allows end-to-end services to be constructed out of purely bilateral agreements.

DiffServ RFCs

  • RFC 2474—Definition of the differentiated services field (DS field) in the IPv4 and IPv6 headers
  • RFC 2475—An architecture for differentiated services
  • RFC 2597—Assured forwarding PHB group
  • RFC 2983—Differentiated services and tunnels
  • RFC 3086—Definition of differentiated services per domain behaviors and rules for their specification
  • RFC 3140—Per hop behavior identification codes (Obsoletes RFC 2836)
  • RFC 3246—An expedited forwarding PHB (Obsoletes RFC 2598)
  • RFC 3247—Supplemental information for the new definition of the EF PHB (expedited forwarding per-hop behavior)
  • RFC 3260—New Terminology and Clarifications for Diffserv (Updates RFC 2474, RFC 2475 and RFC 2597)
  • RFC 4594—Configuration Guidelines for DiffServ Service Classes
  • RFC 5865—A differentiated services code point (DSCP) for capacity-admitted traffic (updates RFC 4542 and RFC 4594)

DiffServ Management RFCs

  • RFC 3289—Management information base for the differentiated services architecture
  • RFC 3290—An informal management model for differentiated services routers
  • RFC 3317—Differentiated services quality of service policy information base