Layer 2 Switching Technology

Remember from earlier chapters that switches operate at Layer 2 of the Open Systems Interconnection (OSI) model.

graphics/note_icon.gif

Cisco has applied switching technology to some of their Layer 3 and Layer 4 products. Because of this, you will sometimes hear people refer to Layer 3 and Layer 4 switches. The CCNA exam, however, only covers Layer 2 switches. Therefore, when you see the term "switch," assume it is a Layer 2 device.


The technology upon which Layer 2 switches operate is the same as that provided by Ethernet bridges. The basic operation of a switch involves the following:

  • Discovering Media Access Control (MAC) addresses

  • Filtering or forwarding frames

  • Preventing loops

Discovering MAC Addresses

Like a bridge, a switch monitors all frames that pass through it to learn the MAC addresses of each device connected to its ports. This information is stored in a database called a filter table . The switch consults the filter table each time it receives a frame to determine whether to forward the frame to a different port or to drop it.

When the switch is initially booted up, the filter table is empty. Forwarding or filtering decisions cannot be made with an empty database, so initially each incoming frame is forwarded through all the switch's ports. This is called flooding the frame . As flooding occurs, the switch begins to learn the MAC addresses and associate them with one of its ports.

This address-learning process is a continual operation of the switch. Each MAC database entry is stored in memory and is valid only for a preset interval. If a new frame does not refresh the entry, the entry is discarded.

Filtering and Forwarding

Each time the switch receives a frame, it examines the destination MAC address. If this address exists in the MAC database, the frame is forwarded only through the switch port associated with the address. This process frees all the segments connected to different ports of the excess bandwidth taken by the frame. This is known as frame filtering .

Whenever the destination MAC address is unknown, the frame is flooded to all switch ports. This is undesirable because it wastes bandwidth.

Preventing Loops

Both bridges and switches introduce the possibility of creating a bridged network with multiple paths to a single destination. Typically, this type of redundancy is considered favorable, but for switches and bridges it can cause problems in the form of bridging loops , which occur when circular connections exist in a bridged network. Figure 6.1 illustrates a bridged network with bridging loops.

Figure 6.1. Switches and bridges can create loops if improperly positioned.

graphics/06fig01.gif

graphics/note_icon.gif

Bridges and switches provide a bridging function. Although we will use the term "bridge" in this discussion, the concept of bridging loops applies equally to switches.


For example, if someone sends a broadcast message from segment 2, the message would be forwarded to physical segment 3 by bridges B and C. Bridge A would then receive two broadcasts and forward both broadcasts to physical segment 1. Bridge D would have forwarded this broadcast to physical segment 1 as well. Subsequently, bridge D will receive the two broadcasts forwarded by bridge A and forward these frames to physical segment 2. This continuous forwarding of broadcast packets wastes bandwidth. With more complex bridged networks, the broadcast packets can be forwarded exponentially, leading to what is termed a broadcast storm . This occurs when so many broadcasts are being continuously forwarded that they consume all the available bandwidth. The Spanning Tree Protocol, which implements an algorithm that removes all circular connections in a bridged network, eliminates bridging loops.

Spanning Tree Protocol

The Spanning Tree Protocol creates a loop-free network topology by placing connections that create loops in a blocking state. It is important to note that this protocol does not eliminate loops but rather only blocks the connections that create the loops. Loops in a network often provide needed redundancy in the case of a physical connection being disconnected. The Spanning Tree Protocol maintains the benefits of redundancy while eliminating the disadvantages of looping. To illustrate how the Spanning Tree Protocol functions, we will use the bridged network shown earlier in Figure 6.1.

The Spanning Tree Protocol selects a root bridge in the network (in this case, bridge A).

Determining the Root Bridge

When a network using multiple bridges and spanning tree protocol starts, the bridges automatically broadcast their ID numbers . The ID number is actually a combination of the MAC address and an assigned priority value. In most cases, the bridge with the lowest priority number assumes the role of root bridge. If two or more bridges have the same priority number, the one with the lowest MAC address becomes the root bridge.


Next, every other bridge selects one of its ports with the least path cost to the root bridge. The least path cost is the sum of the cost to traverse every network between the indicated bridge and the root bridge. The root path cost can be determined in multiple ways; in this case, we have arbitrarily assigned costs to each path. Next, designated bridges are determined. A designated bridge is the bridge on each LAN with the lowest aggregate root path cost. It's the only bridge on a LAN allowed to forward frames. Figure 6.2 illustrates our network with the root path cost assigned to each bridge interface.

Figure 6.2. The root path cost for each bridge interface.

graphics/06fig02.gif

By applying the Spanning Tree Protocol, we block the connection between bridge C and physical segments 2 and 3, because bridge D and bridge B both have lower aggregate root path costs to the root bridge (bridge A). We also block the connection between bridge D and physical segment 2, because bridge B has a lower root path cost than bridge D. Figure 6.3 illustrates our bridged network after the Spanning Tree Protocol has been applied. Note that the connections between bridge C and physical segments 2 and 3 are blocked, as well as the connection between bridge D and physical segment 2.

Figure 6.3. A bridged network with Spanning Tree Protocol.

graphics/06fig03.gif

We now have no circular routes in our network, but we maintain redundancy, because the Spanning Tree Protocol is applied whenever a bridge is powered up or a topology change occurs. Therefore, if the connection between bridge B and physical segment 2 is broken, the Spanning Tree Protocol would run and the connection between bridge D and physical segment 2.



CCNA Exam Cram[tm] 2 (Exams 640-821, 640-811, 640-801)
CCNA Exam Cram[tm] 2 (Exams 640-821, 640-811, 640-801)
ISBN: 789730197
EAN: N/A
Year: 2005
Pages: 155

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net