Spanning Tree Protocol configuration for the Cisco PT Simulation Experiment (5) switch
Experimental Purpose :
Understanding how spanning Tree protocol works
Mastering the Fast Spanning Tree protocol RSTP basic configuration method
Experimental Background : The company's finance department and the sales department of the PC through 2 switches to achieve communication, in order to improve network reliability, redundant link is a good idea to prevent a link failure caused by the entire network interruption, but redundant topology has a series of problems such as network loops, This requires proper configuration on the switch.
Technical Principle :
Spanning Tree Protocol: monitor the two-tier switched network to identify all available links and turn off redundant links to ensure that no loops occur. First , the spanning tree algorithm is used to create a topology database, and then the redundant backup link of the network is logically disconnected, so that the data frame can only be forwarded on the optimal link selected by the Spanning tree protocol.
Protocol version: STP (Spanning Tree Protocol), RSTP (Fast spanning Tree Protocol), MSTP (multi spanning Tree Protocol).
Spanning Tree algorithm (STA):
-
to elect the Root bridge, which has the smallest bridge ID (that is, RID), the bridge ID is determined by the bridge precedence (priority) and bridge MAC address together
-
calculate the path to the root bridge, by port overhead (cost), Bridge ID (bid= Bridge priority + Bridge MAC address ), Port ID (pid= port priority + port number) determine the best path, the cost depends on the bandwidth of the link
Configure the port role with root port (root ports), specified port (designated port), and non-specified ports (non-designated port)
Spanning tree ports have 4 states, and transitions between states take a certain amount of time,from blocking to listening is required -seconds,from listening to learning needs theseconds,from learning to forwarding required theseconds. In most cases, the ports on the switch are in a blocked or forwarded state.
BLOCK: Listen/Receive only BPDUs message
Listen (Listening): can only receive or send bpdus messages
-
learning (learning) : can receive or send BPDU Message, mac
-
forwarding (Forwarding) : can receive or send BPDU Message, and form mac Address table, send and receive data frames simultaneously
STP Convergence: All ports on the switch are converted to forwarding or blocking mode, which takes 50 seconds by default. The switch is unable to forward the data until the convergence is complete, and for this reason Cisco has created an expansion feature ( convergence acceleration) of the spanning tree to patch defects in the IEEE202.1D standard, including Portfast, Uplinkfast, Backbonefast features.
802.1W standard, the can converge the network faster when the network structure is changed. when the root port or the specified port fails, the redundant port can be switched directly to the replacement or backup port, enabling fast convergence of less than 1 seconds for the RSTP protocol.
Port Status: Learning, forwarding, discarding
Port role: Added replacement port (Alternate port) and backup port on Build tree Protocol
Experimental Equipment : switch_2960 2 units, PC 4, straight line, crossover line.
Experimental topology :
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/9C/9D/wKioL1lzNYTA0UwgAABPhNGXyFw137.png-wh_500x0-wm_ 3-wmp_4-s_1201653377.png "title=" 6.1.PNG "width=" 453 "height=" 285 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width : 453px;height:285px; "alt=" Wkiol1lznyta0uwgaabphngxyfw137.png-wh_50 "/>
Experimental steps:
Network by topology and redundant links for switches
By default, STP is enabled. Bridge Protocol Data Units (BPDUs) are transferred between the two switches. Select the root switch, root port, and so on to determine the forwarding status of the port. , a port marked yellow is blocked
Configuring the Fast Spanning Tree Protocol (RSTP)
View the switch spanning Tree protocol configuration
switch#show Spanning-tree Summary
switch#show Spanning-tree
Test. When the primary link is down, it can automatically switch to the backup link and ensure the normal forwarding of the data.
Note: The switch is connected only if the 2 switches are configured with RSTP. If the first line reconfiguration will cause a broadcast storm, affecting the normal operation of the switch.
PC settings 192.168.1.2 // pc0192.168.1.3 //pc1192.168.1.4 //pc2192.168.1.5 //pc3// Subnet mask and gateway 255.255.255.0192.168.1.1
Switch0 and SWITCH1 configuration switch>enswitch#show spanning-tree //look at the switch spanning tree running state switch#show spanning-tree summary //look at the configuration information of the spanning tree Switch#conf tswitch (config ) #inter f0/1switch (config-if) #switchport access vlan 2 //divides the port into Vlan 2switch (config-if) #exitSwitch (config) #inter f0/2switch (config-if) # switchport access vlan 3 //divides the port into vlan 3Switch (config-if) #exitSwitch (config) #inter range f0/23-24switch (config-if) #switch mode Trunk switch (config-if) #exitSwitch (config) #spanning-tree mode rapid-pvst    //specifies that the spanning tree protocol is of type Rstpswitch (config) #endSwitch #show spanning-tree   //determine root switch, port role, port status, etc.
# Link Test PC0 (Command prompt cmd) ping 192.168.1.4//link switch0switch>enswitch#conf tswitch (config) #inter f0/23 Turn off Port switch (config-if) #shutdownPC0 (Command prompt cmd) on the main link ping 192.168.1.4//link//Backup link flag changed from yellow to green, indicating backup link is enabled
Lab Environment: Windows 7, Cisco PT 6.3
Reference: CCNA Study Guide (7th edition)
Spanning Tree protocol configuration for the Cisco PT Simulation Experiment (5) switch