WIREFILTER(1)

πŸ’– WIREFILTER(1) πŸ’–

okay bestie, welcome to wirefilter, from the General Commands Manual, section 1, obviously. it's a Wire packet filter for Virtual Distributed Ethernet and it's genuinely iconic, let me tell you everything 🫢


✨ NAME ✨

wirefilter β€” Wire packet filter for Virtual Distributed Ethernet


🌸 SYNOPSIS 🌸

wirefilter

[-f rcfile] [-l loss] [-l lostburst] [-d delay] [-D dup] [-b bandwidth]
[-s interface_speed] [-c channel_bufsize] [-n noise_factor] [-m
mtu_size] [-M mgmt socket] [-v vde_plug1:vde_plug2] [--daemon]
[--pidfile pidfile_path] [--blink blink] [--blinkid blink_identifier]
[-N]

πŸ¦‹ DESCRIPTION πŸ¦‹

so a wirefilter can emulate delays and packet loss on virtual wires, no cap. like, for example:

dpipe vde_plug /tmp/s1 = wirefilter -l 10 = vde_plug /tmp/s2

this creates a wire between two vde_switches (with sockets /tmp/s1 and /tmp/s2 respectively, duh). and this cable looses 10% of the packets in each direction. it's giving lossy. 😭

the same cable can be created using:

wirefilter -v /tmp/s1:/tmp/s2 -l 10

periodt, same vibe, different spelling πŸ’…


πŸ’… OPTIONS πŸ’…

  • -f rcfile β€” use a startup configuration file. it's useful for complex defitions such as those for the Markov mode (see below, bestie). the startup configuration file has the same syntax of the management interface β€” in other word it's a script of management commands executed before the first packet is forwarded. so it runs before literally anything ships ✨
  • -l loss β€” percentage of loss as a floating point number. and you can specify different loss percentage for the two channels: LR20.5 means 20.5% of packet flowing left to right are lost, RL10 means 10% from right to left. directional loss, we love to see it πŸŽ€
  • -L lostburst β€” when this is not zero, wirefilter uses the Gilbert model for bursty errors. this is the mean length of lost packet bursts. (it is a two state Markov chain: the probability to exit from the faulty state is 1/lostburst, the probability to enter the faulty state is loss/(lostburst-(1-loss)). the loss rate converges to the value loss.) math girlies rise πŸ”₯
  • -d delay β€” Extra delay (in milliseconds). this delay is added to the real communication delay. packets are temporarily stored and resent after the delay. it is possible to specify different values for LR and RL like in the previous option. when the delay is specified as two numbers with a + in between, the first is the standard delay and the second is a random variation. 1000+500 means that the delay can be randomly chosen between half second and 1.5 seconds. it is possible to add 'U' or 'N' at the end. 1000+500U means that the dealys are uniformly distributed, 1000+500N means that the delays follow a Gaussian normal distribution (more than 98% of the values are inside the limits). random but make it statistically valid, obsessed 🌈
  • -D dup β€” percentage of dup packet. it has the same syntax of -l. > do not use dup factor 100% because it means that each packet is sent infinite times. like, do not. infinite packets is not the slay you think it is πŸ’€
  • -b bandwidth β€” Channel bandwidth in Bytes/sec. it has the same syntax of -d. it is also possible to use suffixes K,M,G to abbreviate 2^10, 2^20, 2^30. 128K means 128KBytes/sec. 128+64K means 64i to 196KBytes/sec. sender is not prevented from sending packets, delivery is delayed to limit the bandwidth to the desired value. (Like a bottleneck along the path.) U and N after the values (e.g. 128+64KN) set the statistic distribution to use (uniform or normal). throttling but make it aesthetic πŸ’œ
  • -s speed β€” Interface speed in Bytes/sec. it has the same syntax of -b. input is blocked for the tramission time of the packet, thus the sender is prevented from sending too fast. so this one actually says no to the sender, unlike -b 😌
  • -c channel_bufsize β€” Channel buffer size (in Bytes): maximum size of the packet queue. exceeding packets are discarded. bye bye extra packets πŸ‘‹
  • -n noise factor β€” Number of bits damaged/one megabyte. little bit of chaos, as a treat ⭐
  • -m mtu size β€” packets longer than mtu_size are discarded. too big, not invited 🚫
  • -N β€” nofifo. with -N packets can be reordered. chaos mode unlocked πŸ™ˆ
  • -M mgmt socket β€” the unix socket where the parameters (loss percentage, delay etc) can be checked and changed runtime. unixterm(1) can be used as a remote terminal for wirefilter. live-editing your network, main character energy πŸ‘‘
  • -v vde_plug1:vde_plug2 β€” If this option is used, the two local vde_plugs (vde_plug1 and vde_plug2) will be connected each other instead of stdin/stdout, using the libvdeplug libraries. this option activates an interactive management session on console (stdin/stdout). cute little self-contained cable πŸŽ€
  • --mgmtmode mode β€” this option sets the access mode of the mgmt socket. the command syntax is quite simple. help provides the list of commands. it is possible to load a script file using the load management command. when in doubt, type help, bestie ✨
  • --daemon β€” wirefilter becomes a daemon. it's independent now, so proud πŸ₯Ή
  • --pidfile pathnamefP β€” wirefilter saves its pid into the file. receipts, but for processes πŸ’–
  • --blinkid name β€” This option defines the id sent for each packet to the blink server (see the --blink option below). the stardard identifier for a wirefilter is the process pid. name your baby 🍼
  • --blink socket β€” wirefilter sends a log message to the specified PF_UNIX/DATAGRAM socket for each packet sent. Each packet has the format: id direction length. e.g:
