Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jan 2011 15:13:03 -0800
From:      Freddie Cash <fjwcash@gmail.com>
To:        Michael Spratt <mike@magicislandtechnologies.com>
Cc:        freebsd-ipfw@freebsd.org
Subject:   Re: soft-cap,
Message-ID:  <AANLkTinjViTOA0tVbw_tAiEMMPkLj5Hy44GmR6r0cWuw@mail.gmail.com>
In-Reply-To: <4D23A04A.3040107@magicislandtechnologies.com>
References:  <AANLkTinHW9wOyf1woxGLMurEsF=Yk3M8wt7%2BFM-C_9ya@mail.gmail.com> <20110104145253.GB8235@onelab2.iet.unipi.it> <4D23A04A.3040107@magicislandtechnologies.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 4, 2011 at 2:33 PM, Michael Spratt
<mike@magicislandtechnologies.com> wrote:
> Dear friends, =C2=A0linux/ipfw/dummynet/transparent-bridge, am trying to =
cap
> users to upload/TX rates, but allow them to go over if the link is not
> congested.
>
> The example below limits each src-ip mask-IP's TX from 10.10.0.0/20 to
> 128Kbp/s, =C2=A0and from 10.20.0.0/20 to 1024Kbp/s.
> -------------------------------------------------------------------------=
------------
> ipfw pipe 1 config bw 128Kbit/s mask src-ip 0xffffffff
> ipfw pipe 2 config bw 1024Kbit/s mask src-ip 0xffffffff

Create 1 pipe of "1024+128" Kbps.

Then create 2 queues, one with weight 1 (the slow queue) and the other
with weight 8 (the fast queue).

That will guarantee that traffic sent through queue 1 gets at least
128 Kbps of bandwidth, even when the pipe is full.  And traffic sent
through queue 2 gets at least 1024 Kbps of bandwidth, even when the
pipe is full.

The beauty of queues, though, is that either queue can "expand" to
fill the full pipe, if there's no traffic in the other queues.

Thus, queue 1 is guaranteed 128 Kbps of bandwidth, but can use up to
the full pipe worth if queue 2 is empty.

And queue 2 is guaranteed 1024 Kbps of bandwidth, but can use up to
the full pipe worth if queue 1 is empty.

> ipfw 10001 add pipe 1 ip from 10.10.0.0/20 to any out xmit br0
> ipfw 10001 add pipe 2 ip from 10.20.0.0/20 to any out xmit br0

Then, change the above rules to use the queues instead.

The way dummynet works, is that pipes set hard limits on the bandwidth.

And queues provide minimum guarantees for bandwidth inside of that pipe.

--=20
Freddie Cash
fjwcash@gmail.com



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