Debug MPLS Packets

You can debug the forwarding of MPLS packets, just as you can debug the forwarding of IP packets. The command is debug mpls packets. However, if you turn on this debug command without further specifying anything, it returns debug output for all label switched packets. This is something that is probably fine in a lab environment, but not in a production network. Fortunately, you can specify an access list that limits the output to certain labeled packets.

WARNING Debugging the forwarding of (labeled) packets can consume many CPU cycles on the router and as such is a dangerous thing to do. When debugging in the data plane—such as debug mpls packets—, be sure you know what you are doing and take the necessary precautions in case the router cannot keep up with the debugging. One thing you should do to limit the risk is to turn off the console logging on that router.

The command debug mpls packets generates output for every packet that is processed. Example 13-8 shows that you can limit the output by specifying an MPLS access list or an interface. The access list needs to be within the range 2700 to 2799, identifying it as an MPLS access list.

Example 13-8 Example of debug mpls packets with Access List event#debug mpls packets ?

<2700-2799> MPLS label access list

Async Async interface

BVI Bridge-Group Virtual Interface

CTunnel CTunnel interface

Dialer Dialer interface

EsconPhy ESCON interface

Ethernet IEEE 802.3

event(config)#access-list 2700 permit ? WORD mpls label table name or 'any'

event(config)#access-list 2700 permit any ? <16-1048575> mpls label number any any label number

event(config)#access-list 2700 permit any 16 ?

<0-7> mpls exp value any any exp value <cr>

event(config)#access-list 2700 permit any 16 any ?

<0-1> mpls eos value any any eos value <cr>

event(config)#access-list 2700 permit any 16 any any ?

You can specify the MPLS label table, the label number, the EXP value, and the EOS value. The MPLS label table is the LFIB that is being used. This is either the global LFIB or a specific VRF LFIB. The MPLS EOS value is the EoS (end-of-stack) or BoS (bottom-of-stack) bit. If you specify 1 for EOS, the debug information displays packets with only one label in the stack. If the top label has the BoS bit set, it is the only label in the stack.

Example 13-9 shows the output when enabling MPLS packet debugging.

Example 13-9 Example of debug mpls packets event#debug mpls packets 2700

Packet debugging is on with ACL 2700

Example 13-9 Example of debug mpls packets (Continued) event#

1d02h: MPLS turbo: Et3/1: rx: Len 122 Stack {16 0 253} {24 0 254} - ipv4 data 1d02h: MPLS turbo: Se4/0: tx: Len 108 Stack {24 0 252} - ipv4 data

NOTE Depending on what router this debugging is performed on, the debug might or might not show the debugging information. On a distributed platform, the packets are switched from line card to line card and do not pass the central CPU of the router. As such, the debugging on the central CPU does not show packets being switched.

The packet enters the router on interface Ethernet3/1 and leaves on interface Serial4/0. The whole label stack is presented as each label is printed between {}. The label information printed is {label EXP TTL}. The label is just the value of the label (20 bits). EXP is the value of the Experimental bits, and TTL is the Time To Live of the label. The BoS bit is not printed. At the end, the underlying data type is displayed; in this case, it is an IPv4 packet. If it were an IPv6 packet, ipv6 data would be printed. Remember that labeled packets are switched based on the label value in the top label. This label value must match the value in the LFIB. The packet that entered the router had two labels, but it had only one when it left. This is confirmed by the LFIB shown in Example 13-10.

Example 13-10 LFIB Entry for Incoming Label 16

event#show mpls forwarding-table labels 16

Local Outgoing

Prefix Bytes Label

Outgoing

Next Hop

Label Label or VC

or Tunnel Id Switched

interface

16 Pop Label

10.200.254.4/32 154802

Se4/0

point2point

The packet that is being switched is an MPLS VPN packet; that is why it has two labels. Because the debug mpls packets was turned on on a penultimate LSR, one label is popped off from the label stack of the packet when it is forwarded through the router. In the case of an AToM packet, the output looks like Example 13-11.

Example 13-11 debug mpls packets of an AToM Packet

1d05h:

MPLS

turbo:

Et3/1:

rx: Len

122 Stack

{16

0 254} {26

0 2} CW {0 0 0}

1d05h:

MPLS

turbo:

Se4/0:

tx: Len

108 Stack

{26

0 2} CW {0

0 0}

You can see that CW, or the control word, is displayed, indicating that the MPLS payload is an AToM packet. The syntax of the control word as displayed in the output of the debug mpls packets command consists of three fields and is the following: {flags length sequence-number}. Refer to Chapter 10, "Any Transport over MPLS," to understand the meaning of these fields in the control word.

0 0

Post a comment