Skip to content
DNS packet generator
C++ Makefile
Branch: master
Clone or download
Latest commit 4d604e5 Dec 20, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
COPYRIGHT added copyright / license files Oct 2, 2018
LICENSE added copyright / license files Oct 2, 2018
Makefile strip ethq from repo Sep 24, 2018
README.md updated README Oct 5, 2018
buffer.h cleanup of buffer.h Dec 20, 2018
dnscvt.cc added copyright / license files Oct 2, 2018
dnsecho.cc annotate the usage function Dec 20, 2018
dnsgen.cc annotate the usage function Dec 20, 2018
packet.cc
packet.h use #pragma once in include files Oct 2, 2018
queryfile.cc added copyright / license files Oct 2, 2018
queryfile.h added copyright / license files Oct 2, 2018
timer.h code comments for timer.h Oct 5, 2018
util.cc added copyright / license files Oct 2, 2018
util.h use #pragma once in include files Oct 2, 2018

README.md

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.

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.

You can’t perform that action at this time.