BUGFIX: timing error on wirefilter/markov mode. some minor fix on the wirefilter...
[vde.git] / vde-2 / man / wirefilter.1
blobd54d6fce536b4ee4b9ef2f6f3b15b4ed8e332af2
1 .TH WIREFILTER 1 "December 6, 2006" "Virtual Distributed Ethernet"
2 .SH NAME
3 wirefilter \- Wire packet filter for Virtual Distributed Ethernet
4 .SH SYNOPSIS
5 .B wirefilter
7 [\fB\-f\fI rcfile\fR]
8 [\fB\-l\fI loss\fR]
9 [\fB\-l\fI lostburst\fR]
10 [\fB\-d\fI delay\fR]
11 [\fB\-D\fI dup\fR]
12 [\fB\-b\fI bandwidth\fR]
13 [\fB\-s\fI interface_speed\fR]
14 [\fB\-c\fI channel_capacity\fR]
15 [\fB\-n\fI noise_factor\fR]
16 [\fB\-m\fI mtu_size\fR]
17 [\fB\-M\fI mgmt socket\fR]
18 [\fB\-v\fI vde_plug1:vde_plug2\fR]
19 [\fB\--daemon\fI]
20 [\fB\--pidfile\fI pidfile_path]
21 [\fB\--blink\fI blink]
22 [\fB\--blinkid\fI blink_identifier]
23 [\fB-N\fR]
24 .br
25 .SH DESCRIPTION
27 \fBwirefilter\fP 
28 is able to emulate delays and packet loss on virtual wires.
29 e.g.:
32 dpipe vde_plug /tmp/s1 = wirefilter -l 10 = vde_plug /tmp/s2
34 creates a wire between two vde_switches (with sockets /tmp/s1 and /tmp/s2
35 respectively). This cable looses 10% of the packets in each direction.
37 The same cable can be created using:
40 wirefilter -v /tmp/s1:/tmp/s2 -l 10
42 .SH OPTIONS
43 .TP
44 .B \-f "\fIrcfile\fP"
45 use a startup configuration file. It is useful for complex defitions
46 such as those for the Markov mode (see below).
47 The startup configuration file has the same syntax of the management
48 interface, in other word it is a script of management commands executed
49 before the first packet is forwarded.
50 .TP
51 .B \-l "\fIloss\fP"
52 percentage of loss as a floating point number. It is possible to specify
53 different loss percentage for the two channels: LR20.5 means 20.5% of packet
54 flowing left to right are lost, RL10 means 10% from right to left.
55 .TP
56 .B \-L "\fIlostburst\fP"
57 when this is not zero, wirefilter uses the Gilbert model for bursty errors.
58 This is the mean length of lost packet bursts. (it is a two state Markov
59 chain: the probability to exit from the faulty state is \fI1/lostburst\fP, the
60 probability to enter the faulty state is \fIloss/(lostburst-(1-loss))\fP. The
61 loss rate converges to the value \fIloss\fR.
62 .TP
63 .B \-d "\fIdelay\fP" 
64 Extra delay (in milliseconds). This delay is added to the
65 real communication delay.  Packets are temporarily stored and resent after the
66 delay.  It is possible to specify different values for LR and RL like in the
67 previous option.  When the delay is specified as two numbers with a + in
68 between, the first is the standard delay and the second is a random variation.
69 1000+500 means that the delay can be randomly chosen between half second and
70 1.5 seconds. It is possible to add 'U' or 'N' at the end. 1000+500U means that
71 the dealys are uniformly distributed, 1000+500N means that the delays follow
72 a Gaussian normal distribution (more than 98% of the values are inside the
73 limits).
74 .TP
75 .B \-D "\fIdup\fP"
76 percentage of dup packet. It has the same syntax of -l. Do not use dup factor 100% 
77 because it means that each packet is sent infinite times. 
78 .TP
79 .B \-b "\fIbandwidth\fP"
80 Channel bandwidth in Bytes/sec. It has the same syntax of -d. It is also possible to
81 use suffixes K,M,G to abbreviate 2^10, 2^20, 2^30.
82 128K means 128KBytes/sec. 128+64K means 64i to 196KBytes/sec.
83 Sender is not prevented from sending packets, delivery is delayed to limit the bandwidth
84 to the desired value. (Like a bottleneck along the path)
85 U and N after the values (e.g. 128+64KN) set the statistic distribution to
86 use (uniform or normal).
87 .TP
88 .B \-s "\fIspeed\fP"
89 Interface speed in Bytes/sec. It has the same syntax of -b. Input is blocked for
90 the tramission time of the packet, thus the sender is prevented from sending too fast.
91 .TP
92 .B \-c "\fIcapacity\fP"
93 Channel capacity (in Bytes): maximum size of the packet queue. Exceeding packets 
94 are discarded. 
95 .TP
96 .B \-n "\fInoise factor\fP"
97 Number of bits damaged/one megabyte. 
98 .TP
99 .B \-m "\fImtu size\fP"
100 Packets longer than mtu_size are discarded.
102 .B \-N 
103 nofifo. with -N packets can be reordered.
105 .B \-M "\fImgmt socket\fP" 
106 the unix socket where the parameters (loss percentage, delay etc) can be checked and
107 changed runtime. unixterm(1) can be used as a remote terminal for wirefilter.
109 .B \-v "\fIvde_plug1:vde_plug2\fP"
110 If this option is used, the two local vde_plugs (vde_plug1 and vde_plug2) will be connected each other instead of stdin/stdout,
111 using the libvdeplug libraries. This option activates an interactive 
112 management session on console (stdin/stdout).
114 .B \--mgmtmode "\fImode\fP" 
115 this option sets the access mode of the mgmt socket.
116 The command syntax is quite simple. \fBhelp\fR provides the
117 list of commands.
118 It is possible to load a script file using the \fBload\fR management command.
120 .B \--daemon\fP 
121 wirefilter becomes a daemon
123 .B \--pidfile "\fIpathnamefP"
124 wirefilter saves its pid into the  file.
126 .B \--blinkid "\fIname\fP"                       
127 This option defines the id sent for each packet to the blink server 
128 (see the --blink option below).
129 The stardard identifier for a wirefilter is the process pid.
131 .B \--blink "\fIsocket\fP"        
132 wirefilter sends a log message to the specified PF_UNIX/DATAGRAM socket 
133 for each packet sent. Each packet has the format: id direction length.
134 e.g:
136 .in +4n
138 6768 LR 44
139 6768 LR 44
140 6768 RL 100
141 6768 LR 100
142 6768 LR 44
146 .SH Markov mode
147 wirefilter provides also a more complex set of parameters using a Markov
148 chain to emulate different states of the link and the tranistions between
149 states. Each state is represented by a node.
150 Markov chain parameters can be set with management commands or rc files only.
151 In fact, due to the large number of parameters the command line would have
152 been unreadable.
154 .B markov-numnodes "\fIn\fP"
155 defines the number of different states. All the parameters of the connection
156 can be defined node by node. Nodes are numbered starting from zero (to n-1).
157 e.g.:
159 .in +4in
161 delay 100+10N[4]
162 loss 10[2]
166 these command define a delay of 90-110 ms (normal distribution) for the node
167 number 4 and a 10\% loss for the node 2.
168 It is possible to resize the Markov chain at run-time.
169 New nodes are unreachable and do not have any edge to other states (i.e.
170 each new node has a loopback edge to the node itself with 100% probability).
171 When reducing the number of nodes, the weight of the edges towards deleted
172 nodes is added to the loopback edge. When the current node of the 
173 emulation is deleted, node 0 becomes the current node.
174 (The emulation always starts from node 0).
176 .B markov-time "\fIms\fP"
177 time period (ms) for the markov chain computation. Each \fIms\fR microseconds
178 a random number generator decides which is the next state (default value=100ms).
180 .B markov-name "\fIn,name\fP"
181 assign a name to a node of the markov chain. 
183 .B markov-setnode "\fIn\fP"
184 manually set the current node to the node \fIn\fP.
186 .B setedge "\fIn1,n2,w\fP"
187 define an edge between \fIn1\fR and \fIn2\fR; \fIw\fR is the weight (probability percentage)
188 of the edge.
189 The loopback edge (from a node to itself) is always computed as 100% minus
190 the sum of the weights of outgoing edges.
192 .B showedges [ "\fIn\fP" ]
193 list the edges from node \fIn\fP (or from the current node when the command
194 has no parameters). Null weight edges are omitted.
196 .B showcurrent
197 show the current Markov state.
199 .B showinfo [ \fIn\fP ]
200 show status and information on state (node)  \fIn\fP. 
201 If the parameter is omitted
202 it shows the status and information on the current state.
204 .B markov-debug [ \fIn\fP ]
205 set the debug level for the current management connection. 
206 In the actual implementation when n is greater than zero each
207 change of markov node causes the output of a debug trace.
208 Debug tracing get disabled when \fIn\fP is zero or the parameter is missing.
209 .SH NOTICE
210 Virtual Distributed Ethernet is not related in any way with
211 www.vde.com ("Verband der Elektrotechnik, Elektronik und Informationstechnik"
212 i.e. the German "Association for Electrical, Electronic & Information
213 Technologies").
214 .SH SEE ALSO
215 \fBvde_switch\fP(1),
216 \fBvdeq\fP(1).
217 \fBdpipe\fP(1).
218 \fBunixterm\fP(1).
220 .SH AUTHOR
221 VDE is a project by Renzo Davoli <renzo@cs.unibo.it>