VPF Monitoring

This document covers topics related to monitoring VPF itself as well as using VPF for monitoring traffic passing through TNSR.

Status

There are several show commands to view various aspects of the VPF configuration and state.

show vpf connection-statistics

Displays a summary of VPF connections based on data in the state table.

See VPF Connection Statistics for details.

show vpf connections

Lists current connections in the VPF state table. Can be optionally filtered, limited, or displayed with increased verboseness.

See VPF Connections (State Data) for details.

show vpf filter ruleset [<name>]

Prints the contents of VPF filter rulesets, optionally limited to a single filter ruleset by name.

The output includes the configured filter rule parameters along with a count of packets and bytes matched by the rule.

show vpf ha

Displays the current VPF High Availability configuration.

show vpf ipfix

Prints the current status of IPFIX in VPF (e.g. enabled or disabled).

show vpf nat ruleset [<name>]

Prints the contents of VPF NAT rulesets, optionally limited to a single NAT ruleset by name.

The output includes the configured NAT rule parameters along with a count of packets and bytes translated by the rule.

show vpf options interfaces

Prints a list of interfaces attached to VPF and the rulesets associated with those interfaces.

show vpf options runtime

Prints the VPF runtime options and their current values.

show vpf options startup

Prints the VPF startup options and their current values.

show vpf status

Prints the current status of VPF itself (e.g. enabled or disabled).

show vpf port-table [<name>]

Prints the current contents of VPF Port Tables, optionally limited to a single port table by name.

show vpf prefix-table [<name>]

Prints the current contents of VPF Prefix Tables, optionally limited to a single prefix table by name.

VPF Connection Statistics

The show vpf connection-statistics command displays a summary of VPF connections based on data in the state table.

This is organized as four tables, IPv4 filter connections, IPv4 endpoint-dependent and endpoint-independent NAT connections, and IPv6 filter connections, each with data grouped by worker thread and summarized.

tnsr# show vpf connection-statistics

VPF IPv4 filter connection statistics:

  Thread      TCP       TCP       UDP       UDP      ICMP      ICMP      Other     Other
            Active    Expired   Active    Expired   Active    Expired   Active    Expired
------------------------------------------------------------------------------------------
         0         0         0         3         0         0         0         0         0
------------------------------------------------------------------------------------------
Total              0         0         3         0         0         0         0         0

VPF IPv4 NAT endpoint-dependent connection statistics:

  Thread      TCP       TCP       UDP       UDP      ICMP      ICMP      Other     Other
            Active    Expired   Active    Expired   Active    Expired   Active    Expired
------------------------------------------------------------------------------------------
         0         0         0         3         0         0         0         0         0
------------------------------------------------------------------------------------------
Total              0         0         3         0         0         0         0         0

VPF IPv4 NAT endpoint-independent connection statistics:

  Thread      TCP       TCP       UDP       UDP      ICMP      ICMP      Other     Other
            Active    Expired   Active    Expired   Active    Expired   Active    Expired
------------------------------------------------------------------------------------------
         0         0         0         3         0         0         0         0         0
------------------------------------------------------------------------------------------
Total              0         0         3         0         0         0         0         0

VPF IPv6 filter connection statistics:

  Thread      TCP       TCP       UDP       UDP      ICMP      ICMP      Other     Other
            Active    Expired   Active    Expired   Active    Expired   Active    Expired
------------------------------------------------------------------------------------------
         0         0         0         0         0         0         0         0         0
------------------------------------------------------------------------------------------
Total              0         0         0         0         0         0         0         0

VPF Connections (State Data)

TNSR includes mechanisms to display and remove current VPF connection states. These commands operate in the same manner for matching which connections the commands will show or clear.

The two commands are:

  • show vpf connections displays connection state data

  • clear vpf connections removes connection state data

Both commands have two main forms, one to display all connections and one to filter the matches. Filtering is important on TNSR devices which may have many thousands or even millions of connection states.

Note

When executing a clear command for VPF connections, VPF High Availability synchronizes that action to its peers. For example, clearing all states from one node will also remove matching connection states from peers.

This bulk action temporarily utilizes additional memory, see VPF HA Memory Requirements for details.

Show VPF Connections Output Limits and Detail

The show vpf connections command has optional output limits and increased detail:

limit <n>

Limits the output of the command to at most n entries. Default limit is 100 entries.

Note

