391 lines
11 KiB
HTML
391 lines
11 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of NETEM</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>NETEM</H1>
|
|
Section: Linux (8)<BR>Updated: 25 November 2011<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
NetEm - Network Emulator
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>tc qdisc ... dev</B>
|
|
|
|
<I>DEVICE</I> ]
|
|
|
|
<B>add netem</B>
|
|
|
|
<I>OPTIONS</I>
|
|
|
|
<P>
|
|
<I>OPTIONS</I> := [ <I>LIMIT</I> ] [ <I>DELAY</I> ] [ <I>LOSS</I> ] [ <I>CORRUPT</I> ] [ <I>DUPLICATION</I> ] [ <I>REORDERING</I> ] [ <I>RATE</I> ] [ <I>SLOT</I> ]
|
|
|
|
<P>
|
|
<I>LIMIT</I> :=
|
|
|
|
<B>limit</B>
|
|
|
|
<I>packets</I>
|
|
|
|
<P>
|
|
<I>DELAY</I> :=
|
|
|
|
<B>delay</B>
|
|
|
|
<I>TIME</I> [ <I>JITTER</I> [ <I>CORRELATION</I> ]]]
|
|
|
|
<BR>
|
|
|
|
<BR> [
|
|
<B>distribution</B> { uniform<B> | </B>normal<B> | </B>pareto<B> | </B>paretonormal<B> } ]</B>
|
|
|
|
<P>
|
|
<I>LOSS</I> :=
|
|
|
|
<B>loss</B> {
|
|
|
|
<B>random</B>
|
|
|
|
<I>PERCENT</I> [ <I>CORRELATION</I> ] |
|
|
|
|
<BR>
|
|
|
|
<B>state</B>
|
|
|
|
<I>p13</I> [ <I>p31</I> [ <I>p32</I> [ <I>p23</I> [ <I>p14</I>]]]] |
|
|
|
|
<BR>
|
|
|
|
<B>gemodel</B>
|
|
|
|
<I>p</I> [ <I>r</I> [ <I>1-h</I> [ <I>1-k</I> ]]] }
|
|
|
|
[ <B>ecn</B> ]
|
|
|
|
<P>
|
|
<I>CORRUPT</I> :=
|
|
|
|
<B>corrupt</B>
|
|
|
|
<I>PERCENT</I> [ <I>CORRELATION</I> ]]
|
|
|
|
<P>
|
|
<I>DUPLICATION</I> :=
|
|
|
|
<B>duplicate</B>
|
|
|
|
<I>PERCENT</I> [ <I>CORRELATION</I> ]]
|
|
|
|
<P>
|
|
<I>REORDERING</I> :=
|
|
|
|
<B>reorder</B>
|
|
|
|
<I>PERCENT</I> [ <I>CORRELATION</I> ] [
|
|
|
|
<B>gap</B>
|
|
|
|
<I>DISTANCE</I> ]
|
|
|
|
<P>
|
|
<I>RATE</I> :=
|
|
|
|
<B>rate</B>
|
|
|
|
<I>RATE</I> [ <I>PACKETOVERHEAD</I> [ <I>CELLSIZE</I> [ <I>CELLOVERHEAD</I> ]]]]
|
|
|
|
<P>
|
|
<I>SLOT</I> :=
|
|
|
|
<B>slot</B> {
|
|
|
|
<I>MIN_DELAY</I> [ <I>MAX_DELAY</I> ] |
|
|
|
|
<BR>
|
|
|
|
<B>distribution</B> { uniform<B> | </B>normal<B> | </B>pareto<B> | </B>paretonormal<B> | </B>
|
|
|
|
<I>FILE</I> } <I>DELAY</I> <I>JITTER</I> }
|
|
|
|
<BR>
|
|
|
|
[ <B>packets</B>
|
|
|
|
<I>PACKETS</I> ] [
|
|
|
|
<B>bytes</B>
|
|
|
|
<I>BYTES</I> ]
|
|
|
|
<P>
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
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 built using the existing Quality Of Service (QOS)
|
|
and Differentiated Services (diffserv) facilities in the Linux
|
|
kernel.
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>netem OPTIONS</H2>
|
|
|
|
netem has the following options:
|
|
<P>
|
|
<A NAME="lbAF"> </A>
|
|
<H3>limit packets</H3>
|
|
|
|
<P>
|
|
maximum number of packets the qdisc may hold queued at a time.
|
|
<P>
|
|
<A NAME="lbAG"> </A>
|
|
<H3>delay</H3>
|
|
|
|
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.
|
|
<P>
|
|
<A NAME="lbAH"> </A>
|
|
<H3>distribution</H3>
|
|
|
|
allow the user to 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 several delay peaks and a tail.
|
|
<P>
|
|
<A NAME="lbAI"> </A>
|
|
<H3>loss random</H3>
|
|
|
|
adds an independent loss probability to the packets outgoing from the chosen
|
|
network interface. It is also possible to add a correlation, but this option
|
|
is now deprecated due to the noticed bad behavior.
|
|
<P>
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>loss state</H3>
|
|
|
|
adds packet losses according to the 4-state Markov using the transition
|
|
probabilities as input parameters. The parameter 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.
|
|
<P>
|
|
<A NAME="lbAK"> </A>
|
|
<H3>loss gemodel</H3>
|
|
|
|
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 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.
|
|
<P>
|
|
<A NAME="lbAL"> </A>
|
|
<H3>ecn</H3>
|
|
|
|
can be used optionally to mark packets instead of dropping them. A loss model
|
|
has to be used for this to be enabled.
|
|
<P>
|
|
<A NAME="lbAM"> </A>
|
|
<H3>corrupt</H3>
|
|
|
|
allows the emulation of 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.
|
|
<P>
|
|
<A NAME="lbAN"> </A>
|
|
<H3>duplicate</H3>
|
|
|
|
using this option the chosen percent of packets is duplicated before queuing
|
|
them. It is also possible to add a correlation through the proper parameter.
|
|
<P>
|
|
<A NAME="lbAO"> </A>
|
|
<H3>reorder</H3>
|
|
|
|
to use reordering, a delay option must be specified. There are two ways to use
|
|
this option (assuming 'delay 10ms' in the options list).
|
|
<P>
|
|
<B>reorder </B>
|
|
|
|
<I>25% 50%</I>
|
|
|
|
<B>gap</B>
|
|
|
|
<I>5</I>
|
|
|
|
<BR>
|
|
|
|
in this first example, the first 4 (gap - 1) packets are delayed by 10ms and
|
|
subsequent packets are sent immediately with a probability of 0.25 (with
|
|
correlation of 50% ) or delayed with a probability of 0.75. After a packet is
|
|
reordered, the process restarts i.e. the next 4 packets are delayed and
|
|
subsequent packets are sent immediately or delayed based on reordering
|
|
probability. To cause a repeatable pattern where every 5th packet is reordered
|
|
reliably, a reorder probability of 100% can be used.
|
|
<P>
|
|
<B>reorder</B>
|
|
|
|
<I>25% 50%</I>
|
|
|
|
<BR>
|
|
|
|
in this second example 25% of packets are sent immediately (with correlation of
|
|
50%) while the others are delayed by 10 ms.
|
|
<P>
|
|
<A NAME="lbAP"> </A>
|
|
<H3>rate</H3>
|
|
|
|
delay packets based on packet size and is a replacement for
|
|
<I>TBF</I>.
|
|
|
|
Rate can be
|
|
specified in common units (e.g. 100kbit). Optional
|
|
<I>PACKETOVERHEAD</I>
|
|
|
|
(in bytes) specify an per packet overhead and can be negative. A positive value can be
|
|
used to simulate additional link layer headers. A negative value can be used to
|
|
artificial strip the Ethernet header (e.g. -14) and/or simulate a link layer
|
|
header compression scheme. The third parameter - an unsigned value - specify
|
|
the cellsize. Cellsize can be used to simulate link layer schemes. ATM for
|
|
example has an payload cellsize of 48 bytes and 5 byte per cell header. If a
|
|
packet is 50 byte then ATM must use two cells: 2 * 48 bytes payload including 2
|
|
* 5 byte header, thus consume 106 byte on the wire. The last optional value
|
|
<I>CELLOVERHEAD</I>
|
|
|
|
can be used to specify per cell overhead - for our ATM example 5.
|
|
<I>CELLOVERHEAD</I>
|
|
|
|
can be negative, but use negative values with caution.
|
|
<P>
|
|
Note that rate throttling is limited by several factors: the kernel clock
|
|
granularity avoid a perfect shaping at a specific level. This will show up in
|
|
an artificial packet compression (bursts). Another influence factor are network
|
|
adapter buffers which can also add artificial delay.
|
|
<P>
|
|
<A NAME="lbAQ"> </A>
|
|
<H3>slot</H3>
|
|
|
|
defer delivering accumulated packets to within a slot. Each available slot can be
|
|
configured with a minimum delay to acquire, and an optional maximum delay.
|
|
Alternatively it can be configured with the distribution similar to
|
|
<B>distribution</B>
|
|
|
|
for
|
|
<B>delay</B>
|
|
|
|
option. Slot delays can be specified in nanoseconds, microseconds, milliseconds or seconds
|
|
(e.g. 800us). Values for the optional parameters
|
|
<I>BYTES</I>
|
|
|
|
will limit the number of bytes delivered per slot, and/or
|
|
<I>PACKETS</I>
|
|
|
|
will limit the number of packets delivered per slot.
|
|
<P>
|
|
These slot options can provide a crude approximation of bursty MACs such as
|
|
DOCSIS, WiFi, and LTE.
|
|
<P>
|
|
Note that slotting is limited by several factors: the kernel clock granularity,
|
|
as with a rate, and attempts to deliver many packets within a slot will be
|
|
smeared by the timer resolution, and by the underlying native bandwidth also.
|
|
<P>
|
|
It is possible to combine slotting with a rate, in which case complex behaviors
|
|
where either the rate, or the slot limits on bytes or packets per slot, govern
|
|
the actual delivered rate.
|
|
<P>
|
|
<A NAME="lbAR"> </A>
|
|
<H2>LIMITATIONS</H2>
|
|
|
|
The main known limitation of Netem are related to timer granularity, since
|
|
Linux is not a real-time operating system.
|
|
<P>
|
|
<A NAME="lbAS"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
<P>
|
|
|
|
tc qdisc add dev eth0 root netem rate 5kbit 20 100 5
|
|
<DL COMPACT><DT id="1"><DD>
|
|
delay all outgoing packets on device eth0 with a rate of 5kbit, a per packet
|
|
overhead of 20 byte, a cellsize of 100 byte and a per celloverhead of 5 byte:
|
|
</DL>
|
|
|
|
<P>
|
|
<A NAME="lbAT"> </A>
|
|
<H2>SOURCES</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2"> 1. <DD>
|
|
Hemminger S. , "Network Emulation with NetEm", Open Source Development Lab,
|
|
April 2005
|
|
(<A HREF="http://devresources.linux-foundation.org/shemminger/netem/LCA2005_paper.pdf)">http://devresources.linux-foundation.org/shemminger/netem/LCA2005_paper.pdf)</A>
|
|
<P>
|
|
<DT id="3"> 2. <DD>
|
|
Netem page from Linux foundation, (<A HREF="https://wiki.linuxfoundation.org/networking/netem)">https://wiki.linuxfoundation.org/networking/netem)</A>
|
|
<P>
|
|
<DT id="4"> 3. <DD>
|
|
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 <A HREF="http://netgroup.uniroma2.it/NetemCLG">http://netgroup.uniroma2.it/NetemCLG</A>
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAU"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc">tc</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-tbf">tc-tbf</A></B>(8)
|
|
|
|
<P>
|
|
<A NAME="lbAV"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
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 <<A HREF="mailto:hagen@jauu.net">hagen@jauu.net</A>>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="5"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="6"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="7"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="8"><A HREF="#lbAE">netem OPTIONS</A><DD>
|
|
<DL>
|
|
<DT id="9"><A HREF="#lbAF">limit packets</A><DD>
|
|
<DT id="10"><A HREF="#lbAG">delay</A><DD>
|
|
<DT id="11"><A HREF="#lbAH">distribution</A><DD>
|
|
<DT id="12"><A HREF="#lbAI">loss random</A><DD>
|
|
<DT id="13"><A HREF="#lbAJ">loss state</A><DD>
|
|
<DT id="14"><A HREF="#lbAK">loss gemodel</A><DD>
|
|
<DT id="15"><A HREF="#lbAL">ecn</A><DD>
|
|
<DT id="16"><A HREF="#lbAM">corrupt</A><DD>
|
|
<DT id="17"><A HREF="#lbAN">duplicate</A><DD>
|
|
<DT id="18"><A HREF="#lbAO">reorder</A><DD>
|
|
<DT id="19"><A HREF="#lbAP">rate</A><DD>
|
|
<DT id="20"><A HREF="#lbAQ">slot</A><DD>
|
|
</DL>
|
|
<DT id="21"><A HREF="#lbAR">LIMITATIONS</A><DD>
|
|
<DT id="22"><A HREF="#lbAS">EXAMPLES</A><DD>
|
|
<DT id="23"><A HREF="#lbAT">SOURCES</A><DD>
|
|
<DT id="24"><A HREF="#lbAU">SEE ALSO</A><DD>
|
|
<DT id="25"><A HREF="#lbAV">AUTHOR</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:17 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|