Change network conditions over time
A fixed 10 percent loss is a lab condition. Real connections get worse, recover, stall for four seconds and come back - and the bug you are chasing usually lives in the change, not in the steady state.
A scenario is a timeline
One JSON file. Each step says at this second, these settings, and anything you do not mention keeps its value:
{
"loop": true,
"steps": [
{"at": 0, "settings": {"latency": 20, "jitter": 15, "down": 4096}},
{"at": 20, "settings": {"loss": 8, "latency": 180}},
{"at": 45, "settings": {"block_ip": "203.0.113.0/24"}},
{"at": 65, "settings": {"block_ip": "", "loss": 0, "latency": 20}}
]
}
Times are seconds from the start of the run, not gaps between steps. With
"loop": true the timeline starts over when it ends, which is what you want for a long
soak: leave it running and use the app.
BeanNetworkTester.exe --scenario cafe-wifi.json --target myapp.exe
Seven of them ship with the program
In the scenarios folder next to the executable. Read from those files, so this is
what you actually have:
| File | Steps | Length | Repeats |
|---|---|---|---|
blocked-endpoint.json | 4 | 65 s | yes |
cafe-wifi.json | 5 | 85 s | yes |
congested-vpn.json | 4 | 70 s | yes |
failing-dns.json | 6 | 85 s | yes |
mobile-lte-to-3g.json | 7 | 85 s | yes |
overloaded-game-server.json | 5 | 72 s | yes |
upload-drop-midway.json | 7 | 75 s | no |
They are ordinary text - open one, change a number, save. The names say what they reproduce: a crowded cafe, a mobile connection dropping from LTE to 3G, an upload that dies half way, a server that gets overloaded, DNS that stops answering.
Two simpler ways to get change
A scenario is worth writing when the sequence matters. When it does not, two settings vary on their own:
- Link on and off - a cycle length and how much of it is downtime. Ten second cycles, four seconds down, forever.
- A speed schedule - a series of speeds the limit walks through, so the connection degrades and recovers without a file.
BeanNetworkTester.exe --flap-period 10 --flap-down 40 --target myapp.exe
Why it works while the app is running
Every setting a scenario touches is applied live, to the session already in progress - the app does not need restarting and neither does the tool. The event log records each step as it happens, so when something breaks you can see which change it followed. Pair that with a seed and the whole sequence, including the random loss inside it, repeats exactly.