Sorry if I'm not using the right language for all this, I'm a software developer not a server/network administrator!

I've got a Windows machine with a single NIC with multiple IP addresses configured. As an example, the NIC address is It has three IP addresses configured in Properties -> Ip 4 Properties -> Advanced, all on different subnets, and (Subnet mask is on all these).

I have a program listening on three UDP sockets with each of these IP addresses.

Three things on the network are broadcasting to each subnet:, and

I can see in wireshark that UDP is coming in from these addresses, so ->, -> etc. However, I'm seeing 'cross contamination' between the sockets. The UDP socket bound to is recieving UDP messages from, and

Either I'm not understanding UDP properly, or something with the networking. I think it's some issue with having these three separate IP addresses on one NIC, because it works fine if each IP has it's own machine (and thus NIC).

Anyone know why a socket would be receiving messages broadcast to a different subnet


Because broadcast traffic is by nature... broadcasted. If you look at the Ethernet Frame portion of the UDP traffic in Wireshark you'll see that the destination MAC address (Layer 2) is FF-FF-FF-FF-FF-FF, which includes all hosts connected to the same physical network segment. All hosts connected to the same physical network segment will receive this traffic and look at the Layer 3 address and determine if they should accept and process the traffic or not. Hosts not in the same Layer 3 destination network will accept the traffic and then discard it... but they will accept it.

  • Thanks. Looks like I need to do more reading on UDP! – Joe Jun 15 '18 at 14:43
  • It's not specific to UDP. TCP traffic behaves the same way. All hosts connected to the same physical network segment receive all broadcast traffic. They then determine if they should "process" the traffic or not. If not, then they simply discard it. – joeqwerty Jun 15 '18 at 15:03

Anyone know why a socket would be receiving messages broadcasts?

Because ... thats how (Layer2) broadcasts work. Every physical NIC in the same L2 broadcast domain will receive the same broadcast packets.

If you want to seperate those, you have to seperate them physically or logically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.