[3440] in linux-net channel archive
Re: shaper or whatever
daemon@ATHENA.MIT.EDU (Alan Cox)
Mon Jun 24 04:36:37 1996
From: Alan Cox <alan@cymru.net>
To: miquels@cistron.nl (Miquel van Smoorenburg)
Date: Mon, 24 Jun 1996 09:11:37 +0100 (BST)
Cc: submit-linux-dev-net@ratatosk.yggdrasil.com
In-Reply-To: <96062431553.014301@drinkel.cistron.nl> from "Miquel van Smoorenburg" at Jun 24, 96 01:43:01 am
> Ah. Are you basing it on the firewall code? I want to start to implement
> something based on the firewall code. It adds a bandwidth argument to
> ipfwadm and sets up a bandwidth struct per source/destination specified.
> Does this concept sound sane? Is this like the thing you are implementing?
Possibly although my current driver variant looks like this, and I've
swapped the token bucket for something simpler for the moment.
Devices "shaper0...shapern" are configured with shapeconfig something like
this
shapeconfig shaper0 eth0 64000 # shaper 0 bind to eth0, 64K
route add some.net dev shaper0
So at the moment Im not using the firewall for this. I have some patches
care of Mike McLagan (frame relay author amongst other bits) that do routing
by source and destination address so you can extend that to say
route add from cheap.customers default dev shaper0
I don't yet have routing by port.
As to todays algorithm its this:
Given a queue of bounded length each new arriving packet is added at the
end of the queue sorted by priority order except that a high priority frame
may only move so far forward. When we add the frame we set its latency time
to 0 and set the time it is clocked out of the shaper to be jiffies +
times of packets ahead of us at that bit rate. Frames beyond us we move
along in time down the queue by our time length in the bitrate, and add
this to its latency. Frames exceeding the latency boundary are dropped. Its
a very very simplistic model but seems to work pretty well when testing.
Alan