Overview

A switch connects devices within a single network by forwarding traffic based on MAC addresses, while a router connects separate networks together by forwarding traffic based on IP addresses. Plugging a device into the wrong one is a common source of confusion — one expands a LAN, the other bridges LANs to each other or to the internet.

Comparison Diagram

SwitchRouterSingle broadcast domainSwitchPC1PC2PC3Forwards by MAC address10.0.1.0/24PCPCInternetWANRouterForwards by IP address, links networks

Comparison Table

AspectSwitchRouter
OSI layerLayer 2 (Data Link)Layer 3 (Network)
Addressing usedMAC addressesIP addresses
Forwarding tableMAC address table (CAM table), learned automaticallyRouting table, built via static routes or routing protocols
Broadcast domainDevices share one broadcast domain (unless VLANs are configured)Separates traffic into distinct broadcast domains per interface
Typical placementConnects devices within a single LAN segmentConnects different networks together, e.g. LAN to LAN or LAN to WAN
Unknown-destination handlingFloods frame to all ports in the VLAN when MAC is unknownDrops or rejects packets with no matching route
Built-in servicesBasic switching only, plus optional VLANs/QoS on managed modelsOften includes NAT, DHCP, firewall, and VPN functions
Typical deviceCisco Catalyst switch in a wiring closetHome router or edge router linking a LAN to an ISP

Key Differences

  • Switches forward traffic using MAC addresses at Layer 2, while routers forward using IP addresses at Layer 3.
  • A switch keeps connected devices in one broadcast domain; a router splits traffic into separate domains.
  • Switches flood frames to unknown destinations within a VLAN; routers simply drop packets they can’t route.
  • Routers commonly bundle NAT and firewall features that switches don’t provide.
  • Switches scale port count for a single network; routers scale the number of distinct networks a device can reach.

When to Use Each

Switch

  • Connecting Local Devices: Use a switch to link PCs, printers, and servers within the same LAN for fast, low-latency communication.
  • Expanding Port Capacity: A switch adds more physical ports to an existing network segment without changing its addressing.
  • VLAN Segmentation: Managed switches can logically separate traffic into VLANs without deploying separate physical networks.

Router

  • Connecting Different Networks: A router is required to pass traffic between separate subnets or between a LAN and the internet.
  • Providing Internet Access: Home and office routers route traffic from the local network to the ISP’s network.
  • NAT and Firewall Needs: Routers translate private addresses to public ones and enforce access rules between networks.