MPLS VPN RD 64-bit or 48-bit ?

各位如果注意看MPLS正式教材的內容,你會發現到一段訊息:
MPLS Vol.2 P.5-22 The RD can be specified in one of these two formats:
。16- bit autonomous system(AS) number followed by a 32-bit decimal number(ASN:nn)
。32-bit IP address followed by a 16-bit decimal number(A.B.C.D:nn)
此時各位如果真的有認真看書的話,你會腦袋中浮現一個問號? RD不是8 bytes(64 bits)嗎? 怎麼這邊加起來只有16 + 32 or 32 + 16 bits ? 後來我詢問了一下我們家資深講師,我大概了解了其中原由,因為RD分為兩種類型(Type 0 & Type 1),因此事實還有兩個位元組(2 bytes * 8=16 bits)就是用來指定類型的。

後來我在網路上找到一篇Jeff Doyle的文章有提到關於這個部份的說明,因此順便摘錄如下:



The first requirement is met by using a Route Distinguisher (RD). The RD is a 64-bit value that is prepended to a prefix to associate it with a specific VPN user. The VPN service provider assigns a unique RD each user, and possibly to each user site. The RD is prepended to every prefix advertised by each user before the prefix is added to the BGP table. 
In our example of five different VPN users advertising 10.1.1.0/24, RDs might be prepended as follows:
-       User A, at site 1:             1:1:10.1.1.0/24
-       User B, at site 1:             2:1:10.1.1.0/24
-       User C, at site 1:             3:1:10.1.1.0/24
-       User D, at site 2:            4:2:10.1.1.0/24
-       User E, at site 3:            5:3:10.1.1.0/24
You can easily see that because of the RDs, the five prefixes that were numerically identical are now unique.
But they are also no longer IPv4 addresses. The addresses created by prepending an RD belong to an address family called VPN-IPv4. And because BGP must advertise this VPN-IPv4 address family in addition to the default IPv4 address family, we use Multiprotocol BGP (MBGP).
For the second requirement, creating policies to determine what prefixes belong in what information tables, a solution might be to create VPN-IPv4 prefix filters for each local information table. But prefix filters don’t scale well operationally, particularly in the presence of hundreds or thousands of individual VPN users.
Filtering on VPN-IPv4 addresses also isn’t as flexible as we would like. For example, user A and user B might want to create a VPN-based intranet between them, advertising a limited subset of their mutual address spaces to each other.
Fortunately, BGP already has a policy tool created especially for applying flexible policies to large groups of prefixes: Communities. The BGP Communities path attribute is a “tag” that can be applied to BGP prefixes. As the name implies, prefixes sharing the same tag comprise a “community” to which some common policy can be applied.
Communities also provide for wide policy flexibility, because a single prefix can have multiple Communities attached to it. So you can create a policy that applies only if a specific Community is recognized, or if some combination of Communities is recognized.
BGP Communities also come in two “flavors”: Standard Communities are 32-bit values; Extended Communities are 64-bit values. And that brings us back to the VPN discussion.
MPLS VPNs use a 64-bit Extended Community attribute called a Route Target (RT). At a given PE, you create an outgoing policy that attaches an RT to prefixes advertised by a VPN user site attached locally to the PE. You then create an incoming policy at all other PEs where that user has attached sites, recognizing the user’s one or more RTs and accepting the associated prefixes into the user’s local VPN information table.
The difference between Route Distinguishers and Route Targets tends to be a source of confusion for many networkers, primarily because they are both 64-bit values that are formatted in exactly the same way. Each has a 2-byte Type field that specifies one of two format types: Either Type 0 or Type 1.  Two fields, the Administrator field and the Assigned Number field, follow the Type field. Type 0 RDs and RTs have a 2-byte Admin field and a 4-byte Assigned Number field; type 1 RDs and RTs have a 4-byte Admin field and a 2-byte Assigned Number field. In both cases the Assigned Number field is some arbitrary number that you define; although the Admin field can also be an arbitrary number if you like, the two types allow you to make that field either a 2-byte AS number or a 4-byte IP address.
The important point, though, is that although RDs and RTs are the same in format they are entirely different animals performing entirely different tricks. Remember that Route Distinguishers serve only to make potentially identical prefixes unique, while Route Targets are a type of BGP Communities attribute that enable distribution of reachability information to the correct information table.

Comments

Popular posts from this blog

TCP/IP 明確擁塞通知 (ECN)

集中式數位交換機(CENTREX)系統

WRR(Weighted Round Robin) vs SRR(Shared/Shaped Round Robin)