Use it when a port takes a long time to pass traffic after link-up — DHCP timeouts on a fresh connection are the classic symptom.
Learning
Learning is the transitional state in which the bridge can learn source MAC addresses but still does not forward ordinary user traffic through the port. It gives the forwarding database time to align with the new active topology before data forwarding. In rapid point-to-point convergence the state may be brief, so a single snapshot can miss it entirely.
1. Learning = builds MAC table but does not forward yet.
2. Short with RSTP proposal/agreement; up to forward-delay (15 s) on shared links.
3. show spanning-tree vlan 10 — state LRN.
link up → discarding → P2p link with RSTP neighbour: proposal/agreement → forwarding in under a second → otherwise forward-delay timers: 15 s discarding + 15 s learning → forwarding
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show spanning-tree vlan 10Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification and known-good state Verify boundary
show spanning-tree vlan 10
show spanning-tree vlan 10 interface Gi1/0/7 detail
show interfaces Gi1/0/7 | include duplex
Run the first command immediately after the link comes up to see the state and Type. The detail view says whether the link type is point-to-point or shared and whether the port is an edge port. The duplex line confirms a half-duplex cause.
Known-good: inter-switch links are type P2p and forwarding within a second; host ports are P2p Edge; no port lingers in LRN.
Step 2 Verification & troubleshooting Narrow the fault
1. Right after link-up, show spanning-tree vlan <vlan> → state and Type of the port.
2. Type Shr: the port is half duplex. Check show interfaces <port> and fix the duplex mismatch.
3. Type P2p Peer(STP): the neighbour runs legacy spanning tree. Change its mode to Rapid PVST+ or MST.
4. A host port: enable PortFast.
5. show spanning-tree vlan <vlan> detail shows the forward-delay value in use.
Step 3 Failure signatures and troubleshooting branches Narrow the fault
- PCs time out on DHCP at boot. The access port has no PortFast and spends 30 seconds in discarding and learning.
- An inter-switch link takes 30 seconds to forward. Half duplex (type
Shr) or a legacy STP neighbour. - Everything is slow after any topology change. A legacy 802.1D switch sits in the path; each port facing it uses timers.
- A port cycles between
BLKandLRN. The link is flapping or the root information keeps changing; find the source of the topology changes.
Step 4 When the problem is really fixed Narrow the fault
- Time from link-up to
FWDis under a second on point-to-point links. - Host ports are edge ports and forward immediately.
- No port shows type
ShrorP2p Peer(STP)unintentionally. - Hosts get a DHCP lease on first attempt after link-up.
Step 5 Common mistakes Narrow the fault
- Long learning time on shared/edge ports because they are not point-to-point.
- Treating learning as forwarding.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
In Learning the port fills the MAC table but still drops user frames. With RSTP on point-to-point links the proposal/agreement handshake skips the wait; a port that sits in LRN for 15 seconds (after 15 seconds discarding) is falling back to timers — shared/half-duplex link, a neighbour running legacy STP, or a host port without PortFast.
show spanning-tree vlan 10 → LRN and the Type column (P2p, Shr, P2p Peer(STP)). show spanning-tree vlan 10 interface <if> detail → link type and whether PortFast/edge is active. show interfaces <if> → duplex; half duplex makes the link shared.
ReferenceWhat it is1 section · depth on demand
What it is
Learning is the short state between discarding and forwarding. The port records source MAC addresses from the frames it receives but still forwards nothing. Cisco output shows it as LRN.
ReferenceWhy it matters1 section · depth on demand
Why it matters
On a healthy RSTP network you rarely catch a port in learning — it passes in a moment. A port that sits in LRN for 15 seconds is using the old timer-based behaviour, and that wait (15 seconds discarding plus 15 seconds learning) is what makes PCs miss DHCP at start-up and makes a failover take half a minute. Learning matters mostly as a symptom.
ReferenceImportant terms & boundaries4 sections · depth on demand
Key points
- The port learns MAC addresses but does not forward.
- With timers it lasts one forward delay, 15 seconds by default, after 15 seconds in discarding.
- Between two RSTP switches on a point-to-point link it is skipped by proposal/agreement.
- An edge port (PortFast) goes straight to forwarding.
- The timers come from the root bridge and are carried in BPDUs — fix the link type instead of tuning timers.
- Type
P2p Peer(STP)means the neighbour runs legacy 802.1D and the port falls back to timers.
In depth
Learning: building the MAC table before forwarding
In the learning state, a port learns source MAC addresses from received frames but doesn't forward them. The Catalyst 9300 RSTP guide lists learning as a state in both 802.1D and RSTP, and counts it as part of the active topology. Learning fills the MAC table first, so that when the port starts forwarding, the switch doesn't flood every frame as unknown unicast.
Timing
| Situation | Time in learning |
|---|---|
| 802.1D or RSTP without a handshake (shared link, or no answer to a proposal) | Forward delay: 15 s by default |
| RSTP with proposal and agreement on a point-to-point link | Skipped or very short |
| Edge port (PortFast) | Skipped: straight to forwarding |
The STP guide gives 15 s as the default forward delay (range 4–30 s).
C9300# show spanning-tree vlan 10 | include LRN
Te1/1/3 Desg LRN 2 128.3 Shr
C9300# show spanning-tree vlan 10 | include LRN|FWD
Te1/1/3 Desg FWD 2 128.3 Shr
A port seen in LRN on an RSTP network for more than a moment usually means it is falling back to timers.
Why a port uses timers in RSTP
| Cause | Check |
|---|---|
| Link type shared (half duplex) | Shr in the Type column; set spanning-tree link-type point-to-point if the link is really point-to-point |
| Peer runs 802.1D (PVST+) | show spanning-tree interface <id> detail shows the protocol; clear spanning-tree detected-protocols after upgrading the peer |
| Peer doesn't answer proposals | Third-party device without RSTP, or a filtering device in the path |
On a modern network with full-duplex links and RSTP on all switches, learning is almost never visible.
Documented example, not captured output.
Quick reference
Learning is the transitional state in which a port fills the MAC address table from incoming frames but does not yet forward user traffic. Its purpose is to avoid a burst of unknown-unicast flooding at the moment a port starts forwarding: the switch already knows where many hosts are.
In RSTP, ports pass through learning only briefly on point-to-point links using proposal/agreement. If you see ports staying in learning for the forward-delay time (15 seconds by default), the link is probably treated as shared or the neighbour does not speak RSTP (it is running classic 802.1D, which forces the slow, timer-based behaviour on that link).
show spanning-tree vlan 20 detail | include Learning|transitions
show spanning-tree interface Gi1/0/24 detail | include Peer
Mechanics and state ownership
The purpose of learning is to fill the MAC address table before the port starts forwarding. Otherwise the first frames after a topology change would be flooded everywhere as unknown unicast.
In classic 802.1D a port went blocking → listening → learning → forwarding, with a forward delay spent in each of the two middle states. RSTP keeps the learning state and the timer as a fallback, but adds a faster way: on a point-to-point link the two switches settle their roles with a proposal and an agreement, and the port moves through learning to forwarding almost at once.
Two conditions must hold for the fast way. The link must be point-to-point, which the switch derives from full duplex (spanning-tree link-type point-to-point overrides it). And the neighbour must speak RSTP; if it sends 802.1D BPDUs, the port behaves the old way on that link only.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Expected output
show spanning-tree vlan 10Expected state: Failure signature: a port stuck on timers shortly after link-up.
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- ----
Gi1/0/1 Root FWD 4 128.1 P2p
Gi1/0/7 Desg LRN 19 128.7 Shr
! Illustrative output, not captured Evidence.Gi1/0/7 negotiated half duplex (type `Shr`), so RSTP cannot use proposal/agreement and waits out the forward-delay timer. Fix the duplex mismatch, or enable PortFast if a host is attached.Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Switching → STP → RSTP — 802.1w → Rapid PVST+ → Learning. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%Quick lookup tables
Learning operational reference
Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.
| Boundary | Known-good for Learning | Suspicious signature | Next proof |
|---|---|---|---|
| Intent | Matches RSTP learning transition design | Configuration differs from peer/design | Compare effective config |
| Control state | Stable expected role/route/member state | a port oscillating through Learning because topology keeps changing, prolonged transition caused by non-edge/shared behavior, or application loss wrongly blamed on a state that was only transient | Inspect protocol/RIB detail |
| Forwarding | Expected egress/Port-Channel/VLAN path | State exists but traffic path disagrees | FIB/MAC/adjacency |
| Closure | Original test passes for explained reason | Symptom merely moved or was bypassed | Regression test |