tgn — a network traffic generator
tgn
[-V
] [-v
] [-l
] [-s
random seed
] [-w
PCAP filename
] [-o
output speaker
] [-c
packet count
] [-h
] [PDU definition
]
tgn is a network traffic generator. It is command-line interface (CLI) program that does the same thing as the send_network command of the Network Expect framework. Refer to nexp(1) for additional details regarding the send_network command.
The only mandatory option is a PDU definition.
The -c
switch allows to specify the number of packets
to send. If -c
is not provided then the number of
packets to send is calculated automatically based on the PDU definition.
-V
causes tgn to
print its version number and exit.
The -s
flag allows to specify a random seed
that will cause predicatibility of pseudo-random numbers
generated by tgn during execution
of a script. In cases where tgn is
used as a protocol fuzzer, this option is useful to be able to
re-generate a specific test case.
-v
increases the verbosity level. Additional information
may be displayed when the verbosity level is higher.
The -l
flag causes tgn to
display all available network speakers and exit. See
nexp(1) for a discussion of network speakers.
The -o
flag allows to select a specific network
speaker for output. Use the -l
option to list
available speakers. By default, the "ip" speaker (kernel-routed
IP packet delivery) is tried first and if it is not available,
which can happen if tgn is not run with
root privileges, the "hex" speaker is used.
The PDU definition is a string that defines a PDU. It uses libpbuild PDU syntax.
shell# tgn -o eth0 "ip(dst = 192.168.1.1)/icmp-echo(id = 'random')"
shell# tgn "ip(src = 192.168.0.1, dst = <192.168.0.10, 192.168.0.11>,ttl = <1, 2>)/" \ "tcp(src = 'random', dst = 22..25, window = 16384,syn, seq = 'random', ack-seq = 0)"
shell# tgn -w /tmp/cap -c 5 "ether()/ip(dst = 1.2.3.4++)/icmp-echo(seq = 0++)" \ && wireshark /tmp/cap
nexp-numspec(1), nexp-payload(1), nexp-ether(5), nexp-gre(5), nexp-ip(5), nexp-mpls(5), nexp(1)
Network Expect was written by Eloy Paris <peloy@netexpect.org>. However, Network Expect borrows ideas from lots of Open Source tools like Nemesis, Packit, hping, Expect, and Scapy. The Network Expect author is indebted to the authors of these tools for their contribution.
This man page was written by Eloy Paris.