Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Stephane Ouellette <ouellettes@videotron.ca>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] htb limiting trouble: no overlimit or dropped packets
Date: Thu, 17 Oct 2002 04:49:09 +0000	[thread overview]
Message-ID: <marc-lartc-103483023218253@msgid-missing> (raw)
In-Reply-To: <marc-lartc-103480767301168@msgid-missing>

Walter Haidinger wrote:
> Hi!
> 
> I'm trying to limit the uplink bandwidth using htb but no packets are
> overlimit or dropped. :-(
> 
> My router config:
> * Linux kernel 2.4.20-pre10 (htb v3.7) with everything built as
>   modules in QoS, iptables in use.
> * tc binary from htb3.6-020525.tgz
> * external interface eth0: Internet access, 512 kbit/s uplink speed
> * internal interface eth1: internal LAN, 100 Mbit/s
> 
> The hosts in the internal lan should be bandwidth limited and are
> masqueraded by the router.
> 
> Q: Must the versions of the kernel module and the tc utility match?
> 
> Below are my commands to create the qdiscs and classes:
> 
> tc qdisc add dev eth1 root handle 1: htb default 20
> tc class add dev eth1 parent 1:  classid 1:1  htb rate 64kbit ceil 64kbit burst 5k
> tc class add dev eth1 parent 1:1 classid 1:10 htb rate 64kbit ceil 64kbit burst 5k
> tc class add dev eth1 parent 1:1 classid 1:20 htb rate 57kbit ceil 64kbit burst 5k
> tc class add dev eth1 parent 1:1 classid 1:30 htb rate 51kbit ceil 64kbit burst 5k
> tc class add dev eth1 parent 1:1 classid 1:40 htb rate 6kbit burst 0
> tc qdisc add dev eth1 parent 1:10 handle 10: sfq perturb 10
> tc qdisc add dev eth1 parent 1:20 handle 20: sfq perturb 10
> tc qdisc add dev eth1 parent 1:30 handle 30: sfq perturb 10
> tc qdisc add dev eth1 parent 1:40 handle 40: sfq perturb 10
> 
> Notes:
> * No errors from the tc utility
> * All filters are scrapped for testing purposes, leaving only
>   unclassified packets which go the default class (this works)
> * Bandwidths are really low for testing
> * There are four classes with 100%, 90%, 80% and 10% bandwidth
> 
> Next I tried an FTP upload from a machine on the internal LAN to the
> internet, creating the following qdisc and class statistics:
> 
> qdisc sfq 40: quantum 1514b perturb 10sec
>  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
> 
>  qdisc sfq 30: quantum 1514b perturb 10sec
>  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
> 
>  qdisc sfq 20: quantum 1514b perturb 10sec
>  Sent 13408020 bytes 12433 pkts (dropped 0, overlimits 0)
> 
>  qdisc sfq 10: quantum 1514b perturb 10sec
>  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
> 
>  qdisc htb 1: r2q 10 default 20 direct_packets_stat 0
>  Sent 13408020 bytes 12433 pkts (dropped 0, overlimits 13422)
> 
>  class htb 1:1 root rate 64Kbit ceil 64Kbit burst 1023b cburst 1680b
>  Sent 13408020 bytes 12433 pkts (dropped 0, overlimits 0)
>  rate 35bps
>  lended: 1136 borrowed: 0 giants: 0
>  tokens: 51202 ctokens: 116901
> 
> class htb 1:10 parent 1:1 leaf 10: prio 0 rate 64Kbit ceil 64Kbit burst
> 1023b cburst 1680b
>  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>  lended: 0 borrowed: 0 giants: 0
>  tokens: 102400 ctokens: 168099
> 
> class htb 1:20 parent 1:1 leaf 20: prio 0 rate 57Kbit ceil 64Kbit burst
> 1671b cburst 1680b
>  Sent 13408020 bytes 12433 pkts (dropped 0, overlimits 0)
>  rate 35bps
>  lended: 11297 borrowed: 1136 giants: 0
>  tokens: 130246 ctokens: 116901
> 
> class htb 1:30 parent 1:1 leaf 30: prio 0 rate 51Kbit ceil 64Kbit burst
> 1664b cburst 1680b
>  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>  lended: 0 borrowed: 0 giants: 0
>  tokens: 208941 ctokens: 168099
> 
> class htb 1:40 parent 1:1 leaf 40: prio 0 rate 6Kbit ceil 6Kbit burst
> 1606b cburst 1606b
>  Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>  lended: 0 borrowed: 0 giants: 0
>  tokens: 1714132 ctokens: 1714132
> 
> Well, everything goes to the default class 1:20 which is OK.
> However, the traffic is *not* limited! No packets overlimit or dropped!
> The FTP upload succeeded with full uplink speed (512 kbit/s).
> 
> Q: What am I missing here? Why isn't the traffic limited by HTB?
> 
> I've read the LARTC Howto, the required manpages, the docs at Martin
> Devera's Homepage and had a look at the Wondershaper. Unfortunately I'm
> still unable to find the bug. :-( Any hints would be appreciated!
> 
> Thanks, Walter
> 
> PS: I've also tried using filters u32 and fwmark but traffic was
>     never limited. I guess there is something wrong with my
>     class/qdisc setup in general, right?
> 
> 
> 
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> 


Walter,

   I'm giving a try on this one, I'm not familiar with HTB at all...

   I think that your only problem is: all classes can borrow bandwidth 
from other classes !!  So there is no bandwidth control !

   You should add the "bounded" modifier to classes that should be limited.

Regards,

Stephane.

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  reply	other threads:[~2002-10-17  4:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-16 22:33 [LARTC] htb limiting trouble: no overlimit or dropped packets Walter Haidinger
2002-10-17  4:49 ` Stephane Ouellette [this message]
2002-10-17  6:38 ` Walter Haidinger
2002-10-17  6:47 ` Walter Haidinger
2002-10-17 10:54 ` Stef Coene
2002-10-17 11:19 ` Walter Haidinger
2002-10-17 18:02 ` Robert Vale
2002-10-17 19:24 ` Walter Haidinger
2002-10-17 20:44 ` Walter Haidinger
2002-10-20 12:18 ` Walter Haidinger
2002-10-20 17:18 ` Walter Haidinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-103483023218253@msgid-missing \
    --to=ouellettes@videotron.ca \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox