🔌 Hubs vs Switches

Hubs (Layer 1)

A hub is a simple repeater. It forwards incoming frames out all ports except the incoming one. It operates at half‑duplex, causing collisions. All devices share bandwidth, so performance degrades as traffic increases. Hubs are obsolete in modern networks.

Switches (Layer 2)

A switch is a smarter device. It learns MAC addresses and builds a MAC address table (CAM table) to forward frames only to the intended destination port, reducing collisions and increasing efficiency.

How a Switch Works

  1. Learning: When a frame arrives, the switch records the source MAC address and the port it came from. This populates the CAM table.
  2. Forwarding: It looks up the destination MAC in the CAM table:
    • If found, the frame is sent only to that port (unicast).
    • If not found, the frame is flooded to all ports (except the incoming one) – this is called unknown unicast flooding.
  3. Broadcast handling: If the destination MAC is FF:FF:FF:FF:FF:FF (broadcast), the switch ignores the table and floods the frame to all ports (like a hub).

Comparison Table

FeatureHubSwitch
OSI LayerLayer 1 (Physical)Layer 2 (Data Link)
ForwardingRepeats to all portsSelective (based on MAC table)
Collision DomainSingle (shared)Each port is its own domain
BandwidthShared among all portsDedicated per port
LearningNoYes (CAM table)
SecurityLow (all devices see all traffic)Higher (traffic only to destination)

Security Considerations

Practical Tips for Medical Networks