All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kiruthika Selvamani <kiruthika.selvamani@gmail.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] HTB on loopback gives a bit rate multiplied by 8
Date: Thu, 02 Jun 2005 13:40:46 +0000	[thread overview]
Message-ID: <5ee6fe6105060206401e1f1ff@mail.gmail.com> (raw)
In-Reply-To: <5ee6fe61050601123763b42b29@mail.gmail.com>

Hi Andy,
Thanks for the suggestion. I changed the MTU to 1500 and it started
working. Is this because HTB shapes traffic based on packet rate
rather than bit rate? How does it use the rate lookup tables?
Thanks
Kiruthika

On 6/1/05, Andy Furniss <andy.furniss@dsl.pipex.com> wrote:
> Kiruthika Selvamani wrote:
> > Hi,
> >
> > I am trying to use htb to limit bandwidth on loopback for traffic
> > through particular port.
> >
> > Here is the script I am using.
> >
> > tc qdisc add dev lo root handle 1: htb
> > tc class add dev lo parent 1: classid 1:1 htb rate 100kbit ceil 100kbit
> > tc class add dev lo parent 1:1 classid 1:10 htb rate 50kbit ceil 50kbit
> > tc class add dev lo parent 1:1 classid 1:11 htb rate 50kbit ceil 50kbit
> > tc filter add dev lo protocol ip parent 1:0 prio 0 u32 match ip sport
> > 22 0xffff flowid 1:10
> > tc filter add dev lo protocol ip parent 1:0 prio 0 u32 match ip dport
> > 22 0xffff flowid 1:11
> >
> > When this script is applied across eth0 (when I do a sftp to another
> > machine) the bandwidth limitation is applied correctly. However if I
> > use this in loopback (sftp to another directory in the same machine)
> > then I get bit rate approx 400kbit - i.e. usually it roughly
> > multiplies the bit rate by 8. Why does this happen? Does HTB work
> > differently in loopback? Any clue regarding this would be mostl
> > helpful.
> 
> It's because the MTU on lo is big and htb uses a small one when it asks
> tc to make it's rate lookup tables.
> 
> if you do a tc -s class ls dev lo you will see there is a giants counter
> , giant packets are only limited as if they are the size of the biggest
> slot in the lookup table.
> 
> To fix specify the mtu of lo on the htb classes or set the mtu on lo to
> 1500.
> 
> Andy.
>
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

  parent reply	other threads:[~2005-06-02 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-01 19:37 [LARTC] HTB on loopback gives a bit rate multiplied by 8 Kiruthika Selvamani
2005-06-01 21:28 ` Andy Furniss
2005-06-02 13:40 ` Kiruthika Selvamani [this message]
2005-06-02 19:32 ` Andy Furniss

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=5ee6fe6105060206401e1f1ff@mail.gmail.com \
    --to=kiruthika.selvamani@gmail.com \
    --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 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.