100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

What is a Network Bridge?

Learn what a network bridge is, how it learns MAC addresses to filter and forward frames, and how it differs from hubs and switches.

mediumQ156 of 224 in Computer Networks Est. time: 5 minsLast updated:
Open Code Lab

Expected Interview Answer

A network bridge is a Layer 2 device that connects two or more network segments and selectively forwards Ethernet frames between them based on learned MAC addresses, effectively joining separate collision or broadcast domains into one logical segment while filtering unnecessary traffic.

A bridge listens to traffic on each of its ports and builds a forwarding table mapping MAC addresses to the port they were seen on, so it can decide to forward, filter, or flood a frame instead of blindly repeating everything the way a hub does. If a frame’s destination MAC is known to be on the same segment it arrived from, the bridge drops it (filtering); if the destination is on a different segment, it forwards only to that port; if the destination is unknown or broadcast, it floods to all other ports. Modern multiport bridges are effectively what we call switches, and bridges run the Spanning Tree Protocol (STP) to prevent loops when segments are connected redundantly. A bridge differs from a repeater/hub, which operates at Layer 1 and has no intelligence about addresses, and from a router, which operates at Layer 3 and forwards based on IP addresses across different networks.

  • Reduces collisions by segmenting a shared network into smaller domains
  • Filters unnecessary traffic instead of blindly repeating every frame
  • Learns MAC-to-port mappings automatically, no manual configuration
  • Foundation concept behind modern multiport Ethernet switches

AI Mentor Explanation

A network bridge is like a scorer who sits between two adjoining practice nets and only relays a shout to the other net if the message is actually meant for someone practicing there. If the shout is meant for someone in the same net it originated in, the scorer stays silent, cutting noise; if the destination net is unknown, the scorer calls it out to both. Over time the scorer learns which players usually practice in which net and stops guessing. That selective relaying, learned over time, is exactly what a bridge does with Ethernet frames.

Step-by-Step Explanation

  1. Step 1

    Listen and learn

    The bridge inspects the source MAC address of every incoming frame and records which port it arrived on.

  2. Step 2

    Build the table

    A MAC-address-to-port forwarding table is populated dynamically, with no manual configuration needed.

  3. Step 3

    Decide per frame

    For each new frame, the bridge filters (same segment), forwards (known other segment), or floods (unknown/broadcast destination).

  4. Step 4

    Prevent loops

    When multiple bridges create redundant paths, Spanning Tree Protocol blocks loops while keeping a backup path ready.

What Interviewer Expects

  • Correctly places the bridge at Layer 2, forwarding by MAC address
  • Explains the learn/filter/forward/flood behavior clearly
  • Distinguishes a bridge from a hub (Layer 1) and a router (Layer 3)
  • Mentions Spanning Tree Protocol in the context of loop prevention

Common Mistakes

  • Confusing a bridge with a simple repeater/hub that has no intelligence
  • Thinking a bridge forwards based on IP addresses like a router does
  • Not knowing a bridge builds its forwarding table dynamically by learning
  • Forgetting that redundant bridged links need STP to avoid loops

Best Answer (HR Friendly)

A network bridge connects two segments of a network and is smart enough to only pass along traffic that actually needs to cross over, instead of repeating everything blindly. It learns over time which devices are on which side, so it can filter out unnecessary chatter and reduce congestion. Modern switches are essentially bridges with many ports built in.

Code Example

Creating a software bridge on Linux
# Create a bridge interface joining two Ethernet NICs
sudo ip link add name br0 type bridge
sudo ip link set eth0 master br0
sudo ip link set eth1 master br0
sudo ip link set br0 up

# View the bridge’s learned MAC-to-port forwarding table
bridge fdb show br br0

Follow-up Questions

  • How does a bridge differ from a switch in modern networks?
  • What problem does the Spanning Tree Protocol solve for bridges?
  • How does a bridge build and age out entries in its forwarding table?
  • What happens when a bridge receives a frame with an unknown destination MAC?

MCQ Practice

1. At which OSI layer does a network bridge primarily operate?

A bridge forwards frames based on MAC addresses, which is a Data Link layer (Layer 2) function.

2. What does a bridge do when it receives a frame for a destination on the same segment it arrived from?

The bridge filters the frame since the destination is already on the local segment; no forwarding is needed.

3. What protocol do bridges use to prevent loops in redundant topologies?

Spanning Tree Protocol (STP) detects redundant paths and blocks ports to prevent Layer 2 loops.

Flash Cards

What is a network bridge?A Layer 2 device joining two segments, forwarding frames selectively based on learned MAC addresses.

How does a bridge learn addresses?By inspecting the source MAC of incoming frames and recording the port they arrived on.

Bridge vs hub?A bridge intelligently filters/forwards by MAC address; a hub blindly repeats to all ports at Layer 1.

Why does a bridge need STP?To prevent Layer 2 loops when redundant bridged paths exist between segments.

1 / 4

Continue Learning