witness: FIX for tvb_get_unicode_string -> tvb_get_string_enc
[metze/wireshark/wip.git] / doc / randpkt.pod
1
2 =head1 NAME
3
4 randpkt - Random Packet Generator
5
6 =head1 SYNOPSIS
7
8 B<randpkt>
9 S<[ B<-b> E<lt>maxbytesE<gt> ]>
10 S<[ B<-c> E<lt>countE<gt> ]>
11 S<[ B<-t> E<lt>typeE<gt> ]>
12 E<lt>filenameE<gt>
13
14 =head1 DESCRIPTION
15
16 B<randpkt> is a small utility that creates a B<pcap> trace file
17 full of random packets.
18
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.
24
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.
29
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.
34
35 =head1 OPTIONS
36
37 =over 4
38
39 =item -b E<lt>maxbytesE<gt>
40
41 Default 5000.
42
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.
47
48 =item -c E<lt>countE<gt>
49
50 Default 1000.
51
52 Defines the number of packets to generate.
53
54 =item -t E<lt>typeE<gt>
55
56 Default Ethernet II frame.
57
58 Defines the type of packet to generate:
59
60         arp             Address Resolution Protocol
61         bgp             Border Gateway Protocol
62         bvlc            BACnet Virtual Link Control
63         dns             Domain Name Service
64         eth             Ethernet
65         fddi            Fiber Distributed Data Interface
66         giop            General Inter-ORB Protocol
67         icmp            Internet Control Message Protocol
68         ip              Internet Protocol
69         llc             Logical Link Control
70         m2m             WiMAX M2M Encapsulation Protocol
71         megaco          MEGACO
72         nbns            NetBIOS-over-TCP Name Service
73         ncp2222         NetWare Core Protocol
74         sctp            Stream Control Transmission Protocol
75         syslog          Syslog message
76         tds             TDS NetLib
77         tcp             Transmission Control Protocol
78         tr              Token-Ring
79         udp             User Datagram Protocol
80         usb             Universal Serial Bus
81         usb-linux       Universal Serial Bus with Linux specific header
82
83 =back
84
85 =head1 EXAMPLES
86
87 To see a description of the randpkt options use:
88
89     randpkt
90
91 To generate a capture file with 1000 DNS packets use:
92
93     randpkt -b 500 -t dns rand_dns.pcap
94
95 To generate a small capture file with just a single LLC frame use:
96
97     randpkt -b 100 -c 1 -t llc single_llc.pcap
98
99 =head1 SEE ALSO
100
101 pcap(3), editcap(1)