Collecting LDP Statistics

LDP traffic statistics show the volume of traffic that has passed through a particular FEC on a router.

When you configure the traffic-statistics statement at the [edit protocols ldp] hierarchy level, the LDP traffic statistics are gathered periodically and written to a file. You can configure how often statistics are collected (in seconds) by using the interval option. The default collection interval is 5 minutes. You must configure an LDP statistics file; otherwise, LDP traffic statistics are not gathered. If the LSP goes down, the LDP statistics are reset.

To collect LDP traffic statistics, include the traffic-statistics statement:

traffic-statistics {file filename <files number> <size size> <world-readable | no-world-readable>;interval interval;no-penultimate-hop;}

For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.

This section includes the following topics:

LDP Statistics Output

The following sample output is from an LDP statistics file:

FEC                  Type       Packets     Bytes    Shared
10.255.350.448/32    Transit          0         0        No
                     Ingress          0         0        No
10.255.350.450/32    Transit          0         0       Yes
                     Ingress          0         0        No
10.255.350.451/32    Transit          0         0        No
                     Ingress          0         0        No
220.220.220.1/32     Transit          0         0       Yes
                     Ingress          0         0        No
220.220.220.2/32     Transit          0         0       Yes
                     Ingress          0         0        No
220.220.220.3/32     Transit          0         0       Yes
                     Ingress          0         0        No
May 28 15:02:05, read 12 statistics in  00:00:00 seconds

The LDP statistics file includes the following columns of data:

Disabling LDP Statistics on the Penultimate-Hop Router

Gathering LDP traffic statistics at the penultimate-hop router can consume excessive system resources, on next-hop routes in particular. This problem is exacerbated if you have configured the deaggregate statement in addition to the traffic-statistics statement. For routers reaching their limit of next-hop route usage, we recommend configuring the no-penultimate-hop option for the traffic-statistics statement:

traffic-statistics {no-penultimate-hop;}

For a list of hierarchy levels at which you can configure the traffic-statistics statement, see the statement summary section for this statement.

Note: When you configure the no-penultimate-hop option, no statistics are available for the FECs that are the penultimate hop for this router.

Whenever you include or remove this option from the configuration, the LDP sessions are taken down and then restarted.

The following sample output is from an LDP statistics file showing routers on which the no-penultimate-hop option is configured:

FEC                 Type            Packets          Bytes       Shared
10.255.245.218/32   Transit               0              0           No
                    Ingress               4            246           No
10.255.245.221/32   Transit     statistics disabled
                    Ingress     statistics disabled
13.1.1.0/24         Transit     statistics disabled
                    Ingress     statistics disabled
13.1.3.0/24         Transit     statistics disabled
                    Ingress     statistics disabled

LDP Statistics Limitations

The following are issues related to collecting LDP statistics by configuring the traffic-statistics statement:

When an LSP goes down, the LDP statistics are reset.