模拟 WAN 网络的最佳方法

发布于 2024-07-06 12:22:56 字数 650 浏览 13 评论 0原文

简而言之,我有一个应用程序,其中数据旨在通过互联网在两台服务器之间流动。 理想情况下,我想测试软件在什么时候停止运行。 在什么下限(带宽、延迟、丢包)下,测试软件的可靠性就会停止工作。

我认为我会做如下:

  1. 设置 3 台计算机(VMware 实例)
  2. 在其中两台服务器上安装 2 个应用程序。
  3. 通过在 Windows 2003 上使用路由和远程访问进行某种魔法,将第三台服务器设置在两台计算机之间 安装
  4. Traffic Shaper XPNetLimiter 限制带宽
  5. 运行类似 TMnetSim Network Simulator 来模拟不良连接。

这听起来是个好主意还是有更简单/更好的方法来做到这一点? 我对 Linux 不太熟悉,我的队友更不习惯。

Simplified, I have an application where data is intended to flow over the internet between two servers. Ideally, I'd like to test at what point the software ceases to function. At what lowerbound limit (bandwidth, latency, dropped packets) do things stop working to test the reliability of the software.

What I thought I would do was the following:

  1. Setup up 3 machines (VMware instances)
  2. Install the 2 applications on two of the servers.
  3. Setup up the 3rd server to sit between the two machines by doing some sort of magic with Routing and Remote Access on Windows 2003
  4. Install either Traffic Shaper XP or NetLimiter to limit the bandwidth
  5. Run something like TMnetSim Network Simulator to simulate a bad connection.

Does this sound like a good idea or are there easier/better ways of doing this? I'm not that comfortable on Linux and my team mates are even less so.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

谜泪 2024-07-13 12:22:56

WANem 正是这样做的。 我们在桌面虚拟机和专用旧电脑上都使用了它,效果非常好。 它可以模拟各种断开的连接。

WANem does exactly this. We have used it both in a virtual machine on the desktop and on a dedicated old pc and it worked great. It can simulate all sorts of broken connectivity.

極樂鬼 2024-07-13 12:22:56

FreeBSD 的 ipfw 可以模拟给定带宽、延迟或错误率的链路。 您可以使用该 FreeBSD 机器作为上述设置中“中间”的机器。

如果您想减少所涉及的服务器数量,您可能还可以在同一台计算机上运行至少一个端点。

FreeBSDs ipfw has provisions to simulate links with a given bandwith, latency or error rate. You could use that FreeBSD machine as your machine "in the middle" in your above setup.

You probably can also run at least one of the endpoints on the same machine if you want to reduce the amount of servers involved.

断肠人 2024-07-13 12:22:56

有人实际上打包了 FreeBSD 解决此问题所需的设置和内容,他们称之为 虚拟网

它模拟/强制执行队列和带宽限制、延迟、数据包丢失和多路径效应。 它还实现了加权公平队列的一种变体,称为 WF2Q+。 它可以在用户的​​工作站上使用,也可以在充当路由器或网桥的 FreeBSD 计算机上使用。

它可以准确地模拟您想要的内容,并且它是免费的,并且可以启动到商用硬件上。 他们甚至有一个罐装安装,它足够小,可以放在软盘上(!),您可以在该链接上下载。

Someone actually packaged up the settings and whatnot necessary for the FreeBSD solution to this problem and they call it DUMMYNET.

It simulates/enforces queue and bandwidth limitations, delays, packet losses, and multipath effects. It also implements a variant of Weighted Fair Queueing called WF2Q+. It can be used on user's workstations, or on FreeBSD machines acting as routers or bridges.

It can simulate exactly what you want, and its free and will boot onto commodity hardware. They even have a canned install of it that is small enough to put on a floppy disk (!) that you can download at that link.

浮云落日 2024-07-13 12:22:56

也许是时候了解一下 Linux 了,因为只需键入一行即可在每个传出数据包上添加 50 毫秒的延迟:

tc qdisc add dev eth0 root netem delay 50ms

有关更多信息,请参阅 Linux 流量控制指南

Maybe it is time to learn a bit about Linux because adding a 50ms delay on every outgoing packet can be done in typing just one line:

tc qdisc add dev eth0 root netem delay 50ms

For more see the Linux Traffic Control HOWTO

夕嗳→ 2024-07-13 12:22:56

大约十年前我们有类似的要求 - 我看看我是否能回忆起我们是如何做到的。

如果我记得的话,我们编写了一个套接字代理程序,该程序由 UNIX 机器上的 inetd 控制。 该套接字将接受来自客户端的连接并打开到服务器的等效会话。 然后它会循环,在两个方向上传递消息。

我们实现 WAN 特性的方法是在连接建立和链路建立后的数据传递中引入随机延迟(有上限和下限)。

它还具有偶尔断开链接的功能,因为 WAN 链接对我们而言不如本地流量可靠。

我记得我们必须使其线程化,以阻止延迟影响链路上的反向流量。

We had a similar requirement some ten years ago - I'll see if I can recall how we managed it.

If I remember, we wrote a socket proxy program which was controlled by inetd on a UNIX box. This socket would accept connections from a client and open equivalent sessions through to the server. It would then loop, passing messages in both directions.

The way we achieved WAN characteristics was to introduce random delays (with upper and lower limits) in both the connection establishment and the passing of data once the link was up.

It also had the feature to drop the link occasionally as WAN links were less reliable for us than local traffic.

I recall we had to make it threaded to stop the delays from affecting reverse traffic on the link.

小ぇ时光︴ 2024-07-13 12:22:56

有一个非常好的(而且免费的)微软解决方案,我们使用它相当长一段时间并且效果很好,它可以很容易地模拟一切(数据包丢失、低带宽、断开连接、延迟......)
这是我在 Windows 环境中找到的最佳解决方案

更多信息和下载链接可以在此处找到:MARCO 博客文章

该产品已经发生了一些演变,现在作为自动化测试的一部分集成到 Visual Studio 中,但我发现独立的使用(很难找到,因此保留本地副本)以更好地工作。 请记住,您至少需要两台计算机(或虚拟机),因为您需要通过网络适配器才能使应用程序发挥其魔力。

There is a very good (and free) Microsoft solution for that, we use it for quite some time and it works great, it can very easily simulate every thing(packet loss, low bandwidth, disconnection, latency....)
This is the best solution i found for a windows environment

More information and a download link can be found here: MARCO blog post

this product has gone some evolution and it is now integrated into visual studio as part of the automation testing, but i found the use of the standalone(that is quite hard to find, so keep a local copy) to work much better. keep in mind that you need at least two computers(or VMs) since you need to pass through a network adapter in order for the application to work its magic.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文