1xdp-trafficgen(8)       An XDP-based traffic generator       xdp-trafficgen(8)
2
3
4

NAME

6       XDP-trafficgen - an XDP-based traffic generator
7

SYNOPSIS

9       XDP-trafficgen is a packet generator utilising the XDP kernel subsystem
10       to generate packets transmit them through a network interface.  Packets
11       are  dynamically  generated and transmitted in the kernel, allowing for
12       high performance (millions of packets per second per core).
13
14
15       XDP-trafficgen supports generating UDP traffic with  fixed  or  dynamic
16       destination  ports, and also has basic support for generating dummy TCP
17       traffic on a single flow.
18
19
20   Running xdp-traffigen
21       The syntax for running xdp-bench is:
22
23              Usage: xdp-trafficgen COMMAND [options]
24
25              COMMAND can be one of:
26                     udp         - run in UDP mode
27                     tcp         - run in TCP mode
28
29
30       Each command, and its options are explained below. Or use  xdp-traffic‐
31       gen COMMAND --help to see the options for each command.
32
33

The UDP command

35       The UDP command generates UDP traffic to a given destination IP and ei‐
36       ther a fixed destination port, or a range of port  numbers.  Only  IPv6
37       traffic  is supported, and the generated packets will have their IP hop
38       limit set to 1, so they can't be routed.
39
40
41       The syntax for the udp command is:
42
43
44       xdp-trafficgen udp [options] <ifname>
45
46
47       Where <ifname> is the name of the destination  interface  that  packets
48       will  be  transmitted  on. Note that the network driver of this network
49       interface must support being the target of XDP redirects (it  must  im‐
50       plement the ndo_xdp_xmit driver operation).
51
52
53       The supported options are:
54
55
56   -m, --dst-mac <mac addr>
57       Set the destination MAC address of generated packets. The default is to
58       generate packets with an all-zero destination MAC.
59
60
61   -M, --src-mac <mac addr>
62       Set the source MAC address of the generated packets. The default is  to
63       use the MAC address of the interface packets are transmitted on.
64
65
66   -a, --dst-addr <addr>
67       Destination  IP  address of generated packets. The default is the link-
68       local fe80::2 address.
69
70
71   -A, --src-addr <addr>
72       Source IP address of generated packets. The default is  the  link-local
73       fe80::1 address.
74
75
76   -p, --dst-port <port>
77       Destination  UDP  port  of  generated packets, or the first port in the
78       range if running with --dyn-ports set. Defaults to 1.
79
80
81   -P, --src-port <port>
82       Source UDP port of generated packets. Defaults to 1.
83
84
85   -d, --dyn-ports <num ports>
86       Enable dynamic port mode where the destination port is  varied  over  a
87       range of <num ports> starting from the --dst-port.
88
89
90   -n, --num-packets <port>
91       Number of packets to send before exiting. If not supplied, xdp-traffic‐
92       gen will keep sending packets until interrupted.
93
94
95   -t, --threads <threads>
96       Number of simultaneous threads to transmit from. Each  thread  will  be
97       pinned to a separate CPU core if possible. Defaults to 1.
98
99
100   -I, --interval <s>
101       Output transmission statistics with this interval (in seconds).
102
103
104   -v, --verbose
105       Enable verbose logging (-vv: more verbose).
106
107
108   --version
109       Display version information and exit.
110
111
112   -h, --help
113       Display a summary of the available options
114
115
116

The TCP command

118       The  TCP command generates dummy TCP traffic in a single TCP flow. This
119       relies on first installing an ingress XDP program on the interface used
120       to  transmit  on.  Then, a regular TCP socket connection is established
121       from userspace, and once the handshake is completed,  the  XDP  program
122       will  take  over  and  start generating traffic on that flow tuple. The
123       ingress XDP program will intercept ACK packets from the  receiver,  and
124       keep track of the receive window.
125
126
127       The  traffic  generator  has no congestion control, and only very basic
128       retransmit tracking: in essence, any duplicate ACKs from  the  receiver
129       will  cause  the  sender  to reset its send sequence number to the last
130       ACKed value and restart from  there.  The  same  thing  happens  if  no
131       progress  on the window is made within two seconds. This means that the
132       traffic generator can generate a large amount of dummy traffic, but  if
133       there's packet loss a lot of this can be retransmissions.
134
135
136       The syntax for the tcp command is:
137
138
139       xdp-trafficgen tcp [options] -i <ifname> <hostname>
140
141
142       Where  <ifname>  is  the name of the destination interface that packets
143       will be transmitted on and <hostname> is the peer hostname  or  IP  ad‐
144       dress  to  connect  to  (only IPv6 is supported). Note that the network
145       driver of this network interface must support being the target  of  XDP
146       redirects (it must implement the ndo_xdp_xmit driver operation).
147
148
149       The supported options are:
150
151
152   -p, --dst-port <port>
153       Connect to destination <port>. Default 10000.
154
155
156   -m, --mode <mode>
157       Load  ingress  XDP program in <mode>; default native (valid values: na‐
158       tive,skb,hw)
159
160
161   -n, --num-packets <port>
162       Number of packets to send before exiting. If not supplied, xdp-traffic‐
163       gen will keep sending packets until interrupted.
164
165
166   -I, --interval <s>
167       Output transmission statistics with this interval (in seconds).
168
169
170   -v, --verbose
171       Enable verbose logging (-vv: more verbose).
172
173
174   --version
175       Display version information and exit.
176
177
178   -h, --help
179       Display a summary of the available options
180
181
182

BUGS

184       Please  report  any bugs on Github: https://github.com/xdp-project/xdp-
185       tools/issues
186
187

AUTHOR

189       xdp-trafficgen  and  this  man  page  were  written  by  Toke  Høiland-
190       Jørgensen.
191
192
193
194V1.4.1                         OCTOBER 20, 2023              xdp-trafficgen(8)
Impressum