根据Cisco技能的MPLS原理以及使用完成[一]51CTO博客 - 凯时娱乐

根据Cisco技能的MPLS原理以及使用完成[一]51CTO博客

2019年02月26日14时38分25秒 | 作者: 向彤 | 标签: 技能,标签,原理 | 浏览: 483

依据Cisco技能的MPLS *** 完成[一] MPLS的呈现是由于现有的路由挑选以及转发技能无法应对越来越大的internet路由表. ATM技能相对于IP技能的优势在于ATM信元转发的快速性, IP技能相对于ATM技能的优势在于IP技能的完成简单性和灵活性. 尽管IP是能够承载在ATM之上的, 可是由于大容量的ATM交互矩阵的高本钱以及每个53字节的ATM信元都会有8字节的ATM头带来的转发低效率, 标签转发技能当令的呈现了. 下图是MPLS(多协议标签转发)技能的一个运用图表.       在这个连载中, 我会顺次解说这些依据标签转发技能的运用细节和CISCO完成. MPLS是一个2.5层技能, 能够参阅下面的依据帧形式的一个协议字段图. MPLS的lable是加在帧头和IP头之间的. 也能够刺进多标签针对不同的MPLS运用(比方MPLS-***运用, 流量工程, 依据MPLS-***的流量工程等).     多标签状况如下图.   由于标签的引进带来的MTU扩展问题. 标签的长度是4字节, 依据CISCO主张, 体系MTU设置为1524假如是以太网封装的话, 多的24字节能够承载6个标签的刺进, 一般状况下6个标签适应于简直一切的运用了. 下面6台路由器组成的一个拓扑环境就是这一部分的试验图.   R1(IPS1)和R2(Border1)之间是EBGP街坊, R2(Border1)和R5(Border2)之间是IBGP街坊, R5(Border2)和R6(IPS2)之间是EBGP街坊. R2(Border1), R3(Core1), R4(Core2), R5(Border2)之间跑IGP协议, 图中是RIP, 后边的具体装备是OSPF. R2(Border1), R3(Core1), R4(Core2), R5(Border2)的相邻接口都启用MPLS并树立MPLS街坊. R1(IPS1)宣告(network)一条R1的32环回路由给R2(Border1). R6(IPS2)宣告(network)一条R6的32环回路由给R5(Border2). Core1和Core2并没有跑BGP协议. 依据BGP原理, R2会从R1学习到一条EBGP路由,而且传递给IBGP街坊R5. R5会将这条IBGP路由传递给EBGP街坊R6. 反之亦然. 依据BGP原理, Core1和Core2并没有跑BGP,也没有将BGP重分发到IGP中, 因而假如从R1 ping 学习到的R6的环回口地址(BGP 路由), 是不会通的, 由于BGP路由黑洞. Core1会丢掉去往R6的包由于路由不可达.  可是, 咱们却能够在R1上(经过以宣告的环回口做源地址)traceroute或许ping学习到的EBGP路由(及是R6的环回口地址), 发现是能够通的.  这个就是MPLS转建议的效果了. 首要咱们看一下LDP/TDP协议也就是标签分发协议. TDP是CISCO的私有协议,可是原理根本一起. LDP/TDP的作业首要分下面几个部分: (1) 街坊发现阶段, 这一阶段经过依据UDP的Hello包发往组播地址224.0.0.2来发现链路上的街坊, 假如丢掉三个hello包宣告街坊失效. 也能够经过装备peer来发送单播hello来树立街坊, 由于ldp session是依据TCP的, 所以ldp能够跨过网络树立session, 并不需求直连. (2) TCP衔接的树立 (3) LDP Session的树立 (4) 标签的分发 同一台路由器上不同接口能够别离启用ldp或许tdp协议, 同一接口上也能够启用ldp和tdp双协议.     下面, 用一个实践的完成例子来解析MPLS的原理. 拓扑运用上面IPS1,IPS2,Border1,Border2,Core1,Core2组成的试验图. 路由器衔接如下: Router1 E1/0 <> Router2 E1/0
Router2 E1/1 <> Router3 E1/1
Router3 E1/2 <> Router4 E1/2
Router4 E1/3 <> Router5 E1/3
Router5 E1/0 <> Router6 E1/0
路由器装备如下: r1#sh run
Building configuration... Current configuration : 1061 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
!
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!        
interface Ethernet1/0
 ip address 172.16.1.1 255.255.0.0
 duplex half
!
interface Ethernet1/1
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/2
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/3
 no ip address
 duplex half
 tag-switching ip
!
router bgp 200
 no synchronization
 bgp router-id 10.10.10.10
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 neighbor 172.16.2.2 remote-as 100
 no auto-summary
!
ip classless
no ip http server
no ip http secure-server
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 login
!
!
end r1#
r1#   r2#sh run
Building configuration... Current configuration : 1374 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
mpls label range 200 299
mpls label protocol ldp
tag-switching tdp router-id Loopback0
!
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/0
 ip address 172.16.2.2 255.255.0.0
 duplex half
!
interface Ethernet1/1
 ip address 10.2.2.2 255.255.255.0
 duplex half
 mpls label protocol ldp
 tag-switching ip
!
interface Ethernet1/2
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/3
 no ip address
 shutdown
 duplex half
!        
router ospf 2
 log-adjacency-changes
 network 2.2.2.2 0.0.0.0 area 0
 network 10.2.2.0 0.0.0.255 area 0
 network 172.16.0.0 0.0.255.255 area 0
!
router bgp 100
 no synchronization
 bgp router-id 20.20.20.20
 bgp log-neighbor-changes
 neighbor 5.5.5.5 remote-as 100
 neighbor 5.5.5.5 update-source Loopback0
 neighbor 172.16.1.1 remote-as 200
 no auto-summary
