Skip to content

FastClick for traffic generation

Tom Barbette edited this page Apr 23, 2024 · 7 revisions

FastClick can be used as a very efficient and high-speed traffic generator/replay and/or sink.

This description presents the different examples available in the repository by order of complexity.

Single side UDP generator, single-threaded, L2

The pktgen-l2.click configuration available in the repository under conf/pktgen/ (online) shows an example configuration to generate UDP packets using FastUDPFlows, then replay the generated packets multiple time from memory, sending the packets with DPDK.

While FastUDPSource could be directly piped to ToDPDKDevice, the ReplayUnqueue elements allows much faster replay from memory. Especially when using QUICK_CLONE 1 and DPDK that will allow to duplicate packets using DPDK's reference counting.

It is called "single side" because it is only generating packets from one port, one side of the "connection".

Single side UDP tester (generator to sink), single-threaded (but one per side), L2

The tester-l2.click configuration is available in the repository under conf/pktgen/ (online).

This configuration includes a generator and a sink, so somehow packets are expected to come back.

Double side UDP tester (generator to sink and sink to generator), single-threaded (but one per side), L2

The tester-l2-dual.click configuration available in the repository under conf/pktgen/ (online).

This configuration is similar to the previous one but is dual-sided, both ports include a generator and a sink.

The tester-l2-dual-loop.click (online) configuration is similar to the dual version, but repeats the test for every packet length from 60 bytes to 1500. While this is interesting to learn the power of the Script element, you should use another tool such as NPF to repeat your experiment multiple times for multiple whatever parameters (such as packet size which is only one important one), compute average, median, stderr, etc...

Multi-thread PCAP packet generator and tester

A more advanced pktgen configuration can be used with 4 threads to play packets from a PCAP file. We present two variants, (with) and (without)pre-loading PCAPs in memory.

The final fully-fledged configuration, tester-l2-mt-replaycap.click (online) also receives packets back on one interface (the same or another one), and computes the throughput, the latency of packets, and a few other statistics by numbering packets in the payload before pre-loading packets in memory. When packets go out the number and time is marked and when a packet is received, a lookup is done to find the original time.

Clone this wiki locally