Link to home
Start Free TrialLog in
Avatar of jskfan
jskfanFlag for Cyprus

asked on

How ARP works beyond the Router

inside the LAN Switches build an ARP to IP address table for each host in the LAN.
However, I am not sure how ARP works , for instance when a Host with IP address 10.1.1.10 wants to reach another host 192.168.10.10, which is behind another Layer3 device, or sometimes 2 hops away.

Thank you
Avatar of Don Johnston
Don Johnston
Flag of United States of America image

inside the LAN Switches build an ARP to IP address table for each host in the LAN.
If you're talking about layer-2 switches, this is not correct.  It is however true for layer-3 switches.
I am not sure how ARP works , for instance when a Host with IP address 10.1.1.10 wants to reach another host 192.168.10.10, which is behind another Layer3 device,
If the destination host is not local, the sending device will use the layer-2 address of it's default-gateway as the destination address for the layer-2 frame.
Avatar of skullnobrains
skullnobrains

basically this is what happens when 10.xyz/8 whant to speak with 192.168.xy

- the IP stack notices the destination is not on the same network
- it performs a lookup in the routing table, and finds let's say 10.1.1.1
- it sends ARP WHO HAS 10.1.1.1 REPLYTO 10.xyz
- 10.1.1.1 answers with it's mac address
- the packet is sent to 10.1.1.1
- 10.1.1.1 receives the packet and notices it is not for him
- 10.1.1.1 decrements the TTL
- 10.1.1.1 looks if it has an interface in the same network as the destination
- we'll assume yes, otherwise go up to second line and repeat the cycle to reach the next hop
- 10..1.1.1 selects the interface, let's say 192.168.1.1/16
- 10.1.1.1 sends an ARP WHOHAS 192.168.xy REPLY TO 192.168.1.1 on that interface
- 192.168.xy answers to 192.168.1.1 with it's MAC address
- the router sends the packet using 10.xyz as the source address to the MAC it received

basically, arp traffic is used for communication in the same network only and does not traverse routers

when not on the same network, the routing table is used to determine the IP of the router on the same network and ARP is used to talk with the router

the router repeats the process
Avatar of jskfan

ASKER

The first step , I believe is :
Host with IP address 10.1.1.10  will send a broadcast " who has IP 192.168.10.10 " ?

The who will respond to Host with IP address 10.1.1.10 ? the router will respond?
if Router1 does not have 192.168.x.x address in its routing table, what protocol will it use to make a request to router2 about the 192.168.x.x network ?
No.  If the host has a default gateway defined with a layer-3 device, it WILL not ARP an address on a different network.

If the host has itself as the default gateway, then it will ARP all addresses regardless of where they are. And if the router is configured for Proxy ARP. it will respond to those requests (assuming it has a route to the destination network).
The first step , I believe is :
Host with IP address 10.1.1.10  will send a broadcast " who has IP 192.168.10.10 " ?

like @don said, no. the above steps are the correct ones. ARP packets are only sent to the same network.

if Router1 does not have 192.168.x.x address in its routing table, what protocol will it use to make a request to router2 about the 192.168.x.x network ?

hosts and routers act the same way : if there is no specific route, there should be a gefault gateway. if there is no default gateway (aka catchall route to 0.0.0.0/0), then the packet is dropped, and an icmp no-route-to-host packet is sent back to the source address.

routing protocols create routes. they are not meant to be used dynamically when a packet arrives (but a non-routable packet may trigger something). they are not part of IP specification and there is hence no "normal" protocol.
Avatar of jskfan

ASKER

so when Host(computer) with IP address 10.1.1.10  want to talk to computer2 that has IP 192.168.10.10 " what would be the process ?

I know skullnobrains described the steps but not clear…I could not understand how steps are chained up...
That's already been answered.

This comment.

I would just make one minor change to steps two and three (but the concept is unchanged):

- the IP stack notices the destination is not on the same network
- The host checks its ARP cache for an entry for the default-gateway.
- If there is no entry for the default gateway, it sends an ARP Request to the DG.
Avatar of jskfan

ASKER

Yes I was referring to Comment ID: 39995989

I wonder if it can be reshaped a little bit to make it clear ?

It sounds like the next hop(Router) does the same thing as the initial computer does, which is the broadcast to find the wanted MAC address. However,in most of articles they say Routers do not do the broadcast….
I wonder if it can be reshaped a little bit to make it clear ?
I don't know how it could any clearer.  If you explain what you're not understanding, that would help.

It sounds like the next hop(Router) does the same thing as the initial computer does, which is the broadcast to find the wanted MAC address.
That is correct.
However,in most of articles they say Routers do not do the broadcast….
Hard to say without seeing the article, but I think you're confusing "forwarding of broadcast" with "generating broadcast".

