alp stp
DESCRIPTION
stpTRANSCRIPT
Version 2
Alp ISIKAlp ISIK
Netas Enterprice NTS EngineerNetas Enterprice NTS Engineer
Ethernet Transmission
• Half-duplex transmission– Data sent in one direction at a time– Results in collisions– Uses CSMA/CD to resolve collisions– Hubs are the most common half-duplex devices
• Full-duplex transmission– Data sent in both directions at the same time– Requires point-to-point connections– No collisions– An approach to higher network efficiency – Switches are the most common full-duplex
devices
Half-Duplex Operation (CSMA/CD )
– All hosts constantly listen to the line.
– Host A transmits.
– Hosts B, C, and D listen to host A and do not transmit.
– All hosts receive host A’s message.
Hub
A B C D
Half-Duplex Operation (CSMA/CD)
– All hosts constantly listen to the line.
– Host A and host B transmit simultaneously.
– Messages collide.
– Both hosts back off for a random time interval.
Hub
A B C D
Full-Duplex Operation
– Attached to a dedicated switched port
– Requires full-duplex support on both ends
– Collision-free
Switch
A B C ED
Auto-Negotiation
• Ethernet’s negotiable operation
– Speed
• 10 Mb/s
• 100 Mb/s
• 1000 Mb/s
– Operation mode
• Half-duplex (CSMA/CD)
• Full-duplex
• If auto-negotiation is enabled, Ethernet nodes connected by a twisted pair cable negotiate their speed as well as duplex mode prior to establishing a link.
1 Collision Domain,1 Collision Domain,1 Broadcast Domain1 Broadcast Domain
Resource
2 Collision Domains, 2 Collision Domains, 1 Broadcast Domain1 Broadcast Domain
Router
3 Broadcast Domains,3 Broadcast Domains,3 Collision Domains3 Collision Domains
Bridge
Switch
Network Domains
Collision Domains
In this figure, there are 8 collision domains and 3 broadcast domains.
Hub
Hub
Hub
Hub
Hub
Hub
Switch
Switch
Router
Collision
Domain
Collision
Domain
Collision
Domain
Collision
Domain
Collision
Domain
Collision
Domain
Collision
Domain
Collision
DomainBroadcast
Domain
Broadcast
Domain
Broadcast
Domain
Switch
11 22
Host A
00 00 A2 00 00 01
Host B
00 00 A2 00 00 02
Switch Forwarding TableNode MAC Address00 00 A2 00 00 0100 00 A2 00 00 02
Interface12
Switching
1/2
1/1
1/3
1/4
1/1
1/2
1/3
1/4
Host A
0000.8c01.000A
Host B
0000.8c01.000B
Host C
0000.8c01.000C
Host D
0000.8c01.000D
Step 1: Host A sends a frame to Host B.
Step 2: The switch receives the frame on 1/1 and places source in MAC table.
Step 3: The destination is not in the MAC table so the switch forwards the frame to all ports except the source.
Step 4: Host B responds to Host A. The switch adds the source address of Host B to the MAC table.
Step 5: Host A and Host B can now send unicast frames bidirectionally.
Step 6: Similarly, Host C and Host D will send frames and populate the MAC table. Step 2
Step 4
0000.8c01.000A
0000.8c01.000B
0000.8c01.000C
0000.8c01.000D
Step 6
Building Up the MAC Forward/Filter Table
Spanning Tree Protocol 802.1
Spanning Tree Protocol — What Is It?
– Link management protocol that is part of IEEE 802.1
– Spanning tree algorithm provides path redundancy in Ethernet bridge/switch networks
– Provides 1 active path at a time between 2 bridges or switches
– Provides backup paths to the active path, should the active path fail
– Primary function is to avoid looping in redundant path Ethernet networks
Redundant Topology — Without STP
• Redundancy
– Advantages:
• Necessary for the link of a switch failover
• Load balancing
– Disadvantages:
• May cause broadcast storms
• May cause multiple frame copies to be sent
• May cause FDB table instability
• Frame looping problems
– Layer 2 has no mechanism to stop looping as layer 3 has with TTL
Receiving Multiple Copies
Segment 1
Segment 2
Host X Host Y
Switch 1 Switch 2
Database Instability
Segment 1
Segment 2
Host A
Unicast Unicast
Port 0
Port 1
Port 0
Port 1
Host B
MAC Address DB
Host A Port 0
MAC Address DB
Host A Port 0
Host A Port 0 Host A Port 1
Switch 1 Switch 2
Broadcast Storms
Segment 1
Segment 2
Host X
Broadcast
Host Y
Switch 1 Switch 2
STP and IEEE 802.1d
– STP is defined in 802.1d as a link management protocol
– Initially developed in 1990, based on the ISO/IEC 10038 standard
– Designed to provide path redundancy in Ethernet bridge/switch-based networks, while preventing loops
– STP uses a root/branch/leaf model, which determines a single path to each leaf spanning the entire L2 network
– End hosts (e.g., PCs) are oblivious to STP and instead see a single LAN segment
STP Port States
• All ports in an STP network go through the following states.
Initialization
Blocking
Listening
Learning
Forwarding
Disabled
STP Port States and Activities
STP port state Part of active topology
Learning of MAC addresses
Disabled No No
Blocking
Listening
Learning No Yes
Forwarding Yes Yes
STP in Action: State 2 — Root Bridge/Switch Election
• Root bridge/switch election calculation:
• After bridges/switches have initialized and all ports are in blocking mode, root bridge election occurs.
• Each bridge/switch has a user-assigned bridge priority.
• The bridge priority ranges from 0 to 65 535 (default is 32 768).
• Each bridge/switch sends its BID to every other bridge/switch. The BID is 8 bytes: 2 for bridge priority and 6 that contain the MAC address of the bridge/switch.
• Election of the root bridge is determined using the Bridge ID, which is made up of the Priority and MAC address
– the switch with lowest Bridge ID value is selected
• Any subsequent physical change in the network after election of the root bridge will cause an STP recalculation.
STP in Action: State 2
Host A
Host B
Boot UpBoot Up
Boot UpBoot Up
Boot UpBoot Up
Boot UpBoot Up
State 2 — Blocking
BPDU
BP
DU
BP
DU
BPDU
BPDU
BPDU
BP
DU
BP
DU
RootBridge/Switch
RootBridge/Switch
RootBridge/Switch
RootBridge/Switch
B
A
C
D
STP in Action: State 2 — Root Bridge/Switch Election
Host A
Host B
State 2 — Blocking
RootBridge/Switch
RootBridge/Switch
RootBridge/Switch
RootBridge/Switch
Priority - 32MAC - 00-80-21-00-00-10
Priority - 16MAC - 00-80-21-00-00-30
Priority - 48MAC - 00-80-21-00-00-20
Priority - 16MAC - 00-80-21-00-00-40
B
A
C
D
STP in Action: State 2 — Root Bridge/Switch Election
Host A
Host B
RootBridge/Switch
LeafBridge/Switch
LeafBridge/Switch
LeafBridge/Switch
Priority - 32MAC - 00-80-21-00-00-10
Priority - 16MAC - 00-80-21-00-00-30
Priority - 48MAC - 00-80-21-00-00-20
Priority - 16MAC - 00-80-21-00-00-40
BP
DU
BP
DU
BPDU
BPDU BPDU
BP
DU
BP
DU
BPDU
B
A
C
D
STP in Action: State 2 — Path Calculation
• Each port on a bridge/switch has a path cost value assigned, depending on bandwidth.
• The accumulated path cost determines the total cost to reach the root bridge/switch.
• Path cost values can be found in the IEEE 802.1d standard.
Link bandwidth
STP cost value
4 Mb/s 250
10 Mb/s 100
16 Mb/s 62
45 Mb/s 39
100 Mb/s 19
155 Mb/s 14
622 Mb/s 6
1 Gb/s 4
10 Gb/s 2
STP in Action: State 2 — Path Calculation
Host A
Host B
Root
Leaf
Leaf
Leaf
BP
DU
BP
DU
BPDU
BPDU BPDU
BP
DU
BP
DU
BPDU
Path Cost 2
Path Cost 10
Path Cost 10
Path Cost 10
B
A
C
D
STP in Action: State 2 — Calculating Forwarding Paths
Host A
Host B
Root
LeafLeaf
Leaf
Path Cost 2
Path Cost 10
Path Cost 10
Path Cost 10
Root Port
Designated Port
Designated Port
Designated Ports
Root Port
Root Port
B
A
C
D
STP in Action: State 3 — Listening State
FDB
Forwarded Traffic
BPDUs
NM Messages
Bridge/Switch
STP in Action: State 4 — Learning State
FDB
Forwarded Traffic
BPDUs
NM Messages
Bridge/Switch
STP in Action: State 5 — Final Forwarding Paths
Host A
Host B
Root
Leaf
Leaf
Leaf
Path Cost 2
Path Cost 10
Path Cost 10
Path Cost 10
B
A
C
D
STP in Action — Topology Change (Deleting a Link)
Host A
Host B
Root
Leaf
Leaf
Leaf
Path Cost 2
Path Cost 10
Path Cost 10
Path Cost 10 A
B C
D
Wait 20 seconds (Max
age time)
BPDU
BP
DU
Designated Ports
Root Port
Listen (15 seconds)Learn (15 seconds)
STP in Action — Topology Change (Path Cost Change)
Host A
Host B
Root
Leaf
Leaf
Leaf
Path Cost
Path Cost 10
2Path Cost
Path Cost 10
Path Cost Change
1 — TCN BPDU sent to Root
2 — Reply w/TCA BPDU set
3 — Topology changed
10 BPDU
BP
DU
TBPDU TBPDU
BPDU
BP
DU
BPDUT
BP
DU
TB
PD
U
TB
PD
U
TB
PD
U Listen (15 seconds)
Learn (15 seconds)
B
A
D
C
STP in Action — Topology Change (Adding a Switch)
Host A
Host B
Root
Leaf
Leaf
Leaf
Path Cost 2
Path Cost 10
Path Cost 10
Path Cost 10
Pa
th C
os
t 10
Path Cost 10
Priority - 16MAC - 00-80-21-00-00-30
Priority - 16MAC - 00-80-21-
00-00-10
BP
DU
BPDU
BPDU
B
D
C
EA
New Root
BPDU
BPDU
BP
DU
BP
DU
Designated Ports
Root Port
Leaf
New switch E added
All ports in listening state
New BPDUs sent
New root switch elected
Final topology
STP and BPDU• The root bridge/switch sends
STP messages via BPDUs to the branches/leaves.
• On individual branches and leaves, the user can specify IDs and path costs.
• The root bridge/switch sets the forwarding delay, hello time, and maximum age.
• BPDU is sent in Ethernet frame with the port’s address as source and the STP Multicast address 01:80:C2:00:00:00 as destination
Protocol ID (2 bytes)Version (1 byte)
Message type (1 byte)Flags (1 byte)
Root ID ( 8 bytes)
Path cost (4 bytes)
Bridge ID (8 bytes)
Port ID (2 bytes)
Message age (2 bytes)
Maximum age (2 bytes)
Hello time (2 bytes)
Forwarding delay (2 bytes)
BPDU Packet
BPDU Packet Details
Protocol ID Always set to 0
Version Always set to 0
Message type Determines which of two BPDU types; configuration or TCN
Flags Handle changes in the active topology
Root ID Contains the bridge ID of root bridge (after convergence, all BPDUs should contain the same value)
Root path cost Cumulative path cost of all links to the root bridge
Bridge ID Identifies the bridge that is transmitting the current configuration message
Port ID Contains a unique value for each port
Message age Time stamp since the root bridge created this BPDU
Maximum age Maximum amount of time this BPDU is saved
Hello time Time between configuration BPDUs
Forwarding delay Time spent in the listening and learning states
Configurable on each bridgeConfigurable on root bridge
Spanning Tree Exercise
• Highlight the steps that will ensure that Switch D is added to the existing Bridge topology using STP
Priority - 16
MAC - 00-80-21-00-00-10
Priority - 16
MAC - 00-80-21-00-00-20
Priority - 16
MAC - 00-80-21-00-00-30
Priority - 16
MAC - 00-80-21-00-00-40
A
B C
D
10
10
10
10
10
Rapid Spanning Tree
What is RSTP?
• What is RSTP?
– Stands for rapid spanning tree protocol
– An evolution to the loop prevention algorithm (STP) from 802.1d
– New IEEE specification is 802.1w
– Achieves rapid failover and convergence times
– Unlike STP, RSTP is not timer-based
– Allows backward compatibility with 802.1d STP
• Why do we need RSTP?
– Network topology convergence is significantly faster than STP
STP port state
RSTP port state
Part of active
topology
Learning of MAC
addresses
Disabled Discard No No
Blocking
Listening
Learning Learning No Yes
Forwarding
Forwarding Yes Yes
STP vs. RSTP — Port States
Port states STP port role (assigned by STP algorithm)
RSTP port role
(configurable)
Forwarding Root Root
Designated Designated
Blocking Blocked Backup
Blocked Alternate
• Role — A new variable assigned to a bridge port
STP vs. RSTP — Port Roles
Alternate Port
Root
Root Port Root Port
Designated PortDesignated Port
Designated PortAlternate Port
BPDU
Backup Port
Root
Root PortRoot Port
Designated PortDesignated Port
Designated PortAlternate Port Backup Port
BPDUBPDU
RSTP BPDU Format
Protocol ID (2 bytes)
Version (1 byte)
Message type (1 byte)
Flags (1 byte)
Root ID ( 8 bytes)
Path cost (4 bytes)
Bridge ID (8 bytes)
Port ID (2 bytes)
Message age (2 bytes)
Maximum age (2 bytes)
Hello time (2 bytes)
Forwarding delay (2 bytes)
Version 1 length (2 bytes)
Configurable
Configurableon root bridge
Bit 0 – Topology change
Bit 1 – Proposal
Bit 2, 3 – Port role0 0 Unknown
0 1 Alternate/backup
1 0 Root
1 1 Designated
Bit 4 – Learning
Bit 5 – Forwarding
Bit 6 – Agreement
Bit 7 – Topology change ACK
STP RSTP
BPDU handling
Non-root bridge only transmits BPDUs when it receives one on the root port
Bridge sends BPDU at hello time intervals
Aging BPDU is aged after the max-age timer expires (and no BPDU is received on the port)
BPDUs are used like keepalive messages (after 3 BPDUs in a row are missed it ages it out)
Accepting inferior BPDUs
— Inferior BPDU is accepted and previously stored information is replaced
Transition to forwarding state
Based on timers (Forward Delay and Max-Age)
Uses a feedback mechanism (no timers involved)
STP vs. RSTP — BPDUs
STP RSTP
Topology change notification
Sends TCN BPDUs toward root
Sends BPDUs (with TC bit set) on all designated and root ports
Topology ACKs
Replies with BPDU with TCA bit set
No acknowledgement (clears MAC addresses on all ports)
Topology change
First sent to root bridge/switch, then relayed from root all the way to the leaf bridge/switch
1-step process (topology change flooded quickly across the network)
STP vs. RSTP — Topology
Virtual LAN
Switches and VLANs
– A VLAN permits a group of ports to share a common broadcast domain regardless of physical location.
– A VLAN can reside on 1 switch or on many switches.– A port that is not in a specific VLAN is in a default VLAN, and
thus in a different broadcast domain.– Each VLAN is identified by a VLAN ID.– Devices in different VLANs can only communicate with each
other if the frame is first sent to a layer 3 device (a router).
Why VLANs?
There are two main reasons for the development of VLANs:
The amount of broadcast traffic and increased security.
Broadcast traffic increased in direct proportion to the number of stations in the
LAN. The goal of the VLAN is the isolation of groups of users so that one group
is not interrupted by the broadcast traffic of another.
VLANs also have the benefit of added security by separating the network into
distinct logical networks. Traffic in one VLAN is separated from another VLAN
as if they were physically separate networks. If traffic is to pass from one VLAN
to another, it must be routed.
VLAN 101VLAN 102VLAN 103
Ethernet switch
Internal switchVLAN 101
Internal switchVLAN 102
Internal switchVLAN 103
Port 1
Port 2
Port 3
Port 5
Port 6
Port 7
How Do VLANs Work?
VLAN 101
Host 1 sends out a broadcast. Which hosts will receive the broadcast?
VLAN Exercise
Switch 1
VLAN 102
VLAN 102
VLAN 101
Host 1
Host 2
Host 3
Host 4
BPDU
BPDU
Switch 1
Switch 2 Switch 3
VLAN 101VLAN 102VLAN 103
VLANs across Multiple Switches
VLANs over Multiple Switches
Switch 1
Switch 2
MAC FDB VLAN 101
MAC FDB VLAN 102
MAC FDB VLAN 103
MAC FDB VLAN 101
MAC FDB VLAN 102
MAC FDB VLAN 103
VLAN 101VLAN 102VLAN 103
Separate Physical
Interfaces
VLAN Trunking
Switch 1
Switch 2
VLAN 101VLAN 102VLAN 103
MAC FDB VLAN 101
MAC FDB VLAN 102
MAC FDB VLAN 103
MAC FDB VLAN 101
MAC FDB VLAN 102
MAC FDB VLAN 103
SFDPre-amble DA SA Length
/Type P a y l o a d (46 to 1500 bytes) FCS
802.1q tag type (value 81 00) Tag control information
2 bytes2 bytes 2 bytes2 bytes
CFICFI (Canonical format: bit ordering can be different)(Canonical format: bit ordering can be different) CFICFI (Canonical format: bit ordering can be different)(Canonical format: bit ordering can be different)
User_priorityUser_priorityUser_priorityUser_priority VLAN_IDVLAN_IDVLAN_IDVLAN_ID
3 bits3 bits3 bits3 bits 1 bit1 bit1 bit1 bit 12 bits12 bits12 bits12 bits
Length of the Length of the MAC frame + 4 bytesMAC frame + 4 bytes
Length of the Length of the MAC frame + 4 bytesMAC frame + 4 bytes
VLANtag
802.1q Ethernet FrameVLAN Tagging
Multiple Spanning Tree Protocol
Multiple Spanning Tree Protocol (MSTP)
– What is MSTP?– Why do we need MSTP?– Differences: MSTP vs. STP– Where to use MSTP
• Example
Multiple Spanning Tree Protocol• What is MSTP?
– An IEEE standard that allows more than one instance of STP– A natural progression from RSTP, introduced in 2003 as part of
802.1s• Why do we need MSTP?
– Allows load balancing of network between different sets of VLANs
– Allows a set of VLANs to run a single instance of the spanning tree while another set runs another instance of the spanning tree
– Some early versions of MSTP, before 802.1s, used a single STP instance per VLAN, which was very CPU-intensive. MSTP lowers CPU usage in these instances.
– Reduce overhead of BPDUs as otherwise they're sent for every VLAN
– Interoperability– Scalabitility
Switch A
Switch CSwitch B
R
D
A
VLAN 1-500
VLAN 501-1000
Root
LeafLeaf
D
R
D
D - DesignatedR - RootA - Alternate
Port States
Standard STP
D - DesignatedR - RootA - Alternate
Port StatesSwitch A
Switch CSwitch B
R
D
A
VLAN 1-500VLAN 501-1000
D
R
D
D
R D
D
A R
MSTP
Spanning Tree Protocol Group (STG)
Multiple STGs provide multiple data paths, which can be used for
load-sharing and redundancy. Enable load sharing between two
switches using multiple STGs by configuring each path with a
different VLAN and then assigning each VLAN to a separate STG.
Each STG is independent. Each STG sends its own Bridge Protocol
Data Units (BPDU), and you must independently configure each
STG. The tagging for the BPDUs from STG1, or the default STG, is
user-configurable (as are tagging settings for all STGs). However,
by default STG1 sends only untagged BPDUs to operate with all
devices that support only one instance of STP. (By default, STG2
through STG8 are tagged.) The tagging setting for each STG is
user-configurable.
Spanning Tree Groups and VLANs
• VLANs are a subset of the STG– With the setup below connectivity to VLAN-4 across the switches
is lost.– Solution is to create a trunk links between the switches
STG-1 STG-1
VLAN-3 VLAN-3
VLAN-4 VLAN-4Blocked
Spanning Tree Groups and VLANs
STG-1 STG-1
STG-1 STG-1
SW1 SW2
SW3 SW4
VLAN-3 VLAN-3
VLAN-3
VLAN-4
VLAN-4
VLAN-4
VLAN-4
TrunkLink
Failure
Port Blocked
Root
Spanning Tree Groups and VLANs
STG-1 STG-1
STG-1 STG-1
SW1 SW2
SW3 SW4
VLAN-3 VLAN-3
VLAN-3
VLAN-4
VLAN-4
VLAN-4
VLAN-4
TrunkLink
Failure
CreateVLAN-3Without
Access Ports
Root
Why have multiple STG
STG-1 STG-1
STG-1 STG-1
SW1 SW2
SW3 SW4
VLAN-3 VLAN-3
VLAN-3
Root
Gigabit Link
Gigabit Link
Gigabit LinkGigabit Link
With a single STG configured a Gig port is not utilised as it is in a blocking state
VLAN-3
VLAN-4
VLAN-4
VLAN-4
VLAN-4
VLAN-3
Why have multiple STG
STG-1 STG-1
STG-1 STG-1VLAN-3 VLAN-3
VLAN-3
VLAN-4
VLAN-4
VLAN-4
VLAN-4
Gigabit Link
Gigabit Link
Gigabit LinkGigabit Link
With VLAN-3 in STG1 and VLAN-4 in STG-2 all links in the network are now being utilised
STG-2 STG-2
STG-2STG-2
blocking In STG-2blocking in STG-1
Tagged BPDUs
• In the previous slide BPDU’s were being passed across a tagged link. On the Passport switch :– STG–1 BPDU are always untagged. This is
necessary inorder for the 8600 to be compatiable with other vendor switches.
– All other STG BPDU’s when passed across tagged links are tagged
Vlan 10
Vlan 20
Vlan 10
Vlan 10
Vlan 20
Vlan 10
Vlan 10
Vlan 20
STG 1
STG 2
Spanning Tree Fast Learning
• Enhanced port mode supported by theNortel.
If you enable Spanning Tree Fast Learning on a port with no other bridges, the port starts more quickly after a switch initialization or a spanning tree change. The port passes through the normal blocking and learning states before the forwarding state, but the hold times for these states is the bridge hello timer (2 seconds by default) instead of the bridge forward delay timer (15 seconds by default). The port configured with Fast Learning can forward data immediately, as soon as the switch learns that the port is enabled.
• Fast Learning is intended for access ports in which only one device is connected to the switch (as in workstations with no other spanning tree devices). For these ports, it is not desirable to wait the usual 30 to 35 seconds for spanning tree initialization and bridge learning.
ATTENTION
If trunk ports are STP-enabled, ensure that all
potential trunk members are connected to their
corresponding members; otherwise, STP cannot
converge correctly, and traffic loss can result.
Troubleshooting• Verifiying the STG BPDU’s
- show port stat stg
• Verifying the Vlan settings– show vlan info …
• Displaying the Forwarding DataBase– show vlan info fdb-entry or fdb-static…
• Verifying the STG– show stg info config [<sid>]– show stg status config [<sid>]
• Verifying the port status– show ports error … or stats …– monitor ports error … or stats …