Results 1 to 3 of 3
I am building a Linux router to manage bandwidth to specific IP addresses.
Everything is working fine, but I am a little confused about the classes and how the hierarchy ...
- 11-13-2007 #1Just Joined!
- Join Date
- Nov 2007
- Posts
- 3
TC Class confusion
I am building a Linux router to manage bandwidth to specific IP addresses.
Everything is working fine, but I am a little confused about the classes and how the hierarchy is working.
Example:
The only why the sfq commands would work is with the 20:, 30:, 40:, etc. What happens when I reach 90: ? Also, am I doing this efficiently? Any help is appreciated.Code:tc qdisc add dev eth0 root handle 1: htb default 12 tc class add dev eth0 parent 1: classid 1:1 htb rate 3mbit ceil 3mbit tc class add dev eth0 parent 1:1 classid 1:10 htb rate 1mbit ceil 2mbit tc class add dev eth0 parent 1:1 classid 1:11 htb rate 1mbit ceil 2mbit tc class add dev eth0 parent 1:1 classid 1:12 htb rate 1mbit ceil 2mbit tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \ match ip dst 0.0.0.0 flowid 1:12 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \ match ip dst x.x.x.x flowid 1:11 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \ match ip dst x.x.x.x flowid 1:10 tc qdisc add dev eth0 parent 1:10 handle 20: sfq tc qdisc add dev eth0 parent 1:11 handle 30: sfq tc qdisc add dev eth0 parent 1:12 handle 40: sfq
- 11-14-2007 #2
Hi,
AFAIK, you can imagine these HTB Qs and classes as a tree.
1. Queue being the ROOT node
2. Classes are INTERIORS
3. SFQs (in your case) are LEAFs or EXTERIORS
I have a few questions on your Q hierarchy:
=>> Your max pipe size is 3Mbps. Then why is the CEIL values for its child classes configured as 2 mbit? Is it done intentionally?
=>> For further improving, classes can be prioritized.
20: 30: 40: are just HANDLE IDs. It can be any value. But the only condition is all the childs need to be properly attached to its parents.
HTH---------------------------------
Registered Linux User #440311
HI2ARUN _AT_ GMAIL _DOT_ COM
---------------------------------
- 11-14-2007 #3Just Joined!
- Join Date
- Nov 2007
- Posts
- 3
The ceil is done intentionally, I was trying to make it 2mbit if it was available.
I would guess I would use prio X for prioritization?
And just to clear up the handle IDs on the sfqs, I can use any number except 1: ?
That was too simple, sorry for the waste of time...


Reply With Quote
