Networking – How does a frame retrieve the recipient’s MAC address

networking

I am studying a Network+ book named All-in-one CompTia Network+ by Mike Meyers.

In chapter 2 he talks about frames and how he represents them as canisters and the data within the frame contains the recipients mac address, senders mac address, data, and sequence number.

What I don't understand is if the sender is sending a file via the network to the recipient, and this frame contains this data, how does the frame know what the recipients MAC address is before sending it?

In regards to TCP/IP when it contains the recipients IP address, that's understandable how it retrieves that value. But I don't understand how it can retrieve the MAC address, because if that frame comes from the senders computer, goes into the router and copies itself to each and every computer that exists on the network, how did it have the MAC address to know where to go?

Let me know if I'm not making sense.

Best Answer

The sender transmits an ARP request (or in IPv6, a Neighbor Solicitation). Basically that is a frame which yells 'which MAC has this IP?'

The owner of that IP will then reply with an almost identical packet, stating 'I have this IP'. That answer also contains the MAC.

This only works on the local network. For all IP traffic not on the local network the packet gets sent to the default gateway. (And obviously, that default gateway is a computer on the local network).

Edit1: Link to the relevant Wikipedia article on ARP

Edit2: The ARP request 'who has this' is obviously a broadcast.

Related Question