4 randpkt - Random Packet Generator
9 S<[ B<-b> E<lt>maxbytesE<gt> ]>
10 S<[ B<-c> E<lt>countE<gt> ]>
11 S<[ B<-t> E<lt>typeE<gt> ]>
16 B<randpkt> is a small utility that creates a B<libpcap> trace file
17 full of random packets.
19 By creating many randomized packets of a certain type, you can
20 test packet sniffers to see how well they handle malformed packets.
21 The sniffer can never trust the data that it sees in the packet because
22 you can always sniff a very bad packet that conforms to no standard.
23 B<randpkt> produces I<very bad> packets.
25 When creating packets of a certain type, B<randpkt> uses a sample
26 packet that is stored internally to B<randpkt>. It uses this as the
27 starting point for your random packets, and then adds extra random
28 bytes to the end of this sample packet.
30 For example, if you choose to create random ARP packets, B<randpkt>
31 will create a packet which contains a predetermined Ethernet II header,
32 with the Type field set to ARP. After the Ethernet II header, it will
33 put a random number of bytes with random values.
39 =item -b E<lt>maxbytesE<gt>
43 Defines the maximum number of bytes added to the sample packet.
44 If you choose a B<maxbytes> value that is less than the size of the
45 sample packet, then your packets would contain only the sample
46 packet... not much variance there! B<randpkt> exits on that condition.
48 =item -c E<lt>countE<gt>
52 Defines the number of packets to generate.
54 =item -t E<lt>typeE<gt>
56 Default Ethernet II frame.
58 Defines the type of packet to generate:
59 arp Address Resolution Protocol
60 bgp Border Gateway Protocol
61 bvlc BACnet Virtual Link Control
62 dns Domain Name Service
64 fddi Fiber Distributed Data Interface
65 giop General Inter-ORB Protocol
66 icmp Internet Control Message Protocol
68 llc Logical Link Control
69 m2m WiMAX M2M Encapsulation Protocol
71 nbns NetBIOS-over-TCP Name Service
72 ncp2222 NetWare Core Protocol
73 sctp Stream Control Transmission Protocol
76 tcp Transmission Control Protocol
78 udp User Datagram Protocol
79 usb Universal Serial Bus
80 usb-linux Universal Serial Bus with Linux specific header
86 To see a description of the randpkt options use:
90 To generate a capture file with 1000 DNS packets use:
92 randpkt -b 500 -t dns rand_dns.pcap
94 To generate a small capture file with just a single LLC frame use:
96 randpkt -b 100 -c 1 -t llc single_llc.pcap