Router Switching Mastery: Unlock Efficient Packet Delivery (Updated 2025)
The router is a device that receives a packet from the source on any interface and forwards it to its destination on another interface. This is possible with the router switching function, which encapsulates packets in the data link frame type for the outgoing data link. Before going further, learn the key networking terms for router switching:
Key Networking Terms for Router Switching
To ensure clarity, here are definitions of key terms used in this article:
- Encapsulation: The process of wrapping a packet (e.g., an IP packet at Layer 3) with a data link layer (Layer 2) header and trailer to prepare it for transmission over a specific medium.
- De-encapsulation: The process of removing the Layer 2 header and trailer to access the Layer 3 packet for routing decisions.
- Layer 2 Frame: A data unit at the Data Link Layer (Layer 2) that includes a header (e.g., MAC addresses), payload (e.g., IP packet), and trailer (e.g., CRC).
- ICMP (Internet Control Message Protocol): A protocol used for diagnostic and error messaging in IP networks, such as ping or traceroute.
- Routing Table: A database in a router that stores the best paths to various network destinations, used to forward packets.
- MAC Address: A unique 48-bit address assigned to network interfaces at the Data Link Layer, used for communication within a single network segment.
The router’s routing function selects the best path for the packet destination, and the router’s switching function encapsulates the packet into the data link frame of the outgoing interface. The router switching function performs the following: receiving a packet from one network and sending it to another.
1. The router receives the Layer 2 encapsulated frame and then de-encapsulates the Layer 2 frame header and trailer.
2. After De-encapsulation, the router reads Layer 3 information and the destination IP address of the IP packet to select the best path in the routing table.
3. When selecting a path for the packet destination, the router encapsulates the Layer 3 packet into a new Layer 2 frame and forwards the frame out of the exit interface.
Figures 1 to 6 illustrate packet switching over a routed network. As shown in Figure 1, the laptop generates an ICMP message for the server in the topology. The packet contains layer 3 information on the source and destination layer 3 addresses. The source layer 3 address is the address of the laptop, and the destination layer 3 address is the server’s IP address. As a packet travels from the source to the destination, the Layer 3 IP addresses do not change because the Layer 3 PDU does not change.
However, the Layer 2 data link addresses change at every hop as each router de-encapsulates and re-encapsulates the packet in a new Layer 2 frame. In Figure 1, the Layer 3 packet is encapsulated for the wireless access point and forwarded to Layer 2 (the laptop’s wireless card) and then to Layer 1 for transmitting on port 1. The wireless port is virtual, not a physical port.
Encapsulation into a different type of Layer 2 frame than the one commonly used for receiving packets is common. For example, a home router receives a frame from the wireless port and then sends it to router 3 over an Ethernet interface. So, the encapsulation for wireless and Ethernet is different. Also, encapsulation for Fast Ethernet, Gigabit Ethernet, and serial interfaces is different.

Figure 2 illustrates that the home router receives layer 2 packets in the shape of bits from layer 1 and then de-encapsulates the packet to read layer 3 information. When reading the source and destination, the router selects the proper outgoing interface, again encapsulates the packet, and sends it to Layer 2 and then to Layer 1.

Notice the source and destination MAC addresses and IP addresses, first on the home router and then on all the routers. The source and destination MAC addresses change at each router, but the IP address does not.

Also, notice in Figure 3 and Figure 4 that the ports between Router3 and Router2 have no MAC addresses in the frame. This is a serial link, and MAC addresses are only required on multi-access networks, such as Ethernet. A serial link is a point-to-point connection and uses a different Layer 2 frame that does not require the MAC address.

For example, when Ethernet frames destined for Server0 are received on Router3 from the Fa0/0 interface, they are de-encapsulated and then re-encapsulated for the serial interface. When Router2 receives the frame, it is de-encapsulated again and then re-encapsulated into an Ethernet frame with a destination MAC address.


The table below better summarizes the process of sending a packet from Laptop 1 to Server 0. You can see the packet source IP, MAC address, Destination IP, and MAC address.
Notice that the source and destination IP addresses do not change until the packet reaches the final destination. However, the source and destination MAC addresses change for each hop. At stage 11th, when the server responds to Laptop 1, the source and destination addresses change accordingly because now Server 0 sends a reply message to Laptop 1. So, this time, the source is server 0.
FAQs
Encapsulation wraps a Layer 3 packet with a Layer 2 frame for transmission, while de-encapsulation removes the Layer 2 frame to access the Layer 3 packet for routing decisions. This process occurs at each router hop.
MAC addresses are specific to Layer 2 and change at each hop because they identify devices within a single network segment. Each router re-encapsulates the packet into a new Layer 2 frame for the next segment.
The routing table stores the best paths to network destinations. The router uses it to determine the outgoing interface for a packet based on its destination IP address, ensuring efficient forwarding.
IP addresses (Layer 3) identify the source and destination across the entire network and remain constant to ensure the packet reaches its intended recipient, regardless of the number of router hops.
ICMP is used for diagnostic and error messaging, like ping or traceroute. In router switching, it helps test connectivity by sending packets that routers process and forward to the destination.