MPLS principles and application implementation based on Cisco technology (I)

Source: Internet
Author: User
Tags domain lookup


MPLS appears because the existing route selection and forwarding technologies cannot cope with the increasing internet route tables. the advantage of ATM technology over IP technology lies in the fast forwarding of ATM cells. The advantage of IP technology over ATM technology lies in the ease of implementation and flexibility of IP technology. although the IP address can be carried on an ATM, because of the high cost of a Large ATM interaction matrix and the 8-byte forwarding efficiency of each 53-byte ATM Cell, tag forwarding technology emerged in due time.
It is an application chart of MPLS (Multi-Protocol Label forwarding) technology. in this serialization, I will explain the application details based on tag forwarding technology and CISCO implementation in sequence. MPLS is a layer-2.5 technology. You can refer to the following frame-based protocol field diagram. MPLS lable is added between the frame header and IP header. multiple labels can also be inserted for different MPLS applications (such as MPLS-VPN applications, traffic engineering, MPLS-VPN-based traffic engineering, etc ). multiple tags are shown in. the MTU is extended due to the introduction of tags. the label length is 4 bytes. According to CISCO's suggestion, the system MTU is set to 1524. If the label is encapsulated over Ethernet, the 24-byte label can carry the insertion of 6 labels, generally, the six labels are suitable for almost all applications. A topological environment composed of the following six routers is an experimental diagram of this part.
R1 (IPS1) and R2 (Border1) are EBGP neighbors, R2 (Border1) and R5 (Border2) are IBGP neighbors, R5 (Border2) and R6 (IPS2) it is an EBGP neighbor. the IGP protocol is run between R2 (Border1), R3 (Core1), R4 (Core2), and R5 (Border2). In the figure, RIP is used. The detailed configuration is OSPF. adjacent interfaces of R2 (Border1), R3 (Core1), R4 (Core2), and R5 (Border2) Enable MPLS and establish MPLS neighbors. r1 (IPS1) declares a 32-ring route of R1 to R2 (Border1 ). r6 (IPS2) announces a 32-ring route of R6 to R5 (Border2 ). core1 and Core2 do not run the BGP protocol. based on the BGP principle, R2 learns an EBGP route from R1 and passes it to the IBGP neighbor R5. R5. This IBGP route is passed to the EBGP neighbor R6. vice versa.
According to the BGP principle, Core1 and Core2 do not run BGP or re-distribute BGP to IGP. Therefore, if the R6 loopback port address (BGP Route) learned from R1 ping ), it will not pass, because the BGP routing black hole. core1 discards the packet destined for R6 because the route is inaccessible. however, we can use traceroute or ping the learned EBGP route (and the R6 loopback address) on R1 ), it is found that it is accessible. this is the role of MPLS Forwarding.
First, let's take a look at the LDP/TDP protocol, that is, the tag distribution protocol. TDP is a CISCO proprietary protocol, but its principles are basically the same. LDP/TDP mainly consists of the following parts: (1) neighbor discovery stage. In this stage, UDP-based Hello packets are sent to the multicast address 224.0.0.2 to find the neighbors on the link, if three hello packets are lost, the neighbor is declared invalid. you can also configure peer to send unicast hello to establish a neighbor. Because ldp session is based on TCP, ldp can establish a session across the network without direct connection. (2) Establishment of TCP connection (3) establishment of LDP Session (4) Distribution of labels different interfaces on the same vro can enable the ldp or tdp Protocols respectively, both ldp and tdp protocols can be enabled on the same interface. next, we will use an actual implementation example to explain the principle of MPLS. the topology uses an experiment diagram composed of IPS1, IPS2, Border1, Border2, Core1, and core2. router connection: 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

The router configuration is as follows: 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
!
Keeper
Shutdown
!
!
Line con 0
Exec-timeout 0 0
Logging synchronous
Stopbits 1
Line aux 0
Stopbits 1
Line vty 0 4
Login
!
!
Endr1 #
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 255.255.255.255.20
Bgp log-neighbor-changes
Neighbor 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
!
!
Keeper
Shutdown
!
!
Line con 0
Exec-timeout 0 0
Logging synchronous
Stopbits 1
Line aux 0
Stopbits 1
Line vty 0 4
Login
!
!
Endr2 # 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
!
!
Keeper
Shutdown
!
!
Line con 0
Exec-timeout 0 0
Logging synchronous
Stopbits 1
Line aux 0
Stopbits 1
Line vty 0 4
Login
!
!
Endr3 # 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
!
!
Keeper
Shutdown
!
!
Line con 0
Exec-timeout 0 0
Logging synchronous
Stopbits 1
Line aux 0
Stopbits 1
Line vty 0 4
Login
!
!
Endr4 # 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
!
!
Keeper
Shutdown
!
!
Line con 0
Exec-timeout 0 0
Logging synchronous
Stopbits 1
Line aux 0
Stopbits 1
Line vty 0 4
Login
!
!
Endr5 # 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
!
!
Keeper
Shutdown
!
!
Line con 0
Exec-timeout 0 0
Logging synchronous
Stopbits 1
Line aux 0
Stopbits 1
Line vty 0 4
Login
!
!
Endr6 # note the core control layer in the MPLS technology field. The forwarding layer structure is shown below. the description is not comprehensive. the routing protocol in the control layer refers to the IP-layer route control interaction protocols, such as RIP and OSPF. LDP refers to the Label Distribution Protocol LDP or TDP. IP Forwarding Table and cef table (FIB) in Cisco IOS are generated by ip routing table and LIB. there is a tag recharge action from Label Forwarding Table (LFIB) to IP Forwarding Table. at the same time, LFIB requires LIB and FIB information, so it is generally considered that LFIB = LIB + FIB
Whether to query the FIB table or LFIB table of the incoming packets is determined by whether the packets contain tags. for packets with tags, the type fields in the Ethernet frame header are different. likewise, the packet sent from an MPLS Router may be an IP packet (after pop or untag action) or a tag packet.
[Common commands] (1) show mpls ldp bindings (view LIB label table) (2) show mpls forwarding-table detail (view label forwarding table of LFIB) (3) show ip cef detail (view fib ip Forwarding Table) [Note!]
(1) For cisco mpls implementation, ip cef must be enabled (2) mpls ldp route-id must be able to reach the ip layer (3) the last hop pop-up principle, the ldp protocol assigns an empty label to the direct connection CIDR Block of the vro. When the next hop is empty, the label pop action is executed (4) ldp does not assign labels to BGP routes (the top-level label is used in mpls vpn applications). This label is obtained from the labels assigned by the next hop address of BGP routes.
(5) In the above implementation, the network segments of R2 and IPS1 and R5 and IPS2 are declared as OSPF. if the two CIDR blocks are not declared as OSPF, R2 and R5 are mutually configured as IBGP neighbors, configure neighbor xx. xx. xx. xx next-hop-self: The lo0 that accesses R6 from R1 with lo0 as the source is still accessible .!!! However, if the BGP router IDs of R2 and R5 do not take lo0 from the loback port, and the direct connection interface with Core1 and Core2 is used as the router id, a routing black hole will be generated. (because of the last hop pop-up principle, the package from R1 to R6 will pop the label at Core2 and query the FIB table. At this time, Core2 does not have a BGP Route, resulting in a black hole .) therefore, when designing an MPLS network, consider the Protocol carefully.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.