ccie blog

Difference between the RD and RT

The Route-Distinguisher (RD) & Route-Target (RT) are two different concepts that are both used in an MPLS VPN. The RD is used to keep all prefixes in the BGP table unique, and the RT is used to transfer routes between VRF’s/VPNS. Let’s take a look at an example.

In the diagram below, the orange = customer A, and the red = customer B.  The ISP is creating a VPN for Customer A’s sites between Cambridge and Birmingham, and also creating a VPN between Customer B’s sites in Cambridge and Birmingham.

The problem here, is that in Birmingham, Customer A and Customer B are using the same prefixes (10.1.0.0/24 & 10.2.0.0/24). So how is PE2 going to keep the prefixes in the BGP table unique? The answer is, PE2 needs to create a separate  RD for each customer. An RD is a 64 bit value that gets prepended in front of the 32 bit IP address in order to make a globally unique 96 bit address. On PE2 if we configure Customer A to use an RD of 1:1, and Customer B with an RD of 2:2, then in the BGP vpnv4 unicast table we will see the following entries:

1:1:10.1.0.0/24
1:1:10.2.0.0/24
2:2:10.1.0.0/24
2:2:10.2.0.0/24

So by pre-pending an RD in front of the route, we have created a globally unique set of BGP prefixes in the vpnv4 BGP table that can be shared between peers. The next question is, how does PE1 know which of these routes belong to Customer A, and which of these routes belong to Customer B? All we’ve done so far is just ensure the routes are globally unique in the vpnv4 BGP table. The table currently contains 4 entries that are literally just considerd prefixes (although it’s very wierd to look at). So the answer is; by using a route-target. A route target is kind of like a little tag that is attached to a route. So PE2 may add, let’s say 100:100 to routes from Customer A in Birmingham, then when PE1 checks the vpnv4 BGP table he can choose to pick out (import) routes that have this 100:100 value and put them into a separate Virtual Routing & Forwarding (VRF) table for Customer A. The configuration regarding RD’s and RT’s is displayed below.

PE2
vrf definition CustomerA
 rd 1:1
 route-target import 100:100
 route-target export 100:100

int fa0/0
 description connection to Customer A Birmingham Site
 ip vrf forwarding CustomerA

So from the output, you can see that Customer A routes are made unique by prepending an RD of 1:1 to each prefix. Each route is assigned a route-target of 100:100 because of the VRF association with the interface. PE2 then exports this route target so that each of the routes will have 100:100 attached in the RT field within the BGP extended community attribute as they are sent to PE1.  PE1 can then import the route-target of 100:100 so that it can associate those routes tagged with this value with the Customer A VRF.

Summary

The RD is used purely for the purpose of ensuring routes are unique per VPN.  So 10 different VPN’s could use 10.0.0.0/24, and each instance of this prefix would be globally unique. The route-target is used to identify a subset of routes within the BGP vpnv4 unicast table that should be used in a VRF for a particular customer.

38 Comments

sokkhiangOctober 4th, 2013 at 10:47 am

nice explanation! Thz for the post.

kumarApril 3rd, 2014 at 7:47 pm

Good Explanation

MehdiJune 17th, 2014 at 9:33 am

The best and short explanation of this difference on the web, Thank you.

swapnil MAugust 9th, 2014 at 5:34 am

Amazing post …..boss keep going

Narayana ReddySeptember 13th, 2014 at 10:30 pm

The best and short explanation

PrashanthSeptember 17th, 2014 at 2:43 pm

Best explanation i found in web

PradeepSeptember 18th, 2014 at 10:23 am

very good explanation..

YashasSeptember 22nd, 2014 at 6:01 am

Awesome 🙂 Thanks

Bhushan TNovember 22nd, 2014 at 2:44 pm

Short and Sweet..Thanks …!!

sakthiFebruary 22nd, 2015 at 10:10 am

Crystal clear explanation yaar.thank you

SachinAugust 26th, 2015 at 12:00 pm

best explanation…

abbasOctober 15th, 2015 at 2:19 pm

yery good , thnks

NizmyNovember 27th, 2015 at 10:00 am

Concept is fully clear.

AniketJanuary 2nd, 2016 at 3:46 pm

Good i like it.

SpencerJanuary 2nd, 2016 at 3:59 pm

This is the best ever

TmanJanuary 12th, 2016 at 10:11 am

Best and simple explanation. Thanks for sharing.

AnkitFebruary 3rd, 2016 at 6:39 am

Awesome!! Thanks a ton for sharing!!

AdebMarch 3rd, 2016 at 8:12 pm

Very clear explanation

LandgarMarch 28th, 2016 at 1:43 pm

the best explanation I´ve found!

Daniel AApril 20th, 2016 at 4:33 am

Love it

FawadApril 25th, 2016 at 7:00 am

The best explanation concept is very clear

Samar GuptaMay 4th, 2016 at 1:48 pm

Excellent explained…

sagarMay 23rd, 2016 at 8:47 pm

Very nicely explained

RezardJune 11th, 2016 at 10:24 am

Very good explaination

SlarJune 23rd, 2016 at 7:54 am

I didn’t get it at first so I read it again. I still didn’t get it. Then I got it. This article allowed me to comprehend in 3 iterations instead of my normal 7. This article is much more efficient than I expected. Your effort will now allow me to understand the VRF MPLS nightmare that I created and fix it.

ROHAN PATILJune 28th, 2016 at 6:17 am

thank you so much for short and brief explanation ….

sekharOctober 2nd, 2016 at 10:39 am

very clear explanation. Finally doubts are killed using this explanation.
thank you very much 🙂

subhash kumarDecember 9th, 2016 at 5:05 am

Very simple concept to understand rd rt roll in vpnn customer

ArunDecember 17th, 2016 at 8:50 am

Crisp explanation

HPJanuary 1st, 2017 at 11:43 am

Thx

cheeryJanuary 17th, 2017 at 10:14 am

well explained. Thanks a lot.

RoomiJanuary 21st, 2017 at 1:41 pm

great job, rather than reading big articles, this is no doubt short and perfect explanation to quick understand the difference between two.

Please keep making the posts like this.

YedPedJanuary 28th, 2017 at 5:58 pm

Best of 2017. Best of ther year. thanks!

StephenFebruary 9th, 2017 at 12:00 am

This has always been a hard thing for me to understand and this helped a lot. Thank you!

anilMarch 27th, 2017 at 3:00 am

ultimate expalanation

Pynbiang HademJune 25th, 2017 at 10:09 am

Clear and Concise explanation. Really helpful

Pynbiang HademJune 25th, 2017 at 10:15 am

Clear and Concise explanation!!.

Mohamed ElsharifAugust 12th, 2017 at 2:57 am

Very informative.

Thank you Steve!

Leave a comment

Your comment