The primary articles network STP (concept principle)

First, what is STP

  Spanning Tree Protocol ( the Spanning Tree Protocol , the STP ), a work in the OSI network model in the second layer (data link layer) communication protocols, it is applied substantially prevent redundant links generating the switch loop. For ensure logical topology Ethernet loop-free thus avoiding broadcast storm, resource-intensive switch.

Two, STP initialization phase

  All devices in the network bridge in the STP enabled, each bridge device considers itself the root bridge. At this time each device only send and receive configuration BPDU, not forward user traffic, all ports are in the Listening state. All bridge equipment root bridge election, the root port and designated port configuration BPDU after by exchange.

Three, STP conceptual

  BPDU: running STP message frame exchanged between switches. The STP BPDU contains the desired path and priority information, STP will use this information to determine the path to the root bridge and the root bridge.

  BID : BID packet length is 8, the priority of the bridge and the bridge 6 backsheet mac address byte contains 2 bytes. The bridge priority value is 0--65535 default value is 32768.

  PID : port priority + port ID (port priority default is 128, the port ID number for the port)

  Root accumulated path overhead: path cost for each port (the root bridge outside the designated port) of each segment by a link to the root bridge from port device (also called link cost) accumulated. Different on the same switch port path cost value of zero.

  Root bridge: is STP spanning tree "roots"

  Root port: that is, between different ports all non-root bridge election of a port optimal path to the root bridge, and only one root port on each non-root device. (Optimal path: port to the root bridge cumulative minimum root path cost)

  Designated port: is between different ports for each physical network segment elect a designated port.

  Blocked ports: turn off the data forwarded to break the loop. Making it a form of "pre-port" exists.

  Peer : when receiving the data transmission side, i.e. the opposite end of the link bridge

Fourth, root bridge election

  Elected from a single root bridge on the switch switched network all running STP, the election of the root bridge is (first comparative bridge priority, the priority of the smallest root bridge according bridge BID priority and mac address determined ; priority when the bridge are equal, comparison mac address, mac address of the root bridge is smaller).

  Send in the election is the BPDU. Election mainly includes two steps: a bridge device to determine their own BPDU, a BPDU is sent to each other are compared to determine the root bridge in the network.

   A beginning of each bridge considers itself the root bridge , BID sent out are their own. Each bridge sends out its configuration BPDU the other receives configuration BPDU transmitted bridge. But the bridge will not have received all port configuration BPDU have to update their configuration BPDU, but the first priority will be to enable BPDU comparison. If the received configuration BPDU lower priority than the configuration BPDU of this port will discard the received configuration BPDU, still retain their original configuration BPDU; otherwise it will extract BID them instead of their own in the original BPDU BID, continuous data interaction is performed, all ports of all switching devices are considered the root bridge is the same, indicating that the root bridge has been selected completed.
When a link or a topology change, will re-select a new root bridge.

The Election root port

  Non-root switch in the election of the root port, according to (in order) the cumulative root path overhead (small), peer BID (small), to end PID (small), local PID (small). (There are articles in the back of the experiments were experiments to verify them)

Sixth, the designated port of elections

  When specifying the port of elections, according to (order) Cumulative root path overhead (small) , BID (small), PID (small) ( Experiments were conducted to verify it in the back of the experiments article )

Seven, blocked ports

  Has not been elected as the root port and designated ports become blocked ports.

Guess you like

Origin www.cnblogs.com/641055499-mozai/p/11594692.html