Introduction
Welcome back. In our last lesson, we established that a Layer 3 switch serves as the central routing hub in a modern network, typically at the distribution or collapsed core layer. We saw that it uses Switched Virtual Interfaces (SVIs) to act as the default gateway for each VLAN.
Today, we're going to dive deep into the mechanics of that process. Our learning outcome is to trace the packet flow for a host in one VLAN communicating with a host in another VLAN via an L3 switch. We'll follow a single packet on its journey, step-by-step, to understand precisely what happens at both Layer 2 (MAC addresses) and Layer 3 (IP addresses). This will connect the configuration commands you're familiar with to the underlying logic of how a network actually functions.
The Scenario
Let's set the stage. Imagine a simple network with a single Layer 3 switch.
- Host A is in VLAN 10 with IP
192.168.10.100. - Host B is in VLAN 20 with IP
192.168.20.200. - The L3 Switch has two SVIs configured:
interface Vlan10with IP192.168.10.1(Host A's gateway)interface Vlan20with IP192.168.20.1(Host B's gateway)
Host A wants to send a packet (e.g., an ICMP echo request from a ping) to Host B. Since they are in different VLANs and different subnets, they cannot communicate directly. They need a router—in this case, our L3 switch.
Step 1: The Source Host's Decision
The entire process begins with a simple decision made by Host A's operating system. Before sending the packet, Host A must determine if the destination is on its local network or a remote one.
It does this by comparing its own network address with the destination's network address. Assuming a /24 mask (255.255.255.0):
- Host A's network:
192.168.10.100AND255.255.255.0=192.168.10.0 - Host B's network:
192.168.20.200AND255.255.255.0=192.168.20.0
The network addresses are different. Host A now knows it cannot deliver the packet directly; it must send it to its configured default gateway (192.168.10.1).
Layer 3 Switching: ASIC-Based Routing & Inter-VLAN Communication
The following article explains this fundamental host behavior. It's a critical first step in any routed communication.
Read the section titled 'Host Communication Behavior'. Focus on the logic described for communication with hosts on 'Different Subnets'.
Step 2: The Journey to the Gateway (Layer 2)
Host A knows it needs to send the packet to the gateway's IP address (192.168.10.1), but to build an Ethernet frame, it needs the gateway's MAC address.
-
ARP for the Gateway: Host A checks its ARP cache. If it doesn't have an entry for
192.168.10.1, it broadcasts an ARP request within VLAN 10: "Who has192.168.10.1? Tell192.168.10.100." -
Gateway's Reply: The L3 switch, which owns the SVI for VLAN 10, receives this broadcast. It replies with a unicast ARP reply to Host A, providing the MAC address associated with its SVI (let's call it
MAC-GW). -
Frame Construction: Host A now has all the information it needs to build the frame. This is the crucial part:
- Source IP:
192.168.10.100(Host A) - Destination IP:
192.168.20.200(Host B - the final destination) - Source MAC:
MAC-A(Host A's MAC address) - Destination MAC:
MAC-GW(The gateway's MAC address - the next hop)
- Source IP:
Host A sends this frame onto the network. The access switch it's connected to forwards this frame (based on the destination MAC-GW) up its trunk link to the L3 switch.
Step 3: Inside the L3 Switch - The Routing Process
The L3 switch receives the frame. It examines the destination MAC address (MAC-GW) and sees that it belongs to one of its own SVIs. This tells the switch that the packet is not meant to be simply switched at Layer 2 but must be processed by its Layer 3 routing engine.
- Packet Inspection: The switch strips off the Layer 2 Ethernet header and looks at the Layer 3 IP header. It sees the destination IP address is
192.168.20.200. - Routing Table Lookup: The switch consults its routing table. It finds an entry for the
192.168.20.0/24network, which is a directly connected network via theinterface Vlan20SVI. The switch now knows it must forward the packet out through VLAN 20. - ARP for the Destination: The switch now needs to build a new Layer 2 frame to send to Host B. To do this, it needs Host B's MAC address. It checks its own ARP table for an entry for
192.168.20.200. If one doesn't exist, it sends an ARP request out on all ports in VLAN 20: "Who has192.168.20.200? Tell192.168.20.1." - Destination's Reply: Host B responds with its MAC address (
MAC-B). The L3 switch caches this information. - Frame Rewrite: The L3 switch now reconstructs the frame for its final delivery to Host B.

The new frame looks like this:
- Source IP:
192.168.10.100(unchanged) - Destination IP:
192.168.20.200(unchanged) - Source MAC:
MAC-GW(The switch's MAC for the outgoing SVI) - Destination MAC:
MAC-B(Host B's MAC address)
The switch also decrements the IP packet's Time-To-Live (TTL) field by 1 and recalculates the IP and frame checksums. It then sends this new frame out the port where Host B is connected.
The key takeaway is that IP addresses guide the packet end-to-end, while MAC addresses guide the frame from hop to hop.
Step 4: Seeing it in Action
Let's watch a practical demonstration of this process. The following video by Keith Barker walks through setting up SVIs and then testing communication, which perfectly illustrates the packet flow we've just discussed.
Inter-VLAN Routing using a Multi-Layer Switch | Cisco CCNA 200-301
First, let's watch the setup. This part explains why a gateway is needed and how SVIs are created on a multilayer switch to act as those logical gateways.
Watch from 01:20 to 07:12. Focus on the explanation of why a host needs a default gateway to communicate outside its local network and how the multilayer switch provides this function through logical SVIs.
Now that the conceptual groundwork is laid, let's see the configuration and verification. This is where you can see the results of the packet trace in real-time.
Inter-VLAN Routing using a Multi-Layer Switch | Cisco CCNA 200-301
Now for the verification. Pay close attention to the ping and tracert commands. The tracert (trace route) command explicitly shows the packet's first hop to the SVI's IP address on the L3 switch, confirming our packet trace.
Watch from 20:59 to 29:51. Notice how he first tests connectivity to the default gateway (ping 10.16.0.1), which is our 'Step 2' (ARPing for the gateway). Then, he tests end-to-end connectivity, which relies on the full routing process. The tracert at 29:10 is the key moment that visualizes the path.
The High-Speed Engine: "Route Once, Switch Many"
The process we've described—involving ARP lookups and routing table decisions—is handled by the switch's CPU. This is relatively slow. If every single packet had to go through the CPU, the switch couldn't handle the traffic of a large network.
This is where specialized hardware, known as Application-Specific Integrated Circuits (ASICs), comes in. Modern Cisco switches use a technology called Cisco Express Forwarding (CEF) to perform routing in hardware at line rate.
The principle is "Route Once, Switch Many."
- Route Once: The very first packet of a flow goes to the CPU, which performs the routing table lookup and resolves the ARP entry as we described.
- Populate Hardware Tables: The CPU uses this information to program the ASICs, creating an entry in hardware tables:
- Forwarding Information Base (FIB): Derived from the IP routing table, it contains the destination prefixes and next-hop information.
- Adjacency Table: Derived from the ARP table, it contains the pre-built Layer 2 headers for the next hop.
- Switch Many: All subsequent packets in the same flow are handled entirely by the ASIC. It performs a high-speed lookup in the hardware tables, rewrites the frame headers, and forwards the packet without ever bothering the CPU.
This is why L3 switches are so powerful: they combine the intelligence of a router with the speed of a switch.
Layer 3 Switching: ASIC-Based Routing & Inter-VLAN Communication
This article provides an excellent, detailed explanation of the hardware forwarding process, contrasting the 'first packet' handled by the CPU with subsequent packets handled by the ASIC.
Please read the sections 'Layer 3 Forwarding Process: Scenario 1' and 'Characteristics of Layer 3 Switching'. Focus on the step-by-step flow and the summary of how MAC and IP addresses change during forwarding.
Conclusion
In this lesson, we deconstructed the process of inter-VLAN routing, tracing a packet from source to destination. You now have a clear picture of the interplay between Layer 2 and Layer 3, and the critical role the L3 switch plays as the intermediary.
Key Takeaways:
- Communication between VLANs is a routed process, not a switched one.
- A host sends packets for remote networks to its default gateway.
- The IP addresses in a packet remain constant from the original source to the final destination.
- The MAC addresses in the Ethernet frame change at every Layer 3 hop. The L3 switch's primary job is to receive a frame destined for its SVI and create a new frame for the next hop.
- The principle of "Route Once, Switch Many" (using CEF and ASICs) allows L3 switches to perform this routing function at extremely high speeds.
Next Steps
Now that you understand how a single L3 switch routes traffic, our next lesson will expand this to a more realistic topology. We will focus on how to plan SVI placement and IP addressing in a multi-switch L3 topology. This will involve deciding which switches should perform L3 functions and how to link them together efficiently.