MPLS labeled packet flow

Once LDP protocol has established a session and labels are distributed. How is a packet switched from ingress LSR to destination Egress LSR ?

Using below topology and an actual lab, let’s follow the process hop by hop. Validation show commands will be used at each step to validate and confirm how labeled switching is executed.

Hostname Loopback address Node type
PE1 172.16.1.1 Cisco IOS
P1 172.16.1.2 Cisco IOS
P2 172.16.1.3 Cisco IOS
P3 172.16.1.4 Cisco XR
PE2 172.16.1.5 Cisco XR

Actual lab was ran on Cisco VIRL, but EVE-NG could also be used.

From PE1, we can reach PE2 loopback 172.16.1.

Copy to Clipboard

On PE1, we want to check which labels  (local and outgoing) are imposed on the packet destined for 172.16.1.5 PE2. It is the outgoing label which will be used by the next hop LSR to switch the packet onward.

In our case, local label is 19 and outgoing is 18.

Copy to Clipboard

On P1 the next LSR, let’s check how is label 18 switched. Here we see  outgoing label value is 18.

Copy to Clipboard

On P2 same command is applied, with one interesting point. Outgoing label value changes to 24002.

On P2, label for destination 172.16.1.5 is received rom P3, which happens to be a Cisco XR and not IOS. So you would see a slight change in the label numbering. Running the command “sh mpls label range” would confirm that IOS range is [16-100000] and XR is [24000-1048575]. Note that you can also set a range using the command “mpls label range value1 value2


Copy to Clipboard

On P3 we expect to see another label switching operation from the 24002 we received from P2 to another one sent by PE2. But in this case, a different operation is takes place, Penultimate hop popping or PHP. So what happens here ?

The Egress LSR PE2, knows that 172.16.1.5 is a local network and does not need a label. PE2 sends an implicit-NULL label (label3), essentially telling P3 to pop the outer label and forward the native IP packet.

Copy to Clipboard

End to end connectivity testing was validated by using a plain ping command from PE1 to PE2 loopback. In reality, to test the label switching path (LSP) correctly, “ping mpls” should be used. This requires that “mpls oam” is enabled globally on the LSR node.

Copy to Clipboard

Traceroute mpls can be ran without a need for “mpls oam” . This is a good command to show the labels used in the path.

Copy to Clipboard