Tracing LDP Operations

Problem

You want to check that LDP is properly exchanging messages with its neighbors.

Solution

Set up a tracing file to capture information about the exchange of LDP protocol packets:

[edit protocols ldp] aviva@RouterG# set traceoptions file ldp-log aviva@RouterG# set traceoptions flag packets

Discussion

One tool for troubleshooting LDP operation is the JUNOS tracing facility. If an LDP session that was operating properly suddenly stops working, you can trace the routers LDP packet exchanges with its neighbors to help track down the source of the problem. This recipe sets up an LDP-specific tracing file named ldp-log that captures all LDP packet exchanges with neighboring routers.

Use the show log command to see the file contents:

aviva@RouterG> show log ldp-log Oct 5 19:25:46 Incredible-Hulk clear-log[15758]: logfile cleared Oct 5 19:25:48 LDP sent UDP PDU 10.0.0.1 -> 224.0.0.2 (t1-4/0/0.0) Oct 5 19:25:48 ver 1, pkt len 42, PDU len 38, ID 192.168.19.1:0 Oct 5 19:25:48 Msg Hello (0x100), len 28, ID 396082 Oct 5 19:25:48 TLV HelloParms (0x400), len 4 Oct 5 19:25:48 TLV XportAddr (0x401), len 4 Oct 5 19:25:48 TLV ConfSeq (0x402), len 4 Oct 5 19:25:49 LDP rcvd UDP PDU 10.0.0.2 -> 224.0.0.2 (t1-4/0/0.0) Oct 5 19:25:49 ver 1, pkt len 42, PDU len 38, ID 192.168.17.1:0 Oct 5 19:25:49 Msg Hello (0x100), len 28, ID 397238 Oct 5 19:25:49 TLV HelloParms (0x400), len 4 Oct 5 19:25:49 TLV XportAddr (0x401), len 4 Oct 5 19:25:49 TLV ConfSeq (0x402), len 4 Oct 5 19:25:52 LDP sent UDP PDU 10.0.0.1 -> 224.0.0.2 (t1-4/0/0.0) Oct 5 19:25:52 ver 1, pkt len 42, PDU len 38, ID 192.168.19.1:0 Oct 5 19:25:52 Msg Hello (0x100), len 28, ID 396083 Oct 5 19:25:52 TLV HelloParms (0x400), len 4 Oct 5 19:25:52 TLV XportAddr (0x401), len 4 Oct 5 19:25:52 TLV ConfSeq (0x402), len 4 Oct 5 19:25:52 LDP sent TCP PDU 192.168.19.1 -> 192.168.17.1 (none) Oct 5 19:25:52 ver 1, pkt len 18, PDU len 14, ID 192.168.19.1:0 Oct 5 19:25:52 Msg Keepalive (0x201), len 4, ID 396084 Oct 5 19:25:52 LDP rcvd TCP PDU 192.168.17.1 -> 192.168.19.1 (none) Oct 5 19:25:52 ver 1, pkt len 18, PDU len 14, ID 192.168.17.1:0 Oct 5 19:25:52 Msg Keepalive (0x201), len 4, ID 397241 Oct 5 19:25:53 LDP rcvd UDP PDU 10.0.0.2 -> 224.0.0.2 (t1-4/0/0.0) Oct 5 19:25:53 ver 1, pkt len 42, PDU len 38, ID 192.168.17.1:0 Oct 5 19:25:53 Msg Hello (0x100), len 28, ID 397242 Oct 5 19:25:53 TLV HelloParms (0x400), len 4 Oct 5 19:25:53 TLV XportAddr (0x401), len 4 Oct 5 19:25:53 TLV ConfSeq (0x402), len 4

This log shows normal LDP operation. LDP is sending and receiving UDP and TCP messages with its neighboring routers. LDP multicasts UDP Hello messages to 224.0.0.2 to discover its neighbors. The log output shows that LDP is sending UDP hellos out the connection to the local subnet (10.0.0.1) and receiving hellos from the other end of the connection (10.0.0.2). LDP establishes TCP connections to exchange label and FEC information and sends periodic keepalive messages (every 10 seconds, by default) to its neighbors to keep the TCP session established. The logfile also shows that LDP is sending and receiving TCP keepalives from 192.168.17.1, the neighboring LDP router. All the entries in this logfile are what you would expect to see when an LDP session is operating properly.

When debugging LDP, you can set one or more of the following trace flags to capture LDP-related information:

[edit protocols ldp] aviva@RouterG# set traceoptions flag ? Possible completions: address Trace address packets all Trace everything binding Trace label binding state error Trace errored packets event Trace LDP state machine events general Trace general events initialization Trace initialization packets label Trace label packets normal Trace normal events notification Trace notification packets packets Trace all LDP packets path Trace label path state periodic Trace periodic (hello and keepalive) packets policy Trace policy processing route Trace routing information state Trace state transitions task Trace routing protocol task processing timer Trace routing protocol timer processing

See Also

Recipe 5.10

Категории