Skip to contentSkip to conversation

am i on the right track ?

LARTC Chandrashekhar Joshi 3 participants 10 messages Jan 14, 2002 – Jan 16, 2002

lore
Share & tools
lore
#0 lore raw

hi,

i am trying to have bandwidth shaping on my linux router.
i have a 64kbps link, on which i want to restrict the link use for http /ftp access and give more bandwidth priority for vpn access. thanks to martin devera i am using the htb for this.

|-----------|            |-----------|
| MAIN LINK |-----+------|  CLASS A  |
|-----------|     |      |-----------|
                   |
            |------+-----|
            | CLASS B    |
            |------------|

MAIN LINK = 64kbps
CLASS A = 24kbps (for HTTP/ FTP and other internet related activities ) CLASS B = 40kbps ( reserved for PPTP-VPN access incoming and outgoing)

requirements :
each class should be able to borrow bandwidth from the other class when excess is available
incoming vpn connections should come through the class B bandwidth policy outgoing vpn connections should go through the class B bandwidth policy

following is the command set (lifted from the htb manual :-) ) i am trying to use :

# tc qdisc add dev eth0 root handle 1: htb default 11
# tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbps ceil 64
kbps burst 2k
# tc class add dev eth0 parent 1: classid 1:10 htb rate 64kbps ceil 64
kbps burst 2k
# tc class add dev eth0 parent 1: classid 1:11 htb rate 64kbps ceil 64
kbps burst 2k
# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src
192.168.1.0 match tcp dst 21 0xffff flowid \      1:10
# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src
192.168.1.0 match tcp dst 80 0xffff flowid  \      1:10
# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src
192.168.1.0 match tcp dst 443 0xffff flowid \    1:10
# tc qdisc add dev eth0 parent 1:10 handle 20: pfifo limit 5
# tc qdisc add dev eth0 parent 1:11 handle 30: sfq perturb 10

first i would like to know whether what i have done is correct or not in context with my problem , i think i am on right track ?

