Skip to contentSkip to conversation

"Fan-in/fan-out" tc filters?

LARTC Steen Suder, privat 3 participants 6 messages Nov 13, 2002

lore
Share & tools
lore
#0 lore raw

Consider a Linux NAT-gateway on an ADSLlink providing internet for a number of users, say, 100 or so.

I want to use WRR, perhaps with attached SFQs or similar, to make sure every user get their fair share of download.

Atop, at the root, I'll place a HTB to limit bandwidth to make sure the gw is the bottleneck to make shaping efficient.

How do I prioritize packets based on tc filters between the root HTB and the WRR?

What I imagine is something like:

                    DEV
                     |
                 ---------
                 |  HTB  |              "Bottleneck"
                 ---------
                     |
                     |
              -------|--------
             /       |        \
            /        |         \
           /         |          \
       -------    -------    --------
       | LOW |    | MED |    | HIGH |   "Prio-bands"
       -------    -------    --------   (HTB, pfifo_fast, PRIO
           \         |          /        or the like)
            \        |         /
             \       |        /
              ----------------
                     |
                     |
                  -------
                  | WRR |
                  -------
                     |
                     |
              -------|--------
             /       |        \
            /        |         \
           /         |          \
       -------    -------    -------
       | SFQ |    | SFQ |    | SFQ |    x 100
       -------    -------    -------

I'd like to do that to make sure that the system overall favours interactive traffic before "bulk". Games and other latency-dependant traffic types must perform the best on the cost of ftp-download or similar.

Attaching pfifo_fast, PRIO or triple (low/medium/high priorities) HTB qdiscs to the root is easy but it seems that it is impossible to attach /one/ WRR afterwards.

How do I accomplish what I want to do?

Signature · 8 lines
Mvh. / Best regards,
Steen Suder		<http://www.suder.dk/>
ICQ UIN			4133803


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

I'd like to do that to make sure that the system overall favours interactive traffic before "bulk". Games and other latency-dependant traffic types must perform the best on the cost of ftp-download or similar.

Attaching pfifo_fast, PRIO or triple (low/medium/high priorities) HTB qdiscs to the root is easy but it seems that it is impossible to attach /one/ WRR afterwards.

What do you mean with WRR? Weighted Round Robin? Or the wrr qdisc?

If you want to improve latency for certain traffic, you can create 2 htb classes. One with a lower prio parameter to get low latency and an other class with all other traffic.
To give each pc on the network the same opportunity to send something, create 100 sub classes with parent=second class. To get fairness / pc, you can add a sfq to each class. You can do the same for the low prio class. If you don't care about fairness / pc, you can add 1 esfq qdisc instead of the 100 sub classes.

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
In reply to Steen Suder, privat
Quoted 8 lines · Stef Coene

If you want to improve latency for certain traffic, you can create 2 htb classes. One with a lower prio parameter to get low latency and an other class with all other traffic.
To give each pc on the network the same opportunity to send something, create 100 sub classes with parent=second class. To get fairness / pc, you can add a sfq to each class. You can do the same for the low prio class. If you don't care about fairness / pc, you can add 1 esfq qdisc instead of the 100 sub classes.

can you add filters both the parent classes and sub classes so that you put packets into the sub classes by ip address and then into the parent classes by port, packet size, tos, etc.?

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

#3 lore raw
In reply to Steen Suder, privat
Quoted 9 lines · Stef Coene
Quoted 7 lines

I'd like to do that to make sure that the system overall favours interactive traffic before "bulk". Games and other latency-dependant traffic types must perform the best on the cost of ftp-download or similar.

Attaching pfifo_fast, PRIO or triple (low/medium/high priorities) HTB qdiscs to the root is easy but it seems that it is impossible to attach /one/ WRR afterwards.

What do you mean with WRR? Weighted Round Robin? Or the wrr qdisc?

The qdisc wrr. It has the possibility to set "penalty" through different weigths.

Quoted 8 lines

