Протокол STP | Курс "Компьютерные сети"
Introduction to Ethernet and Protocols
Overview of Ethernet Connections
- The speaker introduces the topic of telecommunications networks, focusing on protocols and their significance.
- A question is posed regarding the feasibility of a ring connection in an Ethernet network with four switches connected by cables.
Broadcast Storm in Ethernet Networks
- The concept of a broadcast storm is introduced, explaining how it occurs when a switch receives a frame without knowing its destination.
- Switches will forward the frame to all ports except the one it came from, leading to multiple copies being sent through interconnected switches.
- This results in frames circulating endlessly, overwhelming the network and causing it to become non-functional.
Spanning Tree Protocol (STP)
Purpose and Functionality
- The speaker explains that due to broadcast storms, ring connections are not viable in Ethernet; thus, Spanning Tree Protocol (STP) is necessary.
- STP prevents loops by disabling certain connections at the software level while maintaining all switches within the network.
Mathematical Basis of STP
- The mathematical definition of a spanning tree is provided: it contains all vertices without cycles, ensuring efficient communication among switches.
Advantages of Spanning Tree Protocol
Reliability and Error Protection
- STP enhances network reliability by allowing multiple connections between switches; if one fails, others can be utilized.
- It also protects against accidental configuration errors that could create loops within an Ethernet setup.
Operation Stages of STP
Three Main Stages
- The operation consists of three stages: selecting a root switch, calculating shortest paths from each switch to the root, and disabling unnecessary connections.
Root Switch Selection Process
- The selection process involves each switch initially considering itself as the root and broadcasting this information until consensus is reached based on identifiers.
Conclusion on STP Implementation
Communication Between Switches
Understanding Spanning Tree Protocol
Neighbor Switches and Root Selection
- Switches compare identifiers in messages with their own. For instance, switch 2 receives messages from switches with identifiers 4 and 1, determining that the neighbor with the lowest identifier is switch 1.
- The switches then send messages not with their own identifier but with the minimum root switch identifier they learned from neighbors. This means they recognize switch 1 as the root based on received information.
Path Calculation to Root Switch
- The process of selecting a root switch concludes, leading to calculating shortest paths from all switches to the root. Path length is determined by two factors: number of intermediate switches and connection speed.
- Shortest path calculations are similar to root selection; all switches broadcast control messages indicating their distance to the root switch.
Distance Metrics and Connection Speeds
- Distances between switches are defined according to IEEE standards (802.1D). For example, if connections operate at 1 Gbps, a distance value of 4 is used.
- Directly connected switches determine their connection speed and assign corresponding distance values. In this case, a direct connection at 1 Gbps results in a distance value of 4.
Redundant Paths Management
- The calculated shortest distances are communicated across the network. If there are multiple paths to the root switch, protocols dictate choosing the one with minimal distance while disabling others.
- In scenarios where two paths have equal distances (e.g., both being 8), the path associated with a higher port number will be disabled.
Avoiding Loops in Network Topology
- Once redundant paths are managed, a spanning tree structure emerges without cycles among all four switches. However, if any connection fails, only one path remains available for data transmission.
- When connecting devices to a switch using STP protocols, immediate data transmission isn't allowed due to potential loop formation risks.
Port States During Connection Setup
- Initially connected ports operate in "listening" mode where they process control messages but do not transmit data.
- As connections stabilize, ports may transition into "learning" mode where they accept frames but do not forward them yet while building MAC address tables.
Handling Loop Formation Risks
- If it’s determined that another switch connects causing a loop formation risk, that port transitions into "blocking" state preventing any data flow.
- Administrators can manually disable ports regardless of device type connected (computer or switch), ensuring no data transmission occurs during potential loop scenarios.
Advancements in Spanning Tree Protocol
- Historical delays in transitioning states (up to 30 seconds initially acceptable in older networks), necessitated faster alternatives like Rapid Spanning Tree Protocol (RSTP).
- RSTP addresses compatibility issues when integrating VLAN technology within STP frameworks by allowing separate spanning trees for each VLAN through Multiple Spanning Tree Protocol (MSTP).
Conclusion on Reliability Through STP
Ethernet Network Redundancy and Spanning Tree Protocol
Overview of Ethernet Redundancy
- In Ethernet networks, redundant connections between switches can be utilized to maintain connectivity during link failures.
- The challenge of broadcast storms is addressed through the implementation of specific protocols.
Spanning Tree Protocol (STP)
- The Spanning Tree Protocol operates in three distinct phases to ensure a loop-free network topology.
Phase 1: Root Bridge Selection
- During the first phase, the protocol selects a root switch based on the lowest identifier among all switches in the network.
Phase 2: Distance Calculation