On 2012-09-17, Simon Perreault <sperrea...@openbsd.org> wrote: > Le 2012-09-17 11:57, Ted Unangst a écrit : >> Here's the background. My cable ISP has this "turbo boost" thing >> where the first ~2 seconds of a connection download at 50Mbps, then >> it's throttled back to 20Mbps. I want to do this in pf (differentiate >> casual web browsing from long downloads). >> >> My first thought is I need to set up two altq queues, one full speed >> and one half speed. [...] >> >> Alternatively, any way to accomplish the same thing would be good. > > I probably have missed something obvious... Why don't you just use hfsc?
I needed something like this for public wifi running over a handful of ADSLs which usually struggled to get more than 2-3Mb each. >From what I've seen in my attempts at using hfsc for this, the limits are for the queue, not per-state. If you have a separate queue for every IP address then maybe you could do something like this on a per-user basis, but given a large enough dhcp range on the network that people turning up and playing with lladdr random don't quickly run you out of space, the queue config is insane (plus then you can only do this per-user, rather than allow a fast burst on *every* connection and then throttle it back). Closest I came to what I wanted was using squid as a transparent proxy on port 80 with delay pools, most ports other than 22/80 got throttled right back (plus I pushed a few critical things like dns/ntp/voip over a dedicated line). It has most of the desired effect but it's a lot heavier-weight than I was really after and of course the main effect is http only.