Switch Latency Monitoring Overview

The switch latency monitoring feature marks each ingress and egress packet with a timestamp value. To calculate the latency for each packet in the system the switch compares the ingress with the egress timestamp. The feature allows you to display historical latency averages between all pairs of ports, as well as real-time latency data.

You can use the latency measurements to identify which flows are impacted by latency issues. In addition the statistics generated by the switch latency monitoring feature allow you to plan network topologies, manage incident responses and identify root causes for application issues in the network. You can also use the statistics to provide a Service Level Agreement (SLA) for latency intensive applications.

Information About Switch Latency Monitoring

How to Use Switch Latency Monitoring

Switch Latency Monitoring feature measure packet latency in nanoseconds. It provides information in the following modes:
  • Real time mode maintains minimum, maximum, and average latency values for all packets between input and output port pairs.

  • Historical mode maintains flow-based latency distribution histograms and provides linear, exponential, or custom binning.

Switch Latency Monitoring Guidelines and Limitations

Switch Latency Monitoring has the following limitations and guidelines:

  • Only one mode (instantaneous, linear histogram, exponential histogram, or custom histogram) can be configured between a egress-ingress port pair at a time. Instantaneous Mode is enabled by default.

  • If any histogram mode is configured between a pair of ports then instantaneous mode is disabled.

  • If the histogram mode is removed between a pair of ports then instantaneous mode is enabled.

  • All switch Latency histogram statistics are lost if the base value is modified.

  • When the latency monitoring mode between an ingress and egress port pair is changed, switch latency statistics between that port pair are lost.

  • Switch Latency Monitoring records are not maintained across a switch reload or ISSU.

  • The Switch Latency Monitoring feature is supported on Ethernet interfaces only.

  • You must issue the clear hardware profile latency monitor all command when the switch is reloaded, or when a new module is powered on.

Switch Latency Monitoring Modes

Switch latency monitoring is supported in the following four modes:

  • Instantaneous Mode

    This mode is enabled by default and allows you to collect minimum, maximum, and average latency values for all the packets flowing between the ingress and egress ports .

  • Linear Histogram

    This mode counts how many packets are in a given latency range by allowing you to count packets within ranges of latencies (in nanoseconds) separately. For example, you can configure a linear histogram that counts how many packets fall into each of the following latency ranges: 800-848, 848-896, 896-944, and 944-992. To configure a linear histogram monitoring mode, you first specify a base for the table (in this example 800 nanoseconds) and you then specify a step value (in this example 50 nanoseconds).

  • Exponential Histogram

    This mode allows the binning of latencies for ranges that increase in an exponential manner. For example, to count the packets in the following ranges of latencies: 848-896, 896-992, 992-1184, and 1184-1568 you specify the mode as exponential mode and set the base value to 800 nanoseconds and the step to 50 nanoseconds.

  • Custom Histogram

    This mode allows you to count the number of packets falling within a specified range, and the number of packets that falls outside of the specified range.

How to Configure Switch Latency Monitoring

Configuring Switch Latency Monitoring

To configure switch latency monitoring you first set the monitoring base value and then configure the ingress and egress port pair and monitoring mode.


Note

Switch latency monitoring in instantaneous mode is enabled by default.


Procedure

  Command or Action Purpose
Step 1

enable

Example:

switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

clear hardware profile latency monitor all

Example:

switch# clear hardware profile latency monitor all

Clears the statistics for all egress and ingress port pairs in the system.

Step 3

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 4

hardware profile latency monitor base nanoseconds

Example:

switch(config)# hardware profile latency monitor base 800

Specifies the base value used to construct switch latency monitoring histograms. Valid values are multiples of 8 in the range 8 to 2147483640 nanoseconds.

Step 5

interface ethernet slot/port

Example:

switch(config)# interface ethernet 1/1

Enters interface configuration mode.

This interface is the egress interface for the egress and ingress port pair.

Step 6

packet latency interface ethernet ingress-interface-slot/port mode linear step step-value

Example:

switch(config-if)# packet latency ethernet 1/2 mode linear step 40

Configures linear mode monitoring between the egress Ethernet interface and this specified ingress Ethernet interface.

Step 7

packet latency interface ethernet ingress-interface-slot/port mode exponential step step-value

Example:

switch(config-if)# packet latency ethernet 1/3-4 mode exponential step 40

Configures exponential mode monitoring between the egress Ethernet interface and the specified ingress Ethernet interface ports.

Step 8

packet latency interface ethernet ingress-interface-slot/port mode customer low-latency low-value high-latency high-value

Example:

switch(config-if)# packet latency ethernet 1/5 mode customer low-latency 40 high-latency 1200

Configures custom mode monitoring between the egress Ethernet interface and the specified ingress Ethernet interface.

Step 9

exit

Example:

switch(config-if)# exit

Updates the configuration and exits interface configuration mode.

Step 10

(Optional) copy running-config startup-config

Example:

switch(config)# copy running-config startup-config
(Optional)

Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.

Verifying Switch Latency Monitoring Statistics

To display the Switch Latency Monitoring statistics, perform the following task:

Command

Purpose

show hardware profile latency monitor interface ethernet egress-interface-slot/port interface ethernet ingress-interface-slot/port

Displays switch latency statistics for specified egress-ingress port pair.

Note 

The ASIC reports a high latency value when the number of packets for a given latency range is monitored using the histograms or when the maximum latency value is monitored in the instantaneous mode. The maximum latency value is approximately 0.4 sec, which is incorrect. Ignore the value displayed because this is an unexpected behavior and does not have any functional impact on the switch.

Configuration Examples for Switch Latency Monitoring

Configuration Example for Switch Latency Monitoring

This example shows how to configure switch latency monitoring:

switch(config)# hardware profile latency monitor base 800
switch(config)# interface ethernet 1/1
switch(config-if)# packet latency interface ethernet 1/2 mode linear step 40
switch(config-if)# packet latency interface ethernet 1/3-4 mode exponential step 40
switch(config-if)# packet latency interface ethernet 1/5 mode custom low 40 high 1200
switch(config)# interface ethernet 2/1
switch(config-if)# packet latency interface ethernet 1/1 mode exponential step 80