# How can I simulate a bad internet connection for testing purposes?

I am developing an online multiplayer game. It works well when I test it on the local area network, but before I release it I would like to test how the user-experience works out for someone who has not such a good connection to the server. How can I simulate a bad internet connection with high latency, low bandwidth, jitter and occasional packet loss when in a local environment?

• Send it to me for testing! Connections in my country are horrible by default. – Stephan Aug 30 '13 at 10:52
• A commendable goal. I do wish published studios would do the same. Epic Games, I'm looking at you. – Gusdor Aug 30 '13 at 12:17
• Find a friend nearby who uses Comcast... – WernerCD Aug 30 '13 at 12:55
• Simulating a bad internet connection contains the current answers and more. – MichaelHouse Aug 30 '13 at 14:29
• I immediately thought of this other recent SE question: superuser.com/questions/637594/… – Patrick M Aug 30 '13 at 14:58

I think Dummynet is what you are looking for. Dummynet is a network emulation tool which can simulate bandwidth limitations, delays, packet losses, and many more. You can easily choose which traffic you want to intercept and configure the limitations, e.g. to limit all incoming TCP traffic to 2Mbit/s you do

ipfw add pipe 2 in proto tcp
ipfw pipe 2 config bw 2Mbit/s


You see the traffic selection is done by the known ipfw firewall and the pipes provide the limitation features.

• does it work with Windows loopback adapter? – Andriy Tylychko Jul 3 '15 at 10:34
• to answer my own question, no, it doesn't work for me on Windows 8.1, even after I disabled signed driver reinforcement – Andriy Tylychko Jul 3 '15 at 13:10
• @AndyT Did you find something that works with loopback? Finding something that does packloss AND works with loopback seem difficult. – AaronLS Apr 24 '16 at 3:15
• @AaronLS: please see another answer here: gamedev.stackexchange.com/a/100779/4731 – Andriy Tylychko Apr 24 '16 at 12:04

If you're on a Mac, you can use Network Link Conditioner.

You can simulate various cases of bad internet connections, including Edge and 3G.

It is a free download in Xcode (go to Xcode → Open Developer Tool → More Developer Tools… and download the Hardware IO Tools for Xcode).

• I like this tools, but I need something that I can use for automated testing. Does anyone know if there is a command line interface for this? – Erik B Jun 1 '17 at 9:54

If you are on linux you can use netem to simulate all of the possible problems with network like high latency, low bandwidth, packet losses and many others.

There is an option for windows called NetLimiter but I haven't used it so can't vouch for it.

Just found a Mac App called SlowlyApp.

• -1 As with the other answers. This is just links. Please update the answer to include descriptions of what the applications do and how they do it. – MichaelHouse Aug 30 '13 at 14:17
• @Byte56: What these apps do is simulate a slow and/or unreliable network connection, just like the question asks for. I'm pretty sure how they do it is outside the scope of this site. I'd say this is a perfectly good answer to the question as asked; if there's a problem, it's in the question, not in the answers. – Ilmari Karonen Aug 30 '13 at 16:00
• Technically, the question asks "How can I simulate a bad internet connection". It doesn't ask for applications to do it. But yes, I think this question is outside the scope of this site. – MichaelHouse Aug 30 '13 at 22:52

Clumsy, for Windows Vista & 7.

• works fine for windows 8.1 on loopback – Andriy Tylychko Jul 3 '15 at 13:09
• Don't forget to run as administrator. Or it silently doesn't do anything. Otherwise great tool. – Neolisk Sep 5 '17 at 18:50

How can I simulate a bad internet connection with high latency, low bandwidth, jitter and occasional packet loss when in a local environment?

If you're on Windows, you can try SoftPerfect Connection Emulator. It's basically a driver that injects itself between your application and the network layer (similar to Wireshark/WinPCAP) for the selected NIC and can simulate limited bandwidth, latency, packet loss, and other things. The UI is simple and straightforward.

It's a commercial product, but the trial lets you do 30-second bursts of "interference" that should be good enough for you to judge whether this tool does what you want.

Another cross-platform option is DummyNet, which behaves in a similar manner (via ipfw) but is a bit less easy-to-use.

I would like to test how the user-experience works out for someone who has not such a good connection to the server.

I think this part of the question could be restated as "how do I deal with network latency in my application?" One commonly-used and effective technique is Dead Reckoning. The linked article explains it better than I can, but the basic idea is that your clients kind of "simulate" where each entity should be and what it should be doing by an algorithm. Whenever an entity deviates from this algorithm (i.e. player input, server-side event, etc), it sends out an update to each client.

I haven't used it in a while, but I've used Charles for testing this. It is an application with various network diagnostics tools, including simulating the problems you mentioned: "a bad internet connection with high latency, low bandwidth, jitter and occasional packet loss"

• From the first glance it looks like Charles is a kind of HTTP proxy, so it can't shape plain TCP or UDP traffic. Am I missing something? – vbo Oct 20 '14 at 15:50
• and it even got +5, wft? – Marian Paździoch Dec 29 '15 at 20:51
• er I'm not sure what "shape plain TCP or UDP traffic" means, but I've used this tool for precisely what the OP asked about, simulating a bad internet connection. – jhocking Dec 30 '15 at 18:46
• @jhocking He means it only works for HTTP traffic. Many realtime games use TCP or UDP. – AaronLS Apr 25 '16 at 17:39

If you're savvy with Fiddler, and you're only interested in HTTP/1 then you can script this.

Fiddler doesn't support HTTP/2, intercepting with it will cause all HTTP traffic to downgrade to HTTP/1.

• Interesting. Can you provide more details? Maybe some example script? – Philipp Oct 8 '19 at 13:08
• @Philipp This answer (stackoverflow.com/a/47401557/442351) gives an example. – BanksySan Oct 8 '19 at 13:50
• It only supports http? Not even websockets? Then I don't think it has much use in game development. If you worry about latency then you wouldn't be using http in the first place. But thanks for mentioning it anyway. – Philipp Oct 8 '19 at 14:59
• @Philipp it does support WebSockets, just hot HTTP/2. Though, you should look at HTTP/2, it's nothing like HTTP/1, no more head-of-line blocking, no more multiple handshakes, no more duplicate headers and/or cookies. – BanksySan Oct 8 '19 at 18:28