259

I would like to visually evaluate web pages response time for several Internet connections types (DSL, Cable, T1, dial-up etc.) while my browser and web server are on the same LAN or even on the same machine. Are there any simple network tools or browser plug-ins that slow down network bandwidth to simulate different real-world connection scenarios.

I appreciate any input on that.

MaxK
  • 3,511
  • 4
  • 20
  • 16

16 Answers16

283

On Linux, see netem: the kernel already contains support for traffic shaping, and can simulate high latency, low bandwidth, packet losses, and all sort of other adverse conditions, even on a loopback device (so you don't need a real, physical network to test across).

JJJ
  • 32,902
  • 20
  • 89
  • 102
ephemient
  • 198,619
  • 38
  • 280
  • 391
  • 56
    +1 to this. Awesome. With a single command I can make "localhost" behave like a public internet service on coffee shop wifi: `sudo tc qdisc add dev lo root netem delay 500ms` – Sam Stokes May 12 '10 at 21:21
  • 9
    Sweet! The docs are here: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem – Thomas Ahle Aug 11 '10 at 17:24
  • 50
    Super cool. Just want to add how to remove the emulation again. To add: `sudo tc qdisc add dev lo root netem delay 100ms` To remove: `sudo tc qdisc del dev lo root netem delay 100ms` – freeall May 17 '12 at 10:54
  • http://stackoverflow.com/questions/11832505/simulating-a-bad-internet-connection/15824081#15824081 – nicolas.leblanc Aug 15 '13 at 14:42
  • 15
    You can completely reset all tc rules for loopback with the single command `sudo tc qdisc del dev lo root` - change `lo` to `eth0` if you're using a wired connection etc – Hamish Downer Sep 18 '13 at 14:26
  • 7
    Recent versions of netem support limiting the bandwidth too using the rate option: `tc qdisc add dev lo root handle 1:0 netem delay 10ms rate 1mbit limit 1000`. Note that for some devices, such as the loopback device, you also need to set it to have a non-zero queue length for the rate option to work: `ifconfig lo txqueuelen 1000`. See http://serverfault.com/a/394949/76090 – z0r Nov 20 '13 at 03:03
  • 2
    Also for Linux is the command-line tool wondershaper: ```sudo apt install wondershaper; sudo wondershaper eth0 128 64``` will throttle the eth0 interface to 128 kilobits down, 64 up. – Luke Jan 22 '17 at 09:29
80

I am resurrecting this thread because I had the same need recently. Amazingly, I discovered that Fiddler can be used to do that by customizing the rules and adding this line oSession["response-trickle-delay"] = "150"; in the section OnBeforeResponse.

Fiddler is really amazing.

Aage
  • 5,932
  • 2
  • 32
  • 57
Paperino
  • 935
  • 7
  • 14
  • 36
    In recent versions of Fiddler, you only need to enable `Simulate Modem Speeds` under Rules -> Performance. – Markus Hedlund Aug 15 '11 at 09:34
  • 4
    +1 Fiddler is an exceptional tool, perhaps overkill for just this but definitely worth having around. You can easily get Fiddler to only fiddle with one program by using the process filter, no setting up of proxies in your program needed! – Deebster Jan 27 '12 at 12:07
  • I was already a lover of Fiddler but now I just can't live without it. I didn't know that the tool I need lives with me every day :) – Ignacio Soler Garcia May 29 '12 at 19:20
  • 5
    Note that this is a windows-only solution, unless you are willing to fiddle with hacks and workarounds. – crazy2be Feb 23 '13 at 04:58
23

try Traffic Shaper XP you can easily limit speed of IE or other browser with this App and its also freeware

Sadegh
  • 6,654
  • 4
  • 34
  • 44
21

Try Microsoft's NEWT, it worked perfect for me. It supplies customized latency, packet drop techniques and more :)

http://blog.mrpol.nl/2010/01/14/network-emulator-toolkit/

Update 1:

Here is a good video tutorial for NEWT - Network Emulator For Windows Toolkit Tutorial (Credits to Jimmery)

