menu
Luigi Rizzo's home
FreeBSD work

Dummynet

This is the main Dummynet page, where you can find recent news on the tool, tutorial material, source code, and precompiled modules and bootable disk images.

Description

dummynet is a tool originally designed for testing networking protocols, and since then used for a variety of applications including bandwidth management. It simulates/enforces queue and bandwidth limitations, delays, packet losses, and multipath effects. It also implements a variant of Weighted Fair Queueing called WF2Q+. It can be used on user's workstations, or on machines acting as routers or bridges.

The main platform for dummynet is FreeBSD, but you can also find it on Mac OS X and we have just (May 2009) completed a Linux/OpenWRT port. To get the idea of what you can do with dummynet, either using it on your workstation, or putting a PC with two ethernet cards between your network and the outside world, here are a few examples :

  • limit the total incoming TCP traffic to 2Mbit/s, and UDP to 300Kbit/s
        ipfw add pipe 2 in proto tcp
        ipfw add pipe 3 in proto udp
        ipfw pipe 2 config bw 2Mbit/s
        ipfw pipe 3 config bw 300Kbit/s
    
  • limit incoming traffic to 300Kbit/s for each host on network 10.1.2.0/24.
        ipfw add pipe 4 src-ip 10.1.2.0/24 in
        ipfw pipe 4 config bw 300Kbit/s queue 20 mask dst-ip 0x000000ff
    
  • simulate an ADSL link to the moon:
        ipfw add pipe 3 out
        ipfw add pipe 4 in
        ipfw pipe 3 config bw 128Kbit/s queue 10 delay 1000ms
        ipfw pipe 4 config bw 640Kbit/s queue 30 delay 1000ms
    
dummynet works by intercepting packets (selected by ipfw rules - ipfw is one of the FreeBSD firewalls) in their way through the protocol stack, and passing them through one or more objects called queues and pipes, which simulate the effects of bandwidth limitations, propagation delays, bounded-size queues, packet losses, multipath. Pipes are fixed-bandwidth channels. Queues represent instead queues of packets, associated with a weight, which share the bandwidth of the pipe they are connected to proportionally to their weight.

Source code, modules and binary images

  • Dummynet is standard on FreeBSD and Mac OS X, so if you have one of these systems you just need to read the manual page with man ipfw and load the appropriate kernel modules, ipfw.ko and dummynet.ko
  • picobsd: you can try Picobsd images (standalone freebsd systems that run from a flash card or CDROM image). Here we have a compressed disk image or an ISO image. The password is "setup" as in default Picobsd systems
  • Linux/openwrt: we have recently ported dummynet to linux and openwrt. You can find here:
  • Revision history:
    • 20090724: fix for a memory leak when using pipes in the linux version; remove a compiler warning when compiling for 64-bit machines;
    • 20090622: initial release for linux

Documentation and papers