0

Let's say I have three different hosts connected by a Layer 2 Switch:

A) IP 1.0.0.1, Subnet 255.255.255.0,

B) IP 1.0.0.2, Subnet 255.255.0.0,

C) IP 1.0.1.1, Subnet 255.255.255.0,

Who would a broadcast message (like an arp request) from each machine reach? I know that if the arp tables were pre-generated, you could send non-broadcast packets directly from A-> B, B->A, and B->C , while A->C, C->A, and C->B would be send to the default gateway and fail.

I know that connecting subnets like this is non-ideal, I was just wondering how communications work when it's done accidentally.

As a second question, let's say that they're now connected by a Layer 3 Switch (A Router?) Am I correct in thinking that a ping from B to C would go from B -> C, and the response would go from C -> R -> B?

2

Who would a broadcast message (like an arp request) from each machine reach?

Ethernet broadcasts from any host will reach any host connected to the same switch/VLAN. IP broadcasts will not reach any of those hosts, because each host has its own broadcast IP address.

a ping from B to C would go from B -> C, and the response would go from C -> R -> B?

Yes, if we have static ARP entries for all the hosts, that will be true.

  • Not with the default split horizon enabled on a router, which says a router will not route a packet to the same network from which is was received. – Ron Maupin May 23 '17 at 16:15
  • So you're saying that a host only listens to an IP broadcast sent to the same place the host would send it? And since their IP broadcast addresses are 1.0.0.255, 1.0.255.255, and 1.0.1.255, nobody will hear the broadcasts from another? If D were IP 1.0.128.1 /17, its broadcast would be 1.0.255.255, and it would be able to send/receive IP broadcast to/from B? And B could send to D in Layer 2, but D couldn't send directly to B without Layer 3? – Ian Riley May 23 '17 at 16:30
  • Yes, any protocol based on IP will not work. But please note that ARP is not IP-based protocol. – Andriy Berestovskyy May 23 '17 at 16:36
  • I realized that from your initial response- I realize now that what I was asking about was IP Broadcast, like a UDP Broadcast packet, not Ethernet Broadcast, like an arp request packet – Ian Riley May 23 '17 at 16:38
  • Yes, IP broadcasts addresses will be different, so TCP/IP stack must drop them. ARPs will definitely reach all hosts in the same broadcast domain, but some hosts might not respond to ARPs from another network. – Andriy Berestovskyy May 23 '17 at 16:51
0

Switch is a layer 2 device. IP addresses or subnet masks are above masks are above the switch's pay grade:p

So in between these hosts if you connected a switch, the broadcast messages will be sent to all interfaces unless you have configured additional VLANs.

If we have a router is connected between these hosts, there is no broadcasts in IP as such and it is completely normal for router to have different interfaces in different subnets.

If it has a route for these hosts, the communication can take place.

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.