Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 2002 07:29:17 +0200
From:      "Patrick O'Reilly" <bsd@perimeter.co.za>
To:        "Randy Smith" <randys@amigo.net>, freebsd-questions@freebsd.org
Subject:   Re: IPFW & DUMMYNET shaping 4.6.2-R - Speed limited to half of pipe limit
Message-ID:  <00d701c26a9d$d344b3e0$0200000a@perimeter.co.za>
References:  <20020916120405.Y11652-100000@stalker.amigo.net>

next in thread | previous in thread | raw e-mail | index | archive | help
From: "Randy Smith" <randys@amigo.net>

> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00d701c26a9d$d344b3e0$0200000a>