what does spanning tree protocol do