Computer Networks

Bridge

Connects two L2 segments and learns MACs. A switch is a multi-port bridge.

Level: beginner

What is it?

A network bridge connects layer-2 segments and forwards frames based on MAC addresses. Modern Ethernet switches are effectively multiport bridges with hardware-accelerated forwarding.

Why does it matter?

Bridging joins local segments while limiting unnecessary traffic compared with repeating every signal. Redundant bridged paths need loop prevention because Ethernet frames do not carry a general hop limit.

Mental model

A bridge learns which MAC addresses are reachable on which side. If a destination is on the same side as the source, it can filter the frame; otherwise it forwards it across.

How it works

  • A bridge learns source addresses to build a forwarding database.
  • Bridges forward known unicast frames selectively and flood eligible unknown/broadcast frames.
  • Transparent bridging preserves the higher-layer IP packet while changing how the local link delivers the frame.
  • Spanning-tree protocols can create a loop-free forwarding topology across redundant bridges.
  • A router differs by making layer-3 forwarding decisions between IP networks.

Steps

  • Frame A arrives from segment 1 with source MAC A.
  • The bridge learns A is reachable through segment 1.
  • For a frame destined to MAC B on segment 2, it forwards the frame across the bridge.
  • For a destination already known on segment 1, it can filter rather than sending the frame onto segment 2.

Real-world usage

  • Explaining basic Ethernet switching concepts.
  • Understanding the bridge/switch relationship and spanning tree.

Common mistakes

  • Confusing a bridge with an IP router.
  • Assuming bridges can have arbitrary redundant forwarding paths without loops.
  • Assuming the bridge needs to inspect HTTP or TCP to forward ordinary Ethernet frames.

Interview questions

What is the relationship between a bridge and a switch?

A switch is commonly described as a multiport bridge, implementing the same basic layer-2 learning and forwarding behavior at higher port density and speed.

Why does bridging need loop prevention?

Layer-2 frames lack a general IP-style hop limit, so a forwarding loop can repeatedly circulate and amplify traffic.

Prerequisites

Related concepts

Continue learning

Browse the full computer science library