40
Spanning Tree V1.2

Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Embed Size (px)

Citation preview

Page 1: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Spanning Tree

V1.2

Page 2: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Objectives

Understand the origin of loop and the solution Understand the working principle of STP

Page 3: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Course Outline

Origin of loop and solution Working principle of STP STP configuration

Page 4: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Redundant Topology

Segment 1

Segment 2

Server/host X Router Y

Page 5: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Segment 1

Segment 2

Server/host X Router Y

Broadcast

Switch A Switch B

Host X sends a Broadcast frame

Broadcast Storms

Page 6: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Segment 1

Segment 2

Server/host X Router Y

Broadcast

Switch A Switch B

Switch B forward Broadcast frame back to Switch A

Broadcast Storms

Page 7: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Segment 1

Segment 2

Server/host X Router Y

BroadcastSwitch A Switch B

Broadcast Storms

Switches continue to propagate broadcast traffic over and over

Page 8: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Multiple Frame Copies

Host X sends an unicast frame to router Y Router Y MAC address has not been learned by either switch yet

Segment 1

Segment 2

Server/host X Router Y Unicast

Switch A Switch B

Page 9: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Segment 1

Segment 2

Server/host XRouter Y

Unicast

Switch A Switch B

Unicast

Unicast

Multiple Frame Copies

Router Y will receive two copies of the same frame

Page 10: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Segment 1

Segment 2

Server/host X Router Y

Unicast Unicast

Switch A Switch B

Port 0

Port 1

Port 0

Port 1

MAC Database Instability

Host X sends an unicast frame to Router Y Router Y MAC Address has not been learned by either Switch y

et Switch A and B learn Host X MAC address on port 0

Page 11: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Segment 1

Segment 2

Server/host XRouter Y

Unicast Unicast

Switch A Switch B

Port 0

Port 1

Port 0

Port 1

MAC Database Instability

Frame to Router Y is flooded Switch A and B incorrectly learn Host X MAC address on port 1

Page 12: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Multiple Loop Problems

Complex topology can cause multiple loops to occur Layer 2 has no mechanism to stop the loop

Server/host

Workstations

Loop

Loop

Loop Broadcast

Page 13: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Solution: Spanning-Tree Protocol

Provides a loop free redundant network topology by placing certain ports in the blocking state

Blockx

Page 14: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Course Outline

Origin of loop and solution Working principle of STP STP configuration

Page 15: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

x

Designated port (F) Root port (F)

Designated port (F) Non-designated port (B)

Root bridge Non-root bridgeSW Y

100baseT

10baseT

SW X

F: forwarding B: blocking

Spanning-Tree Operations

One root bridge per network One root port per non-root bridge One designated port per segment

Page 16: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Switch YDefault priority 32768 (8000 hex)MAC 0c0022222222

Switch XDefault priority 32768 (8000 hex) MAC 0c0011111111

BPDU

Spanning-Tree Protocol Root Bridge Selection

BPDU = Bridge protocol data unit (default = sent every 2 seconds)

Root bridge = Bridge with the lowest bridge ID Bridge ID = Bridge priority + bridge MAC address In the example, which switch has the lowest bridge ID?

Page 17: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

BPDU

DMADMA LLC HeaderLLC HeaderSMASMA L/TL/T PayloadPayload

Page 18: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Link Speed Cost (reratify IEEE spec) Cost (previous IEEE spec)----------------------------------------------------------------------------------------------------10 Gbps 2 11 Gbps 4 1100 Mbps 19 1010 Mbps 100 100

Spanning-Tree Protocol Path Cost

Page 19: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Switch YMAC 0c0022222222Default priority 32768

Switch XMAC 0c0011111111Default priority 32768

Port 0

Port 1

Port 0

Port 1

Switch ZMac 0c0011110000Default priority 32768

Port 0

100baseT

100baseT

Spanning-Tree:

Can you figure out: Which is the root bridge? Which are the designated, non-designated, and root ports? Which are forwarding or blocking ports?

Page 20: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Switch YMAC 0c0022222222Default priority 32768

Switch XMAC 0c0011111111Default priority 32768

Port 0

Port 1

Port 0

Port 1

Switch ZMac 0c0011110000Default priority 32768

Port 0

100baseT

100baseT

Designated port (F)

Root port (F)

Non-designated port (BLK)Designated port (F)

Root port (F)

Spanning-Tree:

Page 21: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Port state

Port state capabilityDisabled N/A D or B

Blocking N/A D, receive B

no learning address

Listening N/A D , receive and send Bno learning address

Learning N/A D , receive and send Blearning address

Forwarding receive and send D and Blearning address

D: data B: BPDU

Page 22: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Port States TransferDisabledDisabled

ListeningListening

BlockingBlocking

ForwardingForwarding

LearningLearning

11 )) port enabledport enabled

22 )) port disabledport disabled

33 )) elected as RP or DPelected as RP or DP

