'\" t
.\"     Title: randpkt
.\"    Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.15
.\"      Date: 2023-06-28
.\"    Manual: \ \&
.\"    Source: \ \&
.\"  Language: English
.\"
.TH "RANDPKT" "1" "2023-06-28" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
.  mso www.tmac
.  am URL
.    ad l
.  .
.  am MTO
.    ad l
.  .
.  LINKSTYLE blue R < >
.\}
.SH "NAME"
randpkt \- Random packet generator
.SH "SYNOPSIS"
.sp
\fBrandpkt\fP
[\~\fB\-b\fP\~<maxbytes>\~]
[\~\fB\-c\fP\~<count>\~]
[\~\fB\-t\fP\~<type>\~]
<filename>
.SH "DESCRIPTION"
.sp
\fBrandpkt\fP is a small utility that creates a \fBpcap\fP trace file
full of random packets.
.sp
By creating many randomized packets of a certain type, you can
test packet sniffers to see how well they handle malformed packets.
The sniffer can never trust the data that it sees in the packet because
you can always sniff a very bad packet that conforms to no standard.
\fBrandpkt\fP produces \fIvery bad\fP packets.
.sp
When creating packets of a certain type, \fBrandpkt\fP uses a sample
packet that is stored internally to \fBrandpkt\fP. It uses this as the
starting point for your random packets, and then adds extra random
bytes to the end of this sample packet.
.sp
For example, if you choose to create random ARP packets, \fBrandpkt\fP
will create a packet which contains a predetermined Ethernet II header,
with the Type field set to ARP. After the Ethernet II header, it will
put a random number of bytes with random values.
.SH "OPTIONS"
.sp
\-b <maxbytes>
.RS 4
.sp
Default 5000.
.sp
Defines the maximum number of bytes added to the sample packet.
If you choose a \fBmaxbytes\fP value that is less than the size of the
sample packet, then your packets would contain only the sample
packet... not much variance there! \fBrandpkt\fP exits on that condition.
.RE
.sp
\-c <count>
.RS 4
.sp
Default 1000.
.sp
Defines the number of packets to generate.
.RE
.sp
\-t <type>
.RS 4
.sp
Default Ethernet II frame.
.sp
Defines the type of packet to generate:
.sp
.if n .RS 4
.nf
.fam C
arp             Address Resolution Protocol
bgp             Border Gateway Protocol
bvlc            BACnet Virtual Link Control
dns             Domain Name Service
eth             Ethernet
fddi            Fiber Distributed Data Interface
giop            General Inter\-ORB Protocol
icmp            Internet Control Message Protocol
ip              Internet Protocol
ipv6            Internet Protocol Version 6
llc             Logical Link Control
m2m             WiMAX M2M Encapsulation Protocol
megaco          MEGACO
nbns            NetBIOS\-over\-TCP Name Service
ncp2222         NetWare Core Protocol
sctp            Stream Control Transmission Protocol
syslog          Syslog message
tds             TDS NetLib
tcp             Transmission Control Protocol
tr              Token\-Ring
udp             User Datagram Protocol
usb             Universal Serial Bus
usb\-linux       Universal Serial Bus with Linux specific header
.fam
.fi
.if n .RE
.RE
.SH "DIAGNOSTIC OPTIONS"
.sp
\-\-log\-level <level>
.RS 4
Set the active log level.
Supported levels in lowest to highest order are "noisy", "debug", "info", "message", "warning", "critical", and "error".
Messages at each level and higher will be printed, for example "warning" prints "warning", "critical", and "error" messages and "noisy" prints all messages.
Levels are case insensitive.
.RE
.sp
\-\-log\-fatal <level>
.RS 4
Abort the program if any messages are logged at the specified level or higher.
For example, "warning" aborts on any "warning", "critical", or "error" messages.
.RE
.sp
\-\-log\-domains <list>
.RS 4
Only print messages for the specified log domains, e.g. "GUI,Epan,sshdump".
List of domains must be comma\-separated.
.RE
.sp
\-\-log\-debug <list>
.RS 4
Force the specified domains to log at the "debug" level.
List of domains must be comma\-separated.
.RE
.sp
\-\-log\-noisy <list>
.RS 4
Force the specified domains to log at the "noisy" level.
List of domains must be comma\-separated.
.RE
.sp
\-\-log\-file <path>
.RS 4
Write log messages and stderr output to the specified file.
.RE
.SH "EXAMPLES"
.sp
To see a description of the randpkt options use:
.sp
.if n .RS 4
.nf
.fam C
randpkt
.fam
.fi
.if n .RE
.sp
To generate a capture file with 1000 DNS packets use:
.sp
.if n .RS 4
.nf
.fam C
randpkt \-b 500 \-t dns rand_dns.pcap
.fam
.fi
.if n .RE
.sp
To generate a small capture file with just a single LLC frame use:
.sp
.if n .RS 4
.nf
.fam C
randpkt \-b 100 \-c 1 \-t llc single_llc.pcap
.fam
.fi
.if n .RE
.SH "SEE ALSO"
.sp
pcap(3), editcap(1)