DNS Trace Replay Client

dns-replay-client

dns-replay-client reads DNS query stream, replays them against a real DNS server with correct timing and outputs the latency for each query (optional). Multiple dns-replay-client instances can work coordinately to generate aggregated DNS query replay stream, with a separated program: dns-replay-controller.

Documentation

% dns-replay-client(1) % Liang Zhu liangzhu@isi.edu % October 22, 2016

NAME

dns-replay-client - replay DNS queries with accurate timing

SYNOPSIS

dns-replay-client [-i FORMAT:PATH] [-o OUTPUT] [-s IP:PORT] [-r IP:PORT] [-n NUMBER] [-c TYPE] [-t TIMEOUT] [-l SECONDS] [-u] [-d] [-f] [-v] [-V] [-h]

DESCRIPTION

dns-replay-client reads DNS query stream, replays them against a real DNS server with correct timing and outputs the latency for each query (optional). Multiple dns-replay-client instances can work coordinately to generate aggregated DNS query replay stream, with a separated program: dns-replay-controller.

It accepts three different types of input:

network trace: any format accepted by libtrace, such as pcap and erf file

plain text: a Fsdb file where each line contains data elements (time, source ip, query name, query class, query type, protocol ) delimited by spaces.

customized binary: a binary file converted use a separated program fsdb2raw

By default, it creates multiple processes to utilize parallelism of multi-core CPU settings.

OPTIONS

-i/--input FORMAT:FILE
input stream, format and file separated by colon like FORMAT:FILE. Accepted format: ‘trace’ (network trace), ‘text’ (plain text Fsdb), ‘raw’ (customized binary). Use ‘-‘ as FILE to read from standard input. It is required without option -d.
-o/--output FILE
specify output file, ‘-‘ for standard output
-s/--server IP:PORT
server address and port, separated by colon, e.g. 192.168.1.1:53
-r/--controller IP:PORT
address and port to receive message from controller, e.g. 192.168.1.100:10053, required in distributed mode (-d)
-n/--num-workers NUMBER
specify number of worker processes. The default is the number of CPU cores.
-c/--connections TYPE
specify the type connection that the queries are send over. Accepted options: udp/tcp/tls/adaptive, ‘adaptive’: query with protocol in input stream. (Note that tls has not been implemented yet.)
-t/--timeout TIMEOUT
specify the timeout for tcp/tls connections, default is 30 seconds
-l/--limit SECONDS
preload seconds of trace, used to control memory consumption default is none (or any negative integer): read all in memory option ‘-f’ set this to none automatically
-u/--unify-udp
each worker uses one socket for all the UDP queries. By default it uses different sockets for different source IP.
-d/--distribute
distributed mode with reading input stream from controller. This requires dns-replay-controller running separately.
-f/--fast
the fastest query replay rate: send input queries immediately without setup timer
-h/--help
print help message
-v/--verbose
verbose log; default is none
-V/--version
show the program version

EXAMPLES

Assume there are input files:

test.pcap:

contains one UDP query and one TCP query for "www.isi.edu A".

test.fsdb:

#fsdb time src_ip qname qclass qtype protocol
1427330638.079111 192.168.1.1 www.isi.edu IN A udp
1427330638.079222 192.168.1.2 www.isi.edu IN A tcp
  1. replay queries over UDP and output to file test.txt

    ./dns-replay-client -i text:test.fsdb -s 192.168.1.200:53 -c udp -o test.txt

    or use pcap input with “-i trace:test.pcap”

  2. replay queries over TCP and output to stdout

    ./dns-replay-client -i text:test.fsdb -s 192.168.1.200:53 -c tcp -o -

  3. replay queries over the protocol given in the input

    ./dns-replay-client -i text:test.fsdb -s 192.168.1.200:53 -c adaptive -o -

  4. use standard input

    cat test.fsdb ./dns-replay-client -i text:- -s 192.168.1.200:53 -c adaptive -o -
    cat test.pcap ./dns-replay-client -i trace:- -s 192.168.1.200:53 -c adaptive -o -
  5. run in distributed mode

    assume dns-replay-controller is running at port 10053 on 192.168.1.100

    ./dns-replay-client -d -s 192.168.1.200:53 -c adaptive -o - -r 192.168.1.100:10053

INSTALLATION

To build, type “make”.

It requires the following packages on Fedora: ldns-devel libtrace-devel libevent-devel protobuf-devel

ALSO SEE

Fsdb(3), dns-replay-controller(1), fsdb2raw(1)

CHANGES