44 ) ) elected as RP or DPelected as RP or DP 55 )) Forward DelayForward Delay

(( 11 )) (( 22 ))

(( 11 ,, 22 ))

(( 11 ,, 22 ))

(( 11 ,, 22 ))(( 11 ))

(( 22 ))(( 44 ))

(( 44 )) (( 55 ))

(( 44 ))(( 55 ))(( 33 ))

Page 23: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Blocking (20 sec)Listening (15 sec) Learning (15 sec)Forwarding

Spanning-Tree Port States

Spanning-tree transitions each port through several different state:

Page 24: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Switch YMAC 0c0022222222Default priority 32768

Switch XMAC 0c0011111111Default priority 32768

Port 0

Port 1

Port 0

Port 1

10baseT

xx

100baseT

Root Bridge

Designated port Root port (F)

Non-designated port (BLK)Designated portBPDUxx

MAXAGE

xxRoot bridgex

Spanning-Tree Recalculation

Page 25: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Spanning Tree Practice

Default priority=32768

MAC=0000.8c00.2101

Switch D

MAC=0000.8c00.9870

Switch E

MAC=0000.8c00.8955

Switch B

MAC=0000.8c00.1202

Switch C

MAC=0000.8c00.1201

Switch A

Page 26: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Course Outline

Origin of loop and solution Working principle of STP STP configuration

Page 27: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

SSTP Configuration

zte# configurezte(config)# spanning-tree enable zte(config)# spanning-tree mode sstp

The default mode of ZXR10 T160G/T64G is MSTP. Whichever mode configured can be compatible and interconnected with other two modes .

Page 28: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

RSTP

RSTP (Rapid Spanning Tree Protocol) provides higher convergence speed than STP (i.e. SSTP mode).

When the network topology is changing, the status of old redundant switch port can be transferred (From Discard to Forward) quickly in the case of point-to-point connection.

Page 29: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

RSTP Port Type

STP port type RSTP port type

Designated Port Designated Port

Root Port Root Port

Disabled Port Disabled Port

Alternate Port

Backup Port

Page 30: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

RSTP Port State

STP port state RSTP port state

Disabled Discarding

Blocking Discarding

Listening Discarding

Learning Learning

Forwarding Forwarding

Page 31: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Alternate And Backup Ports

D BA

D D

R R

Page 32: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Speed Up

Edge Port Handshake

Page 33: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

MSTP

10,20,30 10,20

20,30

10

30 2010,30 10,30

Page 34: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

MSTP The concept of instance and VLAN mirroring are added

in MSTP (Multiple Spanning Tree Protocol); SSTP mode and RSTP mode can both be considered to be instances of MSTP mode, namely, the case that only one instance 0 exists. MSTP mode also provides fast convergence and load balance in VLAN environment.

In SSTP and RSTP modes, there is no such kind of concept as VLAN, there is only one status for each port, namely, the forwarding statuses of ports in different VLANs are consistent. While in MSTP mode, there exist multiple spanning tree instances, the forwarding statuses of ports are different in different VLANs. Multiple independent subtree instances can be formed inside MST region to achieve load balance.

By default, MSTP is enabled

Page 35: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Per-VLAN STP And Instance

VLAN 10 topology

VLAN 20 topology

VLAN 30 topology

VLAN Instance

Default Instance 0

Page 36: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Switch A

Switch B

Fei_1/1

ZXR10(config)#interface fei_1/1ZXR10(config-if)#switchport mode trunkZXR10(config-if)#switchport trunk vlan 1-2ZXR10(config-if)#exitZXR10(config)#loop-detect interface fei_1/1 enable

ZXR10(config)#loop-detect interface fei_1/1 vlan 1-2 enable

ZXR10(config)#show loop-detect interface-detail fei_1/1isUp isMonitor isLoop isProtectedenable enable no disablenpNum portNum reopenTime counter1 24 600 158loopVlan vlanRange0 1 2

Interface Loop Protection

Page 37: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

ZTE Ethernet Switch Ring

A

B

C

D

E

FMaster

TransitTransit

Transit

Transit

Transit

primary secondary

To F

LINK DOWN

LINK DOWN

Theory speed: 50ms

zesr add vlan 4094 xgei_4/1 xgei_4/2 MASTER standard zesr set healthtime 100 failtime 300

zesr add vlan 4094 xgei_4/1 xgei_4/2 TRANSIT standard

Page 38: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Summarization

Loop is easily formed whenever there is a redundant design

LAN switch runs STP to resolve loop problem STP uses BPDU to exchange information and

make decision Ports that enable STP will transfer to different

states according to current topology changing

Page 39: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP

Questions

How are unicast and broadcast packets processed by LAN switch?

How many STP port states there are? When and how will they transfer?

How is root bridge elected? And how about root port?

How to speed up the convergence? What is the role of BPDU?

Page 40: Spanning Tree V1.2. Objectives Understand the origin of loop and the solution Understand the working principle of STP