From owner-freebsd-questions Wed Oct 2 22:28:20 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0297337B401 for ; Wed, 2 Oct 2002 22:28:19 -0700 (PDT) Received: from perimeter.co.za (obelix.perimeter.co.za [209.212.102.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAADB43E8A for ; Wed, 2 Oct 2002 22:28:13 -0700 (PDT) (envelope-from bsd@perimeter.co.za) Received: from asterix (ndf-dial-196-31-123-57.mweb.co.za [196.31.123.57]) (AUTH: LOGIN bsd@perimeter.co.za) by perimeter.co.za with esmtp; Thu, 03 Oct 2002 07:27:58 +0200 Message-ID: <00d701c26a9d$d344b3e0$0200000a@perimeter.co.za> From: "Patrick O'Reilly" To: "Randy Smith" , freebsd-questions@freebsd.org References: <20020916120405.Y11652-100000@stalker.amigo.net> Subject: Re: IPFW & DUMMYNET shaping 4.6.2-R - Speed limited to half of pipe limit Date: Thu, 3 Oct 2002 07:29:17 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 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 From: "Randy Smith" > Hi all, > > I am using IPFW and DUMMYNET to do traffic shaping on 4.6.2-R gateway > (uname -a below). I have set the upload to 800Kbit/s and the download to > 1500Kbit/s. Here is the relevent section from ipfw.conf. > > add 500 pipe 1 ip from 192.169.91.16:255.255.255.240 to any pipe 1 config bw 800Kbit/s > add 500 pipe 2 ip from any to 192.168.91.16:255.255.255.240 pipe 2 config bw 1500Kbit/s > > If I've read the docs correctly, the network 192.168.91.16/240 should have > it's upload limited to 800Kbs it's download to 1500Kbs. However, MRTG is > reporting that the upload traffic is maxing out at around 400Kbs. > > I have played with the upload speed and the connection always maxes out at > about half of what I set it to. > > My questions: > 1) How do I get the traffic limited to the bw I set it to? > 2) What is causing this? > 3) Would changing/setting the queuing method help? > Randy, Your problem is simple: Remember that IPFW interacts with packets as they pass through interfaces. Your ipfw rules will match each packet twice - once as it enters the gateway from the source network, and a second time as it leaves the gateway en route to the destination. Both times you are queuing the packet in the same pipe. This means that each packet uses twice its own bandwidth in the pipe.... The solution is to change your rules as follows (assume fxp0 is your internet NIC): > add 500 pipe 1 ip from 192.169.91.16:255.255.255.240 to any via fxp0 > add 500 pipe 2 ip from any to 192.168.91.16:255.255.255.240 via fxp0 --- Regards, Patrick O'Reilly. ___ _ __ / _ )__ __ (_)_ __ ___ _/ /____ __ / __/ -_) _) / ~ ) -_), ,-/ -_) _) /_/ \__/_//_/_/~/_/\__/ \__/\__/_/ http://www.perimeter.co.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message