Eran Betzalel
  • 4,105
  • 3
  • 38
  • 66
  • Does this work like fiddler (ie. is it invisible to the client and server apps?) – UpTheCreek Jun 07 '13 at 14:49
  • 2
    Yes, I think it's working in the driver level. – Eran Betzalel Jun 08 '13 at 13:37
  • 1
    I tried it, but I couldn't figure it out - is there a help file anywhere? – UpTheCreek Jun 08 '13 at 14:39
  • It's pretty straight forward, but you'll have to know some basic network concepts before using this tool. – Eran Betzalel Jun 08 '13 at 15:19
  • 1
    I know basic networking concepts - but couldn't get it to do anything. – UpTheCreek Jun 08 '13 at 15:25
  • 1
    Use the trace button (looks like a yellow foot) to see if your filters are relevant to any network packets. Try simple stuff, like dropping every packet for port 80 (HTTP). – Eran Betzalel Jun 08 '13 at 21:45
  • 1
    Same here; I'm a developer, I've written TCP level C++ code before -- have configured QoS (and many other things) in detail for routers -- I have a network intensive app running (downloading/uploading 2 - 4 Mb/s right now) -- Tried the tracing, and also "Action->Toggle Tracing", but nothing happens. Also don't see any relevant way to setup bandwidth throttling... so that's annoying. – BrainSlugs83 Aug 08 '13 at 00:20
  • 3
    Ive not got the network knowledge of you guys, but I got NEWT to work after watching this youtube vid: https://www.youtube.com/watch?v=s5o_GnYOloA - I hope this helps – Jimmery Jun 09 '14 at 10:53
  • Didn't work on windows8.1 – RanP Dec 22 '15 at 15:38
  • @RanP, Make sure you press 'F5' to start the throttling action. You have to start it explicitly. – Phillip Ngan Nov 06 '18 at 22:47
18

My work uses this tool, and it seems quite good: http://www.dallaway.com/sloppy/

Best of luck.

Jon Onstott
  • 13,499
  • 16
  • 80
  • 133
  • 1
    +1 Java-based, so it works great on OSX (haven't tried it on Windows or Linux yet) - easy to install & run, works transparently, and doesn't leave a mess afterwards! – Richard Inglis Feb 12 '12 at 13:01
  • yep, excellent tool, web based jnlp (no install needed, just launch it) it creates a proxy on localhost, port is configurable, speed can be changed dynamically +32 ;) – jobwat Mar 14 '12 at 03:31
  • I've used **sloppy** before and I love it, but sadly it does not support `https`: https://groups.google.com/forum/#!topic/sloppy-discuss/tOyCx7igfkw – Jess Jul 15 '13 at 13:29
  • doesn't simulate the packet loss of crappy networks though. – catbadger Feb 22 '17 at 18:49
14

I've successfully used TMnetSim (bottom of the page, under “Other Tools” - the link says something like “ZIP: TMnetSim Network Simulator version 2.4 32-bit (600KB)”

It's not just for websites - you can slow connections to any TCP port. I was using it to simulate a slow SQL Server (port 1433).

yucer
  • 4,431
  • 3
  • 34
  • 42
Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
6

I love Charles.

The free version works fine for me.

Throttling, rerwiting, breakpoints are all awesome features.

Roland Keesom
  • 8,180
  • 5
  • 45
  • 52
  • 2
    Yeah, it works fine for 30 days... :-/ – BrainSlugs83 Aug 08 '13 at 00:26
  • 1
    For me it works fine also after the 30 days, you just have to wait a little longer and it reboots after 30 minutes. But you can always get the license. – Roland Keesom Aug 08 '13 at 07:18
  • Version 3.7? The website seems to imply that after 30 days you have to purchase it to continue using it. – BrainSlugs83 Aug 08 '13 at 20:00
  • 1
    Your assumption is wrong. In the first 30 days you can use it without delays. After that there are small delays and it reboots after 30 minutes. – Roland Keesom Aug 09 '13 at 07:18
  • 4
    From their Website: `After 30 days if you decide to continue using Charles you must purchase a license` – Florian F Oct 07 '14 at 21:23
  • for others benefit: Charles 3 and 4 gave me very unstable results when throttling. Pretty much every throttle setting didn't work as expected except for utilization %. – Darkhydro Feb 19 '21 at 21:58
