Address Resolution - MODULO 9 Flashcards
MAC and IP
Destination on Same Network
Sometimes a host must send a message, but it only knows the IP address of the
destination device.
The host needs to know the MAC address of that device, but how can it be discovered?
That is where address resolution becomes critical.
There are two primary addresses assigned to a device on an Ethernet LAN:
Physical address (the MAC address) – Used for NIC to NIC communications on
the same Ethernet network.
* Logical address (the IP address) – Used to send the packet from the source
device to the destination device. The destination IP address may be on the same IP
network as the source or it may be on a remote network.
Layer 2 physical addresses (i.e., Ethernet MAC addresses) are used to deliver the data link
frame with the encapsulated IP packet from one NIC to another NIC that is on the same
network.
If the destination IP address is on the same network, the destination MAC address will be
that of the destination device.
The Layer 2 Ethernet frame contains the following:
Destination MAC address – This is the simplified MAC address of PC2, 55-55-55.
* Source MAC address – This is the simplified MAC address of the Ethernet NIC on
PC1, aa-aa-aa.
The Layer 3 IP packet contains the following:
Source IPv4 address – This is the IPv4 address of PC1, 192.168.10.10.
* Destination IPv4 address – This is the IPv4 address of PC2, 192.168.10.11.
Destination on Remote Network
When the destination IP address (IPv4 or IPv6) is on a remote network, the destination
MAC address will be the address of the host default gateway (i.e., the router interface).
Consider the following example using a simplified MAC address representation.
example, PC1 wants to send a packet to PC2.
PC2 is located on remote network.
Because the destination IPv4 address is not on the same local network as PC1, the
destination MAC address is that of the local default gateway on the router.
Routers examine the destination IPv4 address to determine the best path to forward the
IPv4 packet.
When the router receives the Ethernet frame, it de-encapsulates the Layer 2 information.
Using the destination IPv4 address, it determines the next-hop device, and then
encapsulates the IPv4 packet in a new data link frame for the outgoing interface.
In our example, R1 would now encapsulate the packet with new Layer 2 address
information as shown in the figure.
The new destination MAC address would be that of the R2 G0/0/1 interface and the new
source MAC address would be that of the R1 G0/0/1 interface.
Along each link in a path, an IP packet is encapsulated in a frame.
The frame is specific to the data link technology that is associated with that link, such as
Ethernet.
If the next-hop device is the final destination, the destination MAC address will be that of
the device Ethernet NIC, as shown in the figure.
ARP Overview
If your network is using the IPv4 communications protocol, the Address Resolution
Protocol, or ARP, is what you need to map IPv4 addresses to MAC addresses. This topic
explains how ARP works.
Every IP device on an Ethernet network has a unique Ethernet MAC address.
When a device sends an Ethernet Layer 2 frame, it contains these two addresses:
- Destination MAC address - The Ethernet MAC address of the destination device
on the same local network segment. If the destination host is on another network,
then the destination address in the frame would be that of the default gateway (i.e.,
router). - Source MAC address - The MAC address of the Ethernet NIC on the source host.
To send a packet to another host on the same local IPv4 network
a host must know the
IPv4 address and the MAC address of the destination device.
Device destination IPv4 addresses are either known or resolved by device name.
However, MAC addresses must be discovered.
A device uses Address Resolution Protocol (ARP) to determine the destination MAC
address of a local device when it knows its IPv4 address.
ARP provides two basic functions:
- Resolving IPv4 addresses to MAC addresses
- Maintaining a table of IPv4 to MAC address mappings
ARP Functions
When a packet is sent to the data link layer to be encapsulated into an Ethernet frame, the
device refers to a table in its memory to find the MAC address that is mapped to the IPv4
address.
This table is stored temporarily in RAM memory and called the ARP table or the ARP
cache.
The sending device will search its ARP table for a destination IPv4 address and a
corresponding MAC address.
- If the packet’s destination IPv4 address is on the same network as the source IPv4
address, the device will search the ARP table for the destination IPv4 address. - If the destination IPv4 address is on a different network than the source IPv4
address, the device will search the ARP table for the IPv4 address of the default
gateway.
In both cases
the search is for an IPv4 address and a corresponding MAC address for the
device.
Each entry, or row, of the ARP table binds an IPv4 address with a MAC address.
We call the relationship between the two values a map.
This simply means that you can locate an IPv4 address in the table and discover the
corresponding MAC address.
The ARP table temporarily saves (caches) the mapping for the devices on the LAN.
If the device locates the IPv4 address, its corresponding MAC address is used as the
destination MAC address in the frame.
If there is no entry is found, then the device sends an ARP request.
ARP Request
An ARP request is sent when a device needs to determine the MAC address that is
associated with an IPv4 address, and it does not have an entry for the IPv4 address in its
ARP table.
ARP messages are encapsulated directly within an Ethernet frame.
There is no IPv4 header.