Skip to content
  • There are no suggestions because the search field is empty.

Packet Delivery Process Overview

Numerous networking devices, including switches, routers, and firewalls, are usually involved in transferring data packets between hosts within a network. This enables users to easily carry out their daily tasks and exchange data when needed. 

However, delivering data packets from one device to another, whether within the same network or across different networks, is complex and involves multiple steps. Therefore, it is crucial to configure a default gateway on all, or at least most devices, so network communications will not experience any setbacks. 

This default gateway uses ARP to learn the MAC address of the next-hop device and properly encapsulate the data before it is sent to its intended destination. This approach ensures that data is transmitted efficiently and effectively.

Host-to-Host Packet Delivery Step-by-Step

Let us look at a simple example in which data is sent from one device to another to understand the steps involved in the host-to-host packet delivery process.

Example network topology consisting of only two computers, a switch, and a router - Part 1

As you can see from the image above, the topology is quite simple and consists of only two computers, PC1 and PC2, a switch (SW1), and a router (R1). The network on the left of R1 is 192.168.1.0/24, whereas the network on the right is 192.168.2.0/24.

The IP and MAC addresses for each interface of the devices are also known, except for the switch because it is irrelevant to our host-to-host delivery example.

Suppose that PC1 intends to establish a remote connection with PC2, which is in a different network and uses Telnet for communication. 

What will happen when the user behind PC1 enters the Telnet command to connect to the IP address of PC2? Most likely, the user will be asked for credentials, indicating that PC1 and PC2 have communicated with each other. However, what occurred in between is what the host-to-host delivery process is all about.

Step 1 - Layer 7 to Layer 3 Encapsulation

The Telnet application on PC1 sends the data, which is added by an additional Layer 4 header indicating the use of a TCP session. This is because Telnet relies on the TCP protocol to establish connections. 

Once this task is completed, the data and TCP header are further encapsulated, and a Layer 3 header is appended that contains various parameters, including the source and destination IP addresses of the communicating devices, which are PC1 and PC2, respectively, in our scenario. 

As such, the source IP address is PC1 (192.168.1.100), and the destination IP address is PC2 (192.168.2.100).

Step 2 - Layer 2 Header and ARP Protocol 

The next step in the encapsulation process on PC1 is to append the Layer 2 header, which includes the MAC addresses of PC1 and PC2. However, before this task, PC1 needs to find out if the destination host is in the same network or belongs to a different one.

If the destination host belongs to a different network, PC1 cannot route the packet. It needs a default gateway to send data between different networks in such a case.

Because PC1 and PC2 are on different networks, PC1 must send the data to R1, which functions as a default gateway, which will then forward it to PC2. Therefore, instead of the MAC address of PC2, PC1 needs the routers’ MAC address.

Example network topology consisting of only two computers, a switch, and a router - Part 2

If the MAC address is already known, PC1 can continue with the encapsulation process. However, if it doesn't know the MAC address, it uses the ARP protocol. PC1 sends an ARP request message with its own MAC address as the source and a broadcast destination MAC address.

When R1 receives the ARP request message, it maps the MAC address to the corresponding IP address of PC1 in the local ARP table and sends an ARP reply message. 

Upon receipt, PC1 learns the MAC address of R1 and writes that information in its own ARP table. PC1 has the missing parameter and can finish the encapsulation process before sending the packet to R1.

Note: The ARP messages do not have any special role on the switch. The switch uses them to learn the MAC addresses of PC1 and R1 and store them in its MAC address table for later use.

Example network topology consisting of only two computers, a switch, and a router - Part 3

When R1 receives the packet, it recognizes its own MAC address (of interface FastEthernet0/1) as a destination MAC address in the Layer 2 header and starts a decapsulation process. 

However, this process stops when it finds out that the destination IP address in the Layer 3 header is not locally used.

Because the packet must be forwarded, R1 checks the routing table and determines that FastEthernet0/2 is the exit interface to reach the destination network, where PC2 belongs.

Step 3 - Repeat 

However, before the packet is forwarded to PC2 through FastEthernet0/2, the same procedure repeats. As you can see from the image below, R1 now requires the MAC address of PC2 to finalize the encapsulation process by replacing the old Layer 2 header with a new one.

Example network topology consisting of only two computers, a switch, and a router - Part 4

If R1 does not have the MAC address, it transmits an ARP request message, and PC2 responds with an ARP reply. After R1 obtains the MAC address of PC2, it appends the Layer 2 header to the other packet parameters, using its own MAC address as the source and the MAC address of PC2 as a destination MAC. 

Now the packet can finally be sent to PC2, which triggers PC2 to reply to PC1 with a prompt for entering Telnet credentials.