If you want to improve latency for certain traffic, you can create 2 htb classes. One with a lower prio parameter to get low latency and an other class with all other traffic.
To give each pc on the network the same opportunity to send something, create 100 sub classes with parent=second class. To get fairness / pc, you can add a sfq to each class. You can do the same for the low prio class. If you don't care about fairness / pc, you can add 1 esfq qdisc instead of the 100 sub classes.

I want to make sure that given an assortment of packets containing different kinds of traffic, say game and download, the game packets will be in front of the download packets when they are dequeued from the leafs of the wrr qdisc.

The idea was to have all traffic go through the same wrr qdisc. They just had to "reordered" before going to the wrr qdisc. Does that make sense?

Partly derived suggestion:

                    DEV
                     |
                 ---------
                 |  HTB  |              "Bottleneck" - needed
                 ---------
                     |
                     |
              -------|
             /       |
            /        |
           /         |
       --------   --------
       |  HS  |   | BULK |              HS = High Speed, low latency
       --------   --------              Bulk = The rest
           |         |
       --------      |
       | SFQ  |      |                  Maybe a complementary SFQ?
       --------      |
                     |
                     |
                  -------
                  | WRR |               wrr qdisc - needed to give
                  -------               instant penalties to heavy
                     |                  downloaders
                     |
              -------|--------
             /       |        \
            /        |         \
           /         |          \
       -------    -------    -------
       | SFQ |    | SFQ |    | SFQ |    x 100
       -------    -------    -------

This solution could very well give better performance for the filtered, interactive traffic. I just have to make sure that the volume i HS doesn't get to big to keep users happy.

They're so picky ;-)

Signature · 7 lines
Mvh. / Best regards,
Steen Suder		<http://www.suder.dk/>
ICQ UIN			4133803

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#4 lore raw
In reply to Steen Suder, privat
Quoted 10 lines · Christian G. Warden
Quoted 8 lines · Stef Coene

If you want to improve latency for certain traffic, you can create 2 htb classes. One with a lower prio parameter to get low latency and an other class with all other traffic.
To give each pc on the network the same opportunity to send something, create 100 sub classes with parent=second class. To get fairness / pc, you can add a sfq to each class. You can do the same for the low prio class. If you don't care about fairness / pc, you can add 1 esfq qdisc instead of the 100 sub classes.

Quoted 3 lines

can you add filters both the parent classes and sub classes so that you put packets into the sub classes by ip address and then into the parent classes by port, packet size, tos, etc.?

You can add filters to the root qdisc or a class. When a filter place a packet in a class, the filters of that class are checked for a match. So you can "stack" filters.

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/
#5 lore raw
In reply to Steen Suder, privat
Quoted 2 lines

The qdisc wrr. It has the possibility to set "penalty" through different weigths.

Then you can't. A qdisc can only have 1 parent.

Quoted 9 lines
Quoted 8 lines

If you want to improve latency for certain traffic, you can create 2 htb classes. One with a lower prio parameter to get low latency and an other class with all other traffic.
To give each pc on the network the same opportunity to send something, create 100 sub classes with parent=second class. To get fairness / pc, you can add a sfq to each class. You can do the same for the low prio class. If you don't care about fairness / pc, you can add 1 esfq qdisc instead of the 100 sub classes.

Quoted 8 lines

I want to make sure that given an assortment of packets containing different kinds of traffic, say game and download, the game packets will be in front of the download packets when they are dequeued from the leafs of the wrr qdisc.

The idea was to have all traffic go through the same wrr qdisc. They just had to "reordered" before going to the wrr qdisc. Does that make sense?

Not really. Imagine you have a ssh packet so it's placed in the low delay class. But after that, it's placed in the same class (under the wrr qdisc) with all the other packets, so it has to wait. Bye, bye low delay.

Quoted 3 lines

This solution could very well give better performance for the filtered, interactive traffic. I just have to make sure that the volume i HS doesn't get to big to keep users happy.

I don't know if this setup is going to work. I never tried something like that, but in theory it should work. I'm just curious if you will get low delays for the HS class.

Quoted 1 line

They're so picky ;-)

I'm sure you can find a solution so you can keep your users happy :)

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/