Which one of the following options is the main purpose for using spanning tree protocol?