2

When ARP is used by a host in a LAN, then it is broadcast because the host does not know where is the destination host, but a router knows which interface it must use to get to the next router. Then does it really need ARP. It can just put the packet on the interface through which it can reach the other router.

2

It can just put the packet on the interface through which it can reach the other router.

There are problems with your premise. Remember that frames on a link are delivered via a layer-2 protocol, and that protocol may have an address that must be resolved in order to encapsulate the packets into frames. If the frames use MAC addresses, then you need ARP to resolve the next-hop layer-3 address into a layer-2 address.

Also, if the link is a multiaccess link, how does the router direct the packets to the one-of-many hosts on the multiaccess link? The packets only have the source and destination layer-3 addresses, not any of the intermediate hop addresses. Yes, the router knows that the packets must go out specific interfaces, but it must have some way to direct the frames to the specific device (router) on a multiaccess interface.

Yes, there are layer-2 protocols that may use other, or no, addressing on the frames. If there is no addressing, e.g. PPP, then the router knows how to create the frame, and there is only one other device on the link, but there are many other layer-2 protocols (frame relay, ATM, etc.) that use other addressing, and a router will use a method other than ARP to resolve the layer-2 address of the next hop.

When ARP is used by a host in a LAN, then it is broadcast because the host does not know where is the destination host, but a router knows which interface it must use to get to the next router.

A router also knows which interface a host is connected on. Remember that at layer-2, another router is just a host on a network. The router knows nothing more about another router than it does a host.

Also, only an ARP request is broadcast. ARP also specifies that a host create an ARP table, and ARP may simply find the layer-2 address in the ARP table without using broadcast.

  • Your point about multiaccess link makes sense. – Kishan Kumar Sep 25 '17 at 13:01
1

ARP is used to retrieve the MAC address of the destination host. At layer 3 it knows the destination IP but when it has to add the L2 header it does not know the mac address of the destination host. So to get the mac address it sends an ARP packet. After getting the response it will update its ARP tables for future lookups.

It does not really matter whether it is a end host or router or a gateway. This is how a network stack is implemented and works. Moreover the L2 header is replaced at every hop by adding a new one containing the next hop MAC address

  • Why do we need to use ARP in router? The link layer protocol could simply use a special address as the destination link layer address. The protocol may state that if a frame with this address is received then the receiver must not discard it. – Kishan Kumar Sep 25 '17 at 12:40
  • @KishanKumar, you would interrupt every host on a link, which may contain a mixture of routers, PCs, printers, etc. A router is another host at layer-2, so it is treated as a host. – Ron Maupin Sep 25 '17 at 12:42
  • Even when a router receives a frame it first unwrap L2 and then L3. L2 address which is mac address is used to uniquely identify any network device. To add that address in a frame ARP protocol is used – enZyme Sep 25 '17 at 12:44
  • @RonMaupin I don't get your point. Please elaborate. – Kishan Kumar Sep 25 '17 at 12:59
  • @enZyme I know what ARP is used for. But why can't we just use the interface when we know that the receiver is at other end. – Kishan Kumar Sep 25 '17 at 13:00
0
  1. From source to destination : IP address will not change.
  2. At source MAC address will added by the computer and destination Mac address will be gateway Mac address only not the destination.
  3. Hop by hop MAC address will change until it reaches to the destination.
0

When ARP is used by a host in a LAN, then it is broadcast because the host does not know where is the destination host, but a router knows which interface it must use to get to the next router. Then does it really need ARP. It can just put the packet on the interface through which it can reach the other router.

Whether or not ARP is used depends not on whether the device is a "host" or a "router" but on the type of interface the packet exits on.

The destination is first looked up in the routing table. This will specify an output interface and possiblly a next-hop address. If no next-hop address is specified then the destination will be used as the next hop address.

What happens next depends on the type of interface. If it is an ethernet interface then there will be a lookup in the arp table and if there is no entry in the arp table then the packet will be put aside while an arp request takes place. This arp table entry will be used to map the next-hop IP address to the MAC address of the receiving router. The recieving router in turn will use the MAC address to filter incoming traffic*.

This applies even if the Ethernet interface in question happens to be connected directly to another router. The router doesn't know or care about that it only cares that the interface is an Ethernet interface.

On the other hand if the interface is some other type then there may be no mapping process at all or there may be some other mapping process specific to the type of link.

* This is important because without it multiple routers on an Ethernet network would lead to packet duplication.

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.