008 STP Principle ISSUE1x1

download 008 STP Principle ISSUE1x1

of 38

Transcript of 008 STP Principle ISSUE1x1

  • 7/29/2019 008 STP Principle ISSUE1x1

    1/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved

    www.huawei.com

    Internal

    ODA040005 STP

    Principle

    ISSUE 1.3

  • 7/29/2019 008 STP Principle ISSUE1x1

    2/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 1

    Spanning Tree Protocol ( STP ) is applied to

    loop network to block some undesirable

    redundant paths with certain algorithms and

    prune the network into a loop-free tree, thereby

    avoiding the proliferation and infinite cycling of

    the packet in the loop network

  • 7/29/2019 008 STP Principle ISSUE1x1

    3/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 2

    References

    Clause 8 of IEEE Std 802.1D, 1998

    Edition

    Clause 17 of IEEE Std 802.1D, 2004

    Edition

    Ethernet Switch Operation Manual

  • 7/29/2019 008 STP Principle ISSUE1x1

    4/38

  • 7/29/2019 008 STP Principle ISSUE1x1

    5/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 4

    Chapter 1 STP Principle

    Chapter 2 RSTP Principle

  • 7/29/2019 008 STP Principle ISSUE1x1

    6/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 5

    Applications Of Transparent Bridge

    Expand LAN scale

    Free and dynamic learning of site address information

    Problem: frames or packets might be forwarded circularly

    and continuously, resulting in network congestion

  • 7/29/2019 008 STP Principle ISSUE1x1

    7/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 6

    Broadcast In A Network With Loops

    LAN 1

    LAN 2

    1

    1 1 1

    2 2 23 33

    Site A

    Site B

    B1 B2 B3

  • 7/29/2019 008 STP Principle ISSUE1x1

    8/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 7

    Why We Need Spanning Tree Protocol?

    Remove path loop that might exist in the bridging network by blocking

    redundant links

    Activate redundant backup links to restore network connection when the

    current active path fails

    ROOTLAN B

    LAN C

    LAN D

    LAN E

    LAN A

  • 7/29/2019 008 STP Principle ISSUE1x1

    9/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 8

    Basic Principle Of Spanning Tree Protocol

    Transmits BPDUs (Bridge Protocol Data Unit )among network bridges and

    do the following jobs:

    Select the root.

    Calculate the shortest path.

    Select designated bridge.

    Select a root port.

    Select designated ports.

  • 7/29/2019 008 STP Principle ISSUE1x1

    10/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 9

    Contents Of BPDU

    The content of BPDU is organized as (Root ID, Root Path Cost, Designated

    Bridge ID, Designated Port ID)

    Root ID: Identifier of root

    Root Path Cost: The smallest path cost from the designated bridge to the

    root

    Designated Bridge ID : Identifier of the designated bridge

    Designated Port ID :Identifier of the designated port

  • 7/29/2019 008 STP Principle ISSUE1x1

    11/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 10

    Configuration Message Format

    DMA: Destination MAC Address

    SMA: Source MAC Address

    L/T: Frame length

    LLC Header: Fixed link head of

    configuration message

    Payload: BPDU Data

    DMA LLC HeaderSMA L/T Payload

    Domain Byte

    Protocol ID 2

    Protocol Version

    BPDU TypeFlag Bit

    Root Bridge ID

    Root Path Cost

    Designated Bridge ID

    Designated Port IDMessage Age

    1

    11

    8

    4

    8

    22

    Max Age

    Hello Time

    Forward Delay

    2

    2

    2

  • 7/29/2019 008 STP Principle ISSUE1x1

    12/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 11

    Construct BPDU

    Select the best BPDU from all the BPDUs to construct its own BPDU.

    Select RootID: the RootID of the BPDU with the highest priority

    Calculate Root Path Cost:

    Root Path Cost is the sum of the Root Path Cost of best BPDU and

    the cost of the port that receives this BPDU

    Select Root Port:

    The root port is the one that receives the best BPDU

    Select designated port: the ports used to forward the packets

    Send the new BPDU from a designated port

  • 7/29/2019 008 STP Principle ISSUE1x1

    13/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 12

    How To Determine The Best BPDU?

    The best BPDU has the high priority

    Assume there are two configuration messages C1 and C2, then:

    According to Root ID

    If above is the same, According to the Root Path Cost

    If above are the same, According to the Designated Bridge ID

    If above are the same, According to the Port ID

    Principle : the smaller, the better

  • 7/29/2019 008 STP Principle ISSUE1x1

    14/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 13

    An Instance Of Receiving And Calculating BPDU

    Port 1

    Port 2Port 3 Port 4

    Port 5

    B81

    LAN A

    B23

    Root

    B80B100B321

    B32

    B123

    B102

  • 7/29/2019 008 STP Principle ISSUE1x1

    15/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 14

    An Instance Of Receiving And Calculating BPDU

    Select Port4 as the rootselect Port1 and Port2 as designated ports, and

    meanwhile block Port3 and Port5.

    Send new BPDU from Port1 and Port2: (23, 15, 81)

    Root ID = 23

    Root Path Cost = 14+1 = 15

    Root Port ID = Port4

    Designated Bridge ID=81

    Port 1

    Port 2 Port 3 Port 4

    Port 5

    blocking

    blocking

    32032 2318123 2314321 2314100 231580

    root

    231581

    B81

    231581

  • 7/29/2019 008 STP Principle ISSUE1x1

    16/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 15

    What To Do If Links Fail?

    Hello Time

    The bridge cyclically sends BPDU from a designated port at the period of

    Hello Time.

    Message Age and Max Age

    BPDUs stored at a port have a Message Age field, which grows

    proportionally with time.

    If there is not BPDU received until the Message Age equals to the Max

    Age, the bridge will regard it as failure on the links connected to this port.

  • 7/29/2019 008 STP Principle ISSUE1x1

    17/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 16

    Processing Of Link Fault (I)

    When the message of the BPDU of Port4 is timeout, this BPDU is

    abandoned, and a new spanning tree are calculated, so as to select Port3

    as the new root port, while the BPDU of bridge 81 remains unchanged

    2318123

    Port 1

    Port 2 Port 3 Port 4

    Port 5

    blocking

    2314321 231580231581

    root

    32032

    231581 231581

    B81

  • 7/29/2019 008 STP Principle ISSUE1x1

    18/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 17

    Processing Of Link Fault (II)

    When the message of the BPDU of Port3 is timeout, this BPDU is

    abandoned, and a new spanning tree are calculated, so as to select Port5 as

    the new root port, while the BPDU of bridge 81 changes to231681

    Port 1

    Port 2 Port 3 Port 4

    Port 5

    231580231681

    root

    23168132032 2318123

    231681 231681

    B81

  • 7/29/2019 008 STP Principle ISSUE1x1

    19/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 18

    Processing Of Link Fault (III)

    When the message of the BPDU of Port5 is timeout, this BPDU is

    abandoned, and it is taken itself as the root bridge to send the BPDU

    (81081) till a BPDU of a higher priority is received from any port

    Port 1

    Port 2 Port 3 Port 4

    Port 5

    81081 81081 8108181081 81081

    B81

  • 7/29/2019 008 STP Principle ISSUE1x1

    20/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 19

    Temporary Loops Or Disconnection

    If the ports at the Forwarding status have not realized that they should stop

    forwarding, temporary loops might exist.

    If ports blocked have not realized that they should start forwarding, it might

    lead to temporary disconnection.

    ROOT

    ROOT

  • 7/29/2019 008 STP Principle ISSUE1x1

    21/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 20

    How to avoid temporary loops?

    Forward Delay: Maximum delay for configuration message to be broadcasted

    to the whole network

    Design interim status: ports at the interim status merely learns address info

    of sites, but does not forward any data

    Ports enter the interim status from the blocked status after the Forward

    Delay, then enter the Forwarding status after the Forward Delay

    Ports will go through a certain delay to change from the blocking status to theforwarding status. This time should at least be twice the forward delay

  • 7/29/2019 008 STP Principle ISSUE1x1

    22/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 21

    Port Status

    Port Ability

    Not receive/send any messageDisabled

    Blocking

    Listening

    Learning

    Port Status

    Forwarding

    Not receive/forward data, receive but nottransfer BPDUs, and not learn addresses

    Not receive/forward data, receive andtransfer BPDUs, but not learn addresses

    Not receive/forward data, receive and

    transfer BPDUs, and start to learn addresses

    Receive and forward data, receive and

    transfer BPDUs, and learn addresses

  • 7/29/2019 008 STP Principle ISSUE1x1

    23/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 22

    Port Status TransitionDisabled

    Listening

    Blocking

    Forwarding

    Learning

    1interface enabled

    2interface disabled

    3interface is selected as root port or designated port

    4interface is selected as backup interface ( blocking)

    5Forward Delay

    1 2

    1

    2

    12

    121

    2

    4

    4 5

    4

    53

  • 7/29/2019 008 STP Principle ISSUE1x1

    24/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 23

    LAN A

    Two Timers about the MAC Address Table

    There are two timers used to update the MAC address info:

    A bigger timer is used when the topology is stable

    A smaller timer is used when the topology changes

    LAN B

    LAN C

    LAN E

    LAN D

    ROOT

    B1

    B2

    B3

    B4

  • 7/29/2019 008 STP Principle ISSUE1x1

    25/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 24

    Transmission Of Topology Change MessageROOT

    1

    3

    2

    44

    5 5

    Topology change notice message

    Topology change response message

    Topology change message

  • 7/29/2019 008 STP Principle ISSUE1x1

    26/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 25

    Disadvantages of STP

    Recovery time is too long: two Forward Delay

    Network diameter should be less than 7.

  • 7/29/2019 008 STP Principle ISSUE1x1

    27/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 26

    Questions

    What is the working mechanism of STP?

    How to select the best BPDU?

  • 7/29/2019 008 STP Principle ISSUE1x1

    28/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 27

    Chapter 1 STP Principle

    Chapter 2 RSTP Principle

  • 7/29/2019 008 STP Principle ISSUE1x1

    29/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 28

    Rapid Spanning Tree Protocol

    The RSTP evolved from the STP, and shares the same basic

    concepts;

    RSTP has all functions of STP;

    RSTP can bring down the recovery time interval

    when the network topology structure changes

  • 7/29/2019 008 STP Principle ISSUE1x1

    30/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 29

    STP vs. RSTP (Port Types)

    STP types of port RSTP types of port

    Designated Port Designated Port

    Root Port Root Port

    Disabled Port Disabled Port

    Alternate Port

    Backup Port

  • 7/29/2019 008 STP Principle ISSUE1x1

    31/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 30

    STP vs. RSTP (Port States)

    STP port state RSTP port state

    Disabled Discarding

    Blocking Discarding

    Listening Discarding

    Learning Learning

    Forwarding Forwarding

  • 7/29/2019 008 STP Principle ISSUE1x1

    32/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 31

    Improvement Of Rapid Spanning Tree (I)

    A new root port can immediately enter the Forwarding status, if the original

    root port has entered the blocked status, and the designated port of the peer

    connected to the new root port is in the Forwarding status.

    LAN A

    TO ROOT

    LAN A

    LAN A LAN A

    F F

    F

    LAN A LAN A

    F F

    F

    TO ROOT

    Designated Port

    Root PortBlocked Port Root Port Blocked Port

    Designated Port Designated Port Designated Port

  • 7/29/2019 008 STP Principle ISSUE1x1

    33/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 32

    Improvement Of Rapid Spanning Tree (II)

    The designated port can make a handshake with the connected

    bridge so as to enter the Forwarding status quickly

    LAN B

    LAN A

    F

    1

    23

    4Handshake request

    Handshake response

    Designated Port

    Root Port

  • 7/29/2019 008 STP Principle ISSUE1x1

    34/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 33

    Attention Handshakes must occur on point to point links.

    LAN A

    LAN B LAN C

    LAN A

    F

    F F

    Non Point to Point Links Handshake Diffusion

    Designated Port

    Designated Port Designated Port

  • 7/29/2019 008 STP Principle ISSUE1x1

    35/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 34

    Improvement Of Rapid Spanning Tree (III)

    The edge ports, i.e., those directly connected to terminals but

    not to other bridges can directly enter the forwarding status,

    without any delay.

    LAN B LAN C

    LAN A

    Edge Port

    LAN DF

    TO ROOT

    Blocked PortDesignated Port

  • 7/29/2019 008 STP Principle ISSUE1x1

    36/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 35

    Questions

    Tell the port state of RSTP ?

    Describe the three improvements of RSTP in simple words ?

  • 7/29/2019 008 STP Principle ISSUE1x1

    37/38

    HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 36

    The functions of STP & RSTP

    Basic principles of STP & RSTP

    Summary

    Slide Modifyiving Notice(stp)

  • 7/29/2019 008 STP Principle ISSUE1x1

    38/38

    www.huawei.com

    Thank You