Nathaniel Pollard
Nathaniel Pollard

Reputation: 23

How to tc filter with NETEM?

I need some help directing netem delays to a specific IP. I have inputted all the commands correctly with no errors and as shown in the pictures attached. I have no latency being added to my speed tests. For further information when I used the command: "tc qdisc add dev eth0 root netem delay 100ms" the delays are added flawlessly. What am I doing wrong ?

P.S. I am a beginner at using TC and NETEM, so please if any solutions are given please be thorough when explaining.

Here are some screenshots for a better understanding towards my problem:

http://postimg.org/image/k9pu6uhxv/ http://postimg.org/image/tis0gyqtv/

Upvotes: 2

Views: 6334

Answers (1)

lorem
lorem

Reputation: 1199

tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 flowid 1:1 match ip dst 192.168.2.219
tc qdisc add dev eth0 parent 1:1 handle 10: netem delay 25ms 5ms
  • PS: by adding 5ms jitter to delay, you also create packet reordering in the network. Assuming that this is what you want.
  • PPS: I am not sure whether adding jitter creates reordering or not in OpenWRT. But it surely does in the Linux kernel. Netem has undergone umpteen number of changes since 2010.
  • PPPS: To introduce jitter w/o packet reordering, set a very high rate limit.

    tc qdisc add dev eth0 parent 1:1 handle 10: rate 1000 mbit netem delay 25ms 5ms
    

Upvotes: 11

Related Questions