C# 中的测量网络性能工具
我即将开发一个网络测量工具。目标是制作一个工具,可以测量客户端和服务器计算机(从客户端)之间的响应时间。它是主应用程序的副应用程序 - 如果主应用程序遇到服务器的响应时间高于特定阈值,该工具将被激活,并执行网络连接测试,以确定客户端服务器连接是否稳定(由于网络是无线等,它可能不稳定。)
我需要执行的测试不仅仅是 ping 操作,还包括传输不同大小的包。
然而,我在通信技术方面的经验很少。
ICMP 协议是正确的选择吗?如果是,是否可以发送不同大小的包(以测量网络是否能够在合理的时间内传输例如 2 MB 的数据)?
我还有第二个担忧。关于防火墙我应该注意什么?如果开发一个在我的本地网络上运行良好的应用程序,但一旦在现实生活中使用,它就会因为测试被防火墙阻止而惨败,这将是一种耻辱。
我希望我的问题不会太幼稚,但我会非常感谢您的帮助。
祝一切顺利
/萨吉
I am about to develop a Network measurement tool. The objective is to make a tool, which can measure the responsetime in between a client and a server machine (from the client side). It is s side-application to a main application - If the main applicaiton experiences that the responsetime from the server is above a certain threshold, the tool will be kicked alive, and performs network connectivity tests, to determine of the client server connection is stable (it might be unstable, due to the network being wireless etc.)
The tests I need to perform are not just ping operations, but also transmitting packages of different size.
I have however very little experience in communications technology.
Is ICMP protocol the way to go? and if yes, is it possible to send packages of differnet sizes (to measure if the network is able to transfer eg. 2 MB of data in a reasonable time)?
I have a second concern. What should I look out for in regards to firewalls? It would be a shame to develop an application which works fine on my local network, but as soon as it is used out in the real life, it fails misserably because the tests are blocked by a firewall.
I hope my questions aren't too noobish, but know that any help is much appreciated.
All the best
/Sagi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了避开防火墙,您应该使用您使用的相同协议和端口进行测试,并在应用程序内部创建一种新类型的消息,该消息应在服务器读取后立即响应:您应该对 ping 进行编程措施。
然后客户端将测量旅行所花费的时间并计算您的 ping 并将其转发回您的服务器。当某些 ISP 为 ICMP 协议数据包提供比其 QoS 服务器上的其他数据包更大的优势时,这也可以提供更好的阅读效果,从而人为地创建(伪造)较低的延迟。而且,您不必担心防火墙不允许您的 ICMP 数据包,因为必须允许您连接到您使用的标准端口。
此外,大多数游戏(《半条命》、《帝国时代》等)都以这种方式工作,而不是通过发送标准 Ping 数据包。
To keep clear of firewalls, you should do a test using the same protocol and port you use, and create inside of your application a new type of message that should be responded as soon as it is read by the server: You should program your ping measures.
Then the client would measure the times spent in travel traveled and compute your ping and relay it back to your server. This also gives a better reading when in case of some ISPs that give a ICMP protocol packets a huge advantage over other packages on their QoS server, artificially creating(faking) lower latency. And also, you would not have to worry about the firewall not allowing your ICMP packets, because you would have to be allowed to conect on the standart port you use.
Also, most games work this way (Half-Life, Age Of Empires etc.) , and not by sending standard Ping packets.