ICMP trace-route in MPLS network

Today I am going to talk about the Trace-route in MPLS domain, there are lot of queries asked by users here about how trace-route works in the MPLS environment. In this article we will briefly discuss about the MPLS trace-route works in the MPLS backbone or MPLS domain.

How Trace-Route works in the traditional IP environment ?
Let's talk about the IP environment first. In IP environment, any node on receiving a packet and if the TTL expires, it is expected to generate “TTL Exceeded” ICMP error message (Type=11, Code=0) and send it to the packet source address. This concept is leveraged to trace the IP path from source to destination by sending UDP packet with TTL sequentially starting from 1. It could be noted that the very basic requirements for this functionality are as below:
  • Source address of the packet is reachable from the transit nodes.
  • ICMP is not filtered along the path.
In MPLS environment, a transit Provider LSR may not always have reachability to the source address and need some enhancement for ICMP handling in MPLS domain. This document discusses about the ICMP trace-route behaviour in MPLS network and a quick comparison with LSP trace.

How it differs in the MPLS environment ?
The default behavior of any LSR on receiving a packet with TTL=1 on top label will follow the traditional IP behavior of dropping the packet and trigger ICMP error message. In order to route the ICMP message to the source, the LSR will perform the below,
  • Buffer the label stack from incoming packet (the packet received with TTL=1)
  • Generate ICMP error message with source as its own address and destination as source address from received packet.
  • Append all labels from bottom of label stack (that was buffered earlier in step 1) with TTL=255 except the top one.
  • Get the top label from buffered label stack and perform local LFIB lookup to get the label to swap and the associated next hop.
  • Append the new label to the top of stack with TTL=255 and send across.

With this approach, the ICMP error message will traverse from transit LSR to egress LER and then back to ingress LER to actual source.

Fig 1.1- Trace-Route in MPLS
In the above topology, when ICMP traceroute is triggered from R2 to 10.1.4.4, the first packet will be sent with TTL of 1. R3 on receiving the packet will decrement the TTL to 0 and trigger ICMP generation mechanism.

R3 will buffer the label stack and generate ICMP error message and include the incoming label stack from the buffer in ICMP payload. It further populate the IP header with source address from incoming interface of the labeled packet, destination address as the source of the labeled packet. The TTL will be set to 255. It now pushes the label stack from the buffer and consults the LFIB table for forwarding action on top label. 

Fig 1.2- Trace-Route with Labels
In the above topology, the received label stack is 17. On performing a lookup in LFIB table, label 17 will be swapped with label 16 and will be forwarded towards nexthop R6. R6 in turn will pop the top label and forward to R4 which will IP forward the packet back towards R2.

As it could be noted in the traceroute output on R2, the incoming label will be listed by each hop along the path.