Useful Articles

25/recent/ticker-posts

ROUTE DISTINGUISHER AND ITS TYPES

ROUTE DISTINGUISHER AND ITS TYPES

 
Route-Distinguisher(RD) is 64bit value appended to an IPv4 route/prefix to make it unique while it is advertised from a PE to PE or PE to RR. The total 96bit prefix is called a VPNv4 route/prefix.

A VPNv4 (or VPN-IPv4) route comprises of 8-byte Route-Distinguisher (RD) and 4-byte IPv4 address. When a PE router receives an IPv4 prefix, it translates it into VPNv4 prefixes. So if the same address scheme is used in different VPNs, it is possible for BGP to carry completely different routes to that address, one for each VPN.


Important Note:  Some books/blogs explain RD is locally significant which is not true. RD value is carried in a VPNv4 update under MP Reach NLRI attribute.

RD consists of following 3 fields

1) A Type field (2 bytes).
2) An Administrator field.
3) An Assigned Number field.

Please the diagram below for more details:

ROUTE-DISTINGUISHER AND ITS TYPES

The value of the Type field determines the lengths and the semantics of the other two fields. The Administrator field identifies the assigned number authority and the Assigned Number field contains a number that has been assigned by the identified authority for that purpose.

At present, three values of Type field are identified- 0, 1 and 2.

TYPE0: If Type value is 0, the Administrator field is 2-bytes and Assigned Number field is 4-bytes.

The Administrator field should be set to Autonomous System Number (ASN- only public ASN should be used) assigned by the appropriate authority. The Assigned Number field contains a number from a numbering space that is administered by the enterprise to which the ASN has been assigned by the appropriate authority.

Example- If the SP is using ASN 100, and the Assigned Number is 200, the IPv4 prefix 192.168.10.0/24 is translated to 0:100:200:192.168.10.0.

TYPE1: If Type value is 1, the Administrator field is 4-bytes and Assigned Number field is 2-bytes.

The Administrator field should be set to the IP address (public IP addresses should be used). The Assigned Number field contains a number from a numbering space that is administered by the enterprise to which the IP address has been assigned by the appropriate authority.

Example- If the SP is using the IP address 9.9.0.1, and the Assigned Number is 200, the IPv4 prefix 192.168.10.0/24 is translated to 1:9.9.0.1:200:192.168.10.0

Type 0 and Type 1 RDs are used when translating IPv4 prefixes to VPNv4 prefix. Cisco IOS uses Type 0 RD only for this purpose.

TYPE2: If Type value is 2, the Administrator field is 4-bytes and Assigned Number field is 2-bytes.

The Administrator field should be set to BGP Autonomous System Number (ASN- only public ASN should be used) assigned by the appropriate authority. The Assigned Number field contains a number from a numbering space that is administered by the enterprise to which the ASN has been assigned by the appropriate authority.

Example- If the SP is using ASN 100, and the Assigned Number is 200, the IPv4 prefix 192.168.10.0/24 is translated to 2:100:200:192.168.10.0

To configure RD in Cisco IOS, use the formats ASN : Seq number  or IP-address : Seq number under  the VRF configuration.

Route Distinguisher (RD) vs  Route Targe (RT)

Route Distinguisher(RD)

Route Distinguisher (RD) helps differentiating the network prefixes at Service Provider side (at PE) when multiple customers using same network ranges. In below examples, two different customers are using same subnet in their LAN.

CustomerA LAN range -  10.10.10.0/24
CustomerB LAN range - 10.10.10.0/24

After we add RD on these routes, these will become VPNv4 and will remain differentiated at Service Provider Core level. Let's assume CustomerA RD value (type 0) is 100:100 and CustomerB RD value (type0) is 100:101


Router(config)#ip vrf CustomerA
Router(config-vrf)#rd 100:100

Router(config)#ip vrf CustomerB
Router(config-vrf)#rd 100:101

CustomerA VPNv4 route :   100:100:10.10.10.0
CustomerB VPNv4 route :   100:101:10.10.10.0


Route Target (RT)

Route Target (RT) is the actual Customer Distinguisher.  For example if CustomerA is allotted an RT 100:500, and if CustomerA has 50 sites connected to different PEs in the Service Provider, the same RT value (100:500) has to be configured under the customer VRF configuation, for example:

Router(config)#ip vrf CustomerA
Router(config-vrf)#rd 100:100
Router(config-vrf)#route-target import 100:500
Router(config-vrf)#route-target export 100:500

Let's assume an RT of 100:501 is allotted to CustomerB and it has 30 sites.  The VRF config on all 30 PEs will be as follows:

Router(config)#ip vrf CustomerB
Router(config-vrf)#rd 100:101
Router(config-vrf)#route-target import 100:501
Router(config-vrf)#route-target export 100:501

Kindly note that if you by mistake you have imported the RT 100:500 (CustomerA) in vrf config of CustomerB, the routes of CustomerA will be imported in CustomerB's routing table.

This shows the importance of RT as customer distinguisher.