]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/tools/netmap/nmreplay.8
THIS BRANCH IS OBSOLETE, PLEASE READ:
[FreeBSD/FreeBSD.git] / tools / tools / netmap / nmreplay.8
1 .\" Copyright (c) 2016 Luigi Rizzo, Universita` di Pisa
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd December 21, 2018
28 .Dt NMREPLAY 8
29 .Os
30 .Sh NAME
31 .Nm nmreplay
32 .Nd playback a pcap file through a netmap interface
33 .Sh SYNOPSIS
34 .Bk -words
35 .Bl -tag -width "nmreplay"
36 .It Nm
37 .Op Fl f Ar pcap-file
38 .Op Fl i Ar netmap-interface
39 .Op Fl B Ar bandwidth
40 .Op Fl D Ar delay
41 .Op Fl L Ar loss
42 .Op Fl b Ar batch size
43 .Op Fl w Ar wait-link
44 .Op Fl v
45 .Op Fl C Ar cpu-placement
46 .El
47 .Ek
48 .Sh DESCRIPTION
49 .Nm
50 works like
51 .Nm tcpreplay
52 to replay a pcap file through a netmap interface,
53 with programmable rates and possibly delays, losses
54 and packet alterations.
55 .Nm
56 is designed to run at high speed, so the transmit schedule
57 is computed ahead of time, and the thread in charge of transmission
58 only has to pump data through the interface.
59 .Nm
60 can connect to any type of netmap port.
61 .Pp
62 Command line options are as follows
63 .Bl -tag -width Ds
64 .It Fl f Ar pcap-file
65 Name of the pcap file to replay.
66 .It Fl i Ar interface
67 Name of the netmap interface to use as output.
68 See
69 .Xr netmap 4
70 for interface name format.
71 .It Fl v
72 Enable verbose mode
73 .It Fl b Ar batch-size
74 Maximum batch size to use during transmissions.
75 .Nm
76 normally transmits packets one at a time, but it may use
77 larger batches, up to the value specified with this option,
78 when running at high rates.
79 .It Fl B Ar bps | Cm constant , Ns Ar bps | Cm ether , Ns Ar bps | Cm real Ns Op , Ns Ar speedup
80 Bandwidth to be used for transmission.
81 .Ar bps
82 is a floating point number optionally follow by a character
83 (k, K, m, M, g, G) that multiplies the value by 10^3, 10^6 and 10^9
84 respectively.
85 .Cm constant
86 (can be omitted) means that the bandwidth will be computed
87 with reference to the actual packet size (excluding CRC and framing).
88 .Cm ether
89 indicates that the ethernet framing (160 bits) and CRC (32 bits)
90 will be included in the computation of the packet size.
91 .Cm real
92 means transmission will occur according to the timestamps
93 recorded in the trace.
94 The optional
95 .Ar speedup
96 multiplier (defaults to 1) indicates how much faster
97 or slower than real time the trace should be replayed.
98 .It Fl D Ar dt | Cm constant , Ns Ar dt | Cm uniform , Ns Ar dmin,dmax | Cm exp , Ar dmin,davg
99 Adds additional delay to the packet transmission, whose distribution
100 can be constant, uniform or exponential.
101 .Ar dt, dmin, dmax, avt
102 are times expressed as floating point numbers optionally followed
103 by a character (s, m, u, n) to indicate seconds, milliseconds,
104 microseconds, nanoseconds.
105 The delay is added to the transmit time and adjusted so that there is
106 never packet reordering.
107 .It Fl L Ar x | Cm plr , Ns Ar x | Cm ber , Ns Ar x
108 Simulates packet or bit errors, causing offending packets to be dropped.
109 .Ar x
110 is a floating point number indicating the packet or bit error rate.
111 .It Fl w Ar wait-link
112 indicates the number of seconds to wait before transmitting.
113 It defaults to 2, and may be useful when talking to physical
114 ports to let link negotiation complete before starting transmission.
115 .El
116 .Sh OPERATION
117 .Nm
118 creates an in-memory schedule with all packets to be transmitted,
119 and then launches a separate thread to take care of transmissions
120 while the main thread reports statistics every second.
121 .Sh SEE ALSO
122 .Xr netmap 4
123 .Sh AUTHORS
124 .An -nosplit
125 .Nm
126 has been written by
127 .An Luigi Rizzo, Andrea Beconcini, Francesco Mola and Lorenzo Biagini
128 at the Universita` di Pisa, Italy.