【实验】MPLS下,Pop Label和No Label的区别

实验环境:

操作系统:Windows 10(1607,14393.351,当时最新测试版),模拟器:GNS3 IOU for Windows 1.5.2(当时最新正式版)
注:当然,只要有思科模拟器都可以做这个实验

【实验】MPLS下,Pop Label和No Label的区别
【实验】MPLS下,Pop Label和No Label的区别

实验步骤:

1、先完成基础配置(IP地址和IGP):

IOU1:

conf t
int l 0
ip add 1.1.1.1 255.255.255.255

int e 0/0
ip add 12.1.1.1 255.255.255.0
no sh

router isis 1
net 49.0001.0000.0000.0001.00
is-type level-1
pass l 0
adv pass

int r e 0/0
ip router isis 1

IOU2:

conf t
int l 0
ip add 2.2.2.2 255.255.255.255

int e 0/0
ip add 12.1.1.2 255.255.255.0
no sh

int e 0/1
ip add 23.1.1.2 255.255.255.0
no sh

router isis 1
net 49.0001.0000.0000.0002.00
is-type level-1
pass l 0
adv pass

int r e 0/0 , e 0/1
ip router isis 1

IOU3:

conf t
int l 0
ip add 3.3.3.3 255.255.255.255

int e 0/0
ip add 34.1.1.3 255.255.255.0
no sh

int e 0/1
ip add 23.1.1.3 255.255.255.0
no sh

router isis 1
net 49.0001.0000.0000.0003.00
is-type level-1
pass l 0
adv pass

int r e 0/0 , e 0/1
ip router isis 1

IOU4:

conf t
int l 0
ip add 4.4.4.4 255.255.255.255

int e 0/0
ip add 34.1.1.4 255.255.255.0
no sh

int e 0/1
ip add 45.1.1.4 255.255.255.0
no sh

router isis 1
net 49.0001.0000.0000.0004.00
is-type level-1
pass l 0
adv pass

int r e 0/0 , e 0/1
ip router isis 1

IOU5:

conf t
int l 0
ip add 5.5.5.5 255.255.255.255

int e 0/0
ip add 56.1.1.5 255.255.255.0
no sh

int e 0/1
ip add 45.1.1.5 255.255.255.0
no sh

router isis 1
net 49.0001.0000.0000.0005.00
is-type level-1
pass l 0
adv pass

int r e 0/0 , e 0/1
ip router isis 1

IOU6:

conf t
int l 0
ip add 6.6.6.6 255.255.255.255

int e 0/0
ip add 56.1.1.6 255.255.255.0
no sh

router isis 1
net 49.0001.0000.0000.0006.00
is-type level-1
pass l 0
adv pass

int r e 0/0
ip router isis 1

2、接着完成MPLS的配置:

IOU2:

mpls ip
mpls label protocol ldp
mpls ldp router-id Loopback0 force
mpls label range 2000 2999

int e 0/1
mpls ip

IOU3:

mpls ip
mpls label protocol ldp
mpls ldp router-id Loopback0 force
mpls label range 3000 3999

router isis 1
mpls ldp autoconfig

IOU4:

mpls ip
mpls label protocol ldp
mpls ldp router-id Loopback0 force
mpls label range 4000 4999

router isis 1
mpls ldp autoconfig

IOU5:

mpls ip
mpls label protocol ldp
mpls ldp router-id Loopback0 force
mpls label range 5000 5999

int e 0/1
mpls ip

3、Pop Label:

【实验】MPLS下,Pop Label和No Label的区别
【实验】MPLS下,Pop Label和No Label的区别

Pop Label这个行为叫做次末跳弹出。如果没有Pop Label,那么在IOU4去访问IOU2(IOU4上ping 2.2.2.2 so 4.4.4.4)时,IOU3发给IOU2的数据包还是带有MPLS标签的,IOU2收到这个带有MPLS标签的数据包后还会去查找LFIB(只要数据包中带有MPLS标签,都会去查找LFIB),查找完LFIB后发现自己是终点且没有下一跳标签可打了,这个时候数据包只能返回给FIB来处理。

如果有Pop Label,IOU3上会弹出一层MPLS标签,IOU2收到的将是一个纯的IP数据包。因为数据包不再带有MPLS标签,所以IOU2不会再去查找LFIB了,那么数据包将按照处理正常IP数据包的方式进行处理(查FIB,然后FIB指明2.2.2.2终止于本地,然后数据包返到进程中的RIB,RIB再指示CPU让CPU处理数据包中携带的ICMP信息)。有了Pop Label这个行为,IOU2将会少查找一次LFIB,节约了处理性能。

如下图所示,IOU3上弹出一层MPLS标签,数据包发送给IOU2后,不再带有MPLS标签:

IOU3#sh mpls forwarding-table 
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
3000       Pop Label  2.2.2.2/32       0             Et0/1      23.1.1.2    
3001       Pop Label  4.4.4.4/32       0             Et0/0      34.1.1.4    
3002       2000       1.1.1.1/32       0             Et0/1      23.1.1.2    
3003       4001       5.5.5.5/32       0             Et0/0      34.1.1.4    
3004       No Label   6.6.6.6/32       0             Et0/0      34.1.1.4
IOU4#tra 2.2.2.2 so 4.4.4.4
Type escape sequence to abort.
Tracing the route to 2.2.2.2
VRF info: (vrf in name/id, vrf out name/id)
  1 34.1.1.3 [MPLS: Label 3000 Exp 0] 1 msec 0 msec 1 msec
  2 23.1.1.2 1 msec 0 msec 0 msec —— 因为IOU3上Pop Label,所以IOU2上收不到MPLS标签

4、No Label:

相信大部分人都知道Pop Label是怎么工作的,那No Label呢?

No Label和Pop Label的区别在于:Pop Label弹出的是一层标签,而No Label弹出的是所有标签。

No Label一般会出现在MPLS域的边界路由器上,比如IOU2:

IOU2#sh mpls forwarding-table 
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
2000       No Label   1.1.1.1/32       570           Et0/0      12.1.1.1    
2001       Pop Label  3.3.3.3/32       0             Et0/1      23.1.1.3    
2002       3001       4.4.4.4/32       0             Et0/1      23.1.1.3    
2003       3003       5.5.5.5/32       0             Et0/1      23.1.1.3    
2004       3004       6.6.6.6/32       0             Et0/1      23.1.1.3

当IOU4去访问IOU1(IOU4上ping 1.1.1.1 so 4.4.4.4)时,在IOU2上执行的就不是Pop Label了,而是No Label。

因为1.1.1.1这条路由来自非MPLS域,而非MPLS域的路由器没有运行MPLS转发机制,所以肯定不认识MPLS标签,这就需要弹出所有MPLS标签后才能将数据包转出MPLS域(注:数据包里会存在带有好几层MPLS标签的情况)。

IOU4#tra 1.1.1.1 so 4.4.4.4
Type escape sequence to abort.
Tracing the route to 1.1.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 34.1.1.3 [MPLS: Label 3002 Exp 0] 1 msec 1 msec 1 msec
  2 23.1.1.2 [MPLS: Label 2000 Exp 0] 0 msec 1 msec 1 msec
  3 12.1.1.1 1 msec 1 msec 1 msec —— 因为IOU2上No Label,所以IOU1上收不到任何MPLS标签

所以,No Label和Pop Label还有一个区别:Pop Label一定是目的前缀在MPLS域内。

 

其他相关文章:

这篇文章对你有帮助吗?

相关文章

发表评论?

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据