OPTION B跨域也叫单跳MP-EBGP跨域,AS内通过正常的MPLS/BGP传递×××信息和构建LSP隧道,AS之间通过单跳的MP-EBGP协议传递×××信息并构建LSP隧道。
×××信息传递
如上图所示,CE2通过IGP传递私网信息给PE2,PE2通过MP-IBGP传递×××信息到ASBR2,ASBR2通过单跳的MP-EBGP传递 ×××路由信息给ASBR1,然后,ASBR1再通过MP-IBGP传递×××信息给PE1,PE1再通过IGP协议把私网信息传递给CE1,至此,CE1拥有到达CE2的路由信息。如果中间跨域多个AS,AS内部全部按照MP-IBGP协议传递,ASBR之间全部按照单跳的MP-EBGP传递。
LSP隧道构建
当使用BGP传递路由时,如果是EBGP传递,下一跳必定改变为自己,如果通过IBGP传递,下一跳可以改变为自己也可以不改变,另外,当采用MP-BGP传递×××路由信息,下一跳更改时,那么就需要为×××重新分配标签。
如上图所示,在OPTION B跨域中,ASBR2向ASBR1传递×××路由时,下一跳必定改变为自己,同时ASBR2重新为×××分配标签,ASBR1向PE1传递×××路由信息时,分两种情况考虑,一是ASBR1向PE1传递×××路由信息时,下一跳改变为自己,一是ASBR1向PE1传递私网路由信息时,下一跳不改变,也就是下一跳仍然为ASBR2。
在改变路由下一跳为ASBR1的情况下,ASBR1重新为×××分配标签,×××从PE1到达PE2的路径为PE1→ASBR1→ASBR2→PE2,在 AS1内,构建PE1到ASBR1的双层LSP隧道,内层为×××标签(ASBR1分配的),外层为PE1到ASBR1的公网隧道,在ASBR之间构建单层LSP隧道,只携带×××标签(ASBR2分配的),在AS2内构建双层LSP隧道,内层为×××标签,PE2分配的,外层为ASBR2到PE2的公网隧道。在两个ASBR处由于×××标签都重新分配,所以最底层的标签在两个ASBR处都会有SWAP操作,也正是通过×××标签的SWAP,把两个AS的 ×××隧道连接起来。
如果不改变×××路由的下一跳,那么PE1接收的×××路由的下一跳就是AS2域内的ASBR2,则×××从PE1到PE2的路径为 PE1→ASBR2→PE2,那么就需要构建一条从PE1一直到ASBR2的双层LSP隧道,内层为×××标签(ASBR2分配的),外层为PE1到 ASBR2的公网隧道,ASBR2到PE2也构建双层LSP隧道,内层为×××标签(PE2分配的),外层为ASBR2到PE2的公网隧道。在这种情况下,ASBR2和ASBR1之间需要运行某种标签分发协议,目的是分发ASBR2的公网标签,另外,在ASBR2处LSP的内外层标签都会进行SWAP操作,从而把两条LSP粘结成一个端到端的LSP隧道。
特点
ASBR需要处理×××信息,但不需要配置VRF实例
ASBR之间一条链路传递所有×××信息
根据不同的情况,ASBR之间构建单层或双层LSP隧道
juniper@Boll-Lab> show route table ***-1 logical-router r2
***-1.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.5.0/24 *[Direct/0] 1d 01:56:41
> via ge-0/1/7.19
10.0.5.2/32 *[Local/0] 1d 01:56:41
Local via ge-0/1/7.19
172.16.0.0/30 *[BGP/170] 00:07:30, localpref 100, from 10.0.3.3 //下一跳为ASBR1
AS path: 200 I
> to 10.0.4.5 via ge-0/1/7.12, Push 101104, Push 100288(top) //压入一层BGP标签,一层LDP标签
juniper@Boll-Lab> show route table mpls.0 label 100288 detail logical-router r1
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
100288 (1 entry, 1 announced)
*LDP Preference: 9
Next hop type: Router, Next hop index: 966
Next-hop reference count: 2
Next hop: 10.0.4.14 via ge-0/1/5.13, selected
Label operation: Pop
State:
Local AS: 100
Age: 1d 0:22:52 Metric: 1
Task: LDP
Announcement bits (1): 0-KRT
AS path: I
Prefixes bound to route: 10.0.3.3/32
juniper@Boll-Lab>
juniper@Boll-Lab> show route table bgp.l3***.0 logical-router r3 //ASBR上需要处理×××的路由信息
bgp.l3***.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
65412:100:10.0.5.0/24
*[BGP/170] 00:10:22, localpref 100, from 10.0.6.2
AS path: I
>to 10.0.4.13 via ge-0/1/6.13, Push 16, Push 100304(top)
65000:100:172.16.0.0/30
*[BGP/170] 00:10:18, localpref 100
AS path: 200 I
>to 10.0.2.2 via ge-0/1/6.35, Push 101184
juniper@Boll-Lab>show route table mpls.0 label 101104 logical-router r3 //弹出外层的LDP标签,在ASBR1进行BGP标签的SWAP
mpls.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
101104 *[×××/170] 00:08:25
>to 10.0.2.2 via ge-0/1/6.35, Swap 101184
juniper@Boll-Lab>show route table mpls.0 label 101184 logical-router r5 //在ASBR2上进行×××标签的SWAP,压入到10.0.9.7的外层LDP标签
mpls.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
101184 *[×××/170] 00:21:43, metric2 1, from 10.0.9.7
> to 10.0.2.9 via ge-0/1/7.45, Swap 16, Push 100624(top)
juniper@Boll-Lab> show route table bgp.l3***.0 logical-router r5
bgp.l3***.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
65412:100:10.0.5.0/24
*[BGP/170] 00:18:11, localpref 100
AS path: 100 I
> to 10.0.2.1 via ge-0/1/7.35, Push 101088
65000:100:172.16.0.0/30
*[BGP/170] 00:18:15, localpref 100, from 10.0.9.7
AS path: I
> to 10.0.2.9 via ge-0/1/7.45, Push 16, Push 100624(top)
juniper@Boll-Lab> show route table mpls.0 label 100624 detail logical-router r4
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
100624 (1 entry, 1 announced)
*LDP Preference: 9
Next hop type: Router, Next hop index: 999
Next-hop reference count: 2
Next hop: 10.0.2.18 via ge-0/1/5.47, selected
Label operation: Pop
State:
Age: 1d 0:08:31 Metric: 1
Task: LDP
Announcement bits (1): 0-KRT
AS path: I
Prefixes bound to route: 10.0.9.7/32
juniper@Boll-Lab> show route table mpls.0 logical-router r7 //弹出LDP标签,弹出BGP标签。转发流量
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0 *[MPLS/0] 1d 02:07:54, metric 1
Receive
1 *[MPLS/0] 1d 02:07:54, metric 1
Receive
2 *[MPLS/0] 1d 02:07:54, metric 1
Receive
16 *[×××/0] 1d 02:07:54
to table ***-4.inet.0, Pop
100304 *[LDP/9] 1d 00:08:41, metric 1
> to 10.0.2.17 via ge-0/1/6.47, Pop
100304(S=0) *[LDP/9] 1d 00:08:41, metric 1
> to 10.0.2.17 via ge-0/1/6.47, Pop
100320 *[LDP/9] 1d 00:08:41, metric 1
> to 10.0.2.17 via ge-0/1/6.47, Swap 100640
juniper@Boll-Lab>