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

20

223

I need to simulate a low bandwidth, high latency connection to a server in order to emulate the conditions of a VPN at a remote site. The bandwidth and latency should be tweakable so I can discover the best combination in order to run our software package.

Magnificence answered 24/9, 2008 at 22:35 Comment(2)
Great question! I'd love to hear some answers related to ASP .NET web development.Castara
Related/dupe: Network tools that simulate slow network connection & Simulate delayed and dropped packets on LinuxTonyatonye
A
81

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

Adora answered 12/3, 2012 at 22:37 Comment(4)
The "Network Link Conditioner" preference pane is part of the Hardware IO Tools for XCode, which you can download from developer.apple.com/downloadsSholem
doesn't seem to work with Genymotion. (Black Screen)Radiosensitive
Download link for newer XCode versions: developer.apple.com/download/more/?q=Additional%20ToolsSyndetic
@Syndetic Thank you. I've updated the answer with the current name of the package and current link.Adora
F
37

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.

Flattie answered 24/9, 2008 at 22:58 Comment(0)
F
32

In the past, I have used a bridge using the Linux Netem (Network Emulation) functionality. It is highly configurable -- allowing the introduction of delays (the first example is for a WAN), packet loss, corruption, etc.

I'm noting that Netem worked very well for my applications, but I also ended up using WANem several times. The provided bootable ISO (and virtual appliance images) made it quite handy.

Fasciation answered 24/9, 2008 at 22:37 Comment(2)
Perfect for my needs, and available out of the box on my Ubuntu 14.04 server!Kristopherkristos
Note: MasterShaper now points to some unrelated landing pageUpside
L
26

I found this little neat program for Windows called clumsy. It's in kind of alpha status, but it seem to work fine for me, and it's open source.

Edit: Others have noticed that you can't limit bandwidth with clumsy, and that's true. You can only add Latency and a couple of other network related errors. This will disqualify this answer as a valid answer to the question, however since I had good use for it when I wanted to simulate a bad network so I'll leave it here as long as it has > 0 votes or similar.

Lambent answered 29/4, 2015 at 7:7 Comment(4)
How do you control bandwidth with clumsy?Tetartohedral
Excellent program. Just what I needed. I Recommend it. Works like a charm and its super easy.Wash
When most people say "limit bandwidth" they are probably more than happy with simply adding massive amounts of latency and packet loss, as these effectively do limit bandwidth. Also this program is amazingly simple to use, beats everything else I tried on windows.Cecilla
Clumsy 0.3 supports explicit bandwidth restriction.Ody
A
23

Charles

I came across Charles the web debugging proxy application and had great success in emulating network latency. It works on Windows, Mac, and Linux.

Charles on Mac

Bandwidth throttle / Bandwidth simulator

Charles can be used to adjust the bandwidth and latency of your Internet connection. This enables you to simulate modem conditions using your high-speed connection.

The bandwidth may be throttled to any arbitrary bytes per second. This enables any connection speed to be simulated.

The latency may also be set to any arbitrary number of milliseconds. The latency delay simulates the latency experienced on slower connections, that is the delay between making a request and the request being received at the other end.

DummyNet

You could also use vmware to run BSD or Linux and try this article (DummyNet) or this one.

Aldarcie answered 24/9, 2008 at 22:51 Comment(2)
Charles is an HTTP proxy, and therefore only suitable for testing HTTP applications. To each their own, but in my opinion it's probably some of the worst software I've ever used. I only used it for a short time while I had to work on a Mac. For Windows users, I'd recommend Fiddler if you need an HTTP debugging proxy. Unfortunately, I didn't find anything other than Charles for OSX.Kershner
Hi Brad. Can you mention what kind of problems did you have?Pariah
K
13

Try WANem

WANem is a Wide Area Network Emulator, meant to provide a real experience of a Wide Area Network/Internet, during application development / testing over a LAN environment.

Klump answered 24/9, 2008 at 22:38 Comment(1)
I've tried this and cannot seem to get it to work. It won't get an IP address from our network for some reason while any other computer has no issues with it.Acetone
A
12

For Windows you can use this application: http://www.softperfect.com/products/connectionemulator/

WAN Connection Emulator for Windows 2000, XP, 2003, Vista, Seven and 2008.

Perhaps the only one available for Windows.

Alodie answered 25/9, 2010 at 7:37 Comment(0)
H
7

I would try using netem on linux. With it you can simulate additional delay, corruption, packet loss and duplication. It even works on the loopback device.

Hypophyge answered 1/10, 2009 at 19:52 Comment(1)
Hey do you have some equivalent command for windows as netem?Domination
D
6

Another client-side program (Windows only), is NetLimiter - http://www.netlimiter.com

Droplight answered 22/10, 2010 at 11:38 Comment(4)
Netlimiter is good, but I think it only does low bandwidth - it can't change the latency?Skantze
The beta plans for v3 listed latency simulation as a planned feature. It was recently released and I haven't used it yet to see if that feature made it in.Droplight
That feature did not make it in to beta version 9. Ugh.Woolgathering
Even the current beta (NetLimiter 4) does not let you change the latency.Hyetograph
U
5