By default, TNSR limits the output to 100 entries to prevent it from generating excessive output with large volumes of state data.

To view more than 100 entries, specify a larger limit value. For example, show vpf connections all limit 500.

verbose

Prints much more detailed information about each connection state.

Show or Clear All VPF Connections

To view all connections, use show vpf connections all:

tnsr# show vpf connections all

VPF connections:
     0. on thread 0, interface WAN, pass from table 0 10.28.0.150:54056, to 142.250.190.14:443,
        protocol tcp, state time-wait, translate 203.0.113.228:7873

1 connections found.

To clear all connections, use clear vpf connections all:

tnsr# clear vpf connections all

478 IPv4 connections removed.
No IPv6 connections removed.

Show or Clear Specific VPF Connections

The matching form of the command follows this syntax:

tnsr# clear vpf connections matching [!] [[!]<filter> [[!]<filter> [...]]]
                                    [(block-only|filter-only|interface-bound-only|
                                    nat-only|post-nat-only|route-table-bound-only)]
tnsr# show vpf connections matching [!] [[!]<filter> [[!]<filter> [...]]]
                                    [(block-only|filter-only|interface-bound-only|
                                    nat-only|post-nat-only|route-table-bound-only)]
                                    [limit <number>] [verbose]
Connection Attribute Filters

These filters restrict output based on specific attributes of connection states. These filters support negation by prepending ! before the filter name.

[!]bound-to <interface>

Matches states bound to a specific interface.

[!]destination (<ip-address>|<prefix>)

Matches states with a specific IPv4 or IPv6 destination address or destination addresses within a specified prefix.

[!]destination-id <id>

Matches states with the given protocol-specific destination identifier. For TCP and UDP, this is a port value. For ICMP types which include an ID, this is the ICMP ID value. For other protocols, this value is 0.

[!]destination-route-table <route-table-name>

Matches states with a destination in the given route table (VRF).

[!]protocol (<name>|<number>)

Matches states with the given protocol, either by protocol name or number.

[!]source (<ip-address>|<prefix>)

Matches states with a specific IPv4 or IPv6 source address or source addresses within a specified prefix.

[!]source-id <id>

Matches states with the given protocol-specific source identifier. For TCP and UDP, this is a port value. For ICMP types which include an ID, this is the ICMP ID value. For other protocols, this value is 0.

[!]source-route-table <route-table-name>

Matches states with a source in the given route table (VRF).

[!]thread-index <n>

Matches states associated with a specific VPP worker thread.

[!]translation (<ip-address>|<prefix>)

Matches states with a specific IPv4 or IPv6 NAT translation address or NAT translation addresses within a specified prefix.

[!]translation-id <id>

Matches states with the given protocol-specific NAT translation identifier. For TCP and UDP this is a port value, other protocols vary in meaning.

Connection Type Filters

These filters restrict output to only certain types of connection states. These filters do not support negation.

block-only

Matches only states created by block rules.

filter-only

Matches only states created by filter rules.

interface-bound-only

Matches only states bound to an interface.

nat-only

Matches only states created by NAT rules.

post-nat-only

Matches only states created by post-NAT rules.

route-table-bound-only

Matches only states bound to a route table.

Logic and Negation

Using multiple filters results in an implicit logical AND between the parameters.

This example means “show all connections from hosts in 10.0.1.0/24 to hosts in 10.0.2.0/24”:

tnsr# show vpf connections matching source 10.0.1.0/24 destination 10.0.2.0/24

Each type of filter may only be specified once in an expression, however, positive and negative filters are considered separately so it is possible to use both forms in a single expression.

Using per-filter negation allows selective exclusion, such as this example which means “show all connections from hosts in 10.0.1.0/24 except connections from 10.0.1.5”:

tnsr# show vpf connections matching source 10.0.1.0/24 !source 10.0.1.5

Prefixing the whole expression with an exclamation mark (!) negates the entire match, making the command match all entries except those which match the specified filters.

Using negation also has the effect of changing the implicit logical AND to an OR operation instead.

For example, this expression means “show connections from either a source of 10.0.1.6 OR a destination of 172.16.0.7”:

tnsr# show vpf connections matching ! !source 10.0.1.6 !destination 172.16.0.7

IPFIX

VPF can send session data, including NAT translations, via IPFIX. See IPFIX Exporter and Configuring IPFIX NAT Logging for details.