On Tue, May 23, 2006 at 03:56:31AM -0700, S t i n g r a y wrote:
> I want to do traffic shaping as per protocol basis so
> if i give a certian bandwith to HTTP protocole , isnt
> there any way i can diffrenciate between HTTP webpages
> & HTTP downloads of huge .iso files ?
> i dont want users who are downloading huge files
> effect userrs who are only checking their webmails.
>
> is there any way ?
The answer is, of course, yes. Now, are there any pre-written tools for
this? And can pf do it?
In the latter case, to some extent. You could get somewhere by defining
a queue with high priority but comparatively low bandwidth, which would
be decidedly suboptimal for downloading but pretty nice for surfing sane
web pages[1]. It looks like altq's hfsc could do this.
I can think of various schemes to detect 'a lot of traffic', but I
don't think it's possible to get pf(4)/altq(9) to shift a connection in
the table to another queue. So that isn't going to work.
What just might work, though, especially for a comparatively small
number of clients, is to assign each client its own queue. The cbq
scheduler would be the classical example of a scheduler to use here;
clients can be guaranteed a certain bandwidth, and any bandwidth left
over is fair game ('cbq(borrow)'). This gives the downloaders plenty of
bandwidth to play with, without unduly inconveniencing the surfers.
Joachim
[1] Of course, it's not all that clear whether or not a heavy web page
like Hotmail would benefit all that much from this.