Router vs. Switch With a Small Network Diagram
A switch forwards frames within one network by MAC address; a router forwards packets between networks by IP address. Trace both paths step by step.
A switch connects devices within one network and forwards Ethernet frames by MAC address. A router connects different networks and forwards IP packets by IP address, choosing a next hop from its routing table. Your home “router” is usually both: a router, a small switch, a Wi-Fi access point and a DHCP server in one box.
The example network
IllustrativeAddresses are from documentation ranges.
Laptop 192.0.2.10 MAC …53:0a ─┐
Printer 192.0.2.20 MAC …53:14 ─┤ switch ─── router LAN side 192.0.2.1 (MAC …53:01)
│ router WAN side 198.51.100.7 ─── ISP ─── internet
web server 203.0.113.80
Subnet: 192.0.2.0/24, default gateway 192.0.2.1
Path 1: laptop to printer (switch only)
-
Step 1. Same subnet?
The laptop compares 192.0.2.20 with its own address under the /24 mask. Same network, so it will deliver directly, without the gateway.
-
Step 2. Find the printer's MAC
It broadcasts an ARP request: “who has 192.0.2.20?” The switch floods the broadcast to all ports; only the printer answers with MAC …53:14.
-
Step 3. Send the frame
Destination MAC …53:14, source MAC …53:0a, carrying an IP packet from 192.0.2.10 to 192.0.2.20.
-
switchStep 4. Switch forwards by MAC
The switch has learned that …53:14 is on the printer's port and sends the frame out that port only. It does not read the IP addresses.
Path 2: laptop to a website (router)
-
Step 1. Different subnet
203.0.113.80 is outside 192.0.2.0/24, so the laptop sends to its default gateway, 192.0.2.1.
-
Step 2. Frame to the router's MAC
Destination MAC is the router's LAN MAC (…53:01), but the IP destination stays 203.0.113.80. This is the key difference: the MAC names the next hop, the IP names the final destination.
-
switchStep 3. Switch forwards it
To the switch this is just another frame for MAC …53:01, sent out the router's port.
-
routerStep 4. Router routes by IP
The router strips the Ethernet header, checks its routing table (the default route points to the ISP), decrements the TTL and, at home, applies NAT: the source becomes its public address 198.51.100.7.
-
routerStep 5. New frame on the next link
The router builds a fresh link-layer header for the ISP link with new source and destination MACs. The original MAC addresses never leave the LAN.
-
Step 6. Reply comes back
The web server replies to 198.51.100.7. The router reverses the NAT mapping, frames the packet to the laptop's MAC …53:0a, and the switch delivers it.
Side by side
| Switch | Router | |
|---|---|---|
| Works with | Ethernet frames (layer 2) | IP packets (layer 3) |
| Forwards by | destination MAC address | destination IP address |
| Learns by | watching source MACs on each port | routing table: connected networks, static routes, routing protocols |
| Connects | devices on the same network | different networks (LAN to ISP) |
| Broadcasts | forwards them to all ports | stops them at the network boundary |
| Changes the packet | no | yes: TTL, link-layer header, often NAT |
“Layer 3 switches” blur the line by routing between VLANs in hardware, but the two jobs stay distinct.
Do you need a separate switch?
If your router has enough Ethernet ports, no. Add an unmanaged switch when you run out of ports or want to wire several devices in another room from one cable. A switch plugged into the router extends the same network: devices behind it get addresses from the router and talk to each other directly through the switch. Plugging in a second router instead creates a second network unless it is set to access-point or bridge mode, a common cause of devices that cannot see each other.
The MAC vs. IP address guide looks at which address changes at each hop, and the Ethernet explainer breaks a frame down byte by byte.
Sources
- RFC 1812: Requirements for IP Version 4 Routers — IETF. routers decrement TTL and forward by destination IP
- RFC 826: An Ethernet Address Resolution Protocol — IETF
- IEEE 802.3 Ethernet Working Group — IEEE
- RFC 5737: IPv4 Address Blocks Reserved for Documentation — IETF
How we made this
Illustrative sample data. The network and its addresses are an illustrative example built from documentation ranges (RFC 5737 IPv4, RFC 7042 MAC). Forwarding behaviour follows the cited standards; no live capture was taken.
Performed by Claude, an AI assistant working in the BinConvert repository, November 16, 2026.
This article was drafted with AI assistance. Every example, calculation and command output on this page was re-run or checked before release; each hop's addresses were checked for consistency with the subnet and forwarding rules. Review: automated test suite and source check, November 16, 2026.
Spotted an error? Tell us and we will correct it.