Traffic Capturing
To capture traffic in an easy way, you can use the NetCap extension to collect and aggregate traffic from multiple worker nodes in a central location. Follow the NetCap documentation page and FPP configuration for NetCapBroken link for more information.
Traffic on UPG is also handled inside the VPP framework. UPG pods run in the Core Cluster, and the commands below should be executed there. Tools to capture traffic using the kernel network stack (like tcpdump or ip) are not useful for UPG debugging.
VPP Packet Tracing
There are many commands in VPP CLI for debugging, and most of them are documented in FPP Troubleshooting docsBroken link.
Commands available there:
trace add <input> <num>show traceclear tracepcap trace
Caution
trace and pcap trace CLI commands use memory to store the trace, so before using it, assess how much
memory is left on the pod. The alternative is to use kernel based pcap capturing inside workload pod that
uses the TAP interface.
VPP trace facilityOpens in a new tab can be used for in-depth debugging of network connectivity.
Dispatch trace VPP facility captures the traversal of the VPP node graph by the buffers (packets), e.g.:
The command above can take up to 20-30Mb RAM to gather the traffic. To stop the trace, run:
The result is saved in /tmp/trace-file.pcap.
For later analysis, this file needs to be copied from the pod to an external machine by hand, for example, by the kubectl cp command:
Using SPAN interfaces
UPG traffic can be captured using SPAN interfaces that mirror all traffic from the UPG memif to the kernel-based TAP interface, making it possible to capture traffic using a standard Linux pod with tshark/tcpdump tools.
To understand better how to do it, let's define an example:
- UPGDeployment installed using name
upg-tdf, instance name (spec.instances) set toinst01 - UPG in TDF mode, with pod name
{UPG-POD-NAME}, with above setting it equals toupg-tdf-inst01-0 - Access network VPPInterface CR named
upg-tdf-inst01-access - Control network VPPInterface CR named
upg-tdf-inst01-sxb - Data network interface named
upg-tdf-inst01-pool-at-sgi-at - Second data interface called
upg-tdf-inst01-pool-de-sgi-de - UPG runs in namespace
{UPG-NS} - UPG is deployed on
{NODE}
First, define a proper Network Attachment Definition in the Core Cluster, for example:
This NADS must be used with a Linux pod and scheduled on the same node that UPG is working on ({NODE}):
Inside the SPAN pod, traffic from the access network is mirrored on the an interface, the data network is mirrored
to interfaces de1 and at1, and the control network traffic is available on the sxb interface.