FreeBSD Traffic Shaping

Christopher Cowart ccowart at rescomp.berkeley.edu
Tue Apr 1 23:55:23 UTC 2008


freebsd at top-consulting.net wrote:
> I am trying to limit the bandwidth available to some connections and I'm 
> not sure FreeBSD can handle this. Maybe some of you can help. Here's what I 
> need to have exactly.
> 
> No matter what the number of connections, each connection should have at 
> most/least 50kbps guaranteed outbound on port 80.
> 
> I've tried dummynet but it doesn't do what I need because if I define a 
> pipe with 1mbps and if I have 1000 connections, each connection will have 
> less than 50kbps.
> 
> Any way to do this in FreeBSD ?

The ipfw(8) man page describes a "mask" configuration parameter.

# /sbin/ipfw pipe 1 config mask src-ip 0xffffffff bw 56Kbit/s

This creates a separate dynamic pipe per source ip address. Each pipe
has a dedicated 56kbps. The man page implies that the mask can combine
fields, so to uniquely identify "each connection", you would mask all
bits of source and destination IP and ports. It looks like the "all"
keyword might do just the trick.

-- 
Chris Cowart
Network Technical Lead
Network & Infrastructure Services, RSSP-IT
UC Berkeley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 825 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20080401/beb6d4d9/attachment.pgp


More information about the freebsd-questions mailing list