Re: Simulating (emulating?) bad network conditions

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, we have used tc netem to successfully make a connection bad. 

-- 
  Jehan Tremback
  jehan@xxxxxxxxxx

On Sat, May 23, 2020, at 1:22 PM, Erik Auerswald wrote:
> 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 DROP
> 
> Alternatively, 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.01
> 
> To reset:
> 
>     $ tc qdisc del dev eth0 root netem
> """
>                 -- https://github.com/tylertreat/Comcast#linux
> 
> I 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
>



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux