Jeremy’s IT Lab lecture video:

Day 21 - Spanning Tree Protocol (STP) (2)


Commands


Classic Spanning Tree Information

The protocol version identifier for classic STP is 0

Spanning Tree Port States

Classic Spanning Tree has 5 different port states, being:

  1. Blocking / Stable
  2. Listening / Transitional
  3. Learning / Transitional
  4. Forwarding / Stable
  5. Disabled

A forwarding interface can move directly into a blocking,

However, a blocking cannot move directly into a forwarding state. It must go through the listening and learning states first.

STP Port StateSend/Receive BPDUsFrame Forwarding
(Regular Traffic)
MAC Address
Learning
Stable/Transitional
BlockingNO/YESNONOStable
ListeningYES/YESNONOTransitional
LearningYES/YESNOYESTransitional
ForwardingYES/YESYESYESStable
DisabledNO/NONONOStable

Spanning Tree Timers

There are 3 different spanning tree timers, being:

  1. Hello / 2 seconds
  2. Forward delay / 15 seconds
  3. Max age / 20 seconds (10 multiplied by hello timer)
STP TimerPurposeDuration
HelloHow often the root bridge sends Hello BPDUs2 sec
Forward DelayHow long the switch will stay in the Listening and Learning states
(each state is 15 seconds = total 30 seconds)
15 sec
Max AgeHow long an interface will wait after ceasing to receive Hello BPDUs to change the STP topology20 sec
(10*hello)

BPDU forwarding

Switches do not forward the BPDUs out of their root ports and non-designated ports, only their designated ports.


Spanning Tree Optional Features (STP Toolkit)

  1. Portfast
    • Portfast allows a port to move immediately into the forwarding state, bypassing listening and learning. This is used for switchports which are connected to end hosts, as they do not pose a risk to causing loops in the network.
    • Portfast will only work on access ports.
  2. BPDU Guard
    • BPDU Guard makes it so when an interface with BPDU Guard enabled receives a BPDU from another switch, the interface will be shut down to prevent a loop from forming.
  3. Root Guard
    • If you enable root guard on an interface, even if it receives a superior BPDU (lower bridge ID) on that interface, the switch will not accept the new switch as the root bridge. The interface will be disabled.
  4. Loop Guard
    • If you enable loop guard on an interface, even if the interface stops receiving BPDUs, it will not start forwarding. The interface will be disabled.

Spanning Tree Primary and Secondary Root Bridges

There are two commands to easily change the bridge priority of a switch, they are:

  1. spanning-tree vlan vlan-id root primary
    • The command sets the STP priority to 24576.
    • If another switch already has a priority lower than 24576, it sets this switch’s priority to 4096 less than the other switch’s priority.
  2. spanning-tree vlan vlan-id root secondary
    • The command sets the STP priority to 28672.

Spanning Tree Port Settings

There are two commands you need to know for spanning tree port settings, they are:

  1. spanning-tree vlan vlan-id cost number
    • Changes an interface’s root cost, therefore overriding the default STP port costs.
  2. spanning-tree vlan vlan-id port-priority number
    • Changes an interface’s port priority, therefore overriding the default STP port priority of 128.

Jeremy’s IT Lab előadásvideó:

21. Nap - Spanning Tree Protocol (STP) (2)


Parancsok


Klasszikus Spanning Tree Információk

A klasszikus STP protokoll verzióazonosítója (protocol version identifier) 0

Spanning Tree Port Állapotok

A Klasszikus Spanning Tree 5 különböző port állapottal rendelkezik:

  1. Blocking / Stabil (Stable)
  2. Listening / Átmeneti (Transitional)
  3. Learning / Átmeneti (Transitional)
  4. Forwarding / Stabil (Stable)
  5. Disabled

Egy forwarding interfész közvetlenül átléphet blocking állapotba,

Azonban a blocking állapotból nem lehet közvetlenül forwarding állapotba lépni. Először kötelezően végig kell mennie a listening és learning állapotokon.

STP Port ÁllapotBPDU-k küldése/fogadásaFrame Továbbítás
(Normál adatforgalom)
MAC Address
Tanulás
Stabil/Átmeneti
BlockingNEM/IGENNEMNEMStabil
ListeningIGEN/IGENNEMNEMÁtmeneti
LearningIGEN/IGENNEMIGENÁtmeneti
ForwardingIGEN/IGENIGENIGENStabil
DisabledNEM/NEMNEMNEMStabil

Spanning Tree Időzítők (Timers)

3 különböző spanning tree időzítő létezik:

  1. Hello / 2 másodperc
  2. Forward delay / 15 másodperc
  3. Max age / 20 másodperc (a hello időzítő 10-szerese)
STP IdőzítőCél / SzerepIdőtartam
HelloMilyen gyakran küld a root bridge Hello BPDU-kat2 mp
Forward DelayMennyi ideig marad a switch a Listening és Learning állapotokban
(mindegyik állapot 15 másodperc = összesen 30 másodperc)
15 mp
Max AgeMennyi ideig vár egy interfész a Hello BPDU-k fogadásának megszűnése után az STP topológia módosításával20 mp
(10*hello)

BPDU továbbítás

A switchek nem továbbítják a BPDU-kat a root és non-designated portjaikon, kizárólag a designated portjaikon.


Spanning Tree Opcionális Funkciók (STP Toolkit)

  1. Portfast
    • A Portfast lehetővé teszi, hogy egy port azonnal forwarding állapotba kerüljön, kihagyva a listening és learning fázisokat. Ezt végberendezésekhez (end hosts) csatlakozó switchportokon használják, mivel ezek nem jelentenek hurokképződési (loop) kockázatot a hálózatban.
    • A Portfast kizárólag access portokon működik.
  2. BPDU Guard
    • A BPDU Guard gondoskodik róla, hogy ha egy BPDU Guard engedélyezett interfész BPDU-t kap egy másik switchtől, az interfész azonnal leálljon (shutdown), megelőzve a hurok kialakulását.
  3. Root Guard
    • Ha engedélyezzük a root guardot egy interfészen, még ha fölényesebb (superior) BPDU-t is kap (alacsonyabb bridge ID-val) az adott porton, a switch nem fogadja el az új switchet root bridge-ként. Az interfész letiltásra (disabled) kerül.
  4. Loop Guard
    • Ha engedélyezzük a loop guardot egy interfészen, még ha az interfész nem is kap többé BPDU-kat, nem kezd el automatikusan forgalmat továbbítani (forwarding). Az interfész letiltásra (disabled) kerül.

Spanning Tree Elsődleges és Másodlagos Root Bridge-ek

Két parancs létezik egy switch bridge priority értékének egyszerű megváltoztatására:

  1. spanning-tree vlan vlan-id root primary
    • A parancs az STP priority-t 24576-ra állítja.
    • Ha egy másik switch prioritása már 24576-nál alacsonyabb, akkor a switch prioritását 4096-tal a másik switch prioritása alá állítja.
  2. spanning-tree vlan vlan-id root secondary
    • A parancs az STP priority-t 28672-re állítja.

Spanning Tree Port Beállítások

Két parancsot kell ismerni a spanning tree portbeállításokhoz:

  1. spanning-tree vlan vlan-id cost number
    • Módosítja egy interfész root cost értékét, felülbírálva az alapértelmezett STP portköltségeket.
  2. spanning-tree vlan vlan-id port-priority number
    • Módosítja egy interfész port priority értékét, felülbírálva az alapértelmezett 128-as STP port priority értéket.