LARTC
[Top] [All Lists]

[LARTC] Creating a contended section of bandwidth with HTB and IMQ

To: lartc@mailman.ds9a.nl
Subject: [LARTC] Creating a contended section of bandwidth with HTB and IMQ
From: Charles Price <cpwp@w3z.co.uk>
Date: Tue, 27 Feb 2007 11:20:01 +0000
Delivered-to: sp-com-lists@consult.net
Delivered-to: lartc-list@securepoint.com
Delivered-to: lartc@outpost.ds9a.nl
List-archive: <http://mailman.ds9a.nl/pipermail/lartc>
List-help: <mailto:lartc-request@mailman.ds9a.nl?subject=help>
List-id: "Mailinglist of the Linux Advanced Routing &amp; Traffic Control project" <lartc.mailman.ds9a.nl>
List-post: <mailto:lartc@mailman.ds9a.nl>
List-subscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=subscribe>
List-unsubscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=unsubscribe>
Organization: charlie.price@w3z.co.uk
Sender: lartc-bounces@mailman.ds9a.nl
User-agent: KMail/1.9.6
Hi All,

I'm trying to create a contended section of bandwidth using IMQ. I have the 
imq0 device up and running, with traffic passing through it.

Firstly, I need to throttle the entire device imq0 to 2mbit/s.

I would then like to add throttle rules for individual IP addresses, allowing 
them to pass up to 512kbit/s each, as long as imq0 has not reached its 
2mbit/s.

The configuration I currently have is as follows:

tc qdisc add dev imq0 root handle 1: htb default 1
tc class add dev imq0 parent 1: classid 1:1 htb rate 2mbit burst 15k

# IP 10.0.0.10
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 512kbit
tc qdisc add dev imq0 parent 10 handle 10: sfq
tc filter add dev imq0 protocol ip parent 1: prio 10 u32 \
  match ip src 10.0.0.10/32 flowid 1:10

# IP 10.0.0.20
tc class add dev imq0 parent 1:1 classid 1:20 htb rate 512kbit
tc qdisc add dev imq0 parent 20 handle 20: sfq
tc filter add dev imq0 protocol ip parent 1: prio 20 u32 \
  match ip src 10.0.0.20/32 flowid 1:20


Both IP addresses (10.0.0.10 and 10.0.0.20)  aquire their 512kbit/s without 
problem. However, when I add more classes like the ones above and pass 
plently of traffic, each IP address still obtains its full 512kbit/s - 
regardless of the 2mbit/s limit in the root class.

Is there a way to achieve this?

Thanks in advance,

Charlie
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

<Prev in Thread] Current Thread [Next in Thread>
  • [LARTC] Creating a contended section of bandwidth with HTB and IMQ, Charles Price <=