Skip to contentSkip to conversation

Complex Traffic shaping setup

LARTC Padam J Singh 3 participants 3 messages Feb 18, 2005

lore
Share & tools
lore
#0 lore raw

Hi!

I have the following setup using iproute2:

========
| Root |
========
    |
    |           ===============
    ------------| Box Level 1 |

    |           ===============
    |
    |           ===============
    ------------| Box Level 2 |
    |           ===============
    |
    |
    |           ===============

    ------------|    Users    |
                ===============
                       |
                       |           =============== ------------|    User 1   |

                       |           ===============
                       |
                       |           ===============
                       ------------|    User 2   |
                       |           ===============
                       |
                       |           ===============

                       ------------|     User 3  |
                                   ===============

I am using HTB for each node, simply because it supports burst mode.

There are box level classes (top level classes) that might limit bandiwdth based on protocols (http, smtp etc) Then there are users classes which rate limit each user to a specific rate.

Each Box Level and User Classes have associated Qdiscs as well.

The issue is that HTB seems to be rate limiting only if I attach filters at the root (1:).

Since classification for box level classes may also match more specific user filters are well, one of the two things happen:

1. If the prio of the filters for Box level is higher or equal than that of Users, packets are only sent to the box level class, and since the rate at box level class is generally higher, the user starts exceeding his limit.
2. If the prio of the User filter is higher, packets matching the user filter are never sent to the Box level classes, making the box level rate for a particular protocol exceed the required for all users put together.

Is there a solutions to this issue? I am unable to really find a solution since filters can only be applied to the root!

Thanks in advance!
Padam Singh.

begin:vcard
fn:Padam Singh
n:Singh;Padam
org:Inventum Technologies Pvt. Ltd.
adr:SDA Commercial Complex;;C-17;New Delhi;Delhi;110016;India email;internet:[email protected]
title:Sr. Solutions Architect tel;work:+91-11-55650222
tel;fax:+91-11-26518800
x-mozilla-html:TRUE
url:http://www.inventum.cc
version:2.1
end:vcard

#1 lore raw

I'm not sure if you have to use different prio for filters (With fw this is a must). Depends on your setup.
With htb, everything is attached with parent as root qdisc.

Quoted 52 lines · Padam J Singh

Hi!

I have the following setup using iproute2:

====
| Root |
====

     |
     |           =======>      ------------| Box Level 1 |
     |           =======>      |
     |           =======>      ------------| Box Level 2 |
     |           =======>      |
     |
     |           =======>      ------------|    Users    |
                 =======>                         | 
                        |           =======>                         ------------|    User 1   |
                        |           =======>                         |
                        |           =======>                         ------------|    User 2   |
                        |           ======== 
                        |
                        |           =======>                         ------------|     User 3  |
                                    =======>  

I am using HTB for each node, simply because it supports burst mode.

There are box level classes (top level classes) that might limit bandiwdth
based on protocols (http, smtp etc)
Then there are users classes which rate limit each user to a specific rate.

Each Box Level and User Classes have associated Qdiscs as well.

The issue is that HTB seems to be rate limiting only if I attach filters at
the root (1:).

Since classification for box level classes may also match more specific
user filters are well, one of the two things happen:

1. If the prio of the filters for Box level is higher or equal than that of
Users, packets are only sent to the box level class, and since the rate at box level class is generally higher, the user starts exceeding his limit.
2. If the prio of the User filter is higher, packets matching the user
filter are never sent to the Box level classes, making the box level rate for a particular protocol exceed the required for all users put together.

Is there a solutions to this issue? I am unable to really find a solution
since filters can only be applied to the root!

Thanks in advance!
Padam Singh.

Signature · 4 lines
Bla bla
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Padam J Singh

This is a multipart message in MIME format.
--=_alternative 006C4DBA86256FAC_Content-Type: text/plain; charset="US-ASCII"

Quoted 5 lines

I'm not sure if you have to use different prio for filters (With fw this is a must). Depends on your setup.
With htb, everything is attached with parent as root qdisc.

Quoted 29 lines
Quoted 27 lines · Padam J Singh

Hi!

I have the following setup using iproute2:

====
| Root |
====

     |
     |           =======> >      ------------| Box Level 1 |
     |           =======> >      |
     |           =======> >      ------------| Box Level 2 |
     |           =======> >      |
     |
     |           =======> >      ------------|    Users    |
                 =======> >                         | 
                        |           =======> >                         ------------|    User 1   |
                        |           =======> >                         |
                        |           =======> >                         ------------|    User 2   |
                        |           ======== 
                        |
                        |           =======> >                         ------------|     User 3  |
                                    =======> > 

I am using HTB for each node, simply because it supports burst mode.

There are box level classes (top level classes) that might limit

bandiwdth

Quoted 2 lines
Quoted 2 lines

based on protocols (http, smtp etc)
Then there are users classes which rate limit each user to a specific

rate.

Quoted 4 lines
Quoted 4 lines

Each Box Level and User Classes have associated Qdiscs as well.

The issue is that HTB seems to be rate limiting only if I attach

filters at

Quoted 3 lines
Quoted 3 lines

the root (1:).

Since classification for box level classes may also match more

specific

Quoted 3 lines
Quoted 3 lines

user filters are well, one of the two things happen:

