1

I know this is a repeated question here, but I cant find any previous threads discussing the headers. Is my understanding of this correct?

Here's the scenario. Two hosts on different networks connected to a router

Host A 10.1.1.1/24 (MAC: AAAA.AAAA.AAAA)

Host B 10.2.2.2/24 (MAC: BBBB.BBBB.BBBB)

Here's my understanding of when host A pings host B.

  • Host A pings Host B
  • Host A first looks at Host B IP, performs the calculation in relation to its own subnet mask, it realizes its on a different network.
  • Host A knows to send it to its default gateway.
  • Since ping must be encapsulated, Host A creates an IP header with the+ source of itself (10.1.1.1) and destination of Host B (10.2.2.2).
  • Ping then floats down the TCP/IP model, and now must build a Ethernet frame header.
  • It plugs in itself as the source mac (AAAA.AAAA.AAAA) but it does not know the gateway's MAC. So it broadcast out FFFF.FFFF.FFFF.
  • The router replies with a unicast of it's gateway mac
  • Host A plugs in the router's gateway mac into the Ethernet frame header. And off goes the packet.
  • The router then strips the layer 2, and sends the packet to host B.
  • I wrote an article series on how packets move through a network. The series finale is a video that discusses your exact scenario in a bit more depth. – Eddie Apr 16 '16 at 21:06
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 14 '17 at 1:52
1

yes, that process is correct. Regarding the step "It plugs in itself as the source mac (AAAA.AAAA.AAAA) but it does not know the gateway's MAC. So it broadcast out FFFF.FFFF.FFFF." Keep in mind that host A will first check it's ARP table to check whether the Routers MAC is already present in the arp table.

Same when the router receives the packet / frame it will check for Layer 2 addressing next Layer 3 addressing. In case of a multiaccess network like Ethernet the router will next check it's own ARP table to check whether it knows Host B's MAC. If not it will perform an ARP lookup.

Hope this helps.

Adam

| improve this answer | |

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.