我想限制带宽并为网络接口添加延迟以模拟卫星通信。例如 800ms 延迟和 1mb/s。
以下正确限制了带宽,但不会增加延迟:
17:16:51 root@Panasonic_FZ-55 ~ # tc qdisc add dev eth0 root tbf rate 1024kbit latency 800ms burst 1540
17:18:48 root@Panasonic_FZ-55 ~ # ping 10.10.91.58
PING 10.10.91.58 (10.10.91.58): 56 data bytes
64 bytes from 10.10.91.58: seq=0 ttl=64 time=0.938 ms
64 bytes from 10.10.91.58: seq=1 ttl=64 time=3.258 ms
64 bytes from 10.10.91.58: seq=2 ttl=64 time=1.259 ms
64 bytes from 10.10.91.58: seq=3 ttl=64 time=1.407 ms
^C
--- 10.10.91.58 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.938/1.715/3.258 ms
17:18:56 root@Panasonic_FZ-55 ~ # iperf -c 10.10.91.58
------------------------------------------------------------
Client connecting to 10.10.91.58, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.10.91.57 port 34790 connected with 10.10.91.58 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.5 sec 1.38 MBytes 1.09 Mbits/sec
17:19:19 root@Panasonic_FZ-55 ~ #
我从这个网站得到了我的信息。
也许是 netem 模拟器: