p4bm-vitisnet Application - 2022.2 English

Vitis Networking P4 User Guide (UG1308)

Document ID
2022.2 English

The p4bm-vitisnet application models the data plane behavior of a P4 program. Its primary input is the .json file produced by the P4 Vitis Networking P4 compiler.

The key features of p4bm-vitisnet are as follows:

  • Supports the Vitis Networking P4 Architecture.
  • Packet data is inserted into the model from files only, of which both PCAP and the Xilinx packet text file format are supported (see Packet File for more information).
  • Input packet metadata can optionally be inserted into the model and output packet metadata is always emitted to a file (seeMetadata File for more information).
  • Dropped packets can optionally be emitted as zero-length packets, enabling the metadata associated with them to be captured if desired.
  • Packet flow is controlled purely from the associated p4bm-vitisnet-cli, which allows table management to be interleaved with packet flow if desired.

When launched, p4bm-vitisnet parses the provided .json file and uses it to allocate and configure all of the resources needed to perform the modeling (parsers, tables, etc.) It then waits for commands to be received from p4bm-vitisnet-cli on the specified socket interface. The model uses run to completion semantics; all commands are executed in full in the order they are received.

The application supports the command line parameters identified in the following table.

Table 1. Optional Parameters
Parameter Description
-h [--help] Prints a list of possible parameters and a short description.
--thrift-port arg TCP port on which to run the Thrift runtime server (socket connection for CLI).
--log-console Enable logging on stdout.
--log-file arg Enable logging to given file.
-L [ --log-level ] arg Set log level, supported values are 'trace', 'debug', 'info', 'warn', 'error', off'; default is 'trace'.
--log-flush If used with '--log-file', the logger will flush to disk after every log message.
--dump-packet-data arg Specify how many bytes of packet data to dump upon receiving and sending a packet. The logger is used to dump the packet data, with log level 'info'. Ensure the log level you have set does not exclude 'info' messages; default is 0, which means that nothing is logged.
-v [ --version ] Display version information.
--json-version Display VitisNetP4 JSON version supported in the format <major>.<minor>.
--load-modules arg Comma separated list of runtime loadable modules (such as extern modeling).