netem for Mac OS X to emulate network latency and dropped packets

The developer tools in 10.7 come with a prefPane for emulating a limited network connection:

enter image description here

Via Network Link Conditioner in Lion » Matt Legend Gemmell


Try ns-2:

Ns-2 is a discrete event simulator targeted at networking research. Ns-2 provides substantial support for simulation of TCP, routing, and multicast protocols over wired and wireless (local and satellite) networks.

Installing NS2 on a MacOS X / Intel Based

I've tried to install ns2-allinone-2.29.3/.2 onto an intel mac based system. After some problems during the compile phase, the simulator part (ns) seems to be fully working. Nam, instead, got some strange errors, related to Xlib. In my knowledge, this strange behaviour is related to some changes to api part of Xlib into macos/intel version. Attached is the error, that i've when try to run nam onto my mac intel based.

tengu:~/Desktop/ns-allinone-2.29/nam-1.11 valvoline$ ./nam 
Xlib: sequence lost (0x10006 > 0x9) in reply type 0x0!
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  1 (X_CreateWindow)
  Resource id in failed request:  0xa
  Serial number of failed request:  6
  Current serial number in output stream:  9

You can go here for a full blown tutorial on Ns-2.