In STP for the first 20s (max-age) root bridge elections occur. In the same moment in which switch receives last BPDU which allow him to decide who is root bridge it also knows which are designated/non-designated ports. In this moment whole topology is converged. For all this swith have 20s. Why do we need additional 2*forward delay time(2*15s) to start forwarding packets ? Why do we need "listening phase" ? Why switch could not start forwarding/learning phase directly after topology converge ?
each phase needs to stay for at least the propagation time in a 7 hops network.
Because in STP 802.1D BPDUs are sent every hello interval 2 seconds it comes 15 seconds.
The objective is to prevent bridging loop.
So the two phases:
and the port moves from one state to another after 15 seconds.
Two switches could take a wrong decision in a lan segment because not aware of another change/decision taken in another lan segment.
Hope to help