Understanding How MPLS Works in Cisco IOS Router

CCNA 200-301

CCNA 200-301

CCNP Enterprise

CCNP Enterprise

CCNP Security

CCNP Security

CCIE Enterprise Lab

CCIE Enterprise Lab

CCIE Security Lab

CCIE Security Lab

CCNP Service Provider

CCNP Service Provider

CCNP Data Center

CCNP Data Center

CCNP Collaboration

CCNP Collaboration

CCIE DC Lab

CCIE DC Lab

ic_r
ic_l
Understanding How MPLS Works in Cisco IOS Router
images

Multi-protocol label switching (MPLS) is a packet forwarding technique, which uses tags to determine the path to the destination. MPLS is a standard and is supported by most network providers, including Cisco. If you are not familiar with the MPLS implementation in a Cisco IOS router, you must first be familiar with the MPLS terminology used by Cisco. Please continue to read for more information to help you understand how MPLS works on Cisco IOS routers.

Understanding How MPLS Works in Cisco IOS Router

In an IP route, each router will perform a lookup on its routing table, so each router needs to have information about the target prefix. In Mpls, only the routers in the first hop and the last hop need to know the information about the destination prefix. This is possible due to the additional bits (which we call the "The label") attached to the header as an identifier to find the path to the destination.

In a Cisco IOS environment, the first and last routers in an MPLS network are called label edge routers (LER), and all routers between them are called label switching routers (LSR). The MPLS path established between LER is called the label exchange path (LSP). For a better understanding, see the following figure:

Both LER and LSR distribute tags independently and exchange label information through protocols called LDP or label distribution protocols. Once LDP is established and each router builds its own MPLS forwarding table, LER / LSR performs so-called "IP to label forwarding", "label to label forwarding" or "label to IP forwarding" to incoming packets based on the information registered in the forwarding table. These are the basics of how MPLS works on Cisco IOS routers, and the checks for each operation will be explained below.

IP-to-label forwarding

This term refers to the label PUSH operation performed by the first LER in the LSP to the input IP packet. As the name implies, unmarked incoming IP packets will be tagged, and the next-hop router will use the tag to forward the packets to their destination.

In the above topology, for example, an unmarked packet sent to 22.0.0.100 ≤ 24 arrives at PE1, which is an LER, where the MPLS process will provide a label for the packet so that the next router that receives the packet will know what to do with it. To view tags for unmarked packets, we can use the command show mpls forwarding-table [destination address]. In the following example output, we can see that for 22.0.0.100 packets, the label is 18 (see outgoing tag 18)

From the output, we can also see that the packet is forwarded through interface f0 / 0, and interface f0 / 0 is connected to the next-hop router P1 (10.1.1.1).

Label-to-label forwarding

This term refers to all LSR operations in the middle of LSP that perform tag SWAP operations on incoming tagged groups. LSR reads the tags on the incoming packets and forwards them to the relevant next-hop and outgoing interfaces. Before LSR forwarding packets, it will exchange tags with its own assigned tags.

To continue with the previous example, packets with tags 18 from PE1 arrive at P1 as LSR. P1 checks the tag (incoming tag 18) and then exchanges it with its own label (outgoing label 16), as shown in the forwarding table below P1:

The packet with label 16 is now forwarded to the next hop, P2 (10.1.1.6), via P1 interface f0 / 1.

Label-to-IP forwarding

This term refers to the label POP operation performed by the last LSR in the LSP on the incoming tagged packet. This LSR will remove the label from the packet, and the next-hop router will continue to forward to the destination using the normal IP route.

Continue again from the above example, and the packet with label 16 arrives from P1 on P2. In the P2 forwarding table, the next operation given for incoming packets with label 16 is the pop tag, as shown in the following output:

The Pop tag indicates that the label has now been removed from the packet, and then it will be forwarded to interface f0 / 0 to the next-hop address 10.1.1.14. The outgoing interface and the next-hop address in P2undefineds MPLS forwarding table enable packets to reach PE2, which is an LER, that ends the packet’s journey through LSP.

Beginning with PE2, the packet will continue to be forwarded as a regular IP packet. It can be seen from the routing table of PE2 that the packet destined for 22.00.100 will be forwarded as the next hop to CE2, which is also the final destination of the packet.

With this example in mind, it is now easier to understand how MPLS works on Cisco IOS routers.

Note:  how MPLS Works in Cisco IOS Router is very important, and it is the most important part of the Cisco certification exam. What’s more, you can improve your ability to understand MPLS technology.

Conclusions – How MPLS Works

As can be seen from the above explanation, the normal IP route only takes place between CE1 and PE1 and PE2 to CE2. The rest of the packet forwarding is not dependent on the routing table at all, but rather on the MPLS forwarding table. For more information on how to configure MPLS on a Cisco IOS router, refer to our previous posts.

Note that only PE1 and PE2 need to know the routing entries for the two CE routers (11.0. 0. 0. 0. 24 and 22. 0. 0. 0. 0. 24), but P1 and P2 do not need to know this information. However, if none of the MPLS routers first establish an L 3 route between their interfaces, the MPLS forwarding table itself cannot be built. Therefore, before configuring MPLS and having these routers build their MPLS forwarding tables, we need to establish routing between PE1-P1-P2-PE2, in which case we have used OSPF and BGP as L 3 routing protocols.

This concept applies to most network providers, including Cisco. This is why understanding how MPLS works in Cisco IOS routers is usually not much different from understanding how it works on other vendors.

About SPOTO

SPOTO offers Cisco CCIE certification practice tests and training to help all candidates to pursue their ideal careers. You can also find more useful tips and suggestions to help you study and master networking knowledge.