模拟多个IP地址进行测试 [英] Simulate multiple IP addresses for testing

查看:884
本文介绍了模拟多个IP地址进行测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要模拟通常用于电机控制的多个嵌入式服务器设备。在现实生活中,网络上可能有多个服务器,而我们的桌面软件同时充当所有电机服务器的客户端。我们手头上有六种这样的电机控制服务器用于基本测试,但是使用真实的硬件测试更大的系统将变得昂贵。我想构建一个可以看起来像网络上许多服务器的模拟器来测试我们的客户端软件。

I need to simulate multiple embedded server devices that are typically used for motor control. In real life, there can be multiple servers on the network and our desktop software acts as a client to all the motor servers simultaneously. We have a half-dozen of these motor control servers on hand for basic testing, but it's getting expensive to test bigger systems with the real hardware. I'd like to build a simulator that can look like many servers on the network to test our client software.

如何构建一个看起来像它的模拟器同一端口上有许多IP地址,而实际上没有许多NIC。例如,客户端软件将尝试在端口1111上连接到服务器192.168.10.1至192.168.10.50。模拟器将接受所有这些连接,并像运行物理电机一样运行模拟,并通过这些套接字连接发送回模拟数据。

How can I build a simulator that will look like it has many IP addresses on the same port without physically having many NIC's. For example, the client software will try to connect to servers 192.168.10.1 thru 192.168.10.50 on port 1111. The simulator will accept all of those connections and run simulations as if it were moving physical motors and send back simulated data on those socket connections.

我可以使用路由器将所有这些地址映射到单个测试服务器吗,或者理想情况下,是否可以使用本地主机来欺骗这些IP地址?客户端软件是用.Net编写的,但是Python的想法也将受到欢迎。

Can I use a router to map all of those addresses to a single testing server, or ideally, is there a way to use localhost to 'spoof' those IP addresses? The client software is written in .Net, but Python ideas would be welcomed as well.

推荐答案

A。考虑使用Bonjour(zeroconf)进行服务发现

A. consider using Bonjour (zeroconf) for service discovery

B。您可以为同一NIC分配1个或多个IP地址:

B. You can assign 1 or more IP addresses the same NIC:

在XP上,依次单击开始->控制面板->网络连接,然后在NIC上选择属性(通常是本地连接)。

On XP, Start -> Control Panel -> Network Connections and select properties on your NIC (usually 'Local Area Connection').

向下滚动到Internet协议(TCP / IP),选择它并单击[属性]。

Scroll down to Internet Protocol (TCP/IP), select it and click on [Properties].

如果使用DHCP,则需要从IT获取静态的基础IP。
否则,请单击[高级],然后在 IP地址下单击[添加..]
输入要添加的其他IP的IP信息。

If you are using DHCP, you will need to get a static, base IP, from your IT. Otherwise, click on [Advanced] and under 'IP Addresses' click [Add..] Enter the IP information for the additional IP you want to add.

为每个其他IP地址重复。

Repeat for each additional IP address.

C。考虑使用VMWare,因为您可以在一个逻辑的计算机网络中配置多个系统和虚拟IP。

C. Consider using VMWare, as you can configure multiple systems and virtual IPs within a single, logical, network of "computers".

-sky

这篇关于模拟多个IP地址进行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