简体   繁体   中英

C# console app won't send UDP multicast packet on Windows Server 2003

I can't seem to get my little test app to send a UDP multicast packet on a particular machine running Windows Server 2003. I have it setup to send a packet to Google's public DNS and another to 239.192.250.250. It runs fine without throwing any errors. But in the Wireshark output, only the Google packet shows up. Any ideas?

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();
}

And here's the Wireshark output:

No.  Time        Source      Destination      Protocol  Length  Info
205  1.83925300  **********  8.8.8.8          UDP       53      Source port: 62432  Destination port: http

On every other machine I've tested including a Windows 2008 R2 server, I get something to the effect of:

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

If you are on a Network switch , they only routes the packet to the connection of the destination machine. Whereas an unswitched hub broadcast packets to all ports.

Wireshark does packet sniffing therefore it cannot see all packets on a switched router.

Here is excerpt from Switch Reference @ Wireshark :

As noted in the Wireshark FAQ , capturing in a switched network environment can prove to be challenging. An individual switch port will receive broadcast, multicast, and unicast traffic destined for that particular port. In most cases it won't receive unicast traffic for other ports, which is what you're probably trying to capture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM