NETEM(8)

NAME
NetEm - Network Emulator

SYNOPSIS
tc qdisc ... dev dev ] add netem OPTIONS

OPTIONS := [ LIMIT ] [ DELAY ] [ LOSS ] [ CORRUPT ] [ DUPLICATION ] [ REORDERING ]

LIMIT := limit packets

DELAY := delay TIME [ JITTER [ CORRELATION ]]]
       [ distribution { uniform | normal | pareto | paretonormal } ]

LOSS := loss { random PERCENT [ CORRELATION ] |
state p13 [ p31 [ p32 [ p23 [ p14]]]] |
gemodel p [ r [ 1-h [ 1-k ]]]

CORRUPT := corrupt PERCENT [ CORRELATION ]]

DUPLICATION := duplicate PERCENT [ CORRELATION ]]

REODERING := reorder PERCENT [ CORRELATION ] [ gap DISTANCE ]

DESCRIPTION
NetEm is an enhancement of the Linux traffic control facilities that allow to add delay, packet loss, duplication and more other characteristics to packets outgoing from a selected network interface. NetEm is build using the existing Quality Of Service (QOS) and Differentiated Services (diffserv) facilities in the Linux kernel.

netem OPTIONS
netem has the following options:

  limit packets

limits the effect of selected options to the indicated number of next packets.

  delay
adds the chosen delay to the packets outgoing to chosen network interface. The optional parameters allows to introduce a delay variation and a correlation. Delay and jitter values are expressed in ms while correlation is percentage.

  distribution
allow the choose the delay distribution. If not specified, the default distribution is normal. Additional parameters allow to consider situations in which network has variable delays depending on traffic flows concurring on the same path, that causes severeal delay peaks and a tail.

  loss random
adds an independent loss probability to the packets outgoing from the chosen network interface. It is also possibile to add a correlation, but this option is now deprecated due to the noticed bad behaviour.

  loss state
adds packet losses according to the 4-state Markov using the transition probabilities as input parameters. The parameters p13 is mandatory and if used alone corresponds to the Bernoulli model. The optional parameters allows to extend the model to 2-state (p31), 3-state (p23 and p32) and 4-state (p14). State 1 corresponds to good reception, State 4 to independent losses, State 3 to burst losses and State 2 to good reception within a burst.

  loss gemodel
adds packet losses according to the Gilbert-Elliot loss model or its special cases (Gilbert, Simple Gilbert and Bernoulli). To use the Bernoulli model, the only needed parameter is p while the the others will be set to the default values r=1-p, 1-h=1 and 1-k=0. The parameters needed for the Simple Gilbert model are two (p and r), while three parameters (p, r, 1-h) are needed for the Gilbert model and four (p, r, 1-h and 1-k) are needed for the Gilbert-Elliot model. As known, p and r are the transition probabilities between the bad and the good states, 1-h is the loss probability in the bad state and 1-k is the loss probability in the good state.

  corrupt
allows the emulate the random noise introducing an error in a random position for a chosen percent of packets. It is also possible to add a correlation through the proper parameter.

  duplicate
using this option the chosen percent of packets is duplicated before queueing them. It is also possible to add a correlation through the proper parameter.

  reorder
there are two ways to use this option:

reorder gap 5 10
in this first example every 5th (10th, 15th) packet is sent immediately while other packets are delayed by 10 ms

reorder 25% 50%
in this second example 25% of packets are sent immediately (with correlation of 50%) while the other are delayed by 10 ms.

LIMITATIONS
The main known limitation of Netem are related to timer granularity, since Linux is not a real-time operating system.

SOURCES

1.  Hemminger S. , "Network Emulation with NetEm", Open Source Development Lab, April 2005 (http://devresources.linux-foundation.org/shemminger/netem/LCA2005_paper.pdf)

2.  Netem page from Linux foundation, (http://www.linuxfoundation.org/en/Net:Netem)

3.  Salsano S., Ludovici F., Ordine A., "Definition of a general and intuitive loss model for packet networks and its implementation in the Netem module in the Linux kernel", available at http://netgroup.uniroma2.it/NetemCLG

SEE ALSO
tc(8), tc-tbf(8)

AUTHOR
Netem was written by Stephen Hemminger at Linux foundation and is based on NISTnet. This manpage was created by Fabio Ludovici <fabio.ludovici at yahoo dot it> and Hagen Paul Pfeifer <hagen@jauu.net>