Using Segment Routing Traffic Matrix

This module provides information about the Segment Routing Traffic Matrix (SR-TM) and the Traffic Collector process, and describes how to configure the TM border and the Traffic Collector and to display traffic information.

Segment Routing Traffic Matrix

A network's traffic matrix is a description, measure, or estimation of the aggregated traffic flows that enter, traverse, and leave a network.

The Segment Routing Traffic Matrix (SR-TM) is designed to help users understand traffic patterns on a router. The Traffic Matrix border divides the network into two parts: internal (interfaces that are inside the border) and external (interfaces that are outside the border). By default, all interfaces are internal. You can configure an interface as external.

Traffic Collector Process

The Traffic Collector collects packet and byte statistics from router components such as prefix counters, tunnel counters, and the TM counter. The TM counter increments when traffic that comes from an external interface to the network is destined for a segment routing prefix-SID. The Traffic Collector keeps histories of the statistics and makes them persistent across process restarts, failovers, and ISSU. Histories are retained for a configurable length of time.

Pcounters

A Pcounter is a packet and byte pair of counters. There is one Pcounter per tunnel. There are two Pcounters per prefix-SID:

  • Base Pcounter – any packet that is switched on the prefix-SID forwarding information base (FIB) entry

  • TM Pcounter – any packet from an external interface and switched on the prefix-SID FIB entry

The Traffic Collector periodically collects the Base Pcounters and TM Pcounters of all prefix-SIDs, and the Pcounters of all tunnel interfaces.

For each Pcounter, the Traffic Collector calculates the number of packets and bytes that have been forwarded during the last interval. The Traffic Collector keeps a history of the per-interval statistics for each of the Pcounters. Each entry in the history contains:

  • The start and end time of the interval

  • The number of packets forwarded during the interval

  • The number of bytes forwarded during the interval

Feature Support and Limitations

  • Pcounters for IPv4 SR Prefix SIDs are supported.

  • Pcounters for IPv6 SR Prefix SIDs are not supported.

  • TM Pcounters increment for incoming SR-labeled, LDP-labeled, and IP traffic destined for an SR Prefix SID.

  • External interface support can be enabled on all Ethernet interfaces except Management, Bundle, and sub interfaces. Tunnels may not be set as external interfaces.

  • Default VRF is supported. Non-default VRF is not supported.

Configuring Traffic Collector

Perform these tasks to configure the traffic collector.

SUMMARY STEPS

  1. configure
  2. traffic-collector
  3. statistics collection-interval value
  4. statistics history-size value
  5. statistics history-timeout value
  6. interface type l3-interface-address
  7. Use the commit or end command.

DETAILED STEPS

  Command or Action Purpose

Step 1

configure

Example:


RP/0/RSP0/CPU0:router# configure

Enters global configuration mode.

Step 2

traffic-collector

Example:


RP/0/RP0/CPU0:router(config)# traffic-collector

Enables traffic collector and places the router in traffic collector configuration mode.

Step 3

statistics collection-interval value

Example:


RP/0/RP0/CPU0:router(config-tc)# statistics collection-interval 5

(Optional) Sets the frequency that the traffic collector collects and posts data, in minutes. Valid values are 1, 2, 3, 4, 5, 6, 10, 12,15, 20, 30, and 60. The default interval is 1.

Step 4

statistics history-size value

Example:


RP/0/RP0/CPU0:router(config-tc)# statistics history-size 10 

(Optional) Specifies the number of entries kept in the history database. Valid values are from 1 to 10. The default is 5.

Note

 

The number of entries affects how the average packet and average byte rates are calculated. The rates are calculated over the range of the histories and are not averages based in real time.

Step 5

statistics history-timeout value

Example:


RP/0/RP0/CPU0:router(config-tc)# statistics history-timeout 24

(Optional) When a prefix SID or a tunnel-te interface is deleted, the history-timeout sets the length of time, in hours, that the prefix SID and tunnel statistics are retained in the history before they are removed. The minimum is one hour; the maximum is 720 hours. The default is 48.

Note

 

Enter 0 to disable the history timeout. (No history is retained.)

Step 6

interface type l3-interface-address

Example:


RP/0/RP0/CPU0:router(config-tc)# interface TenGigE 0/1/0/3

Identifies interfaces that handle external traffic. Only L3 interfaces are supported for external traffic.

Step 7

Use the commit or end command.

commit —Saves the configuration changes and remains within the configuration session.

end —Prompts user to take one of these actions:
  • Yes — Saves configuration changes and exits the configuration session.

  • No —Exits the configuration session without committing the configuration changes.

  • Cancel —Remains in the configuration session, without committing the configuration changes.

This completes the configuration for the traffic collector.

Displaying Traffic Information

The following show commands display information about the interfaces and tunnels:


Note


For detailed information about the command syntax for the following show commands, see the Segment Routing Command Reference Guide.
  • Display the configured external interfaces:

    
    RP/0/RSP0/CPU0:router# show traffic-collector external-interface 
      Interface             Status          
      --------------------  ----------------
      Te0/1/0/3             Enabled 
      Te0/1/0/4             Enabled 
    
    
  • Display the counter history database for a prefix-SID:

    
    RP/0/RSP0/CPU0:router# show traffic-collector ipv4 counters prefix 10.1.1.10/32 detail
    Prefix: 10.1.1.10/32  Label: 16010 State: Active
    Base:
        Average over the last 5 collection intervals:
            Packet rate: 9496937 pps, Byte rate: 9363979882 Bps
    
        History of counters:
            23:01 - 23:02: Packets 9379529, Bytes: 9248215594 
            23:00 - 23:01: Packets 9687124, Bytes: 9551504264 
            22:59 - 23:00: Packets 9539200, Bytes: 9405651200 
            22:58 - 22:59: Packets 9845278, Bytes: 9707444108 
            22:57 - 22:58: Packets 9033554, Bytes: 8907084244 
    TM Counters:
        Average over the last 5 collection intervals:
            Packet rate: 9528754 pps, Byte rate: 9357236821 Bps
    
        History of counters:
            23:01 - 23:02: Packets 9400815, Bytes: 9231600330 
            23:00 - 23:01: Packets 9699455, Bytes: 9524864810 
            22:59 - 23:00: Packets 9579889, Bytes: 9407450998 
            22:58 - 22:59: Packets 9911734, Bytes: 9733322788 
            22:57 - 22:58: Packets 9051879, Bytes: 8888945178
    
    

    This output shows the average Pcounter (packets, bytes), the Pcounter history, and the collection interval of the Base and TM for the specified prefix-SID.

  • Display the counter history database for a policy:

    
    RP/0/RSP0/CPU0:router# show traffic-collector counters tunnels srte_c_12_ep_6.6.6.2 detail
    Tunnel: srte_c_12_ep_6.6.6.2  State: Active
        Average over the last 5 collection intervals:
            Packet rate: 9694434 pps, Byte rate: 9597489858 Bps
    
        History of counters:
            23:14 – 23:15: Packets 9870522 , Bytes: 9771816780 
            23:13 – 23:14: Packets 9553048 , Bytes: 9457517520 
            23:12 – 23:13: Packets 9647265 , Bytes: 9550792350 
            23:11 – 23:12: Packets 9756654 , Bytes: 9659087460 
            23:10 – 23:11: Packets 9694434 , Bytes: 9548235180
    
    

    This output shows the average Pcounter (packets, bytes), the Pcounter history, and the collection interval for the policy.