dns-replay-client replays DNS queries against a real DNS server with correct timing. Optionally it can log the latency for each query, or the timing for each query and response. Multiple instances of dns-replay-client can work coordinately to replay large query stream with dns-replay-controller.
Support for raw connection type (1.1)
Bug fixes and Beta release (1.0)
initial test release (0.1)
% dns-replay-client(1) % Liang Zhu liangzhu@isi.edu % October 5, 2018
dns-replay-client - replay DNS queries with accurate timing
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] [-e]
dns-replay-client replays DNS queries against a real DNS server with correct timing. Optionally it can log the latency for each query, or the timing for each query and response. Multiple instances of dns-replay-client can work in coordination to replay large query stream with dns-replay-controller.
It deals with three different types of input format:
network trace: any format accepted by libtrace, such as pcap and erf file
plain text: a Fsdb file where each line contains data elements delimited by spaces. Each line of the input text file should be (time, source ip, query name, query class, query type, protocol).
customized raw binary: a DNS message with prepended message size. The DNS message is defined in dns_msg.proto, and is converted to binary by Google’s protocol buffer library.
dns-query-mutator can convert network trace files to raw files.
It is recommended to use raw input files when the input query rate is high, in order to achieve the actual query rate.
By default, dns-replay-client creates multiple processes to utilize parallelism of multi-core CPU settings.
By default, dns-replay-client loads all the input trace into memory.
Option -l/--limit
can preload limited seconds of traces to control RAM
usage.
-i/--input
FORMAT:FILE-o/--output
FORMAT:FILE-s/--server
IP:PORT-r/--controller
IP:PORT-n/--num-workers
NUMBER-c/--connections
TYPEadaptive: query with protocol in input stream.
raw: send packets as UDP, replicating source IP and port, and TTL. Note that some input formats do not contain source port, and a random port will be used in these cases. You will need additional routing/filtering settings in your experiment to handle replies (see RAW.md).
tls has not been implemented yet.
-t/--timeout
TIMEOUT-l/--limit
SECONDS-Q/--query-limit
NUMBER-u/--unify-udp
-d/--distribute
-f/--fast
-h/--help
-v/--verbose
-V/--version
-e/--edns
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 ttl src_port
1427330638.079111 192.168.1.1 www.isi.edu IN A udp 45 2122
1427330638.079222 192.168.1.2 www.isi.edu IN A tcp 32 19762
test.raw:
./dns-query-mutator -i trace:test.pcap -o raw:test.raw
replay queries over UDP and output latency to file test.txt
./dns-replay-client -i text:test.fsdb -s 192.168.1.200:53 -c udp -o latency:test.txt
or use pcap input with -i trace:test.pcap
replay queries over TCP and output the timing of reach query and response to stdout
./dns-replay-client -i text:test.fsdb -s 192.168.1.200:53 -c tcp -o timing:-
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 timing:-
replay queries using raw sockets over UDP and output latency to file test.txt, set EDNS in each query
./dns-replay-client -i text:test.fsdb -s 192.168.1.200:53 -c raw -e -o latency:test.txt
or use pcap input with -i trace:test.pcap
preload 15-second trace to control RAM usage
./dns-replay-client -l 15 -i raw:test.raw -s 192.168.1.200:53 -c adaptive -o timing:-
use standard input
cat test.fsdb | ./dns-replay-client -i text:- -s 192.168.1.200:53 -c adaptive -o latency:-
cat test.pcap | ./dns-replay-client -i trace:- -s 192.168.1.200:53 -c adaptive -o latency:-
cat test.raw | ./dns-replay-client -i raw:- -s 192.168.1.200:53 -c adaptive -o latency:-
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 timing:- -r 192.168.1.100:10053
To build, type make.
Fedora: Required packages are: ldns-devel libtrace-devel libevent-devel protobuf-devel
Ubuntu: You may use install-client.sh to install required packages on Ubuntu. For server setup see RAW.md.
dns-replay-controller(1), dns-query-mutator(1), Fsdb(3)