I use NetBalancer on my Windows machine.

http://seriousbit.com/netbalancer/

Updates on 2017-10-07: The last free version of NetBalancer is 9.2.7. The program has a hard-coded expiration date. Before you start the NetBalancer service, you need to turn back the system clock before 2016-10-18. See this article for details.

Unionist answered 6/4, 2013 at 0:46 Comment(1)
Thank you!! NetBalancer is the only tool listed on this page that I was able to get to work and that can control latency.Hyetograph
P
4

Found this one for Windows using Fiddler (free solution) http://www.logic-worx.com/index.php/tools-and-apps/fiddler-connection-simulator/

Prairial answered 3/7, 2012 at 14:27 Comment(1)
Fiddler itself has an option: Rules -> Performance -> Simulate Modem Speeds, if you don't want to use a separate plugin.Edwyna
P
4

I guess tc could do the job on UNIX based platform.

tc is used to configure Traffic Control in the Linux kernel
http://lartc.org/manpages/tc.txt

Piper answered 22/5, 2016 at 11:18 Comment(0)
O
3

To simulate a low bandwidth connection for testing web sites use Google Chrome, you can go to the Network Tab in F12 Tools and select a bandwidth level to simulate or create custom bandwidth to simulate.

Odeen answered 9/6, 2016 at 10:18 Comment(1)
Thanks! If you can't find it, it's in the Chrome console, Network tab, at the right side of "Disable cache" button. It's default value is "No throttling".Cult
D
1

If you're on linux, I find the Traffic Control program to be a great help for this sort of thing.

Doelling answered 1/10, 2009 at 19:58 Comment(0)
K
1

There is a product from http://www.shunra.com called VE Desktop which can be used to simulate varying network conditions. It allows you to tweak latencies, bandwidth and packetloss with a simple UI. Only caveat is, its not free. Hope this helps.

Kokand answered 7/10, 2010 at 14:17 Comment(0)
C
1

I've been looking for an easy to use tool for this type of testing for a while now. I just came across this the other day: Network Delay Simulator

If you're running Windows, you should check it out. It was super easy to set up and get going, and seems to work really well. It allows you to define bandwidth, latency, and packet loss in each direction. The other really nice thing is that you can define "Flow Match Conditions" so that it only affects the traffic you want it to. Oh yeah, and it's free.

Cordell answered 20/5, 2011 at 16:44 Comment(1)
Link does not work.Rhiannonrhianon
C
1

i think i found what i need. maybe you can use charles proxy or slowy. hope it helps.

Conciliator answered 31/3, 2013 at 23:9 Comment(0)
P
1

Take a look at the NE-ONE Network Emulator which allows you to configure bandwidth, latency, packet loss, packet reordering, packet duplication, packet fragmentation, network congestion and many more impairments so that you can create real-world network conditions in the lab. Different impairments can be configured for the up and downlink so you could have a really good uplink but a really bad downlink experience, great for seeing how the app handles TCP queuing because the acks don't come back in a timely manner and the overall latency therefore increases!

There's an overview video here http://www.youtube.com/watch?v=DwtqlE7LcrQ specifically aimed at game developers, but it shows what it's about. NE-ONE is configured using a web browser so it's really easy to get installed and configured - you don't need to be a network guru :-)

There's a hardware version - http://www.itrinegy.com/index.php/products/network-emulators/ne-one - or you can download a Virtual Appliance (software) version that runs under VMware ESXi Server. The Virtual Appliance can be download from VMware's Solution Exchange - solutionexchange.vmware.com/store/products/ne-one-flex-network-emulator

Personal answered 18/3, 2016 at 12:27 Comment(0)
S
0

LANforge ICE is a network emulator with an emphasis on virtual routing, jitter, corruption and delay. Projects have used it to emulate satellite link, cable and modem connections, and high-speed (10Gbit) wan emulation. You can use a Java GUI to build your virtual networks and generate very detailed reports of the traffic flow. The LANforge products also provide traffic generation features: frame, ethernet, layer-3 and stateful traffic (NFS, http). Recent editions for LANforge have sophisticated WiFi testing features as well.

Scarabaeus answered 15/8, 2016 at 22:30 Comment(0)
T
0

You can try this: CovenantSQL/GNTE just write YAML like this:

group:
  - 
    name: china
    nodes:
      - 
        ip: 10.250.1.2
        cmd: "cd /scripts && ./YourBin args"
      - 
        ip: 10.250.1.3
        cmd: "cd /scripts && ./YourBin args"
    delay: "100ms 10ms 30%"
    loss: "1% 10%"
  - 
    name: us
    nodes:
      - 
        ip: 10.250.2.2
        cmd: "cd /scripts && ./YourBin args"
      - 
        ip: 10.250.2.3
        cmd: "cd /scripts && ./YourBin args"
    delay: "1000ms 10ms 30%"
    loss: "1% 10%"

network:
  -
    groups:
      - china
      - us
    delay: "200ms 10ms 1%"
    corrupt: "0.2%"
    rate: "10mbit"

run ./generate scripts/your.yaml

Televisor answered 4/8, 2018 at 10:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.