In Rapid Spanning Tree Protocol (RSTP), an alternate port provides a backup path to the root bridge. It is selected when a switch has multiple paths to the root bridge, but this specific path has a higher path cost than the elected root port. Consequently, it provides an alternate, higher-cost path to the root bridge. While functioning as an alternate port, it remains in a discarding (blocking) state to prevent Layer 2 loops. It stays in this blocking state as long as it continues to receive superior Bridge Protocol Data Units (BPDUs) from a neighboring upstream switch, which confirms the presence of a better path or another designated bridge on the segment. If the root port fails, the alternate port rapidly transitions to the forwarding state.