Please Help: applying multiple different delays with netem

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to use tc and netem to delay packets from several different
machines as they exit via eth0. Assume two source IPs, 10.0.0.122 and
10.0.0.133. I'd like to delay packets from the first one by 200ms, and
packets from the second one by 300 ms. Any other traffic should be sent
out normally. Here's what I tried:

# make three classes, 1:1, 1:2, and 1:3:
tc qdisc add dev eth0 root handle 1: prio

# attach netem with 200ms delay to priority 2 hook:
tc qdisc add dev eth0 parent 1:2 handle 20: netem delay 200ms

# attach netem with 300ms delay to priority 3 hook:
tc qdisc add dev eth0 parent 1:3 handle 30: netem delay 300ms

# classify packets from .122 as priority 2:
tc filter add dev eth0 protocol ip parent 1:0 prio 2 u32 \
     match ip src 10.0.0.122/32 flowid 10:2

# classify packets from .133 as priority 3:
tc filter add dev eth0 protocol ip parent 1:0 prio 3 u32 \
     match ip src 10.0.0.133/32 flowid 10:3

This works, except unclassified traffic (e.g., from another machine
10.0.0.111) will ALWAYS be delayed by 200 ms (same as traffic
matched to priority 2).

How do I make unmatched traffic go through normally ? Do I need to
attach a qdisc to priority 1, or is there an assumed default qdisc
already there ? Is there something magic about priority 2, and do I
need to understand and modify the priomap to fix this? Would this way
of doing things generalize for more classes with different delays
applied to them ?

This is the first time I've dealt with this, and I'm somewhat shocked
and awed :) Any help is much appreciated !

Thanks,
Gabriel
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux