Introducing Spanning Tree Protocol
Chapter 2, "Defeating a Learning Bridge's Forwarding Process," explained how Ethernet switches build their forwarding tables by learning source MAC addresses from data traffic. When an Ethernet frame arrives on a switch port in VLAN X with a destination MAC address for which there is no entry in the forwarding table, the switch floods the frame. That is, it sends a copy of the frame to every single port in VLAN X (except the port that originally received the frame). Although this is perfectly fine in a single-switch environment, interesting side effects are observed in multiswitch topologies, as Figure 3-1 shows. The figure represents a simple network composed of two LAN switches interconnected by two Ethernet links.
Figure 3-1 Basic Network Setup a
MAC-address 0000.0000.000A
Switch 1
All Interfaces Are in VLAN 5
Switch 2
MAC-address 0000.0000.000B
In the next steps, MAC addresses are conveniently shortened to a single-letter format for clarity. A legitimate Ethernet MAC address is actually made up of 6 bytes. The following sequence of events occurs when an application on the top PC (MAC address A) communicates with the bottom PC (MAC address B):
1 The top PC sends a frame to the bottom PC (destination MAC address B).
2 Switch 1 learns that MAC address A is off port 0/1.
3 Switch 1 looks up MAC address B; no match is found.
4 Switch 1 sends out the frame on link X and Y (a process known as flooding).
5 Switch 2 receives the frame from A to B on link X and updates its forwarding table. (A is on link X.)
A split-second later, switch 2 receives the exact same frame on link Y; this time, it causes a new update to the forwarding table. This is known as a race condition— whichever MAC address arrives first wins the race and gets installed in the forwarding table.
6 Switch 2 looks up MAC address B; no match is found. (B hasn't talked yet.)
7 Switch 2 sends out the frame on port 0/2 and link Y (or X, depending on the outcome of the race condition described in Step 5).
8 Switch 1 and PC B both receive the frame; however, this frame causes switch 1 to again update its forwarding table. (MAC address A is now off link Y or X.)
9 Return to Step 3 and loop forever. Even if B talks, nothing changes because both switches constantly update their forwarding tables with incorrect information (because of the never-ending packet loop).
There is no such thing as a Time to Live (TTL) field in Ethernet headers. No routing protocol distributes information related to MAC addresses and their whereabouts. Simply put, short of a power or link failure, nothing can stop the packets from looping endlessly between switch 1 and 2. There's no need for a broadcast or multicast frame; a simple unicast frame does fine.
The problem is hardly new. After Radia Perlman's work in the early 1990s, the IEEE ratified her protocol work into a standard known as 802.1D. 802.1D defines the original Spanning Tree Protocol (STP), whose task is to disable redundant paths from one end of the Layer 2 network to another, thereby achieving two goals: no packet duplication or loops while still providing automatic traffic rerouting in case of failure. If switch 1 or switch 2 (or both) were running the STP, the topology represented in Figure 3-1 would logically appear as what's shown in Figure 3-2.
Figure 3-2 Loop-Free Topology Calculated by STP
Link X
Link Y: Blocking
MAC-address A
Link Y: Blocking
Link X
MAC-address B
With link Y disabled by the spanning-tree algorithm running on switch 2, packets from the top PC to the bottom PC can no longer loop forever.
STP is an extremely pervasive protocol; it keeps virtually every single existing Ethernet-based LAN network loop free.
Continue reading here: STP Operation More Details
Was this article helpful?
Readers' Questions
-
jaana10 months ago
- Reply