In the first chapter, you were introduced to bit of switching and switches. You already know that the layer 2 of the OSI model deals with switching frames in the local network and that switches work at this layer. You also know that switches break collision domains to provide a faster and collision free network. In this chapter, we take a deeper look at how switches work.

From Chapter 4, you will remember that routing protocols are prone to loops. Similarly, redundant links in layer 2 can cause loops. By now you are aware that loops of any kind are bad. Hence, the Spanning Tree Protocol (STP) was developed to keep layer 2 networks loop free. STP is discussed in depth in this chapter.