DEV Community

Cover image for How to Simulate a Bad Internet Connection on Windows: Test Latency, Packet Loss & Jitter
DonislawDev
DonislawDev

Posted on

How to Simulate a Bad Internet Connection on Windows: Test Latency, Packet Loss & Jitter

Hello, if you want to test your Windows app in poor network conditions, you can use "Bean Network Tester." All things from this post can be done from the GUI or CLI, the tool is open source, 100% free for commercial use.

1. Instalation.

You can get the .msi or .zip from GitHub (please give it a star)

Or install it from package managears:

winget install -e --id DonislawDev.BeanNetworkTester

choco install bean-network-tester

*To use the app, you will need admin rights

2. How to Simulate LTE/3G network or crowded WiFI + more

By design Bean Network Tester will target "ALL NETWORK TRAFFIC", so be sure to set a specific target. The fastest setup is:

  1. Select the "Profile" that you wish to use
  2. Write "Target process"
  3. Click the "Start" Button

This way you can easily test your app in few clicks, each profile comes with own stats like: "Loss, Losses in a row (burst), Latency, Jitter Download,Upload limit" and more.
 You can see the full list of profile stats and CLI parameters here

Tip:You can also target by IP or ports:

3.More "advanced" use

The app comes with premade profiles, but you can create your own profiles or settings files, you can experiemnt with with tons of things, let's say you want to check how the app will behave during TCP_Sync drop or TCP_reset:

This way you can customize the app for your own testing and share the profiles with your team

4. Scenarios system

At the bottom of the app, you can see the "scenarios":


there are few premade scenarios (click "Load Scenario...")


They are just .json files that you can add or edit:
"{
"loop": true,
"steps": [
{ "at": 0, "settings": { "filter": "udp", "dst_port": "53", "latency": 10, "jitter": 5 } },
{ "at": 15, "settings": { "loss": 25, "latency": 200, "jitter": 200 } },
{ "at": 35, "settings": { "loss": 60, "latency": 750, "jitter": 500 } },
{ "at": 55, "settings": { "loss": 100 } },
{ "at": 68, "settings": { "loss": 10, "latency": 100, "jitter": 80 } },
{ "at": 85, "settings": { "loss": 0, "latency": 10, "jitter": 5 } }
]
}

"
You can also create your own scenarios, let's say at 90 second, we would like to reset_tcp, we could just add:
"{ "at": 90, "action": "reset_tcp" },"

5. END

The tool is a lot more advanced, You can see all network options here, but that's not all, because the app comes with a few useful things. There is a "connections" tab in which you can see download/upload stats, packets, and connections.

And there is a "tools" tab in which you can check which ports are being used + active connections without running the packet capture:

In this post, I didn't get into the technical details of burst, tcp/udp or WinDivert which is used in Bean Network Tester, it's mostly a quick start, but if you want to use the app in more "advanced" cases, then it's always an good thing to know a few things about networking.

*I'm the author of the tool

Top comments (0)