STP (Spanning Tree Protocol) STP, a Layer 2 protocol, gets rid of loops that are produced due to redundant connections on a switched network.