1 .\" Copyright (c) 2016, George V. Neville-Neil
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions are met:
7 .\" 1. Redistributions of source code must retain the above copyright notice,
8 .\" this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 .\" POSSIBILITY OF SUCH DAMAGE.
33 .Nd Packet generator for use with
42 .Op Fl t Ar pkts_to_send
43 .Op Fl r Ar pkts_to_receive
45 .Op Fl d Ar dst_ip[:port[-dst_ip:port]]
46 .Op Fl s Ar src_ip[:port[-src_ip:port]]
50 .Op Fl b Ar burst size
55 .Op Fl w Ar wait_for_link_time
64 generates and receives raw network packets using
66 The arguments are as follows:
70 Network interface name.
71 .It Fl f Ar function tx rx ping pong
72 Set the function to transmit, receive of ping/pong.
74 Number of iterations (can be 0).
76 Number of packets to send. Also forces transmit mode.
77 .It Fl r Ar pkts_to_receive
78 Number of packets to receive. Also forces rx mode.
80 Packet size in bytes excluding CRC.
81 .It Fl d Ar dst_ip[:port[-dst_ip:port]]
82 Destination IPv4 address and port, single or range.
83 .It Fl s Ar src_ip[:port[-src_ip:port]]
84 Source IPv4 address and port, single or range.
86 Destination MAC address in colon notation.
88 Source MAC address in colon notation.
92 to a particular CPU core using
94 .It Fl b Ar burst size
95 Set the size of a burst of packets.
97 Number of cores to use.
99 Number of threads to use.
100 .It Fl T Ar report_ms
101 Number of milliseconds between reports.
103 Use libpcap instead of netmap for reading or writing.
104 .It Fl w Ar wait_for_link_time
105 Number of seconds to wait to make sure that the network link is up. A
106 network device driver may take some time to create a new
107 transmit/receive ring pair when
111 Packet transmission rate. Not setting the packet transmission rate tells
113 to transmit packets as quickly as possible. On servers from 2010 on-wards
115 is able to completely use all of the bandwidth of a 10 or 40Gbps link,
116 so this option should be used unless your intention is to saturate the link.
118 Dump payload transmitted or received.
120 Add empty virtio-net-header with size 'len'. This option is only use
121 with Virtual Machine technologies that use virtio as a network interface.
123 Load the packet from a pcap file rather than constructing it inside of
126 Use random IPv4 src address/port
128 Use random IPv4 dst address/port
132 is a raw packet generator that can utilize either
136 but which is most often uses with
140 used depends upon how the underlying Ethernet driver exposes its
141 transmit and receive rings to
143 Most modern network interfaces that support 10Gbps and higher speeds
144 have several transmit and receive rings that are used by the operating
145 system to balance traffic across the interface.
147 can peel off one or more of the transmit or receive rings for its own
148 use without interfering with packets that might otherwise be destined
149 for the host. For example on a system with a Chelsio Network
150 Interface Card (NIC) the interface specification of
154 access to a pair of transmit and receive rings that are separate from
155 the more commonly known cxl0 interface, which is used by the operating
156 system's TCP/IP stack.
158 Capture and count all packets arriving on the operating system's cxl0
159 interface. Using this will block packets from reaching the operating
160 system's network stack.
166 Send a stream of fake DNS packets between two hosts with a packet
167 length of 128 bytes. You must set the destination MAC address for
168 packets to be received by the target host.
172 -i netmap:ncxl0 -f tx -s 172.16.0.1:53 -d 172.16.1.3:53 -D 00:07:43:29:2a:e0
178 This manual page was written by
179 .An George V. Neville-Neil Aq gnn@FreeBSD.org .