How do I simulate a low bandwidth, high latency environment? [closed]

Solution 1:

For macOS, there is the Network Link Conditioner that simulates configurable bandwidth, latency, and packet loss. It is contained in the Additional Tools for Xcode package. Screenshot

Solution 2:

There's an excellent writeup of setting up a FreeBSD machine to do just this - take your standard old desktop, toss in an additional NIC, and build.

The writeup is available at http://www.freebsd.org/doc/en/articles/filtering-bridges/article.html.

In step 5 of the above instructions, you're enabling a firewall. For just simulating a different IP connection, you could (for example) do the following:

Create a file /etc/rc.firewall.56k which contains the following:

ipfw add pipe 1 ip from any to any out
ipfw add pipe 2 ip from any to any in    
ipfw pipe 1 config bw 56Kbit/s   
ipfw pipe 2 config bw 56Kbit/s

And change /etc/rc.conf... replace the line

firewall_type="open"

with

firewall_type="/etc/rc.firewall.56k"

reboot, and you've got yourself a 56K bridge!

If you happen to be working from a Macintosh, that OS has ipfw built into it by default. I've done the same thing by routing network traffic over the Airport and through the ethernet, setting it up so that anything coming over the airport has the same characteristics as whatever I'm trying to emulate. You can invoke the ipfw commands directly from the terminal and get the same effects.