6

For Linux or OSX, you can use ipfw.

From Quora (http://www.quora.com/What-is-the-best-tool-to-simulate-a-slow-internet-connection-on-a-Mac)

Essentially using a firewall to throttle all network data:

Define a rule that uses a pipe to reroute all traffic from any source address to any destination address, execute the following command (as root, or using sudo):

$ ipfw add pipe 1 all from any to any

To configure this rule to limit bandwidth to 300Kbit/s and impose 200ms of latency each way:

$ ipfw pipe 1 config bw 300Kbit/s delay 200ms

To remove all rules and recover your original network connection:

$ ipfw flush

dule
  • 17,798
  • 4
  • 39
  • 38
6

DummyNet

Try this FreeBSD based VMWare image. It also has an excellent how-to, purely free and stands up in 20 minutes.

Update: DummyNet also supports Linux, OSX and Windows by now

Florian F
  • 4,044
  • 3
  • 30
  • 31
flecks
  • 61
  • 1
  • 2
  • 1
    Thanks for the tip on this. Turns out there's now a native Windows version available, which I used successfully. – GuyBehindtheGuy Nov 15 '10 at 19:49
  • I went this way. But configuration took me ~4 hours. I should have known to replace "192.168.0." to "192.168.196." (the subnet) through *all* the rc.conf and rc.firewall. – bohdan_trotsenko Aug 10 '11 at 21:17
4

Mac OS X has now an integrated tool able to simulate slow and bad networks : http://9to5mac.com/2011/08/10/new-in-os-x-lion-network-link-conditioner-utility-lets-you-simulate-internet-and-bandwidth-conditions/

Offirmo
  • 18,962
  • 12
  • 76
  • 97
4

If you use Apache, you can use mod_bandwith.

See here for configuration parameters.

jontro
  • 10,241
  • 6
  • 46
  • 71
Alex
  • 32,506
  • 16
  • 106
  • 171
2

You can also try WANem which is an open source Wide Area Network emulator. You can download the image (ISO, Knoppix live CD) or VMWare virtual appliances.

kri
  • 494
  • 1
  • 6
  • 12
2

A simple mac GUI program is

https://www.macupdate.com/app/mac/28072/entonnoir/ which can limit the speed

VARUN ISAC
  • 443
  • 3
  • 13
2

If you'd like a hardware solution, Netgear has a series of cheap ($50 or so) switches that do bandwidth limiting. Netgear Prosafe GS105E and similar switches are worth investigating.

Allen
  • 21
  • 2
1

You can use dummynet ofcourse, There is extension of dummynet called KauNet. which can provide even more precise control of network conditions. It can drop/delay/re-order specific packets (that way you can perform more in-depth analysis of dropping key packets like TCP handshake to see how your web pages digest it). It also works in time domain. Usually most the emulators are tuned to work in data domain. In time domain you can specify from what time to what time you can alter the network conditions.

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
0

In case you need to simulate network connection quality when developing for Windows Phone, you might give a try to a Visual Studio built-in tool called Simulation Dashboard (more details here http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206952(v=vs.105).aspx):

You can use the Simulation Dashboard in Visual Studio to test your app for these connection problems, and to help prevent users from encountering scenarios like the following:

  • High-resolution music or videos stutter or freeze while streaming, or take a long time to download over a low-bandwidth connection.
  • Calls to a web service fail with a timeout.
  • The app crashes when no network is available.
  • Data transfer does not resume when the network connection is lost and then restored.
  • The user’s battery is drained by a streaming app that uses the network inefficiently.
  • Mapping the user’s route is interrupted in a navigation app.

...

In Visual Studio, on the Tools menu, open Simulation Dashboard. Find the network simulation section of the dashboard and check the Enable Network Simulation check box.

Nikita R.
  • 7,245
  • 3
  • 51
  • 62