Skip to contentSkip to conversation

Structuring my shaping

LARTC Hayden Myers 5 participants 7 messages Oct 17, 2002 – Oct 21, 2002

lore
Share & tools
lore
#0 lore raw

The shaping for my project needs to limit individual users while giving each user equal priority. My thoughts are to create a root prio qdisc and then place a qdisc underneath that for each user. Inside each of those qdiscs will be the classes to subdivide traffic based on port. Is this the best way to accomplish what I want?

Hayden Myers
Support Manager
Skyline Network Technologies
[email protected]
(410)583-1337 option 2

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

#1 lore raw
Quoted 5 lines · Hayden Myers

The shaping for my project needs to limit individual users while giving each user equal priority. My thoughts are to create a root prio qdisc and then place a qdisc underneath that for each user. Inside each of those qdiscs will be the classes to subdivide traffic based on port. Is this the best way to accomplish what I want?

You can use the efsq (enhanced SFQ). This qdisc is based on the sfq qdisc, but you can create the hash keys based on ip addresses and/or ports (both src and dst). Attach that qdisc as the root qdisc and you are done.

If you want more control, you have to add a cbq or htb qdisc as the root qdisc and create a class and filter for each user.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw

[LARTC] Structuring my shaping (fwd)

In reply to Hayden Myers

I still don't understand how I can have multiple classes with a different filter for each class and then change one of the filters without blowing away the rest and having to have different priorities. I'm shaping traffic between users so all filters should have the same priority. Anybody else have problems changing/deleting filters? I see some messages on the net but none have responses. I saw something about u32h but his examples give me RTNETLINK: invalid argument messages. This is beginning to irritate me highly.

Hayden Myers
Support Manager
Skyline Network Technologies
[email protected]
(410)583-1337 option 2

---------- Forwarded message ----------
Date: Thu, 17 Oct 2002 19:14:34 -0400 (EDT)
From: Hayden Myers <[email protected]>
To: [email protected]
Subject: Structuring my shaping

The shaping for my project needs to limit individual users while giving each user equal priority. My thoughts are to create a root prio qdisc and then place a qdisc underneath that for each user. Inside each of those qdiscs will be the classes to subdivide traffic based on port. Is this the best way to accomplish what I want?

Hayden Myers
Support Manager
Skyline Network Technologies
[email protected]
(410)583-1337 option 2

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

#3 lore raw

Re: [LARTC] Structuring my shaping (fwd)

In reply to Hayden Myers
Quoted 8 lines · Hayden Myers

I still don't understand how I can have multiple classes with a different filter for each class and then change one of the filters without blowing away the rest and having to have different priorities. I'm shaping traffic between users so all filters should have the same priority. Anybody else have problems changing/deleting filters? I see some messages on the net but none have responses. I saw something about u32h but his examples give me RTNETLINK: invalid argument messages. This is beginning to irritate me highly.

This is not the answer you need, but it's an answer. If nobody responds on your mail, it means nobody knows the answer/solution.
I always delete everything and after that reaplly all commands. So I can't help you.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#4 lore raw

Re: [LARTC] Structuring my shaping (fwd)

In reply to Hayden Myers

hi,

i am not sure whether my point
will do your help or not. if you have problems with deleting your filters , then maybe the following will do some help. if you don't have a problem with that, then just ignore this message :)

i delete my filters in a way which just change the "add" to "del" and nothing else different.

say, i add a filter :
tc filter add dev eth0 parent 1:0 prio 1 handle 0x30 tcindex classid 1:171

then, later i want to delete it,
i just type:
tc filter del dev eth0 parent 1:0 prio 1 handle 0x30 tcindex classid 1:171

hoping this will do some help.

by the way, this methord does can delete the filter, but i am NOT sure whether this will have some negative influence on the other classes.

regards
folke.

Quoted 42 lines

