From owner-freebsd-questions Thu Oct 4 3:18:30 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mip.co.za (puck.mip.co.za [209.212.106.44]) by hub.freebsd.org (Postfix) with ESMTP id CB1D337B405 for ; Thu, 4 Oct 2001 03:17:54 -0700 (PDT) Received: from patrick (patrick.mip.co.za [10.3.13.181]) by mip.co.za (8.9.3/8.9.3) with SMTP id MAA92759; Thu, 4 Oct 2001 12:17:43 +0200 (SAST) (envelope-from patrick@mip.co.za) From: "Patrick O'Reilly" To: "FreeBSD Question List" , "Steven" Subject: RE: Fair bandwidth division Date: Thu, 4 Oct 2001 12:20:28 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <01100319141400.00382@kyle.offline.org.uk> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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