If the outbound interface of the router is an ethernet interface and there is no entry in the ARP cache, then the router will have to ARP for the MAC address of the next router (or the destination if it's on that network).
thanks @don, indeed, i had skipped the possibility that the host has the arp in it's cache

--

as far as broadcast goes, ARP is essentially a broadcast protocol : arp queries are always sent to the whole network. this is precisely the reason why we use IP on top of ARP : to provide routing through the use of addressing

when you read "routers don't do broadcast", the article's author probably referred to IP broadcasts. btw, routers can perfectly route broadcasts but there are blocked on many of them to prevent smurf and smurf-like attacks

--

i'll try to shorten and clarify a bit

all hosts including routers use that same mechanism when they need to sent packets :
- if the host is on my network, choose to communicate directly with it, if not use the next hop found by interrogating the routing table (which is always on my network)
- use arp (or arp cache) to retrieve the mac address of the peer defined at above step
- send the packet to that peer using the mac address retrieved in the previous step

the only difference between a router and other hosts is that a router will accept to receive packets that are not for him and attempt to forward them. in the process, the ARP headers are replaced and the TTL is decremented
Avatar of jskfan

ASKER

<<Hard to say without seeing the article, but I think you're confusing "forwarding of broadcast" with "generating broadcast".>>>
That 's true donjohnson, I was confused about that point..


I was not sure Next hop router will generate a broadcast in order to request the MAC address of the wanted IP address…
So if I understand the Router will still query the next Router asking him " Do you have the MAC address of this IP address ?"  if that's the case the First router will update  MAC to IP address information in its own MAC Table….

Assuming after the Host(computer) has gone through the request of IP to MAC to find the destination host , and the Routers in the way have all updated their MAC to IP address table to include the destination host…
at this point the first router will send back the MAC address of the destination to the requesting Host ??
It's a minor terminology issue, but the the term for the table that contains IP addresses and the MAC address which corresponds to that IP address, is the ARP cache or ARP table.  Layer-2 switches have a list of MAC addresses and the interface those MAC addresses are associated with. This is called a MAC Address Table. Also known as the MAC database, CAM table or switching database.

I was not sure Next hop router will generate a broadcast in order to request the MAC address of the wanted IP address…
So if I understand the Router will still query the next Router asking him " Do you have the MAC address of this IP address ?"  if that's the case the First router will update  MAC to IP address information in its own MAC Table….
A device will only send an ARP request if it does not know the MAC address for a particular IP address.  The ARP cache for a Cisco router four hours by default. So once a router ARPs a device once, it typically does not have to query it again.

Assuming after the Host(computer) has gone through the request of IP to MAC to find the destination host , and the Routers in the way have all updated their MAC to IP address table to include the destination host…
at this point the first router will send back the MAC address of the destination to the requesting Host ??
No. A host will NEVER know the MAC address of a device on a different network.  I doesn't need to know that information. Any destination not of the local network is simply forwarded to the default gateway. That router will then send the packet towards the destination.
Avatar of jskfan

ASKER

<<<Any destination not of the local network is simply forwarded to the default gateway. That router will then send the packet towards the destination.>>>

the router will act on behalf of the HOST.

I want to know how the information chain is lined up..this is why I asked for the steps that the request made by the host reaches the destination and how the response will get back to the originating host…
Avatar of jskfan

ASKER

it is described on the comment ID: 39995989.
however when  router1 asks Router2 about IP address 192.168.x.y , assuming Router2 knows about it…..then what information Router2 will deliver back to Router1 and what information will Router1 deliver back to the Host ?
ASKER CERTIFIED SOLUTION
Avatar of Don Johnston
Don Johnston
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

Thank you…
I do not mean to make this thread too long….but I want to understand the trip back to Host A, once all those requests are made up all the way to the destination host B…how does the response travel back…will  the routers  on the way to host A do the decapsulate/encapsulate of the packets and ARP the next hop ?
The return packet goes through the exact same process. Only the addresses are different.
yes :

for example
A - RT1 - RT2 - B

A has a route telling it that it can reach B through RT1
RT1 has a route telling it that it can reach B through RT2

likewise
B has a route telling it that it can reach A through RT2
RT2 has a route telling it that it can reach A through RT1

A does not even know that RT2 exists, likewise B does not know about RT1

each host only does ARP with it's neighbors (A with RT1, RT1 with RT2, and RT2 with B)

in normally configured networks, the forward and reverse paths follow the same chain of hosts but there is no formal requirement
Avatar of jskfan

ASKER

Thank you Guys!