From: Hayden Myers <[email protected]>
To: [email protected]
Subject: [LARTC] Structuring my shaping (fwd)
Date: Sat, 19 Oct 2002 15:59:47 -0400 (EDT)

I still don't understand how I can have multiple classes with a different filter for each class and then change one of the filters without blowing away the rest and having to have different priorities. I'm shaping traffic between users so all filters should have the same priority. Anybody else have problems changing/deleting filters? I see some messages on the net but none have responses. I saw something about u32h but his examples give me RTNETLINK: invalid argument messages. This is beginning to irritate me highly.

Hayden Myers
Support Manager
Skyline Network Technologies
[email protected]
(410)583-1337 option 2

---------- Forwarded message ----------
Date: Thu, 17 Oct 2002 19:14:34 -0400 (EDT)
From: Hayden Myers <[email protected]>
To: [email protected]
Subject: Structuring my shaping

The shaping for my project needs to limit individual users while giving each user equal priority. My thoughts are to create a root prio qdisc and then place a qdisc underneath that for each user. Inside each of those qdiscs will be the classes to subdivide traffic based on port. Is this the best way to accomplish what I want?

Hayden Myers
Support Manager
Skyline Network Technologies
[email protected]
(410)583-1337 option 2

Quoted 3 lines

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

_________________________________________________________________
Get a speedy connection with MSN Broadband.  Join now!
http://resourcecenter.msn.com/access/plans/freeactivation.asp

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

#5 lore raw

Re: [LARTC] Structuring my shaping (fwd)

In reply to Hayden Myers
Quoted 4 lines · Hayden Myers

I still don't understand how I can have multiple classes with a different filter for each class and then change one of the filters without blowing away the rest and having to have different priorities. I'm shaping traffic between users so all filters should have the same priority.

First of all, you need to distinguish between filters and filter elements. iproute2/tc makes this distinction rather vague, but it's still there.

Filters are organized in lists at qdiscs or classes. Within each such list, they are unique with respect to protocol and priority. So you can't have multiple filters with the same priority. Note that the filter priority has nothing to do with the priority of the class in the qdisc.

If any of this sounds confusing to you, you may want to have a quick look at one of the following two documents:
ftp://icaftp.epfl.ch/pub/people/almesber/pub/tcio-current.ps.gz ftp://icaftp.epfl.ch/pub/people/almesber/junk/tc-04FEB2001-0.tar.gz (just ignore the implementation bits).

You could parent filters at classes, but this still implies some evaluation order, only that this order now depends on subtle qdisc internals. Also, not all qdiscs let you do this (e.g. sch_prio doesn't).

Quoted 4 lines

Anybody else have problems changing/deleting filters? I see some messages on the net but none have responses. I saw something about u32h but his examples give me RTNETLINK: invalid argument messages. This is beginning to irritate me highly.

Why don't you try to write a small script that produces the problem, run it through tcsim (tcsim enables all traffic control elements, so there are no problems with things being unconfigured, modules missing, bad versions of iproute2/tc, etc.), and if the problem still occurs with tcsim, post your script to the list ?

To run your script with tcsim, simply do

$ tcsim -v
dev eth0  // or whatever device your script is for
tc qdisc add dev eth0 ...etc...
^D

- Werner

Signature · 6 lines
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         [email protected] /
/_http://www.almesberger.net/____________________________________________/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#6 lore raw

Re: [LARTC] Structuring my shaping (fwd)

In reply to Hayden Myers

Hello Hayden,

filters use slightly different pointers (and also hash tables for quick filtering)
I don't use change possibilities with tc, at first del then add new one.

[root@proxy /root]# tc -s filter ls dev imq0

filter parent 1: protocol ip pref 5 u32
filter parent 1: protocol ip pref 5 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 5 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10
match 00160000/ffff0000 at 20
filter parent 1: protocol ip pref 5 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 1:10
match 00170000/ffff0000 at 20

-----------------------------------
mailto:[email protected]
BR
Alexey Talikov
FORTEK
-----------------------------------

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