Dear all, I''ve got a working HTB configuration with iptables, fwmark, SFQ etc. At the moment, I can mark traffic and give it a maximum bandwidth and a minimum guaranteed bandwidth, so far so good. What I would like to do is the following: In stead of defining a min/max for a certain type of traffic (e.g. http, ftp whatever), I would like to define a "minimum guaranteed bandwidth per connection". e.g. An application connecting to port X would get 10kbit/s guaranteed, the next connection to port X would also get 10kbit/s etc. Would be something like having N (the maximum number of connections) HTB classes, and put every new connection in another class. Does anyone know how to do that? Kind regards, Jeroen Vriesman. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi!Jeroen Vriesman wrote:>In stead of defining a min/max for a certain type of traffic (e.g. http, ftp whatever), I would like to define a "minimum guaranteed bandwidth per connection". >e.g. An application connecting to port X would get 10kbit/s guaranteed, the next connection to port X would also get 10kbit/s etc. > >Would be something like having N (the maximum number of connections) HTB classes, and put every new connection in another class. > >I don''t know how you can put every new connection in a new class, but why don''t you try this: Decide what will be the maximum number of connections you want to provide the guaranteed minimum and how much will it be (kbit/s). If for example we take connections to port 80, create a HTB class with rate=max_conn*guaranteed_rate and classify all traffic to port 80 to it. Then add an SFQ behind. This way if there is a fewer number of connections than you planned for each will get (class_rate/connections)kbit, which will more than the guaranteed minimun. If the number is equal to the number of connections, the SFQ will make sure that no particular connection take over the bandwitdh, and evey connection will get it''s guaranteed minimum. If there are more connections than you expected, each will get an equal portion of the available bandwidth. Actually that''s exactly what SFQ is designed for, to distribute the available bandwidth equally to every connection. Greets, Rado _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hi, well, that''s exactly what I''m doing now. The only thing is that it only makes sense if there are a lot of connections, when there are only a few, they will get a lot of bandwidth, which isn''t what I want. Thanks for the response. Jeroen. On Wed, 21 Apr 2004 16:54:11 +0300 Radoslav Kolev <radolin@del.bg> wrote:> Hi!Jeroen Vriesman wrote: > > >In stead of defining a min/max for a certain type of traffic (e.g. http, ftp whatever), I would like to define a "minimum guaranteed bandwidth per connection". > >e.g. An application connecting to port X would get 10kbit/s guaranteed, the next connection to port X would also get 10kbit/s etc. > > > >Would be something like having N (the maximum number of connections) HTB classes, and put every new connection in another class. > > > > > I don''t know how you can put every new connection in a new class, but > why don''t you try this: > Decide what will be the maximum number of connections you want to > provide the guaranteed minimum and how much will it be (kbit/s). > If for example we take connections to port 80, create a HTB class with > rate=max_conn*guaranteed_rate and classify all traffic to port 80 to it. > Then add an SFQ behind. This way if there is a fewer number of > connections than you planned for each will get > (class_rate/connections)kbit, which > will more than the guaranteed minimun. If the number is equal to the > number of connections, the SFQ will make sure that no particular connection > take over the bandwitdh, and evey connection will get it''s guaranteed > minimum. If there are more connections than you expected, each will get > an equal portion of the available bandwidth. Actually that''s exactly > what SFQ is designed for, to distribute the available bandwidth equally > to every connection. > > Greets, > Rado > > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ >_______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/