Hubs (Layer 1): Simple devices that broadcast incoming data packets to all connected ports. Because they do not manage traffic, they create a single large collision domain, leading to network congestion as more devices are added.
Switches (Layer 2): Intelligent devices that learn the MAC addresses of connected nodes. They create a dedicated virtual circuit between the sender and receiver, effectively providing each port with its own collision domain and maximizing available bandwidth.
Bridges: Used to connect two separate network segments. A bridge inspects the destination MAC address to decide whether to forward a packet across the bridge or keep it within the local segment, thereby reducing unnecessary traffic.
Routers (Layer 3): Devices that connect different networks, such as a LAN to the Internet. Routers use IP Addresses and routing tables to determine the best path for data packets to travel across complex network boundaries.
Gateways: A combination of hardware and software that connects networks using different protocols. A gateway performs protocol translation, allowing a LAN using one communication standard to communicate with a mainframe or external network using another.
Modems: Hardware that modulates digital data into analog signals (and vice versa) for transmission over traditional telephone lines or cable systems, serving as the bridge between the LAN and the Service Provider's infrastructure.
| Feature | Hub | Switch | Router |
|---|---|---|---|
| OSI Layer | Physical (Layer 1) | Data Link (Layer 2) | Network (Layer 3) |
| Traffic Handling | Broadcasts to all ports | Forwards to specific MAC | Routes based on IP |
| Collision Domain | Shared across all ports | One per port | One per port |
| Intelligence | Low (Passive) | Medium (Active) | High (Dynamic) |
Identify the Layer: When asked about a device's function, first identify its OSI layer. If it deals with MAC addresses, it is Layer 2 (Switch/Bridge); if it deals with IP addresses, it is Layer 3 (Router).
Collision vs. Broadcast Domains: Remember that a Switch breaks up collision domains but maintains a single broadcast domain. A Router breaks up both collision and broadcast domains.
Media Selection Logic: If a scenario requires high security and long distance, choose Fiber Optic. If cost-effectiveness in a small office is the priority, choose UTP.
Sanity Check: Always verify if the hardware matches the topology. For example, a Star topology requires a central Hub or Switch, whereas a Bus topology requires terminators and a single backbone cable.