验证理论
1.分析AR2-4之间的标签交换
2.分析MPLS表项
3.分析AR1-5之间的非标签交换
实验拓扑
初始配置
AR1-AR5使用ISIS完全打通
AR2.3.4上布置MPLS
[AR2]mpls lsr-id 150.1.2.2
[AR2]mpls
Info: Mpls starting, please wait... OK!
[AR2-mpls]mpls ldp
[AR2-mpls-ldp]int g 0/0/1
[AR2-GigabitEthernet0/0/1]mpls
[AR2-GigabitEthernet0/0/1]mpls ldp
[AR3]mpls lsr-id 150.1.3.3
[AR3]mpls
Info: Mpls starting, please wait... OK!
[AR3-mpls]mpls ldp
[AR3-mpls-ldp]int g 0/0/1
[AR3-GigabitEthernet0/0/1]mpls
[AR3-GigabitEthernet0/0/1]mpls ldp
[AR3-GigabitEthernet0/0/1]int g 0/0/2
[AR3-GigabitEthernet0/0/2]mpls
[AR3-GigabitEthernet0/0/2]mpls ldp
[AR4]mpls lsr-id 150.1.4.4
[AR4]mpls
Info: Mpls starting, please wait... OK!
[AR4-mpls]mpls ldp
[AR4-mpls-ldp]int g 0/0/2
[AR4-GigabitEthernet0/0/2]mpls
[AR4-GigabitEthernet0/0/2]mpls ldp
初始结果
全网IGP互通
[AR1]dis ip routing-table | in 150.1
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15
Destination/Mask Proto Pre Cost Flags NextHop Interface
150.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
150.1.2.2/32 ISIS-L2 15 10 D 155.1.12.2 GigabitEthernet0/0/0
150.1.3.3/32 ISIS-L2 15 20 D 155.1.12.2 GigabitEthernet0/0/0
150.1.4.4/32 ISIS-L2 15 30 D 155.1.12.2 GigabitEthernet0/0/0
150.1.5.5/32 ISIS-L2 15 40 D 155.1.12.2 GigabitEthernet0/0/0
MPLS搭建成功
[AR3]dis mpls ldp session all
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A ‘*‘ before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
150.1.2.2:0 Operational DU Active 0000:00:05 23/23
150.1.4.4:0 Operational DU Passive 0000:00:04 20/20
------------------------------------------------------------------------------
TOTAL: 2 session(s) Found.
[AR3]
一.实验目的
第一步,150.1.2.2访问150.1.4.4
此时去访问的150.1.4.4就是FEC
此时AR3上执行标签快速转换,将1025转为3,由于3是隐式空标签,所以3,4之间的数据其实已经是不带标签了,仍然需要使用ARP信息
[AR2]tracert -v -q 1 -a 150.1.2.2 150.1.4.4
traceroute to 150.1.4.4(150.1.4.4), max hops: 30 ,packet length: 40,press CTRL_C to break
1 155.1.23.3[MPLS Label=1025 Exp=0 S=1 TTL=1] 40 ms
2 155.1.34.4 30 ms
[AR2]dis mpls lsp
-------------------------------------------------------------------------------
LSP Information: LDP LSP
-------------------------------------------------------------------------------
FEC In/Out Label In/Out IF Vrf Name
150.1.3.3/32 NULL/3 -/GE0/0/1
150.1.3.3/32 1024/3 -/GE0/0/1
150.1.2.2/32 3/NULL -/-
150.1.4.4/32 NULL/1025 -/GE0/0/1
150.1.4.4/32 1025/1025 -/GE0/0/1
[AR2]
[AR3]dis mpls lsp
-------------------------------------------------------------------------------
LSP Information: LDP LSP
-------------------------------------------------------------------------------
FEC In/Out Label In/Out IF Vrf Name
150.1.3.3/32 3/NULL -/-
150.1.2.2/32 NULL/3 -/GE0/0/1
150.1.2.2/32 1024/3 -/GE0/0/1
150.1.4.4/32 NULL/3 -/GE0/0/2
150.1.4.4/32 1025/3 -/GE0/0/2
[AR3]
AR2-3之间抓包,有标签,不需要ARP信息
AR3,4之间抓包,没有标签,需要ARP信息
第二步:查看MPLS控制平面和转发平面的表项
控制平面:路由表(RIB),标签信息表(LIB)
转发平面:IP转发信息表(FIB表),标签转发信息表(LFIB)
控制平面——路由表(RIB)
[AR2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
150.1.1.1/32 ISIS-L2 15 10 D 155.1.12.1 GigabitEthernet0/0/0
150.1.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
150.1.3.3/32 ISIS-L2 15 10 D 155.1.23.3 GigabitEthernet0/0/1
150.1.4.4/32 ISIS-L2 15 20 D 155.1.23.3 GigabitEthernet0/0/1
150.1.5.5/32 ISIS-L2 15 30 D 155.1.23.3 GigabitEthernet0/0/1
155.1.12.0/24 Direct 0 0 D 155.1.12.2 GigabitEthernet0/0/0
155.1.12.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
155.1.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
155.1.23.0/24 Direct 0 0 D 155.1.23.2 GigabitEthernet0/0/1
155.1.23.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
155.1.23.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
155.1.34.0/24 ISIS-L2 15 20 D 155.1.23.3 GigabitEthernet0/0/1
155.1.45.0/24 ISIS-L2 15 30 D 155.1.23.3 GigabitEthernet0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
控制平面——标签信息表(LIB)
[AR2]dis mpls lsp
-------------------------------------------------------------------------------
LSP Information: LDP LSP
-------------------------------------------------------------------------------
FEC In/Out Label In/Out IF Vrf Name
150.1.3.3/32 NULL/3 -/GE0/0/1
150.1.3.3/32 1024/3 -/GE0/0/1
150.1.2.2/32 3/NULL -/-
150.1.4.4/32 NULL/1025 -/GE0/0/1
150.1.4.4/32 1025/1025 -/GE0/0/1
[AR2]dis mpls lsp include 150.1.4.4 32 verbose
-------------------------------------------------------------------------------
LSP Information: LDP LSP
-------------------------------------------------------------------------------
No : 1
VrfIndex :
Fec : 150.1.4.4/32
Nexthop : 155.1.23.3
In-Label : NULL
Out-Label : 1025
In-Interface : ----------
Out-Interface : GigabitEthernet0/0/1
LspIndex : 6147
Token : 0x3
FrrToken : 0x0
LsrType : Ingress
Outgoing token : 0x0
Label Operation : PUSH
Mpls-Mtu : 1500
TimeStamp : 18401sec
Bfd-State : ---
BGPKey : ------
No : 2
VrfIndex :
Fec : 150.1.4.4/32
Nexthop : 155.1.23.3
In-Label : 1025
Out-Label : 1025
In-Interface : ----------
Out-Interface : GigabitEthernet0/0/1
LspIndex : 6148
Token : 0x4
FrrToken : 0x0
LsrType : Transit
Outgoing token : 0x0
Label Operation : SWAP
Mpls-Mtu : 1500
TimeStamp : 18401sec
Bfd-State : ---
BGPKey : ------
转发平面——转发信息表(FIB)
[AR2]dis fib
Route Flags: G - Gateway Route, H - Host Route, U - Up Route
S - Static Route, D - Dynamic Route, B - Black Hole Route
L - Vlink Route
--------------------------------------------------------------------------------
FIB Table:
Total number of Routes : 17
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
150.1.4.4/32 155.1.23.3 DGHU t[1770] GE0/0/1 0x3
150.1.3.3/32 155.1.23.3 DGHU t[1721] GE0/0/1 0x1
150.1.5.5/32 155.1.23.3 DGHU t[1476] GE0/0/1 0x0
150.1.1.1/32 155.1.12.1 DGHU t[1254] GE0/0/0 0x0
155.1.23.255/32 127.0.0.1 HU t[932] InLoop0 0x0
155.1.23.2/32 127.0.0.1 HU t[932] InLoop0 0x0
155.1.12.255/32 127.0.0.1 HU t[919] InLoop0 0x0
155.1.12.2/32 127.0.0.1 HU t[919] InLoop0 0x0
150.1.2.2/32 127.0.0.1 HU t[907] InLoop0 0x0
255.255.255.255/32 127.0.0.1 HU t[2] InLoop0 0x0
127.255.255.255/32 127.0.0.1 HU t[2] InLoop0 0x0
127.0.0.1/32 127.0.0.1 HU t[2] InLoop0 0x0
127.0.0.0/8 127.0.0.1 U t[2] InLoop0 0x0
155.1.12.0/24 155.1.12.2 U t[919] GE0/0/0 0x0
155.1.23.0/24 155.1.23.2 U t[932] GE0/0/1 0x0
155.1.34.0/24 155.1.23.3 DGU t[1334] GE0/0/1 0x0
155.1.45.0/24 155.1.23.3 DGU t[1423] GE0/0/1 0x0
[AR2]
ENSP不支持查看转发平面LFIB表
第三步:分析AR1与AR5互访
此时可以看到互访是没有使用标签的
[AR1]tracert -v -q 1 -a 150.1.1.1 150.1.5.5
traceroute to 150.1.5.5(150.1.5.5), max hops: 30 ,packet length: 40,press CTRL_C to break
1 155.1.12.2 30 ms
2 155.1.23.3 30 ms
3 155.1.34.4 40 ms
4 155.1.45.5 50 ms
[AR1]
从IP网络进入AR2查AR2的FIB表,根据FIB表可知对应的隧道为0,即去往150.1.5.5没有标签对应,直接路由转发即可
[AR2]dis fib
Route Flags: G - Gateway Route, H - Host Route, U - Up Route
S - Static Route, D - Dynamic Route, B - Black Hole Route
L - Vlink Route
--------------------------------------------------------------------------------
FIB Table:
Total number of Routes : 17
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
150.1.4.4/32 155.1.23.3 DGHU t[1770] GE0/0/1 0x3
150.1.3.3/32 155.1.23.3 DGHU t[1721] GE0/0/1 0x1
150.1.5.5/32 155.1.23.3 DGHU t[1476] GE0/0/1 0x0
150.1.1.1/32 155.1.12.1 DGHU t[1254] GE0/0/0 0x0
155.1.23.255/32 127.0.0.1 HU t[932] InLoop0 0x0
155.1.23.2/32 127.0.0.1 HU t[932] InLoop0 0x0
155.1.12.255/32 127.0.0.1 HU t[919] InLoop0 0x0
155.1.12.2/32 127.0.0.1 HU t[919] InLoop0 0x0
150.1.2.2/32 127.0.0.1 HU t[907] InLoop0 0x0
255.255.255.255/32 127.0.0.1 HU t[2] InLoop0 0x0
127.255.255.255/32 127.0.0.1 HU t[2] InLoop0 0x0
127.0.0.1/32 127.0.0.1 HU t[2] InLoop0 0x0
127.0.0.0/8 127.0.0.1 U t[2] InLoop0 0x0
155.1.12.0/24 155.1.12.2 U t[919] GE0/0/0 0x0
155.1.23.0/24 155.1.23.2 U t[932] GE0/0/1 0x0
155.1.34.0/24 155.1.23.3 DGU t[1334] GE0/0/1 0x0
155.1.45.0/24 155.1.23.3 DGU t[1423] GE0/0/1 0x0
[AR2]
而比如说有标签对应的转发等价类150.1.4.4,详细看下标签
[AR2]dis tunnel-info tunnel-id 0x3
Tunnel ID: 0x3
Tunnel Token: 3
Type: lsp
Destination: 150.1.4.4
Out Slot: 0
Instance ID: 0
Out Interface: GigabitEthernet0/0/1
Out Label: 1025
Next Hop: 155.1.23.3
Lsp Index: 6147
原因分析:
1.华为分配标签的特点:MPLS内部路由器一定是收到了下游的标签才会往上游分配标签,所以拓扑中AR5因为没有使能MPLS所以没有向AR4发送转发等价类150.1.5.5的标签,AR4就不会向AR3发送,AR3更不会向AR3发送转发等价类150.1.5.5的标签了
2.华为默认只对自己的主机路由分标签,比如说AR4不会对从IGP学到的转发等价类150.1.5.5分标签