Understanding the Relationship Between IP Address and MAC Address

Understanding the Relationship Between IP Address and MAC Address

In computer networks, to share resources and exchange data in an orderly manner, some pre-agreed rules must be followed. These standards or agreements established for data exchange in the network are called network protocols, abbreviated as protocols.

To enable efficient transmission between computers, a layered approach is adopted, similar to how people collaborate to complete a task in daily life. There are 7 layers and 5 layers, each with its own advantages and disadvantages.

The collection of layers and their protocols in computer networks is referred to as the architecture of computer networks. Here, we introduce the architecture of the five-layer protocol, as shown in the following diagram:

Understanding the Relationship Between IP Address and MAC Address

First, the IP address is at the network layer. To understand the relationship between IP and MAC addresses, we should first clarify why we use the IP protocol at the network layer?

The TCP/IP architecture employs standardized protocols at the network layer, but interconnected networks can be heterogeneous.

As shown in diagram a below, many computer networks are interconnected through routers. Since the interconnected computer networks use the same Internet Protocol (IP), the interconnected networks can be viewed as a virtual internet as shown in diagram b.

Understanding the Relationship Between IP Address and MAC Address

What does this mean? It means that the heterogeneity between networks is an objective reality, and we use the IP protocol to make these networks with different characteristics appear as a unified network, thus enabling communication between hosts.

Next, let’s briefly discuss the MAC address (also known as the physical address or hardware address). Each site that constitutes the network has a machine-readable address, known as the site’s physical address, which is hard-coded on the network card and does not change. The MAC address on your computer is unique.The physical address is used by the data link layer and physical layer.

Next, we need to understand the difference between the IP address and the hardware address. See the following diagram:

Understanding the Relationship Between IP Address and MAC Address
Understanding the Relationship Between IP Address and MAC Address

When host H1 sends a message to H2, from the network layer’s perspective, it is the flow of IP datagrams, but in reality, it looks like this:

Understanding the Relationship Between IP Address and MAC Address
(In the diagram, HA represents the MAC address)

First, clarify the goal: host H1 now wants to send a message to host H2.

The IP datagram of host H1 (network layer) is handed down to the data link layer and is encapsulated into a MAC frame from HA1 to HA3. Then, router R1 receives the MAC frame, passes it to the network layer, and removes the MAC frame header to see the IP; the router then performs routing selection and continues the process by passing it to the data link layer to encapsulate it into a MAC frame, repeating this until it reaches the router where the destination host is located, and then sends it to the destination host.(Here, the ARP protocol is used to convert the IP address into a MAC address.)

Note:On the IP layer of the abstract internet, only IP datagrams can be seen. The IP1→IP2 in the diagram indicates that the IP addresses of the two routers from source IP1 to destination IP2 do not appear in the header of the IP datagram; the router only makes routing decisions based on the network number of the destination host’s IP address. In the specific physical network’s link layer, only MAC frames can be seen, and IP datagrams are not visible.

Understanding the Relationship Between IP Address and MAC Address

When transmitting data, the data flows from the upper layer down to the lower layer and then is transmitted over the communication link. As shown in the diagram above, once the IP datagram using the IP address is handed over to the data link layer, it is encapsulated with the MAC address into a MAC frame. In the actual transmission process, the source address and destination address used are both MAC addresses.

Summary: What is the relationship between IP addresses and MAC addresses?

The abstract internet at the IP layer masks the complex details of the lower layers, allowing discussions at the abstract network layer using a unified, abstract IP address to study the communication between hosts or between hosts and routers.

In simpler terms, having an IP address allows you to find the destination host through the router, masking the heterogeneity of the underlying network, while the MAC address completes the actual forwarding at the lower layer.

Claim Your Benefits

Understanding the Relationship Between IP Address and MAC Address

Plant a Tree
The best time was ten years ago
The second best time is now
Learning is the same
Understanding the Relationship Between IP Address and MAC Address

Source: Internet. If infringement, please delete.

Leave a Comment