| NVIDIA DOCA SDK | Data Center on a Chip Framework Documentation |
This section describes DOCA Flow CT samples based on the DOCA Flow CT pipe.
The samples illustrate how to use the library API to manage TCP/UDP connections.
Info
All the DOCA samples described in this section are governed under the BSD-3 software license agreement.
Refer to the following documents:
To build a given sample:
Info: The binary doca_flow_ct_udp is created under /tmp/build/samples/.
For example, to use doca_flow_ct_udp:
-h, --help Print a help synopsis-v, --version Print program version information -l, --log-level Set the (numeric) log level for the program <10=DISABLE, 20=CRITICAL, 30=ERROR, 40=WARNING, 50=INFO, 60=DEBUG, 70=TRACE>--sdk-log-level Set the SDK (numeric) log level for the program <10=DISABLE, 20=CRITICAL, 30=ERROR, 40=WARNING, 50=INFO, 60=DEBUG, 70=TRACE>-j, --json <path> Parse all command flags from an input json file-p, --pci_addr <PCI-ADDRESS> PCI device addressFor additional information per sample, use the -h option:
The following is a CLI example for running the samples when port 03:00.0 is configured (multi-port e-switch) as manager port:
Info: To avoid the test being impacted by unexpected packets, it only accepts packets like the following examples:
1.1.1.10101:0101:0101:0101:0101:0101:0101:0101Note: All CT UDP samples demonstrate the usage of the connection's duplication filter. Duplication filter is used if the user is interested in preventing same connection rule insertion in a high-rate workload environment.
This sample illustrates how to create a simple pipeline on two standalone e-switches. Multi-port e-switch must be disabled.
mode_args="switch,hws" in the doca_flow_cfg struct.Info: Ports are configured according to the parameters provided to doca_dpdk_port_probe() in the main function.
doca_flow_ct_add_entry() to create a hardware rule according to the parsed 5-tuple info.Reference:
doca_flow/flow_ct_udp/flow_ct_2_ports_sample.cdoca_flow/flow_ct_udp/flow_ct_2_ports_main.cdoca_flow/flow_ct_udp/meson.buildThis sample illustrates how to create a simple UDP pipeline with a CT pipe in it.
mode_args="switch,hws" in the doca_flow_cfg struct.Info: Ports are configured according to the parameters provided to doca_dpdk_port_probe() in the main function.
doca_flow_ct_add_entry() is called to create a hardware rule according to the parsed 5-tuple info.Reference:
doca_flow/flow_ct_udp/flow_ct_udp_sample.cdoca_flow/flow_ct_udp/flow_ct_udp_main.cdoca_flow/flow_ct_udp/meson.buildThis sample illustrates how to query a Flow CT UDP session entry. The query can be done according to session direction (origin or reply). The pipeline is identical to that of the Flow CT UDP sample.
./port_0_info.txt.Reference:
doca_flow/flow_ct_udp_query/flow_ct_udp_query_sample.cdoca_flow/flow_ct_udp_query/flow_ct_udp_query_main.cdoca_flow/flow_ct_udp_query/meson.buildThis sample illustrates how a CT entry can be updated after creation.
The pipeline is identical to that of the Flow CT UDP sample. In case of non-active UDP sessions, a relevant entry shall be updated with an aging timeout.
Reference:
doca_flow/flow_ct_udp_update/flow_ct_udp_update_sample.cdoca_flow/flow_ct_udp_update/flow_ct_udp_update_main.cdoca_flow/flow_ct_udp_update/meson.buildThis sample is based on the Flow CT UDP sample. The sample illustrates that a hardware entry can be created with a single match (matching performed in one direction only) in the API call doca_flow_ct_add_entry().
This sample illustrates the use of the DOCA Flow CT aging functionality. It demonstrates how to build a pipe and add different entries with different aging times and user data.
No packets need to be sent for this sample.
mode_args="switch,hws" in the doca_flow_cfg struct.Info: Ports are configured according to the parameters provided to doca_dpdk_port_probe() in the main function.
Reference:
doca_flow/flow_ct_aging/flow_ct_aging_sample.cdoca_flow/flow_ct_aging/flow_ct_aging_main.cdoca_flow/flow_ct_aging/meson.buildThis sample illustrates how to manage TCP flags with CT to achieve better control over TCP sessions.
Info: The sample expects to receive at least SYN and FIN packets.
mode_args="switch,hws" in the doca_flow_cfg struct.Info: Ports are configured according to the parameters provided to doca_dpdk_port_probe() in the main function.
rte_eth_tx_burst() on port 0 (proxy port) by rte_flow_dynf_metadata_set() to 1.Reference:
doca_flow/flow_ct_tcp/flow_ct_tcp_sample.cdoca_flow/flow_ct_tcp/flow_ct_tcp_main.cdoca_flow/flow_ct_tcp/meson.buildThis sample illustrates how to add shared and non-shared actions to CT TCP sessions. The pipeline is identical to that of the Flow CT TCP sample.
Info: The sample expects to receive at least SYN and FIN packets.
This sample adds a shared action on one side of the session that placed the value 1 in the packet's metadata, while on the other side of the session a non-shared action is placed. The non-shared action simply flips the order of the source-destination IP addresses and port numbers.
Reference:
doca_flow/flow_ct_tcp_actions/flow_ct_tcp_actions_sample.cdoca_flow/flow_ct_tcp_actions/flow_ct_tcp_actions_main.cdoca_flow/flow_ct_tcp_actions/meson.buildThis sample illustrates how to use the flow log callback to alert when a session is aged/removed.
Info: The sample expects to receive at least SYN and FIN packets.
This sample is based on the Flow CT TCP sample. Once a session is removed (after receiving FIN packet), the callback is triggered and session counters are queried.
Reference:
doca_flow/flow_ct_tcp_flow_log/flow_ct_tcp_flow_log_sample.cdoca_flow/flow_ct_tcp_flow_log/flow_ct_tcp_flow_log_main.cdoca_flow/flow_ct_tcp_flow_log/meson.buildThis sample illustrates how to manage a flow with a different IP type per direction.
In case of a SYN flag:
From this point on, all IPv4 TCP packets (belonging to the origin direction) and all IPv6 TCP packets (belonging to the reply direction) are offloaded.
Reference:
doca_flow/flow_ct_tcp/flow_ct_tcp_sample_ipv4_ipv6.cdoca_flow/flow_ct_tcp/flow_ct_tcp_ipv4_ipv6_main.cdoca_flow/flow_ct_tcp/meson.build