1

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 172.1.48.3. It has three IP addresses configured in Properties -> Ip 4 Properties -> Advanced, all on different subnets 172.1.48.3, 172.1.88.3 and 172.1.104.3. (Subnet mask is 255.255.255.0 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: 172.1.48.255, 172.1.88.255 and 172.1.104.255.

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

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 172.1.48.3 socket would be receiving messages broadcast to a different subnet 172.1.104.255?

2

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.

2
  • 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
1

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.