Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Oct 2001 12:20:28 +0200
From:      "Patrick O'Reilly" <patrick@mip.co.za>
To:        "FreeBSD Question List" <freebsd-questions@freebsd.org>, "Steven" <steven@trance.org>
Subject:   RE: Fair bandwidth division
Message-ID:  <NDBBIMKICMDGDMNOOCAIGEOEDJAA.patrick@mip.co.za>
In-Reply-To: <01100319141400.00382@kyle.offline.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Just a theoretical pointer:

Reading the man page for ipfw leads me to believe that you might get what
you need by using DUMMYNET's pipe and queue features.  I have used pipes
with great success, but have no experience with queues.  The man page
indicates that each queue is assigned a weight within a pipe, with multiple
queues per pipe.

(The following changes will probably be done in /etc/rc.conf)

So, I am thinking, if you set up a pipe with, say, 128k bandwidth:
# ipfw pipe 1 config bw 128Kbit/s

And then set a queue for each PC on the network:
# ipfw queue 1 config pipe 1 weight 1
# ipfw queue 2 config pipe 1 weight 1
# etc...

Finally, add the rules to your firewall ruleset:
# ipfw add 1000 queue 1 from any to 192.168.1.101
# ipfw add 1000 queue 2 from any to 192.168.1.102

These are sample lines only - you will need to see how to fit this into your
existing ipfw configuration.

Anyway, it seems to me that regardless of how many connections a user opens
with kazaa, they are all channelled through one queue by this ipfw ruleset,
and hence have equal weight when fighting for bandwidth with another queue
(which represents another host).  The total bandwidth up for grabs is
limited by the pipe config.  You might make this equal to, or smaller, than
your link's wire speed. I think this will render the "fair" split that you
are after, and as elaborated by Ted (i.e. - equal weight per host, not equal
weight per tcp connection) .

Let me know how it works out...

Patrick.

-----Original Message-----
From: owner-freebsd-questions@FreeBSD.ORG
[mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Steven
Sent: 03 October 2001 20:14
To: freebsd-questions@FreeBSD.ORG
Subject: Fair bandwidth division


Hi,

I have a freebsd 4.1 machine running as a natd router for my home network.
In recent weeks my housemates have started using the file sharing program
kazaa, which downloads its files from several sources at once in an attempt
to saturate as much bandwidth as possible.

This is a bit of a problem, as I have have found when one person is making a
download with it and using maybe 65k/sec, others in the house (namely me)
get a top speed of maybe 0.5k/sec (from sites which can easily shift at a
much higher speeds).

I do not wish to divide up the bandwidth on a permenant
basis - it makes no sense as a lot of the time there may only be one person
using the net connection. I would however like to find a way to dynamically
divide the bandwidth "fairly", so that one computer cannot hog all the
bandwidth when others are trying to use the connection too.

Is there a way of doing this? I've done a few searches but cannot see
anything obvious.

Thanks

Steven

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


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?NDBBIMKICMDGDMNOOCAIGEOEDJAA.patrick>