why i did what i did
now to meet the above requirements what i did was to define bandwidth shaping only for http, https & ftp (the major bandwidth guzzlers to class A and made the class B as default.
but because of above rulesets my other inet services (like domain, ssh, whois, ping etc) will go through the default policy of class B, which i want to avoid without adding additional rulesets; can i define a ruleset
for VPN something like below : (and remove the rulesets for class A
and make clas A as default)

# tc filter add dev eth0 protocol 47 parent 1:0 prio 1 u32 match ip src
192.168.1.0 flowid 1:11
# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src
192.168.1.0 match tcp dst 1723 0xffff \
    flowid 1:11

but how do i define the ruleset for incoming connections, can the following be true

# tc filter add dev eth0 protocol 47 parent 1:0 prio 1 u32 match ip dst
192.168.1.0 flowid 1:11
# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst
192.168.1.0 match tcp dst 1723 0xffff \
    flowid 1:11

thanx in advance

regards / shekhar

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

#1 lore raw

I have not too much time to read it just now. But just wondering if you really want 64kbps or rather 64kbit ?
devik

Quoted 4 lines · Chandrashekhar Joshi

hi,

i am trying to have bandwidth shaping on my linux router.
i have a 64kbps link, on which i want to restrict the link use for http

....

Quoted 3 lines

MAIN LINK = 64kbps
CLASS A = 24kbps (for HTTP/ FTP and other internet related activities ) CLASS B = 40kbps ( reserved for PPTP-VPN access incoming and outgoing)

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

#2 lore raw
In reply to Chandrashekhar Joshi

yes it is 64kbps (actually it is 256kbits so i suppose that works out to 64kbps right)

thanks
regards /shekhar

Quoted 21 lines · Martin Devera

I have not too much time to read it just now. But just wondering if you really want 64kbps or rather 64kbit ?
devik

Quoted 5 lines · Chandrashekhar Joshi

hi,

i am trying to have bandwidth shaping on my linux router.
i have a 64kbps link, on which i want to restrict the link use for http

....

Quoted 4 lines

MAIN LINK = 64kbps
CLASS A = 24kbps (for HTTP/ FTP and other internet related activities ) CLASS B = 40kbps ( reserved for PPTP-VPN access incoming and outgoing)

#3 lore raw
In reply to Chandrashekhar Joshi

I don't understand it .. 256kbit = 32kbps. Why
do you use 64kbps !?

Quoted 31 lines · Chandrashekhar Joshi

yes it is 64kbps (actually it is 256kbits so i suppose that works out to 64kbps right)

thanks
regards /shekhar

Quoted 21 lines · Martin Devera

I have not too much time to read it just now. But just wondering if you really want 64kbps or rather 64kbit ?
devik

Quoted 5 lines · Chandrashekhar Joshi

hi,

i am trying to have bandwidth shaping on my linux router.
i have a 64kbps link, on which i want to restrict the link use for http

....

Quoted 4 lines

MAIN LINK = 64kbps
CLASS A = 24kbps (for HTTP/ FTP and other internet related activities ) CLASS B = 40kbps ( reserved for PPTP-VPN access incoming and outgoing)

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

#4 lore raw
In reply to Chandrashekhar Joshi
Quoted 2 lines · Martin Devera

I don't understand it .. 256kbit = 32kbps. Why
do you use 64kbps !?

No, 256kbit is 256kb/s is 32KB/s.

Lowercase means bits, uppercase means bytes.

Rob

Signature · 8 lines
Rob Kaper - [email protected]
    phone - +31 10 2436060
      fax - +31 10 2436066
     cell - +31 64 7114454

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
#5 lore raw
In reply to Chandrashekhar Joshi

Are sure ? I'm speaking in tc terms ..

Quoted 17 lines · Rob Kaper
Quoted 2 lines · Martin Devera

I don't understand it .. 256kbit = 32kbps. Why
do you use 64kbps !?

No, 256kbit is 256kb/s is 32KB/s.

Lowercase means bits, uppercase means bytes.

Rob

Signature · 4 lines
Rob Kaper - [email protected]
    phone - +31 10 2436060
      fax - +31 10 2436066
     cell - +31 64 7114454

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

#6 lore raw
In reply to Chandrashekhar Joshi
Quoted 1 line · Martin Devera

Are sure ? I'm speaking in tc terms ..

Hm, I'm speaking in human terms. ;-)

It's what I (and most others) would expect anyway.

Quoted 1 line
Quoted 1 line

No, 256kbit is 256kb/s is 32KB/s.

Rob

Signature · 8 lines
Rob Kaper - [email protected]
    phone - +31 10 2436060
      fax - +31 10 2436066
     cell - +31 64 7114454

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
#7 lore raw
In reply to Chandrashekhar Joshi
Quoted 4 lines · Martin Devera
Quoted 1 line

Are sure ? I'm speaking in tc terms ..

Hm, I'm speaking in human terms. ;-)

I know. I don't assume that Joshi is fool so that I don't try to explain him difference between bit and byte.

I wrote the mail because kbit and kbps are different terms in tc and despite being in FAQ users still don't understand it.
devik

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

#8 lore raw
In reply to Chandrashekhar Joshi

hi,
yes it was a small oops in calculation, (or was it a big one :-) ) but back to the main theme are my rulesets correct ???

shekhar

Quoted 13 lines · Rob Kaper
Quoted 2 lines · Martin Devera

Are sure ? I'm speaking in tc terms ..

Hm, I'm speaking in human terms. ;-)

It's what I (and most others) would expect anyway.

Quoted 2 lines
Quoted 2 lines

No, 256kbit is 256kb/s is 32KB/s.

Rob

#9 lore raw
In reply to Chandrashekhar Joshi

Yes is seems to be.

Quoted 4 lines · Chandrashekhar Joshi

hi,
yes it was a small oops in calculation, (or was it a big one :-) ) but back to the main theme are my rulesets correct ???

Quoted 19 lines

shekhar

Quoted 13 lines · Rob Kaper
Quoted 2 lines · Martin Devera

Are sure ? I'm speaking in tc terms ..

Hm, I'm speaking in human terms. ;-)

It's what I (and most others) would expect anyway.

Quoted 2 lines
Quoted 2 lines

No, 256kbit is 256kb/s is 32KB/s.

Rob

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