1KXDPGUN(8)                         Knot DNS                         KXDPGUN(8)
2
3
4

NAME

6       kxdpgun - XDP-powered DNS benchmarking tool
7

SYNOPSIS

9       kxdpgun [options] -i filename targetIP
10

DESCRIPTION

12       Powerful  generator  of  DNS  traffic,  sending  and  receiving packets
13       through XDP.
14
15       Queries are generated according to a textual file which is read sequen‐
16       tially  in  a  loop  until  a configured duration elapses. The order of
17       queries is not guaranteed. Responses are received (unless disabled) and
18       counted, but not checked against queries.
19
20       The number of parallel threads is autodected according to the number of
21       queues configured for the network interface.
22
23   Options
24       -t, --duration seconds
25              Duration of traffic generation, specified as a decimal number in
26              seconds (default is 5.0).
27
28       -T, --tcp
29              Send queries over TCP.
30
31       -Q, --qps queries
32              Number of queries-per-second (approximately) to be sent (default
33              is 1000).  The program is not optimized for low speeds at  which
34              it may lose communication packets. The recommended minimum speed
35              is 2 packets per thread (Rx/Tx queue).
36
37       -b, --batch size
38              Send more queries in a batch. Improves QPS but  may  affect  the
39              counterpart's packet loss (default is 10 for UDP and 1 for TCP).
40
41       -r, --drop
42              Drop  incoming  responses.  Improves  QPS, but disables response
43              statistics.
44
45       -p, --port number
46              Remote destination port (default is 53).
47
48       -F, --affinity cpu_spec
49              CPU  affinity  for  all  threads   specified   in   the   format
50              [<cpu_start>][s<cpu_step>],  where <cpu_start> is the CPU ID for
51              the first thread and <cpu_step> is the CPU ID increment for next
52              thread (default is 0s1).
53
54       -i, --infile filename
55              Path to a file with query templates.
56
57       -I, --interface interface
58              Network interface for outgoing communication. This can be useful
59              in situations when the interfaces are in a bond for example.
60
61       -l, --local localIP[/prefix]
62              Override the auto-detected source  IP  address.  If  an  address
63              range  is  specified instead, various IPs from the range will be
64              used for different queries uniformly.
65
66       targetIP
67              The IPv4 or IPv6 address of remote destination.
68
69       -h, --help
70              Print the program help.
71
72       -V, --version
73              Print the program version.
74
75   Queries file format
76       Each line describes a query in the form:
77
78       query_name query_type [flags]
79
80       Where query_name is a domain name to be queried, query_type is a record
81       type name, and flags is a single character:
82
83       E Send query with EDNS.
84
85       D Request DNSSEC (EDNS + DO flag).
86
87   Signals
88       Sending  USR1  signal  to a running process triggers current statistics
89       dump to the standard output.
90

NOTES

92       Linux kernel 4.18+ is required.
93
94       The utility has to be executed under root or with  these  capabilities:
95       CAP_NET_RAW, CAP_NET_ADMIN, CAP_SYS_ADMIN, and CAP_SYS_RESOURCE if max‐
96       imum locked memory limit is too low on Linux < 5.11.
97
98       The utility allocates source UDP/TCP ports from the range 2000-65535.
99

EXIT VALUES

101       Exit status of 0 means successful operation. Any other exit status  in‐
102       dicates an error.
103

EXAMPLES

105       Manually created queries file:
106
107          abc6.example.com. AAAA
108          nxdomain.example.com. A
109          notzone. A
110          a.example.com. NS E
111          ab.example.com. A D
112          abcd.example.com. DS D
113
114       Queries file generated from a zone file (Knot DNS format):
115
116          cat ZONE_FILE | awk "{print \$1,\$3}" | grep -E "(NS|DS|A|AAAA|PTR|MX|SOA)$" | sort -u -R > queries.txt
117
118       Basic usage:
119
120          # kxdpgun -i ~/queries.txt 2001:DB8::1
121
122       Using UDP with increased batch size:
123
124          # kxdpgun -t 20 -Q 1000000 -i ~/queries.txt -b 20 -p 8853 192.0.2.1
125
126       Using TCP:
127
128          # kxdpgun -t 20 -Q 100000 -i ~/queries.txt -T -p 8853 192.0.2.1
129

SEE ALSO

131       kdig(1).
132

AUTHOR

134       CZ.NIC Labs <https://www.knot-dns.cz>
135
137       Copyright 2010–2021, CZ.NIC, z.s.p.o.
138
139
140
141
1423.1.4                             2021-11-04                        KXDPGUN(8)
Impressum