Jeremy’s IT Lab lecture video:
Day 22 - Rapid Spanning Tree Protocol (3)
Commands
Commands List
Spanning Tree Show Commands
6. Spanning Tree
Link to original
- show spanning-tree
-->Shows general STP status and information- show spanning-tree vlan vlan-id
-->Shows spanning-tree information for a specific VLAN- show spanning-tree detail
-->Shows detailed STP information- show spanning-tree summary
-->Shows a summary of the current STP configurationSpanning Tree Interface Commands
Spanning Tree
1. General
- spanning-tree mode mode {mst
/pvst/rapid-pvst} (Versions)2. Spanning Tree Portfast / BPDU Guard
- spanning-tree portfast
-->Enables portfast on the current interface.- spanning-tree portfast default
-->Enables Portfast on all access ports by default.- spanning-tree bpduguard enable
-->Enables BPDU Guard on the current interface.- spanning-tree portfast bpduguard default
-->Enables BPDU Guard on all Portfast-enabled interfaces by default.3. Spanning Tree VLAN Related
- spanning-tree vlan vlan-id root primary
-->Sets the STP bridge priority to 24576 (Or 4096 lower than the current lowest STP priority.)- spanning-tree vlan vlan-id root secondary
-->Sets the STP bridge priority to 28672- spanning-tree vlan vlan-id cost number
-->Changes the interface’s STP root cost- spanning-tree vlan vlan-id port-priority number
-->Changes the interface’s port priority4. Spanning Tree Link Type
Link to original
- spanning-tree link-type type { point-to-point
/shared }
Rapid Spanning Tree Information
The protocol version identifier for RSTP is 2
Spanning Tree Versions
Spanning Tree has industry-standard (IEEE) versions and Cisco proprietary versions.
- Industry Standards (IEEE)
- Spanning Tree Protocol (802.1D)
- The original STP.
- All VLANs share one STP instance. Therefore, cannot load balance.
- Rapid Spanning Tree Protocol (802.1w)
- Much faster at converging/adapting to network changes than 802.1D.
- All VLANs share one STP instance. Therefore, cannot load balance.
- Multiple Spanning Tree Protocol (802.1s)
- Uses modified RSTP mechanics.
- Can group multiple VLANs into different instances (ie. VLANs 1-5 in instance 1, VLANs 6-10 in instance 2) to perform load balancing.
- Spanning Tree Protocol (802.1D)
- Cisco proprietary
- Per-VLAN Spanning Tree Plus (PVST+)
- Cisco’s upgrade to 802.1D.
- Each VLAN has its own STP instance.
- Can load balance by blocking different ports in each VLAN.
- Rapid Per-VLAN Spanning Tree Plus (Rapid PVST+)
- Cisco’s upgrade to 802.1w
- Each VLAN has its own STP instance.
- Can load balance by blocking different ports in each VLAN.
- Per-VLAN Spanning Tree Plus (PVST+)
Similarities between STP and RSTP
- RSTP has the same purpose as STP.
- RSTP elects a root bridge with the same rules.
- RSTP elects root ports with the same rules.
- RSTP elects designated ports with the same rules.
RSTP Port States
| STP Port State | Send/Receive BPDUs | Frame Forwarding (Regular Traffic) | MAC Address Learning | Stable/Transitional |
|---|---|---|---|---|
| Discarding | NO/YES | NO | NO | Stable |
| Learning | YES/YES | NO | YES | Transitional |
| Forwarding | YES/YES | YES | YES | Stable |
- If a port is administratively disabled (with shutdown command), it’s in a discarding state.
- If a port is enabled, but blocking traffic to prevent Layer 2 loops, it’s in a discarding state.
RSTP Port Roles
- The root port role remains unchanged in RSTP.
- The designated port role remains unchanged in RSTP.
- The non-designated port is split into two separate roles in RSTP:
- Alternate port
- The alternate port role is a discarding port that receives a superior BPDU from another switch.
- It serves as a backup to the root port. If the root port fails, the switch can immediately change to its best alternate port to forwarding.
- Backup port
- The backup port is discarding port that receives a superior BPDU from another interface on the same switch. (This only happens when two interfaces are connected to the same collision domain through a hub)
- It serves as a backup to the designated port.
- The interface with the lowest Port ID will be selected as the designated port, and the other will be the backup port.
- Alternate port
RSTP New Built-in Functionalities
- UplinkFast
- When a root port goes down, the switch changes to the alternate port for forwarding. This feature is similar to the classic STP optional feature, UplinkFast.
- BackboneFast
- BackboneFast allows switches to expire the max age timer on interfaces and rapidly forward superior BPDUs to other switches.
RSTP BPDUs
In classic STP, only the root bridge sent BPDUs and other switches forwarded them. In RSTP, all switches running RSTP send their own BPDUs every hello time (2 seconds by default) from their designated ports.
- In classic STP, a switch waits 10 hello intervals (20 seconds) before considering a neighbor to be lost.
- In RSTP, a switch considers a neighbor lost if it misses 3 BPDUs (6 seconds). It will then flush all MAC addresses learned on that interface.
RSTP Link Types
There are 3 different link types:
- Edge
- A port that is connected to an end host. Moves directly to forwarding, without negotiation.
- Point-to-point
- Direct connection between two switches. Operates in full-duplex.
- Shared
- Connection to a hub. Must operate in half-duplex.
Jeremy’s IT Lab előadásvideó:
22. Nap - Rapid Spanning Tree Protocol (3)
Parancsok
Parancslista
Spanning Tree Show Parancsok
6. Spanning Tree
Eredeti hivatkozása
- show spanning-tree
-->Megjeleníti az általános STP állapotot és információkat- show spanning-tree vlan vlan-id
-->Megjeleníti egy adott VLAN spanning-tree információit- show spanning-tree detail
-->Részletes STP információkat jelenít meg- show spanning-tree summary
-->Összefoglalót jelenít meg az aktuális STP konfigurációrólSpanning Tree Interfész Parancsok
Spanning Tree
1. Általános
- spanning-tree mode mode {mst
/pvst/rapid-pvst} (Verziók)2. Spanning Tree Portfast / BPDU Guard
- spanning-tree portfast
-->Engedélyezi a portfastot az aktuális interfészen.- spanning-tree portfast default
-->Alapértelmezés szerint engedélyezi a Portfastot minden access porton.- spanning-tree bpduguard enable
-->Engedélyezi a BPDU Guardot az aktuális interfészen.- spanning-tree portfast bpduguard default
-->Alapértelmezés szerint engedélyezi a BPDU Guardot minden Portfast-engedélyezett interfészen.3. Spanning Tree VLAN-hoz kapcsolódó parancsok
- spanning-tree vlan vlan-id root primary
-->Az STP bridge priority értékét 24576-ra állítja (Vagy 4096-tal alacsonyabbra a jelenlegi legalacsonyabb STP priority-nél.)- spanning-tree vlan vlan-id root secondary
-->Az STP bridge priority értékét 28672-re állítja- spanning-tree vlan vlan-id cost number
-->Módosítja az interfész STP root cost értékét- spanning-tree vlan vlan-id port-priority number
-->Módosítja az interfész port priority értékét4. Spanning Tree Link Típus
Eredeti hivatkozása
- spanning-tree link-type type { point-to-point
/shared }
Rapid Spanning Tree Információk
Az RSTP protokoll verzióazonosítója (protocol version identifier) 2
Spanning Tree Verziók
A Spanning Tree protokollnak léteznek ipari szabványos (IEEE) és Cisco-specifikus (proprietary) verziói.
- Ipari Szabványok (IEEE)
- Spanning Tree Protocol (802.1D)
- Az eredeti STP.
- Minden VLAN egyetlen közös STP példányon osztozik. Emiatt nem képes terheléselosztásra (load balance).
- Rapid Spanning Tree Protocol (802.1w)
- Sokkal gyorsabban konvergál / alkalmazkodik a hálózati változásokhoz, mint a 802.1D.
- Minden VLAN egyetlen közös STP példányon osztozik. Emiatt nem képes terheléselosztásra.
- Multiple Spanning Tree Protocol (802.1s)
- Módosított RSTP mechanizmusokat használ.
- Képes több VLAN-t külön példányokba csoportosítani (pl. 1-5 VLAN-ok az 1. példányba, 6-10 VLAN-ok a 2. példányba) a terheléselosztás megvalósításához.
- Spanning Tree Protocol (802.1D)
- Cisco-specifikus (Proprietary)
- Per-VLAN Spanning Tree Plus (PVST+)
- A Cisco fejlesztése a 802.1D-hez képest.
- Minden VLAN saját külön STP példánnyal rendelkezik.
- Képes terheléselosztásra oly módon, hogy VLAN-onként eltérő portokat blokkol.
- Rapid Per-VLAN Spanning Tree Plus (Rapid PVST+)
- A Cisco fejlesztése a 802.1w-hez képest.
- Minden VLAN saját külön STP példánnyal rendelkezik.
- Képes terheléselosztásra oly módon, hogy VLAN-onként eltérő portokat blokkol.
- Per-VLAN Spanning Tree Plus (PVST+)
Hasonlóságok az STP és az RSTP között
- Az RSTP ugyanazt a célt szolgálja, mint az STP.
- Az RSTP ugyanazokkal a szabályokkal választja meg a root bridge-et.
- Az RSTP ugyanazokkal a szabályokkal választja meg a root portokat.
- Az RSTP ugyanazokkal a szabályokkal választja meg a designated portokat.
RSTP Port Állapotok
| STP Port Állapot | BPDU-k küldése/fogadása | Frame Továbbítás (Normál adatforgalom) | MAC Address Tanulás | Stabil/Átmeneti |
|---|---|---|---|---|
| Discarding | NEM/IGEN | NEM | NEM | Stabil |
| Learning | IGEN/IGEN | NEM | IGEN | Átmeneti |
| Forwarding | IGEN/IGEN | IGEN | IGEN | Stabil |
- Ha egy port adminisztratív módon le van tiltva (a shutdown paranccsal), akkor discarding állapotban van.
- Ha egy port engedélyezve van, de blokkolja a forgalmat a Layer 2 loopok megelőzése érdekében, akkor is discarding állapotban van.
RSTP Port Szerepek (Roles)
- A root port szerepkör változatlan marad az RSTP-ben.
- A designated port szerepkör változatlan marad az RSTP-ben.
- A non-designated port szerepkör két különálló szerepre oszlik az RSTP-ben:
- Alternate port
- Az alternate port egy olyan discarding port, amely fölényesebb (superior) BPDU-t kap egy másik switchtől.
- A root port tartalékaként (backup) szolgál. Ha a root port meghibásodik, a switch azonnal forwarding állapotba állíthatja a legjobb alternate portját.
- Backup port
- A backup port egy olyan discarding port, amely fölényesebb BPDU-t kap ugyanannak a switchnek egy másik interfészétől. (Ez csak akkor fordul elő, ha két interfész ugyanahhoz a collision domainhez kapcsolódik egy hubon keresztül)
- A designated port tartalékaként szolgál.
- A legalacsonyabb Port ID-val rendelkező interfész lesz a designated port, a másik pedig a backup port.
- Alternate port
RSTP Új Beépített Funkciók
- UplinkFast
- Amikor egy root port leáll, a switch azonnal átvált az alternate portra a továbbításhoz. Ez a funkció megegyezik a klasszikus STP opcionális UplinkFast funkciójával.
- BackboneFast
- A BackboneFast lehetővé teszi a switchek számára, hogy azonnal lejárassák a max age időzítőt az interfészeken, és gyorsan továbbítsák a fölényesebb (superior) BPDU-kat a többi switch felé.
RSTP BPDU-k
A klasszikus STP-ben kizárólag a root bridge küldött BPDU-kat, a többi switch pedig csak továbbította azokat. Az RSTP-ben minden RSTP-t futtató switch minden hello time időközönként (alapértelmezés szerint 2 másodperc) saját BPDU-kat küld ki a designated portjain.
- A klasszikus STP-ben a switch 10 hello időközt (20 másodperc) vár, mielőtt egy szomszédot elveszettnek tekintene.
- Az RSTP-ben a switch már 3 kimaradt BPDU után (6 másodperc) elveszettnek tekinti a szomszédot. Ekkor törli (flush) az adott interfészen tanult összes MAC-címet.
RSTP Link Típusok
3 különböző link típus létezik:
- Edge
- Végberendezéshez csatlakozó port. Közvetlenül forwarding állapotba lép, egyeztetés (negotiation) nélkül.
- Point-to-point
- Közvetlen kapcsolat két switch között. Full-duplex módban működik.
- Shared
- Kapcsolat egy hubhoz. Kötelezően half-duplex módban működik.