Networking Fundamentals

Hub vs Switch vs Router — Key Differences Explained

G Gurpreet Singh July 28, 2026 5 min read
Hub vs Switch vs Router — Key Differences Explained
A hub broadcasts every frame to all connected ports (Layer 1, no intelligence). A switch forwards frames only to the correct port using MAC addresses (Layer 2). A router routes packets between different networks using IP addresses (Layer 3). Hubs are obsolete — modern networks use switches and routers.
Key takeaways

  • Hub = Layer 1 — no intelligence, broadcasts to all ports, creates one collision domain, completely obsolete
  • Switch = Layer 2 — uses MAC address table, one collision domain per port, full-duplex, widely used in LANs
  • Router = Layer 3 — uses IP routing table, separates broadcast domains, connects different networks
  • Home routers are 3-in-1 devices: router + switch (LAN ports) + wireless access point
  • Layer 3 switches can route between VLANs without a separate router — used at distribution/core layer
  • Switches flood unknown unicast frames to all ports — this is not a security risk in normal operation
  • Default gateway = the router's IP address that devices send traffic to when destination is outside local network

A hub broadcasts data to all connected devices (Layer 1). A switch forwards frames only to the correct device using MAC addresses (Layer 2). A router routes packets between different networks using IP addresses (Layer 3). In modern networks, hubs are obsolete — switches and routers do all the work.

Quick Comparison Table

FeatureHubSwitchRouter
OSI LayerLayer 1 (Physical)Layer 2 (Data Link)Layer 3 (Network)
AddressingNoneMAC addressIP address
ForwardingBroadcast to all portsUnicast to specific portRoutes between networks
Collision domainOne (shared)One per portOne per port
Broadcast domainOneOne (per VLAN)One per interface
IntelligenceNoneMAC address tableRouting table
Used in?ObsoleteLANs everywhereBetween networks, internet
SpeedHalf-duplex onlyFull-duplexFull-duplex

What is a Hub?

A hub is the simplest network device — it has no intelligence. Every frame received on any port is immediately retransmitted out every other port. It operates at OSI Layer 1 and has no awareness of MAC addresses or IP addresses.

Problems with hubs:

  • Collisions: All ports share a single collision domain — only one device can transmit at a time
  • Security risk: Every device sees every frame — trivial to sniff traffic with a packet analyzer
  • Bandwidth waste: A 100 Mbps hub shared among 8 devices = ~12.5 Mbps average per device

Status: Hubs are completely obsolete. They have not been manufactured for mainstream use since the early 2000s. Every modern network uses switches.

What is a Switch?

A network switch is an intelligent Layer 2 device. When a frame arrives, the switch reads the source MAC address, records which port it came from, and stores this in its MAC address table (also called CAM table). When forwarding, the switch sends the frame only to the port associated with the destination MAC address — not to every port like a hub.

How a Switch Forwards Frames

  1. Frame arrives on port 1 from Device A (MAC: AA:AA:AA:AA:AA:AA)
  2. Switch records: Port 1 = AA:AA:AA:AA:AA:AA in MAC table
  3. Switch reads destination MAC: BB:BB:BB:BB:BB:BB
  4. If BB:BB:BB:BB:BB:BB is in the table on port 3 → sends frame ONLY to port 3
  5. If not in table → floods frame to all ports (unknown unicast flood)

Switch Benefits

  • Dedicated bandwidth: Each port = its own collision domain — full-duplex, no collisions
  • Security: Devices only receive frames addressed to them
  • VLANs: Logical network segmentation within one physical switch
  • Speed: Modern switches operate at 1 Gbps, 10 Gbps, 25 Gbps, or 100 Gbps per port

Types of Switches

  • Unmanaged: Plug and play, no configuration — home/small office use
  • Managed: VLAN support, STP, port security, monitoring — enterprise use
  • Layer 3 switch: Has built-in routing capability — routes between VLANs without a separate router
  • PoE switch: Powers IP phones, cameras, and WAPs through the Ethernet cable

What is a Router?

A router operates at Layer 3 and connects different networks together. While a switch works with MAC addresses within the same network, a router works with IP addresses and makes decisions about where to send packets across different networks.

Your home router connects your local network (192.168.x.x) to the internet (your ISP’s network). Without it, your devices could only communicate with each other — not with the wider internet.

What a Router Does

  • Receives a packet, reads the destination IP address
  • Looks up the destination in its routing table
  • Forwards the packet out the appropriate interface toward the destination
  • Strips the old Layer 2 header and writes a new one for the next hop
  • Decrements the TTL (Time to Live) — drops packet if TTL reaches 0

Router Features

  • NAT: Translates private IPs to public IPs — allows multiple devices to share one public IP
  • DHCP server: Automatically assigns IP addresses to connected devices
  • Firewall: Basic packet filtering — stateful inspection on home routers
  • Routing protocols: BGP, OSPF, EIGRP — learns routes dynamically from other routers
  • QoS: Prioritizes traffic — critical for VoIP and video conferencing

When to Use Each Device

Use CaseDevice
Connect PCs in same office/floorSwitch
Connect office to internetRouter
Connect two different officesRouter (+ WAN link)
Segment office into departmentsManaged switch (VLANs)
Route between VLANs without a routerLayer 3 switch
Power IP phones/cameras/WAPsPoE switch
Home networkHome router (switch + router + WAP combined)

Modern Home Router — All Three in One

Your home “router” is actually three devices in one box: a router (routes between your LAN and the internet), a switch (the 4 LAN ports on the back), and a wireless access point (the WiFi). In enterprise networks, these functions are handled by separate dedicated devices for performance and reliability.

Related Articles

Frequently Asked Questions

Can a switch replace a router?

A standard Layer 2 switch cannot replace a router — it cannot route traffic between different IP networks. However, a Layer 3 switch can route between VLANs within the same organization. You still need a router (or firewall with routing capability) to connect to the internet or other external networks.

Does a router have a MAC address?

Yes. Every router interface has a MAC address for Layer 2 communication and an IP address for Layer 3 routing. When a device sends data to the router (its default gateway), it uses the router’s MAC address in the Ethernet frame header.

What is the default gateway?

The default gateway is the router’s IP address that devices send traffic to when the destination is outside their local network. For example, if your PC has IP 192.168.1.10 and the router is 192.168.1.1, the default gateway is 192.168.1.1.

Is a firewall a router?

A firewall can perform routing functions, but its primary purpose is traffic filtering and security enforcement. A router’s primary purpose is path selection and packet forwarding. In enterprise networks, the firewall sits between the router and the internal network, inspecting traffic the router has already forwarded.

]]>

GU
Written by

Gurpreet Singh

Hey! I"m Gurpreet Singh and I Have 7+ Years of experience in the Network & Security Domain as well as the Cloud Infra Domain. I am Certified with Cisco ( CCNA ), CheckPoint ( CCSA ), 1xAWS, 3xAZURE, and 3xNSE. So I love to share my tech knowledge with you.

Leave a Reply

Your email address will not be published. Required fields are marked *