1

If a device A needs to send an IP datagram to device B and if the arp table of device A doesn't have an entry for the mac address of the device B. Device A will send an arp request packet and in response, the device B will send a reply packet which causes device A to update its cache table. But at the same time device B also update its arp cache table. Now since the path taken by the Ip datagram is independent there is no guarantee a packet for device A will be sent through device B so why does the receiver(device B) update its arp cache table.

0

That is because most protocols used on a network will be in the form of a request/response. Host A is most likely wanting something from Host B when it sends an ARP request to Host B. Unidirectional communication is not unheard of, but it is far more likely going to be bidirectional communication that Host A wants.

Host B will probably receive something from Host A if it gets an ARP request from Host A, and Host B will probably need to reply to Host A. If Host B didn't update its ARP table, then if would need to send an ARP request to Host A when it needs to respond to Host A. That causes delays and wastes bandwidth, but Host B can simply update its ARP table with no delays or used bandwidth when Host A makes an ARP request of Host B.


Now since the path taken by the Ip datagram is independent there is no guarantee a packet for device A will be sent through device B

Remember that this is all on the same layer-2 network for MAC addresses and ARP. IP doesn't really play any role in delivering layer-3 packets on a LAN. If the LAN protocol uses MAC, e.g. ethernet, then the layer-2 frames are delivered directly from one host to another host.

If Host A and Host B are on different LANs, then Host A would not send an ARP request for Host B, it would know that host B is on a different layer-3 network, and it would send an ARP request for its configured gateway (the host on the LAN that knows how to reach other networks), although it probably already has the MAC address for its configured gateway in it ARP table.

  • I agree with that, but what if A wants to send something to B and there are two paths, one from C and another one from D. Now during an arp request from A to C to send a packet to B. C will update its cache. But if B sends some data back to A using path D the update of C is of no use. So still is it prefered that C(a receiver of arp request) should update its cache. – S.C Nov 18 '17 at 5:55
  • 2
    Frames on a LAN are delivered directly from host to host. When packets must pass through other hosts, the frames are stripped, and A would never ARP for B, it would ARP for the next hop host. – Ron Maupin Nov 18 '17 at 5:59

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.