【发布时间】:2013-12-29 19:52:02
【问题描述】:
我似乎无法让我的小测试应用程序在运行 Windows Server 2003 的特定机器上发送 UDP 多播数据包。我已将其设置为向 Google 的公共 DNS 发送一个数据包,并将另一个数据包发送到 239.192.250.250。它运行良好,没有抛出任何错误。但在 Wireshark 输出中,只显示了 Google 数据包。有什么想法吗?
static void Main(string[] args)
{
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
var data = ASCIIEncoding.UTF8.GetBytes("hello world");
socket.SendTo(data, new IPEndPoint(IPAddress.Parse("8.8.8.8"), 80));
socket.SendTo(data, new IPEndPoint(IPAddress.Parse("239.192.250.250"), 80));
Console.ReadKey();
}
这是 Wireshark 的输出:
No. Time Source Destination Protocol Length Info
205 1.83925300 ********** 8.8.8.8 UDP 53 Source port: 62432 Destination port: http
在我测试过的所有其他机器上,包括 Windows 2008 R2 服务器,我得到的结果是:
No. Time Source Destination Protocol Length Info
58 4.52926800 ********** 8.8.8.8 UDP 53 Source port: 56530 Destination port: http
60 4.52940400 ********** 239.192.250.250 UDP 53 Source port: 56530 Destination port: http
【问题讨论】:
-
Windows 2003 和 2008 服务器是否连接到相同类型的路由器?因为如果你使用的是交换机路由器,wire Shark 无法看到来自另一台机器的所有数据包。
-
Windows 2003 和 2008 服务器实际上位于完全不同的网络上。 2008 年是 Rackspace 云服务器,2003 年是客户的内部服务器。我提出它是因为我想驳斥它可能是一般 Windows Server 的限制的想法。该测试也在同一客户端网络中的 Window 7 机器上完成,并且运行良好。据我所知,我只是在他的服务器上遇到了问题。
-
当我发布wireshark 流量时,我以为我看到的是传出流量。假设是这种情况,路由器是否有可能干扰? Wireshark 不会位于路由器和网络接口之间吗?不管网络设置如何,我仍然认为我应该看到到两个 IP 地址的传出流量。
-
所以我只是尝试将数据发送到一个随机 IP 地址,但它并没有像我想象的那样出现在 Wireshark 中。我现在猜想我对网络的了解还不够。流量是否仅在实际发送到某个地方时才会显示?
标签: c# sockets networking windows-server-2003 multicast