Simulating (emulating?) bad network conditions
Hi,
recently someone asked about a script for simulating or emulating degraded network conditions. I could not provide an answer, because I do not have something like that available, yet.
But I have just read about "Comcast" which seems to do just that:
https://github.com/tylertreat/Comcast
The README.md contains information on how to use iptables and/or tc directly instead of through Comcast as well:
"""
Linux
On Linux, you can use iptables to drop incoming and outgoing packets.
$ iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP
$ iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROPAlternatively, you can use tc which supports some additional options.
$ tc qdisc add dev eth0 root netem delay 50ms 20ms distribution normal
$ tc qdisc change dev eth0 root netem reorder 0.02 duplicate 0.05 corrupt 0.01To reset:
$ tc qdisc del dev eth0 root netem
"""
-- https://github.com/tylertreat/Comcast#linuxI have not tested this, but it seems to provide a starting point for experimentation.
HTH,
Erik
Signature · 3 lines
To a first approximation, we can say that accidents are almost always
the result of incorrect estimates of the likelihood of one or more things.
-- C. Michael Holloway, NASAYes, we have used tc netem to successfully make a connection bad.
Signature · 2 lines
Jehan Tremback [email protected]
Quoted 43 lines · Erik Auerswald
Hi,
recently someone asked about a script for simulating or emulating degraded network conditions. I could not provide an answer, because I do not have something like that available, yet.
But I have just read about "Comcast" which seems to do just that:
https://github.com/tylertreat/ComcastThe README.md contains information on how to use iptables and/or tc directly instead of through Comcast as well:
"""
LinuxOn Linux, you can use iptables to drop incoming and outgoing packets.
$ iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP $ iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROPAlternatively, you can use tc which supports some additional options.
$ tc qdisc add dev eth0 root netem delay 50ms 20ms distribution normal $ tc qdisc change dev eth0 root netem reorder 0.02 duplicate 0.05 corrupt 0.01To reset:
$ tc qdisc del dev eth0 root netem """ -- https://github.com/tylertreat/Comcast#linuxI have not tested this, but it seems to provide a starting point for experimentation.
HTH,
ErikSignature · 3 lines
To a first approximation, we can say that accidents are almost always the result of incorrect estimates of the likelihood of one or more things. -- C. Michael Holloway, NASA
If you want terribad network conditions, you can use cellsim (instructions at http://alfalfa.mit.edu/) which will let you replay actual network condition traces from cellular links (including such awesome properties as intermittent 60+s latency).
--Quentin
Quoted 51 lines · Jehan Tremback
Yes, we have used tc netem to successfully make a connection bad.
--
Jehan Tremback
[email protected]Quoted 43 lines · Erik Auerswald
Hi,
recently someone asked about a script for simulating or emulating degraded network conditions. I could not provide an answer, because I do not have something like that available, yet.
But I have just read about "Comcast" which seems to do just that:
https://github.com/tylertreat/ComcastThe README.md contains information on how to use iptables and/or tc directly instead of through Comcast as well:
"""
LinuxOn Linux, you can use iptables to drop incoming and outgoing packets.
$ iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP $ iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROPAlternatively, you can use tc which supports some additional options.
$ tc qdisc add dev eth0 root netem delay 50ms 20ms distribution normal $ tc qdisc change dev eth0 root netem reorder 0.02 duplicate 0.05 corrupt 0.01To reset:
$ tc qdisc del dev eth0 root netem """ -- https://github.com/tylertreat/Comcast#linuxI have not tested this, but it seems to provide a starting point for experimentation.
HTH,
Erik
--
To a first approximation, we can say that accidents are almost always the result of incorrect estimates of the likelihood of one or more things.
-- C. Michael Holloway, NASA
Thanks all for these comments. (I appreciate the snarkiness of the name "comcast".)
Rich
Quoted 42 lines · Erik Auerswald
Hi,
recently someone asked about a script for simulating or emulating degraded network conditions. I could not provide an answer, because I do not have something like that available, yet.
But I have just read about "Comcast" which seems to do just that:
https://github.com/tylertreat/ComcastThe README.md contains information on how to use iptables and/or tc directly instead of through Comcast as well:
"""
LinuxOn Linux, you can use iptables to drop incoming and outgoing packets.
$ iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP $ iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROPAlternatively, you can use tc which supports some additional options.
$ tc qdisc add dev eth0 root netem delay 50ms 20ms distribution normal $ tc qdisc change dev eth0 root netem reorder 0.02 duplicate 0.05 corrupt 0.01To reset:
$ tc qdisc del dev eth0 root netem """ -- https://github.com/tylertreat/Comcast#linuxI have not tested this, but it seems to provide a starting point for experimentation.
HTH,
ErikSignature · 3 lines
To a first approximation, we can say that accidents are almost always the result of incorrect estimates of the likelihood of one or more things. -- C. Michael Holloway, NASA