当前位置: 移动技术网 > 科技>操作系统>Linux > 使用 linux 模拟广域网延迟 - Emulating wide area network delays with Linux

使用 linux 模拟广域网延迟 - Emulating wide area network delays with Linux

2019年08月09日  | 移动技术网科技  | 我要评论

netem (already enabled in the linux kernel) provides network emulation functionality for testing protocols by emulating the properties of wide area networks. 

to simulate an additional latency of 80 ms, just type sudo tc qdisc add dev eth0 root netem delay 80ms 
it just adds a fixed amount of delay to all packets going out of the local ethernet. 

to stop the additional latency, just type sudo tc qdisc change dev eth0 root netem delay 0ms 

lines to add to the file /etc/rc.local before exit 0, to add 40ms of latency :

# add +40ms latency tc qdisc add dev eth0 root netem delay 40ms

note: if your network interface is not eth0, replace eth0 with the name of your network interface

 

在调研 iperf 的时候,偶然看到。对项目很有帮助,原文链接:https://iperf.fr/iperf-servers.php#netem

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网