1. If the prio of the filters for Box level is higher or equal than

that of

Quoted 1 line
Quoted 1 line

Users, packets are only sent to the box level class, and since the

rate at

Quoted 1 line
Quoted 1 line

box level class is generally higher, the user starts exceeding his

limit.

Quoted 1 line
Quoted 1 line

2. If the prio of the User filter is higher, packets matching the

user

Quoted 1 line
Quoted 1 line

filter are never sent to the Box level classes, making the box level

rate

Quoted 1 line
Quoted 1 line

for a particular protocol exceed the required for all users put

together.

Quoted 2 lines
Quoted 2 lines

Is there a solutions to this issue? I am unable to really find a

solution

Quoted 6 lines
Quoted 6 lines

since filters can only be applied to the root!

Thanks in advance!
Padam Singh.

The filters get attached to the root, then use the flowid to determine the destination priority on the HTB.

tc class add dev $e parent 10:1 classid 10:10 htb rate $citrix ceil $nonVoipRate
tc class add dev $e parent 10:1 classid 10:20 htb rate $video ceil $nonVoipRate

tc filter add dev $e protocol ip parent 10: prio 1 u32 match ip src $CONNECTRIA1/32 flowid 10:10

tc filter add dev $e protocol ip parent 10: prio 1 u32 match ip sport 1720 0xffff flowid 10:20
tc filter add dev $e protocol ip parent 10: prio 1 u32 match ip dport 1720 0xffff flowid 10:20
etc...

-Ron

--=_alternative 006C4DBA86256FAC_Content-Type: text/html; charset="US-ASCII"

<br><font size=2><tt>&gt; I'm not sure if you have to use different prio for filters (With fw<br>
&gt; this is a must). Depends on your setup.<br>
&gt; With htb, everything is attached with parent as root qdisc.<br> &gt; <br>
&gt; <br>
&gt; On Fri, 18 Feb 2005 18:27:26 +0530, Padam J Singh<br>
&gt; &lt;[email protected]&gt; wrote:<br>
&gt; &gt; &nbsp;Hi!<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;I have the following setup using iproute2: <br> &gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;====<br>
&gt; &gt; &nbsp;| Root |<br>
&gt; &gt; &nbsp;====<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;|<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br> &gt; &gt; &nbsp; &nbsp; &nbsp;------------| Box Level 1 |<br>

&gt; &gt; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;|<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;------------| Box Level 2 |<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;|<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;|<br>
&gt; &gt; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br>

&gt; &gt; &nbsp; &nbsp; &nbsp;------------| &nbsp; &nbsp;Users &nbsp; &nbsp;|<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;========<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | <br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ------------| &nbsp; &nbsp;User 1 &nbsp; |<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ------------| &nbsp; &nbsp;User 2 &nbsp; |<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =======<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ------------| &nbsp; &nbsp; User 3 &nbsp;|<br> &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ========<br> &gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;I am using HTB for each node, simply because it supports burst mode.<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;There are box level classes (top level classes) that might limit bandiwdth<br>
&gt; &gt; based on protocols (http, smtp etc)<br>
&gt; &gt; &nbsp;Then there are users classes which rate limit each user to a specific rate.<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;Each Box Level and User Classes have associated Qdiscs as well.<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;The issue is that HTB seems to be rate limiting only if I attach filters at<br>
&gt; &gt; the root (1:).<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;Since classification for box level classes may also match more specific<br>
&gt; &gt; user filters are well, one of the two things happen:<br> &gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;1. If the prio of the filters for Box level is higher or equal than that of<br>
&gt; &gt; Users, packets are only sent to the box level class, and since the rate at<br>
&gt; &gt; box level class is generally higher, the user starts exceeding his limit.<br>
&gt; &gt; &nbsp;2. If the prio of the User filter is higher, packets matching the user<br>
&gt; &gt; filter are never sent to the Box level classes, making the box level rate<br>
&gt; &gt; for a particular protocol exceed the required for all users put together.<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;Is there a solutions to this issue? I am unable to really find a solution<br>
&gt; &gt; since filters can only be applied to the root!<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;Thanks in advance!<br>
&gt; &gt; &nbsp;Padam Singh.<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; <br>
</tt></font>
<br><font size=2><tt>The filters get attached to the root, then use the flowid to determine the destination priority on the HTB.</tt></font> <br>
<br><font size=2><tt>tc class add dev $e parent 10:1 classid 10:10 htb rate $citrix ceil $nonVoipRate</tt></font>
<br><font size=2><tt>tc class add dev $e parent 10:1 classid 10:20 htb rate $video ceil $nonVoipRate</tt></font>
<br>
<br><font size=2><tt>tc filter add dev $e protocol ip parent 10: prio 1 u32 match ip src $CONNECTRIA1/32 flowid 10:10</tt></font>
<br>
<br><font size=2><tt>tc filter add dev $e protocol ip parent 10: prio 1 u32 match ip sport 1720 0xffff flowid 10:20</tt></font>
<br><font size=2><tt>tc filter add dev $e protocol ip parent 10: prio 1 u32 match ip dport 1720 0xffff flowid 10:20</tt></font>
<br><font size=2><tt>etc...</tt></font>
<br>
<br><font size=2><tt>-Ron<br>
</tt></font>
--=_alternative 006C4DBA86256FAC_=--
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/