Network Engineering Stack Exchange is a question and answer site for network engineers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a question regarding ARP:

If host A wants to send a message to host B and the ARP table of host A does not contain a MAC address for host B then he sends an ARP request and host B replies with its MAC adress.

Now what happens if there is a third host C on the net whose ARP table is also empty. While this third host C receives and ignores host As ARP request does it process the ARP reply of host B ?

In other words: do hosts on a network learn other hosts MAC addresses from ARP replies not addressed to them ?

At university I've heard that that is the way switches learn which hosts are reachable via their ports but not if hosts do the same.

Thank you in advance !

share|improve this question
up vote 4 down vote accepted

As per RFC826, the answer is NO.

The algorithm in the RFC clearly state that the address is added in the local table only if the host is the target of the packet.

However Host C will update its table if it already has an old entry for host A and its not up to date.

It's possible that some specific implementation of ARP do listen to ARP query to populate the cache, but there's no way to know it without testing.

EDIT in response to comments :

The RFC mention that :

Negative conditionals indicate an end of processing and a discarding of the packet.

Then in the algorithm we have :

?Am I the target protocol address?

Yes:
  If Merge_flag is false, add the triplet <protocol type,
      sender protocol address, sender hardware address> to
      the translation table.

So since for host C the answer to the above question is No, it doesn't go to the step "add sender hardware to the translation table", it just stop processing.

Also, as mentioned by xpac and Ron Maupin , in a modern, switched environment, host C will not even see the answer from B to A.

share|improve this answer
4  
As an addition: If I'm not mistaken, the ARP reply from host A is directed to host B via host A's MAC address - which will usually lead to host C not even being able to see that reply, at least not on a switched network. A switch however will see all these packets, but a switch doesn't care if it's ARP or something else. A switch will just, whenever a frame arrives, look at the source MAC and remember "Ah, that MAC is on the port X I just received these frame from. I will send all frames for that MAC only via that port in the future." – xpac Feb 17 at 13:40
    
Host A can send a gradious ARP packet to notify all hosts in a subnet of its MAC/IP address. This is done on network up. This is also used by e.g. Windows to test if an IP already exists in a network. – Paebbels Feb 17 at 19:23
    
@JFL Could you quote the section of the RFC that states that? I tried to skim through it just now and couldn't find it. – Eddie Feb 17 at 19:29
    
As a point of clarification to your question (since the terms get muddled) a network switch (operating by definition on just on layers 1 and 2) does not use ARP at all, it doesn't have an ARP table and it doesn't use ARP to determine which hosts are on which port. A switch learns who is on what port only after observing the source mac of a frame arriving on the port in question. – Jeff Meden Feb 17 at 20:34

All the hosts see the ARP request, but only the requester will see the ARP reply. Since ARP replies are unicast back to the requester, Host C will never even see the ARP reply from Host B.

How hosts populate their ARP caches is not how switches populate their MAC address tables. Switches look at all the traffic coming through switch ports to populate their MAC address tables.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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