6768 LR 44
6768 LR 44
6768 RL 100
6768 LR 100
6768 LR 44

🧠 Markov mode 🧠

wirefilter provides also a more complex set of parameters using a Markov chain to emulate different states of the link and the tranistions between states. each state is represented by a node. Markov chain parameters can be set with management commands or rc files only. in fact, due to the large number of parameters the command line would have been unreadable. (they were protecting us from ourselves, ngl πŸ™)

  • markov-numnodes n β€” defines the number of different states. all the parameters of the connection can be defined node by node. nodes are numbered starting from zero (to n-1). e.g.:
delay 100+10N[4]
loss 10[2]

these command define a delay of 90-110 ms (normal distribution) for the node number 4 and a 10 loss for the node 2. it is possible to resize the Markov chain at run-time. new nodes are unreachable and do not have any edge to other states (i.e. each new node has a loopback edge to the node itself with 100% probability). when reducing the number of nodes, the weight of the edges towards deleted nodes is added to the loopback edge. when the current node of the emulation is deleted, node 0 becomes the current node. (the emulation always starts from node 0). live resizing, we love a flexible queen πŸ’…

  • markov-time ms β€” time period (ms) for the markov chain computation. each ms microseconds a random number generator decides which is the next state (default value=100ms). the dice roll happens on a schedule, periodt 🎲
  • markov-name n,name β€” assign a name to a node of the markov chain. name your states, it's self care πŸŽ€
  • markov-setnode n β€” manually set the current node to the node n. you're driving now πŸš—
  • setedge n1,n2,w β€” define an edge between n1 and n2; w is the weight (probability percentage) of the edge. the loopback edge (from a node to itself) is always computed as 100% minus the sum of the weights of outgoing edges. the math does itself, iconic ✨
  • showedges [ n ] β€” list the edges from node n (or from the current node when the command has no parameters). null weight edges are omitted. nothing to see there, literally πŸ™ˆ
  • showcurrent β€” show the current Markov state. where are we, bestie πŸ“
  • showinfo [ n ] β€” show status and information on state (node) n. If the parameter is omitted it shows the status and information on the current state. gossip about the current state, love that for us πŸ’–
  • markov-debug [ n ] β€” set the debug level for the current management connection. in the actual implementation when n is greater than zero each change of markov node causes the output of a debug trace. debug tracing get disabled when n is zero or the parameter is missing. turn the volume up or all the way down πŸ”₯

πŸ“’ NOTICE πŸ“’

Virtual Distributed Ethernet is not related in any way with www.vde.com ("Verband der Elektrotechnik, Elektronik und Informationstechnik" i.e. the German "Association for Electrical, Electronic & Information Technologies"). different vde, no drama, we're all friends here 🫢


πŸ‘€ SEE ALSO πŸ‘€

vde_switch(1), vdeq(1). dpipe(1). unixterm(1).


πŸ’œ AUTHOR πŸ’œ

VDE is a project by Renzo Davoli <renzo@cs.unibo.it>


and that's the whole page, bestie 🌸 this was Virtual Distributed Ethernet, the December 6, 2006 era of the WIREFILTER(1) manual β€” go build a lossy cable and slay πŸ’…βœ¨