https://github.com/isc-projects/dnsgen
DNS packet generator
https://github.com/isc-projects/dnsgen
Last synced: 10 months ago
JSON representation
DNS packet generator
- Host: GitHub
- URL: https://github.com/isc-projects/dnsgen
- Owner: isc-projects
- License: mpl-2.0
- Created: 2018-10-02T14:22:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T16:01:10.000Z (almost 2 years ago)
- Last Synced: 2024-12-06T21:42:13.139Z (over 1 year ago)
- Language: C++
- Size: 72.3 KB
- Stars: 41
- Watchers: 6
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ISC DNS Packet Generator
========================
dnsgen
------
`dnsgen` is somewhat like Nominum's `dnsperf` utility, and indeed
shares many of the same command line parameters.
Unlike `dnsperf`, it uses `AF_PACKET` raw sockets and therefore only
runs under Linux. The use of raw sockets allows for the use of a
far larger range of source ports and higher performance than using
"normal" UDP sockets. The data file is loaded completely into
memory on start up so that disk I/O does not affect measurements.
For optimal performance `dnsgen` supports a raw input file mode where
the data file contains raw pre-compiled DNS queries.
To reduce CPU load `dnsgen` does not attempt to correlate received
packets with those it has transmitted. It simply counts those packets
that arrive back on the network interface. Is is therefore best used
on a network interface that is directly connected to the server under
test and not shared with any other services.
In normal operation the packet-per second value reported is the peak
rolling average of the received packet rate observed during the run.
To attempt to find this value `dnsgen` starts sending packets at the
specified sending rate (`-r` option) and then measures the rate at
which packets are received. The sending rate is then continually
adjusted to be the midpoint between the maximum observed rate so
far and the received rate, plus the specified "increment" rate (`-R`
option).
Eventually a steady state should be achieved when the difference
between the received rate and the transmitted rate is equal to the
increment rate, and where that increment represents a small overhead
in lost packets.
In the alternative "ramp" mode (`-M` option) packets are transmitted
at the specified starting rate with the rate increasing thereafter
by the specified increment every 0.1s without regard to the inbound
received rate.
The "batch" value (`-b`) controls how many packets are transmitted at
a time via the `sendmmsg` system call. It is important to tune this
to find the optimal value for your configuration.
dnsecho
-------
Uses `AF_PACKET` mode to receive raw (UDP) packets and immediately
return them from whence they came.
Known Limitations
-----------------
- IPv4 only
- dnsecho: ICMP Port unreachable messages generated by kernel
might be sent along with the echoed packet
Raw File Format
===============
The raw file format looks exactly like a stream of TCP queries,
i.e. a repeated sequence of a two byte packet length (in network
order) followed by the query in wire format.
EDNS OPT RRs are not included within the file, but may be optionally
added "in memory" via the `QueryFile` API once the raw file has
been loaded.
The `dnscvt` utility should be used to convert `dnsperf` format input
files into the raw format.