Bandwidth throttling using netem?
Asked Answered
H

2

7

I am trying to emulate a network as (bitrate: 200kbps , packetloss: 0.03, delay: 400ms) and I am using netem.

tc qdisc add dev eth1 root handle 1:0 netem delay 400ms loss 0.03%
tc qdisc add dev eth1 parent 1:1 handle 10: tbf rate 200kbit buffer 1600 limit 3000

When i run this i am getting error stating

RTNETLINK answers: No such file or directory

Where am I going wrong? how can I do it better?

Hewet answered 7/5, 2012 at 11:10 Comment(0)
H
8
tc qdisc add dev eth1 root handle 1:0 tbf rate 200kbit buffer 1600 limit 3000
tc qdisc add dev eth1 parent 1:0 handle 10: netem delay 400ms loss 0.03%

This worked. Seriously not sure about the difference between this two,

Hewet answered 8/5, 2012 at 7:21 Comment(0)
W
1

Please refer http://edseek.com/~jasonb/articles/traffic_shaping/classes.html

--> edseek link is dead - try the archive.is page: http://archive.is/o4UTQ

--> or perhaps better: http://www.lartc.org

==:> and yet another good resource: http://myconfigure.blogspot.com/2012/03/traffic-shaping.html

Please get the below cmds to set eth as per your requirements.

tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1: htb default 1
tc class add dev eth1 parent 1: classid 0:1 htb rate 200kbit
tc qdisc add dev eth1 parent 1:1 handle 10: netem delay 400000 5 loss 0.03%
tc qdisc ls dev eth1
tc class ls dev eth1
Wingspread answered 24/9, 2013 at 12:41 Comment(1)
link to Jason's article is dead but can be viewed in archive: archive.is/o4UTQDangerfield

© 2022 - 2024 — McMap. All rights reserved.