All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stef Coene <stef.coene@docum.org>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] two classes in one queue
Date: Tue, 26 Mar 2002 19:13:09 +0000	[thread overview]
Message-ID: <marc-lartc-101717007330763@msgid-missing> (raw)
In-Reply-To: <marc-lartc-101716959929978@msgid-missing>

On Tuesday 26 March 2002 20:05, Omar Armas wrote:
> I'm using tc to control traffic to some networks. In this case, I have 2
> different classes going through eth2 (in a rh 7.2box).
> The point is that I want that all traffic to the classes 200.39.174.0/24
> and 200.39.187.0/24(the sum between them) be limited to 256.
>
> How can I tell "tc" to limit 2 classes to the same flowid?
>
> Right now I'm using:
>
> tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst
> 200.39.174.0/24 flowid 10:256
> tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst
> 200.39.187.0/24 flowid 10:256
>
> But these leaves 256 to each network, and I want 256 to the sum of them.
> Any idea?
I asume you want each network to use 50% of the bandwith (but they may borrow 
from each other)?  The only thing you have to do is to create 2 new classes 
with parent 10:256 , rate = 128 and with no bounded parameter.  Point the 2 
filters to the 2 new classes and you'r done.
And of course, you remove the sfq qdisc from 10:256 and add 2 sfq qdiscs to 
the 2 new classes.

Stef

> [root@diablo bin]# more bandwidth.sh
> #!/bin/bash
> tc qdisc add dev eth0 root handle 10: cbq bandwidth 10Mbit avpkt 1000
> tc class add dev eth0 parent 10:0 classid 10:1 cbq bandwidth 10Mbit rate
> 10Mbit allot 1514 weight 1Mbit prio 8 maxburst 20 avpkt 1000
>
> tc class add dev eth0 parent 10:1 classid 10:64 cbq bandwidth 10Mbit
> rate 64Kbit allot 1514 weight 6Kbit prio 5 maxburst 20 avpkt 1000
> bounded
> tc class add dev eth0 parent 10:1 classid 10:128 cbq bandwidth 10Mbit
> rate 128Kbit allot 1514 weight 12Kbit prio 5 maxburst 20 avpkt 1000
> bounded
> tc class add dev eth0 parent 10:1 classid 10:256 cbq bandwidth 10Mbit
> rate 256Kbit allot 1514 weight 25Kbit prio 5 maxburst 20 avpkt 1000
> bounded
> tc class add dev eth0 parent 10:1 classid 10:512 cbq bandwidth 10Mbit
> rate 512Kbit allot 1514 weight 51Kbit prio 5 maxburst 20 avpkt 1000
> bounded
> tc class add dev eth0 parent 10:1 classid 10:1024 cbq bandwidth 10Mbit
> rate 1024Kbit allot 1514 weight 102Kbit prio 5 maxburst 20 avpkt 1000
> bounded
>
>
> tc qdisc add dev eth0 parent 10:64 sfq quantum 1514b perturb 15
> tc qdisc add dev eth0 parent 10:128 sfq quantum 1514b perturb 15
> tc qdisc add dev eth0 parent 10:256 sfq quantum 1514b perturb 15
> tc qdisc add dev eth0 parent 10:512 sfq quantum 1514b perturb 15
> tc qdisc add dev eth0 parent 10:1024 sfq quantum 1514b perturb 15
>
> tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst
> 200.39.174.0/24 flowid 10:256
> tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip src
> 200.39.174.0/24 flowid 10:256
> tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip dst
> 200.39.187.0/24 flowid 10:256
> tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip src
> 200.39.187.0/24 flowid 10:256
> [root@diablo bin]#
>
> Please, if you see something wrong let me know.
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.net
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

      reply	other threads:[~2002-03-26 19:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-26 19:05 [LARTC] two classes in one queue Omar Armas
2002-03-26 19:13 ` Stef Coene [this message]

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-101717007330763@msgid-missing \
    --to=stef.coene@docum.org \
    --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.