Skip to contentSkip to conversation

HTB Question

LARTC Stef Coene 1 participant 1 message Apr 12, 2003

lore
Share & tools
lore

Stef Coene

author
#0 lore raw
Quoted 7 lines · Allan Gee

Hi Stef,
Sorry to write to you directly but my list membership is not working, I
receive the archive but cant send to the list, cant delete myself because I don't exist and can't rejoin as they say I do exist, anyway hope you don't mind

Can you tell me what the difference between these two scripts is please.

Sorry it took so long to formulate an answer. It' was a busy week for me.

Quoted 10 lines

What I want to achieve is a high speed channel 1000kbit from port 3000 from an application running on the box doing the shaping, while shaping the traffic at 64kbit going thru the box to the network, WITHOUT affecting the small 64kbit bandwidth.

In EXAMPLE 1 ALL traffic goes thru 1:1 but does not seem to affect the slow channels 1:2,1:3 and 1:4
In EXAMPLE 2 the port 3000 traffic only goes thru 1:998 and 1:997 but it shows "lended" packets in the "tc stats"
My feeling is EXAMPLE 2 is the right way but I would like your input

You need to do something like this :
root htb qdisc
class 1:1 with rate = ceil = 1000 + 64 = 1046

    class 1:2 with rate = 1000, ceil = 1064
    class 1:3 with rate = 64, ceil = 64

If you want to control the 64 kbit more, you have to attach the classes to 1:3. Giving class 1:2 a ceil of 1064, allows it to borrow the unused bandwidth of class 1:3. You also have to give class 1:3 a ceil of 64, so you never send more data then your link cna handle.

I also have some comments on your scripts :

Quoted 2 lines

tc class add dev eth0 parent 1: classid 1:998 htb rate 1000kbit tc qdisc add dev eth0 parent 1:998 handle 1998: sfq perturb 10

The added sfq will removed as soone as you execute the foloowing command.

Quoted 5 lines

tc class add dev eth0 parent 1:998 classid 1:997 htb rate 1000kbit ceil 1000kbit prio 0 quantum 15140
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 3000 0xffff flowid 1:997

Quoted 8 lines

EXAMPLE 2:
tc qdisc del dev eth0 root handle 1: htb default 999
tc qdisc add dev eth0 root handle 1: htb default 999 r2q 1 tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbit tc class add dev eth0 parent 1:1 classid 1:5 htb rate 1000kbit ceil 1000kbit prio 0 quantum 15140
tc class add dev eth0 parent 1:5 classid 1:6 htb rate 1000kbit ceil 1000kbit prio 0 quantum 15140

Why are you doing this ???

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/