This is simple wrapper around tc utility to test different network conditions in more realistic way than simple bandwidth trottling. Not limiting to Chrome browser and with more complex traffic shapes.
It simulates non-constant latency, bandwidth restrictions, and dropped/reordered/corrupted packets. Potentially you could add any traffic shapes by adding your preset to the script, by default it contains 7 presets:
| Preset | Latency | Bandwidth | Packet-loss |
|---|---|---|---|
gprs |
500 | 50 | 2 |
edge |
300 | 250 | 1.5 |
3g |
250 | 750 | 1.5 |
dial-up |
185 | 40 | 2 |
dsl |
70 | 2000 | 2 |
wifi |
40 | 30000 | 0.2 |
loss (only packet-loss) |
- | - | 2 |
Ensure that you have kernel-modules-extra installed.
- Copy this script and make it executable
chmod u+x - From the root user run
net-emulation.sh 3g - After your done run
net-emulation.sh resetto reset network to default condition
By default ethernet interface is used, but you could change it to any other, for example, wifi by changing NET_INTERFACE value to wlp3s0.
net-emulation.sh gprs|edge|3g|dial-up|dsl|wifi|loss|resetTo reset emulation run net-emulation.sh reset.
To check active discipline use tc -s qdisc directly.
For more info see docs for tc
If you are not on linux-kernel take a look on comcast
See case study how network shape affect different protocols performance by Akamai.