6

Host A and B are on the same subnet. A sends ARP request(s) asking for B's MAC. For whatever reason, B doesn't respond. Will A either:

  1. Give up -- it can't reach B
  2. Send the packet to the default gateway, router R, and let it try to route it to B?

Of course, if B was on a different subnet, A would go straight to #2 above. My question is, in a case where they're on the same subnet, but ARP fails, will hosts also try #2.

When does this come up? Two cases:

  1. A is really on a different subnet than B, but the subnet masks are misconfigured.

  2. A and B are on the same subnet, but both in protected ports (a private VLAN), and so can't directly communicate to each other, without the router.

PS I could imagine the behavior is implementation dependent. So I'd appreciate not just a theoretical argument, but citing how a particular OS behaves, or at least citing a RFC or standard.

SRobertJames
  • 197
  • 1
  • 2
  • 5
  • If there is no reply to an ARP request, then a error message is sent to the application. How that happens is, indeed, OS dependent, but host/server OSes are off-topic here. You could try to ask that part on [sf] for a business network, or on [su] for a personal network. – Ron Maupin Jul 15 '18 at 03:05

3 Answers3

6

Each ARP would timeout and a new one would be resent periodically. Depending on the implementation, it would likely give up at some stage. The application may time out of its own accord, or lower layers could pass an error up to the application layer.

It definitely would not send to the default gateway though (unless the default gateway responded, proxy ARP etc)

In the case where the two hosts are on different networks, there may be a case where the default gateway performs proxy ARP for the host and replies with its own MAC, then forwards the traffic on. This would only happen if the router is configured to send proxy ARP, both hosts are configured with addresses/masks so that they believe they are on the same network and the router has longer masks and believes they are on different networks). This isn't an ARP timeout though, the router performing proxy ARP would respond immediately.

5

If A's ARP requests aren't answered the ARP attempt will time out after a few retries and return an error (host unreachable or similar) returned to the upper layer.

A will not try to use a gateway router as B's destination address is located in the same subnet. The decision between attempting local delivery or using a gateway is made based on the local routing table which is in turn based on the network part and mask length of each host interface. There is no fallback to a gateway when local delivery fails.

A is really on a different subnet than B, but the subnet masks are misconfigured.

If A is located elsewhere or doesn't exist doesn't matter. B decides that A is local based on their common subnet prefix and if local delivery fails that's it.

A and B are on the same subnet, but both in protected ports (a private VLAN), and so can't directly communicate to each other, without the router.

Same thing - if B's ARP request doesn't reach A or A's reply doesn't reach B, ARP fails and no local delivery takes place (nor any other way).

ARP is defined in RFC 826, with a few updates.

Zac67
  • 81,287
  • 3
  • 67
  • 131
0

Simply put, no.

When a host ARPs, it has already calculated that the host is within the local subnet by comparing its own IP address and its subnet mask.

J.S.
  • 9
  • 1