我需要模拟到服务器的低带宽、高延迟连接,以模拟远程站点上VPN的条件。带宽和延迟应该是可调整的,这样我就可以发现最好的组合来运行我们的软件包。
当前回答
查尔斯
我遇到了Charles web调试代理应用程序,并在模拟网络延迟方面取得了巨大的成功。它可以在Windows、Mac和Linux上运行。
Bandwidth throttle / Bandwidth simulator Charles can be used to adjust the bandwidth and latency of your Internet connection. This enables you to simulate modem conditions using your high-speed connection. The bandwidth may be throttled to any arbitrary bytes per second. This enables any connection speed to be simulated. The latency may also be set to any arbitrary number of milliseconds. The latency delay simulates the latency experienced on slower connections, that is the delay between making a request and the request being received at the other end.
虚拟网
您也可以使用vmware来运行BSD或Linux,并尝试本文(DummyNet)或本文。
其他回答
有一篇很棒的关于如何设置一台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命令,效果相同。
在过去,我使用了使用Linux Netem(网络仿真)功能的桥接。它是高度可配置的——允许引入延迟(第一个例子是WAN)、数据包丢失、损坏等。
我注意到Netem在我的应用程序中工作得非常好,但我也多次使用WANem。提供的可引导的ISO(和虚拟设备映像)非常方便。
查尔斯
我遇到了Charles web调试代理应用程序,并在模拟网络延迟方面取得了巨大的成功。它可以在Windows、Mac和Linux上运行。
Bandwidth throttle / Bandwidth simulator Charles can be used to adjust the bandwidth and latency of your Internet connection. This enables you to simulate modem conditions using your high-speed connection. The bandwidth may be throttled to any arbitrary bytes per second. This enables any connection speed to be simulated. The latency may also be set to any arbitrary number of milliseconds. The latency delay simulates the latency experienced on slower connections, that is the delay between making a request and the request being received at the other end.
虚拟网
您也可以使用vmware来运行BSD或Linux,并尝试本文(DummyNet)或本文。
对于Windows,您可以使用这个应用程序:http://www.softperfect.com/products/connectionemulator/
广域网连接模拟器的Windows 2000, XP, 2003, Vista, 7和2008。
也许这是唯一一个Windows版本。
我发现这个简洁的Windows程序叫笨笨。它还处于alpha阶段,但对我来说工作得很好,而且它是开源的。
编辑:其他人已经注意到你不能用笨拙来限制带宽,这是真的。您只能添加延迟和其他一些与网络相关的错误。 这将取消这个答案作为问题的有效答案的资格,但是,由于我想要模拟一个糟糕的网络时,它很有用,所以我将把它留在这里,只要它有> 0票或类似的投票。
推荐文章
- 如何模拟低带宽、高延迟的环境?
- 使用Moq验证方法调用
- 尝试模拟datetime.date.today(),但不工作
- 如何用python timeit对代码段进行性能测试?
- 确定bash中是否存在一个函数
- 如何使用“测试”包打印Go测试?
- 如何在IntelliJ中为整个项目配置“缩短命令行”方法
- toBe(true) vs toBeTruthy() vs toBeTrue()
- 什么时候应该使用Debug.Assert()?
- 从控制台停止一个Android应用程序
- 使Android模拟器运行得更快
- 如何“去测试”我的项目中的所有测试?
- 测试HTML电子邮件渲染
- 测试过程。环境与玩笑
- Rspec:“数组。应该== another_array"而不考虑顺序