You can configure MPLS so that it periodically gathers traffic statistics about all MPLS sessions, including transit sessions, by configuring the statistics statement. You must configure the statistics statement if you want to collect MPLS traffic statistics using Simple Network Management Protocol (SNMP) polling of MPLS Management Information Bases (MIBs).
To enable MPLS statistics collection, include the statistics statement:
-
statistics {
- auto-bandwidth;
- file filename <size size> <files number> <no-stamp> <replace>
- (world-readable | <no-world-readable>);
- interval seconds;
- }
You can configure these statements at the following hierarchy levels:
The default interval is 300 seconds.
The statistics are placed in a file, with one entry per LSP. During the specified interval, the following information is recorded in this file:
![]() |
Note: If you configure the replace option, an existing trace file is replaced if there is one. However, the change does not take effect after you commit the configuration. The change takes effect only after the routing protocol process restarts. |
At the end of each periodic report, a summary shows the current time, total number of sessions, number of sessions read, number of sessions ignored, and read errors, if any. Ignored sessions are typically those not in the up state or those with a reserved (0 through 15) incoming label (typically the egress point of an LSP). The reason for a read error appears on the same line as the entry for the LSP on which the error occurred. Gathering statistics is an unreliable process; occasional read errors might affect their accuracy. The following is a sample of the information included in the output file:
lsp6 0 pkt 0 Byte 0 pps 0 Bps 0 lsp5 0 pkt 0 Byte 0 pps 0 Bps 0 lsp6.1 34845 pkt 2926980 Byte 1049 pps 88179 Bps 132 lsp5.1 0 pkt 0 Byte 0 pps 0 Bps 0 lsp4 0 pkt 0 Byte 0 pps 0 Bps 0 Dec 7 17:28:38 Total 6 sessions: 5 success, 0 fail, 1 ignored