Sub topic 13
Proposal/agreement handshake and link types
This chapter assumes you know how classic 802.1D elects a root bridge and assigns root, designated and alternate port roles. It also assumes you know why classic STP waits through the listening and learning states. Here you will see how Rapid STP (802.1w) skips those waits safely, and why the answer depends on the type of link.
The problem the handshake solves
Classic STP lets a designated port move to forwarding only after two forward-delay periods, 15 seconds each by default. The delay exists because a switch cannot be sure its neighbors agree about the topology. Forwarding too early could create a temporary loop.
Rapid STP replaces the timers with a direct conversation between two switches. If the neighbor confirms it is not forwarding traffic in a way that could form a loop, the port can forward at once. That conversation is the proposal/agreement handshake.
Three link types
RSTP classifies every port by link type. The type decides whether the handshake is allowed.
| Link type | How it is determined | Fast transition? |
|---|---|---|
| Point-to-point | Full duplex by default, or set manually | Yes, through the handshake |
| Shared | Half duplex by default, or set manually | No, falls back to timers |
| Edge | PortFast configured, or auto-detected | Yes, immediately |
Point-to-point means exactly one other bridge is on the segment, so one agreement is enough to prove the link is safe. A shared segment, such as a hub, may hold several bridges. One reply cannot speak for all of them, so RSTP uses the classic listening and learning delays on that port.
Switches infer the type from duplex. A full-duplex port is assumed to be point-to-point, and a half-duplex port is assumed to be shared. This inference can be wrong. A link that is full duplex but passes through a media converter or a layer 1 repeater may carry more than two bridges. A half-duplex link that is really point-to-point stays slow until you override it.
How the handshake works
The handshake uses flags in the RSTP BPDU, which is version 2. The flags byte includes Proposal, Agreement, Learning, Forwarding, Topology Change and a 2-bit port role field.
Assume SW1 is the root and SW2 has just been connected to it by a point-to-point link.
- SW1's new designated port starts in the discarding state. It sends a BPDU with the Proposal flag set and the role set to designated.
- SW2 sees that this BPDU is superior to anything it knows, so the port receiving it becomes SW2's root port.
- SW2 performs a sync. It puts its other designated and root-candidate ports into discarding, except edge ports and ports that are already alternate. Now SW2 can forward nothing that might loop back.
- SW2 sends a BPDU with the Agreement flag from its new root port.
- SW1 receives the agreement and moves its designated port to forwarding immediately.
SW2's own downstream designated ports then send proposals of their own. The handshake ripples outward one hop at a time, taking milliseconds per hop instead of 30 seconds.
What the sync does and does not block
The sync is the price of the speed. For a brief moment, SW2 blocks every non-edge port that is not already safe. This is why a topology change on a core switch can briefly interrupt traffic on other links, even though no cable moved.
A port is already in sync, and is not disturbed, in these cases:
- It is an edge port.
- It is an alternate or backup port, which is already discarding.
- It is the new root port.
If a port is not in sync and is not an edge port, it is forced to discarding until its own neighbor sends an agreement. A device that does not speak RSTP never sends one, so that port falls back to the timer-based path.
Fast failover without a handshake
Not every recovery needs a handshake. If a switch loses its root port and holds an alternate port, the alternate becomes the new root port at once. The alternate already received a superior BPDU from the root's direction, so no proposal is needed.
RSTP also reacts faster to stale information. A port considers its neighbor lost after three missed hellos, which is 6 seconds at the default 2-second hello. Classic STP waits for max age, 20 seconds. If a designated bridge sends an inferior BPDU, which happens when it loses its path to the root, RSTP accepts it immediately and acts on it.
Edge ports in the picture
An edge port skips the handshake entirely and forwards immediately. It does so on the assumption that only a host sits behind it. If a BPDU arrives, the port loses its edge status and behaves as an ordinary port. On Cisco IOS, PortFast on an access port is the usual way to declare an edge port. Pair it with BPDU Guard so a surprise switch cannot join the topology unnoticed.
Configuring and checking link types
! Cisco IOS: Rapid PVST+ with explicit link types
configure terminal
spanning-tree mode rapid-pvst
interface GigabitEthernet0/1
spanning-tree link-type point-to-point
interface GigabitEthernet0/2
spanning-tree link-type shared
interface GigabitEthernet0/5
switchport mode access
spanning-tree portfast
end
! Verify
show spanning-tree vlan 10
show spanning-tree interface GigabitEthernet0/1 detailIn the show spanning-tree vlan 10 output, the Type column reports P2p, Shr or Edge. A type of P2p Peer(STP) means the neighbor is sending classic 802.1D BPDUs, so that port will not use the handshake. A typical line looks like this:
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/1 Root FWD 4 128.1 P2p
Gi0/2 Altn BLK 4 128.2 P2p
Gi0/5 Desg FWD 4 128.5 P2p EdgeCommon errors
- A trunk shows
Shr. The port is probably half duplex or negotiated down. Fix the duplex, or set the link type manually if you are certain only two bridges are present. - Forcing
point-to-pointon a real shared segment. The handshake can complete with one bridge while another on the segment is still forwarding. That can cause a temporary loop, so only override when you know the physical topology. - A legacy 802.1D neighbor. The port sends classic BPDUs after detecting an older neighbor and uses timers. The
Peer(STP)marker shows this. The port may stay in that mode until the neighbor is removed and the migration timer expires. - Expecting speed on an edge port that is not edge. Without PortFast, an access port starts as a normal port and must complete a handshake with a host. Hosts never answer, so the port waits for the timer path.
Exercise
SW2 has a root port to SW1, an alternate port to SW4, a designated port to SW3, and an edge port to a server. SW1 sends SW2 a proposal. Which of SW2's ports does the sync put into discarding, and why do the others stay as they are?
Show answer
Only the designated port to SW3 is forced into discarding. The root port is the port that received the proposal, the alternate port is already discarding, and the edge port is exempt from sync because only a host sits behind it. After SW2 sends its agreement to SW1, it sends a proposal to SW3, and the designated port forwards once SW3 agrees.