talk:netem

In the “Delaying only some traffic” section of this page, the following code is given as an example of how to create a delay to just one ip address:

# tc qdisc add dev eth0 root handle 1: prio
# tc qdisc add dev eth0 parent 1:3 handle 30: netem \
    delay 200ms 10ms distribution normal
# tc qdisc add dev eth0 parent 30:1 tbf rate 20kbit buffer 1600 limit 3000
# tc filter add dev eth0 protocol ip parent 1:0 prio 3 u32 \
    match ip dst 65.172.181.4/32 flowid 10:3

When I try this, I get delay to *all* outbound ip addresses. Does anyone else find this? Is this code wrong, or is there something else I have to do?

According command which you showed upper You created 1 queue: prio (q) → netem (q) → tbf (q) and redirect filtered traffic to it.

But You didn't created other queue to traffic which You don't want filtered. So for me all traffic (filtered and not filtered) must go through your queue.

I would recommend you to create sth like it:

prio (q) 1: -> tbf (q) 3:
              /  \
netem 3:31 <-     -> not netem 3:32

and after that create filter with flowid 3:31

packet corruption

The netem documentation states that a single bit error can be introduced at random location in a packet. But is ther a way to extend this to multiple errors in a packet. Any adivce will be of great help.

Also as I am new to Netem what does the “0.1%” mean in the netem command

# tc qdisc change dev eth0 root netem corrupt 0.1%