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

7,604

Solution 1

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

Solution 2

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.

Share:
7,604

Related videos on Youtube

Dougnukem
Author by

Dougnukem

Worked at some game companies and social game startups, working on a new web startup currently. Personal Website

Updated on September 17, 2022

Comments

  • Dougnukem
    Dougnukem over 1 year

    I'm looking for an open source/free network emulator tool that I could use on Mac OS X, to simulate a slow network connection, limited bandwidth and other network characteristics such as dropped packets etc for both UDP/TCP connections (or even on the physical layer).

    I'm looking for the simplest solution that would allow me to run TCP/UDP servers and have a few clients connect to them on localhost emulating various network connections.

    I'm mainly wondering if I can use something like Linux's netem on Mac OS X (or even better cross-platform Windows/Linux/Mac).

    Perhaps I can run VirtualBox and a Linux kernel running netem, has anyone had luck with that?

    Related: Simulating a low-bandwidth, high-latency network connection on Linux

  • Paul
    Paul almost 12 years
    Please add details as to how ns-2 answers the question - the linked cannot be relied upon to remain over time.
  • ptim
    ptim over 9 years
    haven't tested it, but I notice that there's an updated build at the page you've linked..
  • chairbender
    chairbender over 4 years
    This does not seem to work for localhost / 127.0.0.1 connections.