Tampilkan postingan dengan label STP. Tampilkan semua postingan
Tampilkan postingan dengan label STP. Tampilkan semua postingan

Selasa, 25 Oktober 2011

STP Principle

The Problem of Looping
→ broadcast storm
→ MAC table flapping

Calculation Process of Spanning Tree → exchange information and parameters in BPDU
→ Select a bridge as the root bridge among all bridges (based-on bridge id: 2-byte bridge priority [0-65535, default: 32768] + 6-byte MAC address). Smallest id become root bridge
→ Calculate the shortest path from the current bridge to the root bridge
→ For every shared network segment, select the bridge nearest to the root bridge as the designated bridge, responsible for the data forwarding of this network segment
→ For every bridge, select a root port. Based on path cost outgoing port, smaller is better. On VRP, the cost of 100M port is 200. If the path cost is same, compare with identifier of upstream switches. If it's still not elected, the port whose upstream port has the smallest identifier is elected. Port identifier: 1-byte port priority [default: 128] + 1-byte port number.
→ Select the designated port besides the root port. Root path cost → bridge id → port id. On the root bridge, all ports are the designated ports of the connected network segments.

Switch port role :
→ root port : root port is the nearest port to the root switch, it is in forwarding state
→ designated port : it forwards data from network segment which connects to the root switch and data from switch to the network segment it connects to
→ alternate port : backup port, it will not forward any data to the network segment it connects to.

Port status description :
→ disabled : port will not forward data, learn MAC address and calculate spanning tree
→ listening : port will not forward data and learn MAC address, but it will calculation spanning tree, receive and send BPDU
→ blocking : port will not forward data and learn MAC address; it will receive and deal with BPDU but not send BPDU
→ learning : port will not forward data, but it will learn MAC address, calculate spanning tree, receive and send BPDU
→ forwarding : port will forward data, learn MAC address, calculate spanning tree, receive and send BPDU.

After enabled, a port switches to Listening state and begins to calculate the spanning tree. If the port is set to the alternate port, the port state changes to Blocking. If the port is set to the root port or designated port, change from Listening to Learning, wait forward delay, then Learning to Forwarding.  

The Problem of STP


The transform from blocking state to forwarding state it takes 2 times forwarding delay. → use RSTP
→ allocating two port roles alternate port and backup port for root port and designated root, for fast state changing. When the root port is invalid, the alternate port will become the new root port and switch to forwarding state without delay. When the designated port is invalid, the backup port will become the new designated port and switch to forwarding state without delay.
→ in the point to point link only connecting two switch ports, just after one way handshake to the downstream bridge, the designated port could change to forwarding state without time delay. If more than three bridges are connected by the shared lnk, the downstream bridge will not respond to the handshake request sent from upstream designated port; only after two times forward delay, it could change to forwarding state.
→ the port is defined as edge port if it is connected with terminal directly instead of other bridges. The edge port could enter forwarding state without any time delay. However, it should be configured manually since the bridge cannot know whether the port is directly connected with the terminal or not.

The second problem of STP : in the case of VLAN, STP makes the host in some VLAN lost communication. How to resolve it? → Multiple Spanning Tree Protocol (MSTP) → IEEE 802.1s
STP/RSTP is based on port, but MSTP based on instance. The instance is a collection of multiple VLANs. Through bounding multiple VLANs into a single instance, the communication cost and network resources could be saved. In MSTP, the topology calculation of every instance independent. The load balancing could be implemented in these instances. In use, multiple VLANs with the same topology could be mapped into the same instance.

Q/A :
How does STP calculate a tree without loop in the network?
→ STP elects a root bridge, and then elects a root port for each non-root switch and elects a designated port for each network segment. The ports that are neither the root port nor the designated port are set to be in blocking state.

How does STP solve temporary loop problem?
→ Before switching from non-Forwarding state to Forwarding state, a port needs to wait two times as long as the forward delay. This ensures that other switches have enough time to calculate the spanning tree.