Networking

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 throughLaptop prints a page: the traffic never reaches the router
1 / 4
  1. 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.

  2. 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.

  3. 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.

  4. 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 throughLaptop loads a page from 203.0.113.80: the router rewrites the frame
1 / 6
  1. 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.

  2. 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.

  3. switchStep 3. Switch forwards it

    To the switch this is just another frame for MAC …53:01, sent out the router's port.

  4. 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.

  5. 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.

  6. 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

SwitchRouter
Works withEthernet frames (layer 2)IP packets (layer 3)
Forwards bydestination MAC addressdestination IP address
Learns bywatching source MACs on each portrouting table: connected networks, static routes, routing protocols
Connectsdevices on the same networkdifferent networks (LAN to ISP)
Broadcastsforwards them to all portsstops them at the network boundary
Changes the packetnoyes: 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

  1. RFC 1812: Requirements for IP Version 4 Routers — IETF. routers decrement TTL and forward by destination IP
  2. RFC 826: An Ethernet Address Resolution Protocol — IETF
  3. IEEE 802.3 Ethernet Working Group — IEEE
  4. 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.

Copied to clipboard!