!
ip classless
no ip http server
no ip http secure-server
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 login
!
!
end r2#   r3#sh run 
Building configuration... Current configuration : 1147 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
mpls label range 300 399
mpls label protocol ldp
tag-switching tdp router-id Loopback0
!        
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!        
interface Ethernet1/0
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/1
 ip address 10.2.2.3 255.255.255.0
 duplex half
 tag-switching ip
!
interface Ethernet1/2
 ip address 10.3.3.3 255.255.255.0
 duplex half
 tag-switching ip
!
interface Ethernet1/3
 no ip address
 shutdown
 duplex half
!
router ospf 3
 log-adjacency-changes
 network 3.3.3.3 0.0.0.0 area 0
 network 10.2.2.0 0.0.0.255 area 0
 network 10.3.3.0 0.0.0.255 area 0
!
ip classless
no ip http server
no ip http secure-server
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 login
!
!
end r3#   r4#sh run
Building configuration... Current configuration : 1173 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
mpls label range 400 499
tag-switching tdp router-id Loopback0
!
!
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/0
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/1
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/2
 ip address 10.3.3.4 255.255.255.0
 duplex half
 mpls label protocol ldp
 tag-switching ip
!
interface Ethernet1/3
 ip address 10.4.4.4 255.255.255.0
 duplex half
 mpls label protocol tdp
 tag-switching ip
!
router ospf 4
 log-adjacency-changes
 network 4.4.4.4 0.0.0.0 area 0
 network 10.3.3.0 0.0.0.255 area 0
 network 10.4.4.0 0.0.0.255 area 0
!
ip classless
no ip http server
no ip http secure-server
!
!
gatekeeper
 shutdown
!
!        
line con 0
 exec-timeout 0 0
 logging synchronous
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 login
!
!
end r4#   r5#sh run
Building configuration... Current configuration : 1353 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
mpls label range 500 599
tag-switching tdp router-id Loopback0
!
!
interface Loopback0
 ip address 5.5.5.5 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/0
 ip address 192.168.5.5 255.255.0.0
 duplex half
!
interface Ethernet1/1
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/2
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/3
 ip address 10.4.4.5 255.255.255.0
 duplex half
 mpls label protocol tdp
 tag-switching ip
!
router ospf 5
 log-adjacency-changes
 network 5.5.5.5 0.0.0.0 area 0
 network 10.4.4.0 0.0.0.255 area 0
 network 192.168.0.0 0.0.255.255 area 0
!
router bgp 100
 no synchronization
 bgp router-id 50.50.50.50
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 100
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 192.168.6.6 remote-as 300
 no auto-summary
!
ip classless
no ip http server
no ip http secure-server
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 login
!
!
end r5#   r6#sh run
Building configuration... Current configuration : 1055 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r6
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
!
!
interface Loopback0
 ip address 6.6.6.6 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!        
interface Ethernet1/0
 ip address 192.168.6.6 255.255.0.0
 duplex half
!
interface Ethernet1/1
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/2
 no ip address
 shutdown
 duplex half
!
interface Ethernet1/3
 no ip address
 shutdown
 duplex half
!
router bgp 300
 no synchronization
 bgp router-id 60.60.60.60
 bgp log-neighbor-changes
 network 6.6.6.6 mask 255.255.255.255
 neighbor 192.168.5.5 remote-as 100
 no auto-summary
!
ip classless
no ip http server
no ip http secure-server
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 login
!
!
end r6#   MPLS技能领域中需求熟记于心的操控层面,转发层面结构图如下所示.   上图描绘的还不是很全面. 操控层面中的routing protocol指的是IP层面的路由操控交互协议,比方RIP,OSPF等等. LDP指的是标签分发协议LDP或许TDP. IP Forwarding Table及是Cisco IOS中的cef table(FIB) 有ip routing table 和LIB 一起效果生成. 一切存在Label Forwarding Table(LFIB) 向IP Forwarding Table做的一个标签回灌动作. 一起, LFIB需求LIB和FIB信息发生, 所以一般能够以为LFIB = LIB + FIB 进入MPLS路由器的报文是查询FIB表仍是LFIB表是依据报文是否带有标签决议的. 带有标签的报文,以太帧头中的类型字段是不一样的. 同理, 出MPLS路由器的报文既有可能是IP包(pop或许untag动作后)也有可能是标签包. [常用命令] (1) show mpls ldp bindings (检查LIB标签表) (2) show mpls forwarding-table detail (检查LFIB的标签转宣布) (3) show  ip cef detail (检查FIB IP转宣布) [注!!!] (1) CISCO的MPLS完成, ip cef 有必要启用 (2) mpls ldp route-id 有必要ip层面可达 (3) 次末跳弹出准则, ldp协议给本路由器直连网段分配空标签, 下一跳为空标签的状况下, 履行标签pop动作 (4) ldp协议不为BGP路由分配标签(在MPLS ***的运用中为顶层标签), 该标签取自BGP路由下一跳地址所分配的标签 (5) 以上的完成中, R2与IPS1的网段和R5与IPS2的网段宣告进了OSPF. 假如这两个网段不宣告进OSPF, R2和R5互为IBGP街坊的装备中, 装备neighbour xx.xx.xx.xx next-hop-self, 从R1以lo0为源拜访R6的lo0仍然是通的. !!!可是假如R2和R5的BGP router id 不取环回口lo0, 而取与Core1和Core2的直衔接口做router id, 这样会有路由黑洞发生. (由于次末跳弹出准则, 从R1到R6的包, 在Core2处就会pop标签而查询FIB表,这个时分Core2并没有BGP路由,导致黑洞.) 所以在设计好的MPLS网络时分, 要细心考虑协议.
版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表凯时娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章