* [LARTC] Questions about HTB.
@ 2003-02-22 10:18 Rokas Zakarevicius
2003-02-22 17:46 ` Stef Coene
0 siblings, 1 reply; 2+ messages in thread
From: Rokas Zakarevicius @ 2003-02-22 10:18 UTC (permalink / raw)
To: lartc
Hello!
Could you help me with these questions?
My system is:
Internet ADSL(PPPoE) ---> ppp0 [LINUX server(router)] eth0 ---> LAN
Server(router) is running on LINUX Slackware 8.1. I have compiled a
new 2.4.20 kernel, enabled all QoS support in the kernel config,
including HTB. My ADSL download bandwidth is 192Kbit/s.
I'd like to shape the download traffic from the internet to different
LAN users. I have done some experiments with HTB-init script, but it
didn't work as I wanted. My HTB configuration is:
--------------------------------------------
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1 htb default 20
tc class add dev eth0 parent 1: classid 1:2 htb rate 192Kbit
tc class add dev eth0 parent 1:2 classid 1:10 htb rate 128Kbit ceil 192Kbit burst 2K prio 1
tc qdisc add dev eth0 parent 1:10 handle 10 sfq perturb 10
tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip sport 80 0xffff classid 1:10
tc class add dev eth0 parent 1:2 classid 1:20 htb rate 24Kbit ceil 192Kbit burst 2K prio 5
tc qdisc add dev eth0 parent 1:20 handle 20 sfq perturb 10
--------------------------------------------
All the download default traffic gets routed to the 1:20 class, which
is a low priority class. And all HTTP traffic gets routed to the 1:10
class, which has high priority. I want Web traffic to have a big
bandwidth and high priority, but all other traffic such as FTP, KaZaA
to have lower bandwidth and lower priority. If I set rateÎil$Kbit
for 1:20 class, it works, but I want 1:20 class to borrow the
bandwidth from 1:10 class (if 1:10 class is not busy with Web
traffic), so I set the above listed configuration.
The problem is that if my download bandwidth is busy with unprivileged
port download (default class 1:20 borrows all the bandwidth), my Web
surfing gets very slow. 1:10 class has a higher priority and bigger
rate, so why 1:20 class borrows big amount of traffic if 1:10 class is
busy with Web surfing??? Could you give me an advice how to solve my
problem??? If one of my LAN users begin downloading a very big file
using KaZaA or FTP, all other users can't browse the Web.
Another question: from what class does 1:20 borrow the traffic?
As I see from the statistics (htb-init stats), both leaf classes
borrow traffic from their parent class 1:2. And why do leaf classes
lend packets to other classes, if they need to borrow packets ???
--------------------------------------------------------------
class htb 1:10 parent 1:2 leaf 10: prio 1 rate 128Kbit ceil 192Kbit burst 2Kb cburst 1844b
Sent 172759492 bytes 151332 pkts (dropped 0, overlimits 0)
rate 796bps 1pps
lended: 132897 borrowed: 18435 giants: 0
tokens: 97601 ctokens: 58300
class htb 1:2 root rate 192Kbit ceil 192Kbit burst 1844b cburst 1844b
Sent 307163200 bytes 288106 pkts (dropped 0, overlimits 0)
rate 4303bps 4pps
lended: 61122 borrowed: 0 giants: 0
tokens: 58300 ctokens: 58300
class htb 1:20 parent 1:2 leaf 20: prio 5 rate 24Kbit ceil 192Kbit burst 2Kb cburst 1844b
Sent 134403708 bytes 136774 pkts (dropped 0, overlimits 0)
rate 3516bps 2pps
lended: 94087 borrowed: 42687 giants: 0
tokens: -141737 ctokens: 12700
-------------------------------------------------------------
Thank you for your patience... :)
Rokas Zakarevicius
Kaunas, Lithuania
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [LARTC] Questions about HTB.
2003-02-22 10:18 [LARTC] Questions about HTB Rokas Zakarevicius
@ 2003-02-22 17:46 ` Stef Coene
0 siblings, 0 replies; 2+ messages in thread
From: Stef Coene @ 2003-02-22 17:46 UTC (permalink / raw)
To: lartc
On Saturday 22 February 2003 11:18, Rokas Zakarevicius wrote:
> Hello!
>
> Could you help me with these questions?
>
> My system is:
> Internet ADSL(PPPoE) ---> ppp0 [LINUX server(router)] eth0 ---> LAN
> Server(router) is running on LINUX Slackware 8.1. I have compiled a
> new 2.4.20 kernel, enabled all QoS support in the kernel config,
> including HTB. My ADSL download bandwidth is 192Kbit/s.
>
> I'd like to shape the download traffic from the internet to different
> LAN users. I have done some experiments with HTB-init script, but it
> didn't work as I wanted. My HTB configuration is:
> --------------------------------------------
> tc qdisc del dev eth0 root
> tc qdisc add dev eth0 root handle 1 htb default 20
>
> tc class add dev eth0 parent 1: classid 1:2 htb rate 192Kbit
>
> tc class add dev eth0 parent 1:2 classid 1:10 htb rate 128Kbit ceil 192Kbit
> burst 2K prio 1 tc qdisc add dev eth0 parent 1:10 handle 10 sfq perturb 10
> tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip sport
> 80 0xffff classid 1:10
>
> tc class add dev eth0 parent 1:2 classid 1:20 htb rate 24Kbit ceil 192Kbit
> burst 2K prio 5 tc qdisc add dev eth0 parent 1:20 handle 20 sfq perturb 10
> --------------------------------------------
> All the download default traffic gets routed to the 1:20 class, which
> is a low priority class. And all HTTP traffic gets routed to the 1:10
> class, which has high priority. I want Web traffic to have a big
> bandwidth and high priority, but all other traffic such as FTP, KaZaA
> to have lower bandwidth and lower priority. If I set rateÎil$Kbit
> for 1:20 class, it works, but I want 1:20 class to borrow the
> bandwidth from 1:10 class (if 1:10 class is not busy with Web
> traffic), so I set the above listed configuration.
> The problem is that if my download bandwidth is busy with unprivileged
> port download (default class 1:20 borrows all the bandwidth), my Web
> surfing gets very slow. 1:10 class has a higher priority and bigger
> rate, so why 1:20 class borrows big amount of traffic if 1:10 class is
> busy with Web surfing??? Could you give me an advice how to solve my
> problem??? If one of my LAN users begin downloading a very big file
> using KaZaA or FTP, all other users can't browse the Web.
Try to limit all bandwidth to less then 192kbit (185kbit or so) so YOU are the
bottleneck on you are link.
And give your http class a bigger burst (20k or so). Also, if you are
downloading a lot (non-http traffic), it uses all bandwidth. If you request
a page, you don't have the available bandwidth to do it. So limit non-http
class to 180kbit so you always have some bandwidth available for httb
traffic.
> Another question: from what class does 1:20 borrow the traffic?
> As I see from the statistics (htb-init stats), both leaf classes
> borrow traffic from their parent class 1:2. And why do leaf classes
> lend packets to other classes, if they need to borrow packets ???
I have some more info on the faq page on www.docum.org :
- overlimits : Packet is not sent due to ceil or rate restrictions
So there was to much data in the class. But don't believe this too much. It
depends on how often the qdisc looked for packets. This counter is
incremented per unsuccessful DRR loop and it's possible that this happens
more then once per packet.
Each dropped packet is overlimited.
- lended : # of packets donated by this class (from its rate)
A class can donate packets to itself.
- borrowed : # packets borrowed from the parent
So the rate was not high enough, but there was bandwidth available from the
parent to fulfill the request.
Stef
--
stef.coene@docum.org
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-02-22 17:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-22 10:18 [LARTC] Questions about HTB Rokas Zakarevicius
2003-02-22 17:46 ` Stef Coene
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.