Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Apr 1998 08:26:23 +1000 (EST)
From:      "Daniel O'Callaghan" <danny@panda.hilink.com.au>
To:        Glen Foster <gfoster@gfoster.com>
Cc:        chrism@keyworld.net, Anthony.Barlow@europe.simoco.com, freebsd-isp@FreeBSD.ORG, freebsd@plinet.com
Subject:   Re: Bandwidth limiter for services?
Message-ID:  <Pine.BSF.3.91.980407081431.313C-100000@panda.hilink.com.au>
In-Reply-To: <199804062152.RAA10319@gfoster.intr.net>

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, 6 Apr 1998, Glen Foster wrote:

> This is speculation on my part based on scanty evidence.  I wish
> Dennis would 'fess up and describe the logic behind his code in this
> forum.

I've written a bandwidth limiter which works fairly basically.  
Unfortunately I lost it and have not had time to rewrite it.  I'll 
describe *my* logic and maybe someone will pick it up and run with it.

* A 64 kbps line has a throughput of 8 kBytes/second, thus each packet will
  take packet_len/8192 seconds to traverse the link.  A 1024 byte packet 
  will take 125 ms to traverse the link.
* Since a packet takes < 1 ms to traverse a decent FreeBSD box with 
  ethernet cards on each side, a packet which is to travel at a notional
  64 kbps must be delayed in transit by (packet_len/8.192 - 1) ms, if the 
  queue is empty.
* If there is already a packet in the queue, the newly arrived packet must
  be scheduled for transmission (packet_len/8.192 - 1) ms after the last
  packet in the queue is due to be sent.

You can see that the above effectively simulates what actually happens in 
a router which converts from your ISPs backbone ethernet/whatever to your 
64 kbps ISDN link.

My bandd used divert sockets, so traffic of a certain type could be sent 
through it - anything ipfw can test for.  It should be noted that the 
system above will work best when there is a separate instance of bandd 
limiting traffic in the opposite direction, as per real life 64k lines.

The above example is for 64kbps.  Adjust accordingly.

Danny

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.980407081431.313C-100000>