我需要模拟到服务器的低带宽、高延迟连接,以模拟远程站点上VPN的条件。带宽和延迟应该是可调整的,这样我就可以发现最好的组合来运行我们的软件包。


当前回答

我会尝试在linux上使用netem。有了它,你可以模拟额外的延迟、损坏、丢包和复制。它甚至可以用在环回设备上。

其他回答

有一篇很棒的关于如何设置一台FreeBSD机器的文章——使用你的标准旧桌面,加上一个额外的网卡,然后构建。

文章可以在http://www.freebsd.org/doc/en/articles/filtering-bridges/article.html上找到。

在上述指令的第5步中,您启用了防火墙。为了模拟不同的IP连接,你可以(例如)执行以下操作:

创建文件“/etc/rc.firewall”。56k,包含以下内容:

ipfw add pipe 1 ip from any to any out
ipfw add pipe 2 ip from any to any in    
ipfw pipe 1 config bw 56Kbit/s   
ipfw pipe 2 config bw 56Kbit/s

修改/etc/rc.conf…更换线路

firewall_type="open"

firewall_type="/etc/rc.firewall.56k"

重新启动,你就有了一个56K的桥!

如果你碰巧在Macintosh上工作,该操作系统默认内置了ipfw。我做了同样的事情,通过机场和以太网路由网络流量,设置它,以便任何经过机场的东西都具有与我试图模拟的东西相同的特征。可以直接在终端上调用ipfw命令,效果相同。

另一个客户端程序(仅限Windows)是NetLimiter - http://www.netlimiter.com

您可以试试这个:CovenantSQL/GNTE 就像这样写YAML:

group:
  - 
    name: china
    nodes:
      - 
        ip: 10.250.1.2
        cmd: "cd /scripts && ./YourBin args"
      - 
        ip: 10.250.1.3
        cmd: "cd /scripts && ./YourBin args"
    delay: "100ms 10ms 30%"
    loss: "1% 10%"
  - 
    name: us
    nodes:
      - 
        ip: 10.250.2.2
        cmd: "cd /scripts && ./YourBin args"
      - 
        ip: 10.250.2.3
        cmd: "cd /scripts && ./YourBin args"
    delay: "1000ms 10ms 30%"
    loss: "1% 10%"

network:
  -
    groups:
      - china
      - us
    delay: "200ms 10ms 1%"
    corrupt: "0.2%"
    rate: "10mbit"

运行。/generate scripts/your.yaml

LANforge ICE is a network emulator with an emphasis on virtual routing, jitter, corruption and delay. Projects have used it to emulate satellite link, cable and modem connections, and high-speed (10Gbit) wan emulation. You can use a Java GUI to build your virtual networks and generate very detailed reports of the traffic flow. The LANforge products also provide traffic generation features: frame, ethernet, layer-3 and stateful traffic (NFS, http). Recent editions for LANforge have sophisticated WiFi testing features as well.

为了模拟一个低带宽连接测试网站使用谷歌Chrome浏览器,你可以去网络选项卡在F12工具和选择一个带宽级别来模拟或创建自定义带宽来模拟。