Skip to contentSkip to conversation

HTB and per-connection bandwidth allocation

LARTC Michael O'Shea 6 participants 8 messages Sep 9, 2002 – Sep 23, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

How do I allocate a guaranteed rate to each individual connection. For example I can allocate, say 1Mb, to all HTTP traffic by defining the appropriate class & filter. In this case, if I have one connection it will get all 1M; if I have 100 then each connection will get ~ 10k. But supposing I want to allocate 10k per individual connection regardless of the number of connections - so if I have only one connection it gets 10k...20 get 20*10k and if I go above 100 any extra connections are dropped. This allows a guaranteed level of service per connection.
I cannot see how to achieve this in HTB.

Thanks
Michael

#1 lore raw

hi!

imho there's an iplimit-patch (at patchomatic) - you should be able to limit the numer of connections to 100 with this...

just a guess
Sebastian

Signature · 8 lines
Sebastian 'spax' Pape          | Better to remain silent and be thought a fool
mailto: [email protected]   | than to speak and remove all doubt.
gpg: http://p-a-p-e.de/gpg.asc |
         --- Do you want to know more? http://www.p-a-p-e.de/ ---

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Michael O'Shea

try SFQ.
devik

Quoted 12 lines · Michael O'Shea

Hi,

How do I allocate a guaranteed rate to each individual connection. For example I can allocate, say 1Mb, to all HTTP traffic by defining the appropriate class & filter. In this case, if I have one connection it will get all 1M; if I have 100 then each connection will get ~ 10k. But supposing I want to allocate 10k per individual connection regardless of the number of connections - so if I have only one connection it gets 10k...20 get 20*10k and if I go above 100 any extra connections are dropped. This allows a guaranteed level of service per connection.
I cannot see how to achieve this in HTB.

Quoted 3 lines

Thanks
Michael

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

#3 lore raw
In reply to Michael O'Shea

Ahh yes .. so that maximum N is fixed in this way ? Hmmm and you then need way to map active connection to free class in HTB for example. It will not be simple because you can't say when conversation ends (safely). So that you will end with all classes busy.

You would have to write it yourself probably - extend iptables connection tracking to maintain table of classids and select classid for new connection and return it when conn is deleted. Then simply copy this number to fwmark ...

If you really need this and can't write it you could ask in lartc list whether someone is willing to write it (for fun or for money).
devik

Quoted 53 lines · Michael O'Shea

devik,
But this is my problem - I don't want bw per connection = total/n ... I want bw per connection = x, where x is a constant fraction of total. So for n connections total bw utilised = n*x <= total.
rgds, Michael

-----Original Message-----
From: devik [mailto:[email protected]]
Sent: 09 September 2002 19:53
To: Michael O'Shea
Subject: RE: [LARTC] HTB and per-connection bandwidth allocation

for n active (backlogged) connection sfq gives
total/n fraction. existence of backlog is
essential ! chech with tc class show whether
htb leaf is backloged during periods you
are interested in.
devik

Quoted 7 lines · Michael O'Shea

devik,

I've tried adding sfq qdiscs to the class that governs HTTP but I still don't get the result I want. If I open a single connection, it still gets all the bandwidth available for the class. My understanding is that the addition of sfq to a class will allow fairness between the individual connections (giving each a 'turn') .. but this does not help with defining

a

Quoted 13 lines

specific rate per connection?

Michael

-----Original Message-----
From: Martin Devera [mailto:[email protected]]
Sent: 09 September 2002 17:52
To: Michael O'Shea
Cc: '[email protected]'
Subject: Re: [LARTC] HTB and per-connection bandwidth allocation

Quoted 10 lines

try SFQ.
devik

Quoted 5 lines · Michael O'Shea

Hi,

How do I allocate a guaranteed rate to each individual connection. For example I can allocate, say 1Mb, to all HTTP traffic by defining the appropriate class & filter. In this case, if I have one connection it

Quoted 19 lines

will

Quoted 3 lines
Quoted 1 line

get all 1M; if I have 100 then each connection will get ~ 10k. But

supposing

Quoted 1 line

I want to allocate 10k per individual connection regardless of the

number

Quoted 2 lines

of

Quoted 1 line

connections - so if I have only one connection it gets 10k...20 get

20*10k

Quoted 9 lines
Quoted 7 lines

and if I go above 100 any extra connections are dropped. This allows a guaranteed level of service per connection.
I cannot see how to achieve this in HTB.

Thanks
Michael

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

#4 lore raw
In reply to Michael O'Shea

Devik,
Thanks for that...now I have to do some thinking.. Rgds
Michael

-----Original Message-----
From: devik [mailto:[email protected]]
Sent: 10 September 2002 10:25
To: Michael O'Shea
Cc: [email protected]
Subject: RE: [LARTC] HTB and per-connection bandwidth allocation

Ahh yes .. so that maximum N is fixed in this way ? Hmmm and you then need way to map active connection to free class in HTB for example. It will not be simple because you can't say when conversation ends (safely). So that you will end with all classes busy.

You would have to write it yourself probably - extend iptables connection tracking to maintain table of classids and select classid for new connection and return it when conn is deleted. Then simply copy this number to fwmark ...

If you really need this and can't write it you could ask in lartc list whether someone is willing to write it (for fun or for money).
devik

Quoted 2 lines · Michael O'Shea

devik,
But this is my problem - I don't want bw per connection = total/n ... I

want

Quoted 11 lines

bw per connection = x, where x is a constant fraction of total. So for n connections total bw utilised = n*x <= total.
rgds, Michael

-----Original Message-----
From: devik [mailto:[email protected]]
Sent: 09 September 2002 19:53
To: Michael O'Shea
Subject: RE: [LARTC] HTB and per-connection bandwidth allocation

Quoted 13 lines

for n active (backlogged) connection sfq gives
total/n fraction. existence of backlog is
essential ! chech with tc class show whether
htb leaf is backloged during periods you
are interested in.
devik

Quoted 4 lines · Michael O'Shea

devik,

I've tried adding sfq qdiscs to the class that governs HTTP but I still don't get the result I want. If I open a single connection, it still

gets

Quoted 3 lines
Quoted 3 lines

all the bandwidth available for the class. My understanding is that the addition of sfq to a class will allow fairness between the individual connections (giving each a 'turn') .. but this does not help with

defining

Quoted 23 lines

a

Quoted 22 lines

specific rate per connection?

Michael

-----Original Message-----
From: Martin Devera [mailto:[email protected]]
Sent: 09 September 2002 17:52
To: Michael O'Shea
Cc: '[email protected]'
Subject: Re: [LARTC] HTB and per-connection bandwidth allocation

try SFQ.
devik

Quoted 4 lines · Michael O'Shea

Hi,

How do I allocate a guaranteed rate to each individual connection. For example I can allocate, say 1Mb, to all HTTP traffic by defining

the

Quoted 20 lines
Quoted 1 line
Quoted 1 line

appropriate class & filter. In this case, if I have one connection it

will

Quoted 3 lines
Quoted 1 line

get all 1M; if I have 100 then each connection will get ~ 10k. But

supposing

Quoted 1 line

I want to allocate 10k per individual connection regardless of the

number

Quoted 2 lines

of

Quoted 1 line

connections - so if I have only one connection it gets 10k...20 get

20*10k

Quoted 9 lines
Quoted 7 lines

and if I go above 100 any extra connections are dropped. This allows a guaranteed level of service per connection.
I cannot see how to achieve this in HTB.

Thanks
Michael

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

#5 lore raw
In reply to Michael O'Shea

Hi

http://mailman.ds9a.nl/pipermail/lartc/2002q3/004977.html

I have the same problem to discuss as in the above link. I want to allocate say X MBit per individual connection regardless of the number of connection . KIndly could anyonen suggest me how to proceed.
I have tried with SFq but is doesnot yeild my requirement..

Thanks,
Namitha.

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#6 lore raw
In reply to Michael O'Shea
Quoted 8 lines · Namitha Rao

Hi

http://mailman.ds9a.nl/pipermail/lartc/2002q3/004977.html

I have the same problem to discuss as in the above link. I want to allocate say X MBit per individual connection regardless of the number of connection . KIndly could anyonen suggest me how to proceed.
I have tried with SFq but is doesnot yeild my requirement..

With CONTRACK/CONNMARK you can get an individual mark per connection, then you will need to allocate dinamic qdisc/class/filter to match that mark.

Problems that i see:
-do not know if there is an easy way to know wath mark was assigned, but you can allways 'use the source'
-do not have experience adding and deleting qdisc/class/filter in milisecond basis.

Not shure at all, but i think that is possible.

Signature · 5 lines
Luciano
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
#7 lore raw
In reply to Michael O'Shea
Quoted 4 lines · Namitha Rao

Hi

http://mailman.ds9a.nl/pipermail/lartc/2002q3/004977.html

Quoted 8 lines

I have the same problem to discuss as in the above link. I want to allocate say X MBit per individual connection regardless of the number of connection
. KIndly could anyonen suggest me how to proceed.
I have tried with SFq but is doesnot yeild my requirement..

Thanks,
Namitha.

If you can't think of a way to turn a connection into a class then search the archive for perflow - someone once started a qdisc to do this.

Andy.
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc