你复习了吗
Simulate delayed and dropped packets on Linux
? 看起来它获得了大量选票,并涵盖了您关于使用模拟数据包丢失的问题
netem
.
Packet loss
Random packet loss is specified in the 'tc' command in percent. The smallest possible non-zero value is:
2â32 = 0.0000000232%
# tc qdisc change dev eth0 root netem loss 0.1%
This causes 1/10th of a percent (i.e. 1 out of 1000) packets to be randomly dropped.
An optional correlation may also be added. This causes the random number generator to be less random and can be used to emulate packet burst losses.
# tc qdisc change dev eth0 root netem loss 0.3% 25%
This will cause 0.3% of packets to be lost, and each successive probability depends by a quarter on the last one.
Probn = 0.25 Ã Probn-1 + 0.75 Ã Random
希望这能帮助并提供更好的方法来处理这个问题!