Blame man/man8/tc-netem.8

Packit Service 3880ab
.TH NETEM 8 "25 November 2011" "iproute2" "Linux"
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
NetEm \- Network Emulator
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
.B "tc qdisc ... dev"
Packit Service 3880ab
.IR DEVICE " ] "
Packit Service 3880ab
.BR "add netem"
Packit Service 3880ab
.I OPTIONS
Packit Service 3880ab
Packit Service 3880ab
.IR OPTIONS " := [ " LIMIT " ] [ " DELAY " ] [ " LOSS \
Packit Service 3880ab
" ] [ " CORRUPT " ] [ " DUPLICATION " ] [ " REORDERING " ] [ " RATE \
Packit Service 3880ab
" ] [ " SLOT " ]"
Packit Service 3880ab
Packit Service 3880ab
.IR LIMIT " := "
Packit Service 3880ab
.B limit
Packit Service 3880ab
.I packets
Packit Service 3880ab
Packit Service 3880ab
.IR DELAY " := "
Packit Service 3880ab
.BI delay
Packit Service 3880ab
.IR TIME " [ " JITTER " [ " CORRELATION " ]]]"
Packit Service 3880ab
.br
Packit Service 3880ab
       [
Packit Service 3880ab
.BR distribution " { "uniform " | " normal " | " pareto " |  " paretonormal " } ]"
Packit Service 3880ab
Packit Service 3880ab
.IR LOSS " := "
Packit Service 3880ab
.BR loss " { "
Packit Service 3880ab
.BI random
Packit Service 3880ab
.IR PERCENT " [ " CORRELATION " ]  |"
Packit Service 3880ab
.br
Packit Service 3880ab
.RB "               " state
Packit Service 3880ab
.IR p13 " [ " p31 " [ " p32 " [ " p23 " [ " p14 "]]]] |"
Packit Service 3880ab
.br
Packit Service 3880ab
.RB "               " gemodel
Packit Service 3880ab
.IR p " [ " r " [ " 1-h " [ " 1-k " ]]] } "
Packit Service 3880ab
.RB  " [ " ecn " ] "
Packit Service 3880ab
Packit Service 3880ab
.IR CORRUPT " := "
Packit Service 3880ab
.B corrupt
Packit Service 3880ab
.IR PERCENT " [ " CORRELATION " ]]"
Packit Service 3880ab
Packit Service 3880ab
.IR DUPLICATION " := "
Packit Service 3880ab
.B duplicate
Packit Service 3880ab
.IR PERCENT " [ " CORRELATION " ]]"
Packit Service 3880ab
Packit Service 3880ab
.IR REORDERING " := "
Packit Service 3880ab
.B reorder
Packit Service 3880ab
.IR PERCENT " [ " CORRELATION " ] [ "
Packit Service 3880ab
.B gap
Packit Service 3880ab
.IR DISTANCE " ]"
Packit Service 3880ab
Packit Service 3880ab
.IR RATE " := "
Packit Service 3880ab
.B rate
Packit Service 3880ab
.IR RATE " [ " PACKETOVERHEAD " [ " CELLSIZE " [ " CELLOVERHEAD " ]]]]"
Packit Service 3880ab
Packit Service 3880ab
.IR SLOT " := "
Packit Service 3880ab
.BR slot " { "
Packit Service 3880ab
.IR MIN_DELAY " [ " MAX_DELAY " ] |"
Packit Service 3880ab
.br
Packit Service 3880ab
.RB "               " distribution " { "uniform " | " normal " | " pareto " | " paretonormal " | "
Packit Service 3880ab
.IR FILE " } " DELAY " " JITTER " } "
Packit Service 3880ab
.br
Packit Service 3880ab
.RB "             [ " packets
Packit Service 3880ab
.IR PACKETS " ] [ "
Packit Service 3880ab
.BR bytes
Packit Service 3880ab
.IR BYTES " ]"
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
NetEm is an enhancement of the Linux traffic control facilities
Packit Service 3880ab
that allow to add delay, packet loss, duplication and more other
Packit Service 3880ab
characteristics to packets outgoing from a selected network
Packit Service 3880ab
interface. NetEm is built using the existing Quality Of Service (QOS)
Packit Service 3880ab
and Differentiated Services (diffserv) facilities in the Linux
Packit Service 3880ab
kernel.
Packit Service 3880ab
Packit Service 3880ab
.SH netem OPTIONS
Packit Service 3880ab
netem has the following options:
Packit Service 3880ab
Packit Service 3880ab
.SS limit packets
Packit Service 3880ab
Packit Service 3880ab
maximum number of packets the qdisc may hold queued at a time.
Packit Service 3880ab
Packit Service 3880ab
.SS delay
Packit Service 3880ab
adds the chosen delay to the packets outgoing to chosen network interface. The
Packit Service 3880ab
optional parameters allows to introduce a delay variation and a correlation.
Packit Service 3880ab
Delay and jitter values are expressed in ms while correlation is percentage.
Packit Service 3880ab
Packit Service 3880ab
.SS distribution
Packit Service 3880ab
allow the user to choose the delay distribution. If not specified, the default
Packit Service 3880ab
distribution is Normal. Additional parameters allow to consider situations in
Packit Service 3880ab
which network has variable delays depending on traffic flows concurring on the
Packit Service 3880ab
same path, that causes several delay peaks and a tail.
Packit Service 3880ab
Packit Service 3880ab
.SS loss random
Packit Service 3880ab
adds an independent loss probability to the packets outgoing from the chosen
Packit Service 3880ab
network interface. It is also possible to add a correlation, but this option
Packit Service 3880ab
is now deprecated due to the noticed bad behavior.
Packit Service 3880ab
Packit Service 3880ab
.SS loss state
Packit Service 3880ab
adds packet losses according to the 4-state Markov using the transition
Packit Service 3880ab
probabilities as input parameters. The parameter p13 is mandatory and if used
Packit Service 3880ab
alone corresponds to the Bernoulli model. The optional parameters allows to
Packit Service 3880ab
extend the model to 2-state (p31), 3-state (p23 and p32) and 4-state (p14).
Packit Service 3880ab
State 1 corresponds to good reception, State 4 to independent losses, State 3
Packit Service 3880ab
to burst losses and State 2 to good reception within a burst.
Packit Service 3880ab
Packit Service 3880ab
.SS loss gemodel
Packit Service 3880ab
adds packet losses according to the Gilbert-Elliot loss model or its special
Packit Service 3880ab
cases (Gilbert, Simple Gilbert and Bernoulli). To use the Bernoulli model, the
Packit Service 3880ab
only needed parameter is p while the others will be set to the default
Packit Service 3880ab
values r=1-p, 1-h=1 and 1-k=0. The parameters needed for the Simple Gilbert
Packit Service 3880ab
model are two (p and r), while three parameters (p, r, 1-h) are needed for the
Packit Service 3880ab
Gilbert model and four (p, r, 1-h and 1-k) are needed for the Gilbert-Elliot
Packit Service 3880ab
model. As known, p and r are the transition probabilities between the bad and
Packit Service 3880ab
the good states, 1-h is the loss probability in the bad state and 1-k is the
Packit Service 3880ab
loss probability in the good state.
Packit Service 3880ab
Packit Service 3880ab
.SS ecn
Packit Service 3880ab
can be used optionally to mark packets instead of dropping them. A loss model
Packit Service 3880ab
has to be used for this to be enabled.
Packit Service 3880ab
Packit Service 3880ab
.SS corrupt
Packit Service 3880ab
allows the emulation of random noise introducing an error in a random position
Packit Service 3880ab
for a chosen percent of packets. It is also possible to add a correlation
Packit Service 3880ab
through the proper parameter.
Packit Service 3880ab
Packit Service 3880ab
.SS duplicate
Packit Service 3880ab
using this option the chosen percent of packets is duplicated before queuing
Packit Service 3880ab
them. It is also possible to add a correlation through the proper parameter.
Packit Service 3880ab
Packit Service 3880ab
.SS reorder
Packit Service 3880ab
to use reordering, a delay option must be specified. There are two ways to use
Packit Service 3880ab
this option (assuming 'delay 10ms' in the options list).
Packit Service 3880ab
Packit Service 3880ab
.B "reorder "
Packit Service 3880ab
.I 25% 50%
Packit Service 3880ab
.B "gap"
Packit Service 3880ab
.I 5
Packit Service 3880ab
.br
Packit Service 3880ab
in this first example, the first 4 (gap - 1) packets are delayed by 10ms and
Packit Service 3880ab
subsequent packets are sent immediately with a probability of 0.25 (with
Packit Service 3880ab
correlation of 50% ) or delayed with a probability of 0.75. After a packet is
Packit Service 3880ab
reordered, the process restarts i.e. the next 4 packets are delayed and
Packit Service 3880ab
subsequent packets are sent immediately or delayed based on reordering
Packit Service 3880ab
probability. To cause a repeatable pattern where every 5th packet is reordered
Packit Service 3880ab
reliably, a reorder probability of 100% can be used.
Packit Service 3880ab
Packit Service 3880ab
.B reorder
Packit Service 3880ab
.I 25% 50%
Packit Service 3880ab
.br
Packit Service 3880ab
in this second example 25% of packets are sent immediately (with correlation of
Packit Service 3880ab
50%) while the others are delayed by 10 ms.
Packit Service 3880ab
Packit Service 3880ab
.SS rate
Packit Service 3880ab
delay packets based on packet size and is a replacement for
Packit Service 3880ab
.IR TBF .
Packit Service 3880ab
Rate can be
Packit Service 3880ab
specified in common units (e.g. 100kbit). Optional
Packit Service 3880ab
.I PACKETOVERHEAD
Packit Service 3880ab
(in bytes) specify an per packet overhead and can be negative. A positive value can be
Packit Service 3880ab
used to simulate additional link layer headers. A negative value can be used to
Packit Service 3880ab
artificial strip the Ethernet header (e.g. -14) and/or simulate a link layer
Packit Service 3880ab
header compression scheme. The third parameter - an unsigned value - specify
Packit Service 3880ab
the cellsize. Cellsize can be used to simulate link layer schemes. ATM for
Packit Service 3880ab
example has an payload cellsize of 48 bytes and 5 byte per cell header. If a
Packit Service 3880ab
packet is 50 byte then ATM must use two cells: 2 * 48 bytes payload including 2
Packit Service 3880ab
* 5 byte header, thus consume 106 byte on the wire. The last optional value
Packit Service 3880ab
.I CELLOVERHEAD
Packit Service 3880ab
can be used to specify per cell overhead - for our ATM example 5.
Packit Service 3880ab
.I CELLOVERHEAD
Packit Service 3880ab
can be negative, but use negative values with caution.
Packit Service 3880ab
Packit Service 3880ab
Note that rate throttling is limited by several factors: the kernel clock
Packit Service 3880ab
granularity avoid a perfect shaping at a specific level. This will show up in
Packit Service 3880ab
an artificial packet compression (bursts). Another influence factor are network
Packit Service 3880ab
adapter buffers which can also add artificial delay.
Packit Service 3880ab
Packit Service 3880ab
.SS slot
Packit Service 3880ab
defer delivering accumulated packets to within a slot. Each available slot can be
Packit Service 3880ab
configured with a minimum delay to acquire, and an optional maximum delay.
Packit Service 3880ab
Alternatively it can be configured with the distribution similar to
Packit Service 3880ab
.BR distribution
Packit Service 3880ab
for
Packit Service 3880ab
.BR delay
Packit Service 3880ab
option. Slot delays can be specified in nanoseconds, microseconds, milliseconds or seconds
Packit Service 3880ab
(e.g. 800us). Values for the optional parameters
Packit Service 3880ab
.I BYTES
Packit Service 3880ab
will limit the number of bytes delivered per slot, and/or
Packit Service 3880ab
.I PACKETS
Packit Service 3880ab
will limit the number of packets delivered per slot.
Packit Service 3880ab
Packit Service 3880ab
These slot options can provide a crude approximation of bursty MACs such as
Packit Service 3880ab
DOCSIS, WiFi, and LTE.
Packit Service 3880ab
Packit Service 3880ab
Note that slotting is limited by several factors: the kernel clock granularity,
Packit Service 3880ab
as with a rate, and attempts to deliver many packets within a slot will be
Packit Service 3880ab
smeared by the timer resolution, and by the underlying native bandwidth also.
Packit Service 3880ab
Packit Service 3880ab
It is possible to combine slotting with a rate, in which case complex behaviors
Packit Service 3880ab
where either the rate, or the slot limits on bytes or packets per slot, govern
Packit Service 3880ab
the actual delivered rate.
Packit Service 3880ab
Packit Service 3880ab
.SH LIMITATIONS
Packit Service 3880ab
The main known limitation of Netem are related to timer granularity, since
Packit Service 3880ab
Linux is not a real-time operating system.
Packit Service 3880ab
Packit Service 3880ab
.SH EXAMPLES
Packit Service 3880ab
.PP
Packit Service 3880ab
tc qdisc add dev eth0 root netem rate 5kbit 20 100 5
Packit Service 3880ab
.RS 4
Packit Service 3880ab
delay all outgoing packets on device eth0 with a rate of 5kbit, a per packet
Packit Service 3880ab
overhead of 20 byte, a cellsize of 100 byte and a per celloverhead of 5 byte:
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.SH SOURCES
Packit Service 3880ab
.IP " 1. " 4
Packit Service 3880ab
Hemminger S. , "Network Emulation with NetEm", Open Source Development Lab,
Packit Service 3880ab
April 2005
Packit Service 3880ab
(http://devresources.linux-foundation.org/shemminger/netem/LCA2005_paper.pdf)
Packit Service 3880ab
Packit Service 3880ab
.IP " 2. " 4
Packit Service 3880ab
Netem page from Linux foundation, (https://wiki.linuxfoundation.org/networking/netem)
Packit Service 3880ab
Packit Service 3880ab
.IP " 3. " 4
Packit Service 3880ab
Salsano S., Ludovici F., Ordine A., "Definition of a general and intuitive loss
Packit Service 3880ab
model for packet networks and its implementation in the Netem module in the
Packit Service 3880ab
Linux kernel", available at http://netgroup.uniroma2.it/NetemCLG
Packit Service 3880ab
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.BR tc (8),
Packit Service 3880ab
.BR tc-tbf (8)
Packit Service 3880ab
Packit Service 3880ab
.SH AUTHOR
Packit Service 3880ab
Netem was written by Stephen Hemminger at Linux foundation and is based on NISTnet.
Packit Service 3880ab
This manpage was created by Fabio Ludovici <fabio.ludovici at yahoo dot it> and
Packit Service 3880ab
Hagen Paul Pfeifer <hagen@jauu.net>