IP and MAC address’

Does that make sense? The layer 3 info it needs and receives is slightly different to the layer 2 info it receives.

This is always the case when routing between subnets.

If routing locally inside the same broadcast domain (bunch of hosts connected to a switch) everything is known locally by the switch (in it's cam table <database of known mac addresses learnt from the network>) and all of the hosts use ARP to learn about each other's MAC addresses, so all the information required to communicate is present.

However, if routing to a different network we need to route at layer-3 (via a router) the host can't send traffic directly to the host because it's remote - it needs to do it via a gateway (router) therefore, instead of the final destination host MAC address in the layer-2 header, the layer-2 destination address of the router's gateway interface is used - so the packet flows directly to the router.

The MAC address of the router would be learnt by the host via ARP.
 
Back
Top Bottom