Skip to contentSkip to conversation

Conceptual question ;-)

LARTC Georgi Alexandrov 1 participant 2 messages Feb 8, 2006 – Feb 10, 2006

lore
Share & tools
lore
#0 lore raw

ehlo list,

I'm willing to shape ppp users e.g. each pppX interface to get XXX kbits I classify traffic going to ppp+ interfaces like this:
iptables -t mangle -A POSTROUTING -o ppp+ -j CLASSIFY --set-class 0002:0020

then i have a file which is executed when a ppp inteface is up and first argument parsed to that file ($1) is the ppp number (e.g. 35 for ppp35). it generally looks like this:

tc qdisc del dev ppp$1 root
tc qdisc add dev ppp$1 root handle 2: htb
tc class add dev ppp$1 parent 2: classid 2:2 htb rate XXXkbit tc class add dev ppp$1 parent 2:2 classid 2:20 htb rate XXXkbit tc qdisc add dev ppp$1 parent 2:20 handle 20: sfq perturb 10

The question is, when for example 10 ppp interfaces are up will they each get XXX kbits.

Signature · 5 lines
regards,
Georgi Alexandrov

Key Server = http://pgp.mit.edu/ :: KeyID = 37B4B3EE
Key Fingerprint = E429 BF93 FA67 44E9 B7D4  F89E F990 01C1 37B4 B3EE

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#1 lore raw
Quoted 8 lines · Jody Shumaker

I don't believe -j CLASSIFY targte can target sub-classes. Pretty sure you can only target classes whose parent is the root class of the qdisc. You would need to use tc filters to do this, or get rid of your redundant classes. For THB for some reason you have a root class and a child class with the same limit? This makes no sense, you'd be fine with just the 2:2 class and attaching the sfq to that, and setting the classify to that.

Quoted 4 lines

Otherwise, yes I think this would work in setting a limit on those ppp devices as they come up to XXXkbit of bandwidth.

- Jody

Actually it looks like it can target sub-classes:

pppoe users ----- eth1-gw/router-eth0 ----- WAN/Internet

For shaping pppoe users upload i do the following:
attached a root qdisc to eth0
then attached a htb class to it (1:10 for example)

Then i attach dynamicaly classes to 1:10 with numbers (1:91 for ppp1 for example) with parent 1:10. There are also dynamic iptables rules (alot of dynamic stuff going on .. lol ;) saying "traffic from that pppoe user going out trough eth0 CLASSIFY as 1:91"
When a ppp43 is up, a class 1:943 with parent 1:10 will be attached to eth0 and iptables rule saying traffic from that pppoe user going out trough eth0 CLASSIFY as 1:943"

and it seems to work fine, upload seems to be shaped at the desired rates. But that is in a "one pppoe user" test environment, i think it should work fine when deployed too, and each pppoe user will get their upload rates ;-)

Signature · 5 lines
regards,
Georgi Alexandrov

Key Server = http://pgp.mit.edu/ :: KeyID = 37B4B3EE
Key Fingerprint = E429 BF93 FA67 44E9 B7D4  F89E F990 01C1 37B4 B3EE

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc