Skip to main content

Command Palette

Search for a command to run...

๐ŸŒ Networking Devices (Part 2) โ€“ Bridges, Switches, and Routers | CN#5

Published
โ€ข4 min read
๐ŸŒ Networking Devices (Part 2) โ€“ Bridges, Switches, and Routers | CN#5

In CN4, we explored cables, repeaters, and hubs. Now, letโ€™s move to smarter devices that donโ€™t just forward blindly โ€” they actually analyze and decide how data flows.

๐Ÿ”น Bridge

๐Ÿ”ธ What is a Bridge?

A bridge is a device that connects two or more LAN segments. Unlike hubs (which broadcast data everywhere), a bridge can look at the MAC address of each frame and decide whether to forward it or not.

  • Works at Layer 2 (Data Link Layer).

  • Introduced to reduce collisions and unnecessary traffic.

๐Ÿ”ธ How it Works

When a frame comes in:

  1. The bridge checks the destination MAC address.

  2. If the destination is on the same segment โ†’ it filters (doesnโ€™t forward).

  3. If the destination is on another segment โ†’ it forwards the frame only there.

  4. Over time, it builds a MAC address table (like a memory map of which devices are connected to which port).

๐Ÿ”ธ Technical Details

  • Number of Ports: Usually 2 (but can be more).

  • Forwarding? โœ… Yes, based on MAC address.

  • Filtering? โœ… Yes, prevents unnecessary traffic.

  • Collision Domains: 1 per port (so if a bridge has 2 ports, it has 2 separate collision domains).

  • Broadcast Domains: Still 1 (doesnโ€™t break broadcasts).

๐Ÿ”ธ Real World Example

Imagine an apartment building with two wings. A security guard (bridge) only lets residents cross wings if they actually need to go there, instead of allowing everyone to run around.


๐Ÿ”น Switch

๐Ÿ”ธ What is a Switch?

A switch is essentially a multi-port bridge, but much smarter and faster. It connects multiple devices and forwards frames only to the specific port where the destination device is.

  • Works at Layer 2 (some advanced ones at Layer 3 = โ€œLayer 3 switchesโ€).

  • Reduces both collisions and unnecessary traffic.

๐Ÿ”ธ How it Works

  1. Maintains a MAC Address Table for all connected devices.

  2. When a frame arrives, the switch looks up the MAC address.

  3. Forwards only to the correct port, not to everyone.

  4. Operates in full-duplex mode (no collisions).

๐Ÿ”ธ Technical Details

  • Number of Ports: 4โ€“48 (common), can be stacked for hundreds.

  • Forwarding? โœ… Yes, MAC-based.

  • Filtering? โœ… Yes, blocks irrelevant frames.

  • Collision Domains: 1 per port (so a 24-port switch = 24 collision domains).

  • Broadcast Domains: Still 1 (unless VLANs are configured).

๐Ÿ”ธ Real World Example

Think of a post office clerk who knows which desk each employee sits at. Instead of shouting, the clerk quietly hands your parcel to the right person.


๐Ÿ”น Router

๐Ÿ”ธ What is a Router?

A router is the brain of networking. Unlike bridges and switches, which only look at MAC addresses, a router looks at IP addresses and decides the best path to forward packets across different networks.

  • Works at Layer 3 (Network Layer).

  • Used to connect LANs to WAN (e.g., home network to the Internet).

๐Ÿ”ธ How it Works

  1. Reads the destination IP address in the packet.

  2. Uses a routing table (like a map) to determine where to forward it.

  3. Can perform Network Address Translation (NAT), firewall filtering, and traffic prioritization.

  4. Separates both collision and broadcast domains.

๐Ÿ”ธ Technical Details

  • Number of Ports: Typically 2+ (LAN + WAN), enterprise routers can have dozens.

  • Forwarding? โœ… Yes, based on IP addresses.

  • Filtering? โœ… Yes, applies access control and routing policies.

  • Collision Domains: 1 per port.

  • Broadcast Domains: Each interface is a separate broadcast domain (unlike switches).

๐Ÿ”ธ Real World Example

Think of Google Maps: It doesnโ€™t just tell you which street is nearby (like a switch), it figures out the best route across cities to get you to your destination.


๐Ÿ“Š Comparison Table

DevicePortsForwardingFilteringCollision DomainsBroadcast DomainsWorks At
Bridge2+โœ… MACโœ… YesPer port1Layer 2
Switch4โ€“48+โœ… MACโœ… YesPer port1 (unless VLAN)Layer 2
RouterMultipleโœ… IPโœ… YesPer portPer interfaceLayer 3

โœ… Stay tuned for CN #6: Exploring the OSI Model!
๐Ÿงต Follow the entire CN series to master networking step-by-step.

More from this blog

A

Alien on Earth: Learning CS

6 posts