3.5 Network Switching: Bridges, Collision vs Broadcast Domains
💡 Core Intuition: The Traffic Intersection Analogy
🍳 The Everyday Analogy: Roundabout vs Traffic Policeman vs City Border
Imagine vehicles navigating city roadways:
- The Repeater / Hub (Layer 1): An open intersection where every incoming car is copied and hurled simultaneously down every single outgoing street! If two cars arrive at the same second, they crash into each other in the center (Collision). The more cars enter the intersection, the more crashes occur until all traffic grinds to a halt.
- The Bridge / Switch (Layer 2): An intelligent traffic officer stationed at the intersection with a clipboard. The officer notes down: "Car license plate
ABC-123just came from North Street." When a car arrives asking to go toABC-123, the officer directs it only to North Street, keeping South, East, and West completely free! Each street is an isolated lane where crashes can never affect the other streets (Separate Collision Domains). But if someone blares a citywide emergency siren (Broadcast), everyone on every street still hears it (Single Broadcast Domain). - The Router (Layer 3): A formal border security checkpoint between two sovereign cities. The checkpoint blocks all local traffic sirens from crossing the border, isolating both crashes and noise completely (Separate Collision and Broadcast Domains).
💻 Bridging to Computer Science
When local area networks grow from a few workstations to thousands of hosts, shared-bus coaxial cables collapse under collision congestion.
To scale networks, hardware engineers developed Transparent Bridges and multi-port Ethernet Switches. Operating at Layer 2 (Data Link Layer), switches inspect physical MAC addresses, make microsecond hardware forwarding decisions, and divide a single large network into hundreds of isolated micro-collision domains.
📑Table of Contents
- 🔌 Connecting Devices: Hubs vs Switches vs Routers
- 🧠 Transparent Bridges & Backward Learning Internals
- 🚦 Forwarding, Filtering & Flooding State Machine
- 💥 Collision Domains vs Broadcast Domains: Rigorous Counting Rules
- 🌳 Bridging Loops, Broadcast Storms & Spanning Tree (STP)
- 🏭 Real-World Production Context: Modern Full-Duplex Switching & Data Center Spines
- 📐 Numerical Applications & Worked Examples
- 🎯 Exam & Interview Pitfall Check
🔌 Connecting Devices: Hubs vs Switches vs Routers
Understanding which OSI layer a networking device operates at determines how it handles electrical collisions and logical broadcasts:
Comparative analysis of Layer 1, Layer 2, and Layer 3 connecting devices
Repeaters & Active Hubs
- •Operates strictly at the Physical Layer; zero awareness of MAC frames or IP packets.
- •Blindly repeats incoming electrical bits across all other connected ports.
- •All ports share a single collision domain and a single broadcast domain.
- •A collision on any one port propagates to and corrupts every connected station.
Bridges & Ethernet Switches
- •Operates at the Data Link Layer; inspects 48-bit MAC address headers.
- •Maintains a hardware Forwarding Database (CAM Table) via backward learning.
- •Breaks the network into isolated collision domains (one per switch port).
- •Does NOT isolate broadcast traffic: all ports share a single broadcast domain.
🧠 Transparent Bridges & Backward Learning Internals
A bridge is called Transparent because stations on the LAN are completely unaware of its existence. You can plug a bridge into a live network, and without any manual configuration, stations immediately communicate through it.
How Does a Switch Learn Network Topology?
A newly booted switch has an empty Forwarding Table (Filtering Database / CAM Table). It learns node locations dynamically using the Backward Learning Algorithm:
Golden Rule of Backward Learning: A bridge learns node locations by inspecting the Source MAC Address of every incoming frame, associating that MAC address with the physical Ingress Port on which the frame arrived.
Hardware switching fabric associates incoming Source MAC addresses with physical ports in CAM table
Table Entry Format
Each entry in the switch's Content Addressable Memory (CAM) table contains:
- MAC Address: The 48-bit hardware address of a host.
- Port Number: The physical switch interface where that host resides.
- Age / TTL Timer: A countdown timer (typically 300 seconds). If no frames arrive from that MAC address before the timer expires, the entry is purged to adapt to laptop mobility or cable reconnections.
🚦 Forwarding, Filtering & Flooding State Machine
When a frame enters a switch on Ingress Port , the switch executes three sequential operations:
Microsecond hardware inspection and forwarding decision sequence
Learn Source MAC
Record (Source MAC, Port, Timestamp) in CAM table. Reset aging timer.
Table Lookup
Query Destination MAC in CAM table. Identify mapped egress port.
Forwarding Action
Execute Filter (same port), Forward (mapped port), or Flood (unknown).
The Three Operational Outcomes
| Destination MAC Status | Egress Port Relation | Switch Action | Network Effect |
|---|---|---|---|
| Known in Table | Target Port == Ingress Port | FILTER (Discard) | The destination host is on the same local segment as the sender. The recipient already received the frame directly over the shared cable; forwarding through the switch would waste bandwidth. |
| Known in Table | Target Port Ingress Port | FORWARD (Unicast) | The switch selectively transmits the frame out only to that specific egress port. All other ports remain silent and free for parallel conversations. |
| Unknown in Table | Not in CAM table | FLOOD | The switch replicates the frame out of every port except the ingress port on which it arrived. |
| Broadcast Address | FF:FF:FF:FF:FF:FF | FLOOD | Replicated out all ports (except ingress) so all LAN hosts receive the broadcast (e.g. ARP request). |
💥 Collision Domains vs Broadcast Domains: Rigorous Counting Rules
This is one of the most frequently tested concepts in computer systems engineering.
Definitions
- Collision Domain: A physical network segment where data packets can collide with one another when sent simultaneously.
- Broadcast Domain: A logical division of a computer network in which all nodes can reach each other by broadcast at the data link layer.
The Golden Hardware Rules
| Network Device | Collision Domain Effect | Broadcast Domain Effect | Physical Layer & Architecture Role |
|---|---|---|---|
| Hub / Repeater (Layer 1) | ❌ Passes / Connects (1 Total) | ❌ Passes / Connects (1 Total) | Pure physical-layer signal repeater. Shares electrical bus; collisions and broadcasts echo to all ports. |
| Bridge / Switch (Layer 2) | ✅ Breaks / Isolates ( Ports) | ❌ Passes / Connects (1 Total) | Data link layer frame switch. Buffers frames into dedicated port micro-segments; broadcasts flood across the LAN. |
| Router / Gateway (Layer 3) | ✅ Breaks / Isolates ( Ports) | ✅ Breaks / Isolates ( Ports) | Network layer packet router. Forwards across subnets; terminates Layer 2 MAC broadcast frames at interface. |
- A Hub does not divide anything: A 16-port Hub has 1 Collision Domain and 1 Broadcast Domain.
- A Switch separates Collision Domains, but NOT Broadcast Domains: An -port switch creates distinct Collision Domains, but maintains 1 single Broadcast Domain across all ports.
- A Router separates BOTH Collision Domains AND Broadcast Domains: An -port router creates Collision Domains and distinct Broadcast Domains (one per routed subnet).
🌳 Bridging Loops, Broadcast Storms & Spanning Tree (STP)
In enterprise networks, network administrators connect multiple switches with redundant parallel links to prevent network downtime if a single cable is severed.
However, redundant physical links in a Layer 2 network introduce fatal Bridging Loops:
Redundant physical loop transformed into a loop-free logical tree by placing redundant ports in Blocking state
The Three Catastrophes of Layer 2 Loops
Because Ethernet frame headers lack a Time-to-Live (TTL) hop limit counter (unlike Layer 3 IP packets):
- Broadcast Storms: When an ARP broadcast enters a looped topology, Switch 1 floods it to Switch 2 and Switch 3. Switch 2 floods it to Switch 3; Switch 3 floods it back to Switch 1. The broadcast replicates exponentially, saturating 100% of network bandwidth within seconds and crashing the switches.
- MAC Table Thrashing: As copies of the same frame circulate endlessly in opposite directions, the switches repeatedly rewrite their CAM table port mappings for the same source MAC thousands of times per second.
- Multiple Frame Copies: Destination hosts receive duplicate copies of the same unicast frame.
The Spanning Tree Protocol Solution (IEEE 802.1D)
Invented by Radia Perlman in 1985, the Spanning Tree Protocol (STP) dynamically breaks loops:
- Switches exchange special control packets called Bridge Protocol Data Units (BPDUs).
- Switches elect a single Root Bridge (the switch with the lowest Bridge ID).
- Every non-root switch calculates the shortest path cost to the Root Bridge.
- Redundant physical ports that create loops are transitioned into the Blocking State (they pass zero data frames, acting as cold standby links).
- If an active link fails, STP detects the loss of BPDUs and automatically unblocks the backup port, restoring connectivity without loops!
🏭 Real-World Production Context: Modern Full-Duplex Switching & Data Center Spines
In the 1980s and 1990s, Ethernet operated in Half-Duplex over shared coaxial cables or hubs, requiring CSMA/CD to manage collisions.
Modern Ethernet operates exclusively in Full-Duplex Switched Mode:
- Every computer has a dedicated twisted-pair copper cable (Cat 5e/Cat 6) plugged directly into a private switch port.
- Category 6 cables contain 4 twisted pairs: Pair 1-2 is dedicated exclusively for transmitting (Tx), while Pair 3-6 is dedicated exclusively for receiving (Rx).
- Because the transmit and receive electrical pathways are physically separated, a host can transmit at while simultaneously receiving at !
The Physical Consequence: In Full-Duplex switched Ethernet, collisions are physically impossible. There is no carrier sensing, no jamming signal, no backoff timer, and no minimum frame size physical constraint. CSMA/CD is completely disabled on full-duplex links! The 64-byte minimum frame size is retained strictly for backward software compatibility with legacy Ethernet specifications.
High-Performance Data Center Switching: Leaf-Spine Topologies
Traditional multi-tier STP architectures left over 50% of switch trunk cables idle in the "Blocking" state to prevent loops. Modern cloud data centers (Google, Meta, AWS) replaced STP with Clos Leaf-Spine Architecture:
- Every Top-of-Rack (Leaf) switch connects to every Spine switch in the building.
- Rather than Layer 2 bridging, links between Leaf and Spine operate as Layer 3 routed links (running BGP/ECMP).
- Equal-Cost Multi-Path (ECMP) enables 100% of physical fiber links to carry active traffic concurrently, delivering deterministic East-West bandwidth for cloud microservices with sub-microsecond latency.
📐 Numerical Applications & Worked Examples
Example 1: Collision vs Broadcast Domain Counting
Problem Statement: Consider a network topology consisting of:
- Two 8-port Ethernet Switches ( and ), connected to each other by a single link.
- Four 4-port Ethernet Hubs (). Hubs and are connected to ports on Switch . Hubs and are connected to ports on Switch .
- All remaining switch and hub ports are connected to individual workstations.
- A Router connects Switch to an external WAN.
Calculate:
- The total number of Collision Domains in the network.
- The total number of Broadcast Domains in the network.
Step-by-Step Solution:
Step 1: Count Collision Domains
- Every port of a Switch that connects to a device represents an independent collision domain.
- Every Hub collapses all its connected nodes into 1 single collision domain.
- Hub and its attached computers: 1 Collision Domain.
- Hub and its attached computers: 1 Collision Domain.
- Hub and its attached computers: 1 Collision Domain.
- Hub and its attached computers: 1 Collision Domain.
- Inter-switch link between and : 1 Collision Domain.
- Link between and the Router: 1 Collision Domain.
- Remaining individual workstations connected directly to switch ports:
- Switch has 8 ports: 2 go to Hubs (), 1 goes to direct workstation ports .
- Switch has 8 ports: 2 go to Hubs (), 1 goes to , 1 goes to Router direct workstation ports .
- Total Collision Domains = .
Step 2: Count Broadcast Domains
- Hubs and Switches do not break broadcast domains. All broadcast traffic floods across all ports of , , and all four hubs.
- The Router interface forms a boundary that stops broadcast traffic.
- Therefore, the entire internal LAN forms 1 single Broadcast Domain (plus 1 for the external WAN side of the router).
- Internal LAN Broadcast Domains = 1 Broadcast Domain.
Example 2: Backward Learning Table State Progression
Problem Statement: A 4-port learning bridge connects four stations ( on Port 1, on Port 2, on Port 3, on Port 4). The bridge's CAM table is initially completely empty. The following sequence of frame transmissions occurs:
- Frame 1: Station transmits to Station .
- Frame 2: Station transmits to Station .
- Frame 3: Station transmits to Station .
- Frame 4: Station transmits to Station .
For each frame, specify:
- The CAM table update performed by the bridge.
- Whether the bridge forwards the frame via Unicast or Flooding.
- Which ports receive the frame.
Step-by-Step Solution:
| Transmission | Ingress Port & Source | CAM Table Update | Target Lookup Result | Bridge Forwarding Action | Ports Receiving Frame |
|---|---|---|---|---|---|
| 1. | Port 1 () | Learns [A -> Port 1] | Destination is not in table. | FLOOD (Replicate to all ports except ingress) | Ports 2, 3, 4 |
| 2. | Port 3 () | Learns [C -> Port 3] | Destination found on Port 1. | FORWARD (Unicast) | Port 1 only |
| 3. | Port 4 () | Learns [D -> Port 4] | Destination found on Port 3. | FORWARD (Unicast) | Port 3 only |
| 4. | Port 2 () | Learns [B -> Port 2] | Destination found on Port 1. | FORWARD (Unicast) | Port 1 only |
Final State of CAM Table: [A: Port 1, B: Port 2, C: Port 3, D: Port 4]. From this point forward, zero flooding will occur for unicast frames between these four nodes.
Example 3: Switch Fanout and Cascading Topology Design
Problem Statement: An engineering laboratory needs to connect 15 workstations in a single local area network using standard 8-port Ethernet switches. Assume these switches do not feature dedicated uplink ports; any port can be used to interconnect switches or connect host machines. What is the minimum number of 8-port switches required to connect all 15 machines?
Step-by-Step Solution:
- Analyze Available Port Capacity:
- A single 8-port switch can connect at most 8 machines. Since , we need at least 2 switches.
- Evaluate 2 Cascaded Switches:
- To connect Switch 1 and Switch 2 together, we must dedicate 1 port on Switch 1 and 1 port on Switch 2 for the interconnect cable.
- Usable ports on Switch 1 = .
- Usable ports on Switch 2 = .
- Total host capacity with 2 switches = .
- Since , 2 switches are insufficient to support 15 workstations!
- Evaluate 3 Cascaded Switches:
- Configure in a line or star: Switch 1 acts as the core, connected to Switch 2 and Switch 3:
- Switch 1 dedicates 2 ports to connect to Switch 2 and Switch 3, leaving for hosts.
- Switch 2 dedicates 1 port to connect to Switch 1, leaving for hosts.
- Switch 3 dedicates 1 port to connect to Switch 1, leaving for hosts.
- Total host capacity = .
- Configure in a line or star: Switch 1 acts as the core, connected to Switch 2 and Switch 3:
- Conclusion: The minimum number of 8-port switches required is 3 switches.
🎯 Exam & Interview Pitfall Check
- Why does a bridge filter (drop) a frame when the destination port matches the ingress port? Because if Destination Port == Ingress Port, both the transmitting station and the destination station reside on the same physical cable segment. When the sender put the bits on the wire, the destination host received them directly over the copper. Forwarding the frame across the bridge would needlessly pollute other network segments with duplicate traffic.
- Does a switch change the MAC addresses of a frame as it forwards it? No. A Layer 2 switch never modifies Source or Destination MAC addresses (unless performing specialized NAT or routing functions). It simply reads the destination address to select the egress port and forwards the frame unchanged. Routers (Layer 3), in contrast, rewrite Source and Destination MAC addresses at every hop!
- Trap: Believing VLANs are required to separate collision domains. A switch separates collision domains on every single port by default, even without any VLAN configuration. VLANs (Virtual Local Area Networks) are used to separate Broadcast Domains within a switch.
- Trap: Forgetting that a frame entering a switch is flooded if the destination MAC is unknown. If an entry is not yet present in the CAM table (due to cache timeout or the destination host having not yet transmitted), the switch does not drop the frame; it floods it out all ports except the ingress port (Unknown Unicast Flooding).