Simulace výpadků sítě

https://man7.org/linux/man-pages/man8/tc-netem.8.html

Funguje jen pro odchozi ramce (egress fronta)

#delay tc qdisc add dev lo root netem delay 500ms tc qdisc change dev lo root netem delay 1s #loss of 50% of segments with a correlation of 25% tc qdisc add dev lo root netem loss 50% 25% #segment corruption with 50% probability with no correlation: tc qdisc change dev lo root netem corrupt 50% tc qdisc change dev lo root netem duplicate 50% 25% tc qdisc change dev lo root netem delay 10ms reorder 25% 50% tc qdisc change dev lo root netem delay 10ms reorder 25% 50% gap 5 tc qdisc change dev lo root netem rate 56kbit #show current config tc qdisc #remove config from interface tc qdisc del dev lo root netem

http://linux-ip.net/gl/tc-filters/tc-filters-node3.html

Pro pouziti na prichozi ramce (ingress) je potreba vytvorit pomoci modulu ifb virtualni sitovku, jejiz egress fronta se pouzije na ingresu te nasi. modulu je mozno zadat parametr, ktery specifikuje, kolik virtualnich sitovek se ma vytvorit.

modprobe ifb ip link set ifb0 up tc qdisc add dev ifb0 root netem delay 500ms #here you can put whatever netem configuration you need at ingress tc qdisc add dev wlan0 handle ffff: ingress tc filter add dev wlan0 parent ffff: u32 match u32 0 0 action mirred egress redirect dev ifb0