L

0260.60DD.DDDD

0260.60DD.DDDD

0260.60BB.BBBB 0260.60CC.CCCC

In this sample network, consider what happens when device A sends a frame destined for device D. The switch receives the frame on port 1 (from device A). Recall that a frame includes the MAC address of the source device and the MAC address of the destination device. Because the switch does not yet know where device D is, the switch must flood the frame out of all the other ports; therefore, the switch sends the frame out of ports 2, 3, and 4. This means that devices B, C, and D all receive the frame. Only device D, however, recognizes its MAC address as the destination address in the frame; it is the only device on which the CPU is interrupted to further process the frame.

KEY POINT

Broadcast and multicast frames are, by default, flooded to all ports of a Layer 2 switch other than the incoming port. The same is true for unicast frames destined for any device not in the MAC address table.

In the meantime, the switch now knows that device A can be reached on port 1 because the switch received a frame from device A on port 1; the switch therefore puts the MAC address of device A

in its MAC address table for port 1. This process is called learning—the switch is learning all the MAC addresses it can reach.

KEY POINT

A switch uses the frame's destination MAC address to determine the port to which it sends the frame.

A switch uses the frame's source MAC address to populate its MAC address table; the switch eavesdrops on the conversation between devices to learn which devices can be reached on which ports.

At some point, device D is likely to reply to device A. At that time, the switch receives a frame from device D on port 4; the switch records this information in its MAC address table as part of its learning process. This time, the switch knows where the destination, device A, is; the switch therefore forwards the frame only out of port 1. This process is called filtering—the switch sends the frames out of only the port through which they need to go, when the switch knows which port that is, rather than flooding them out of every port. This reduces the traffic on the other ports and reduces the interruptions that the other devices experience. Over time, the switch learns where all the devices are, and the MAC address table is fully populated, as shown in Figure 1-17.

Figure 1-17 The Switch Learns Where All the Devices Are and Populates Its MAC Address Table

Addresses that can be reached

MAC Address Table

0260.60AA.AAAA 0260.60BB.BBBB 0260.60CC.CCCC 2060.60DD.DDDD

MAC Address Table

0260.60AA.AAAA 0260.60BB.BBBB 0260.60CC.CCCC 2060.60DD.DDDD

Addresses that can be reached y

0260.60DD.DDDD

0260.60DD.DDDD

0260.60BB.BBBB 0260.60CC.CCCC

The filtering process also means that multiple simultaneous conversations can occur between different devices. For example, if device A and device B want to communicate, the switch sends their data between ports 1 and 2; no traffic goes on ports 3 or 4. At the same time, devices C and D can communicate on ports 3 and 4 without interfering with the traffic on ports 1 and 2. Consequently, the network's overall throughput has increased dramatically.

The MAC address table is kept in the switch's memory and has a finite size (depending on the specific switch used). If many devices are attached to the switch, the switch might not have room for an entry for every one, so the table entries time out after a period of not being used. As a result, the most active devices are always in the table.

MAC addresses can also be statically configured in the MAC address table, and you can specify a maximum number of addresses allowed per port. One advantage of static addresses is that less flooding occurs, both when the switch first comes up and because of not aging out the addresses. However, this also means that if a device is moved, the switch configuration must be changed. A related feature available in some switches is the capability to sticky-learn addresses—the address is dynamically learned, as described earlier, but is then automatically entered as a static command in the switch configuration. Limiting the number of addresses per port to one and statically configuring those addresses can ensure that only specific devices are permitted access to the network; this feature is particularly useful when addresses are sticky-learned.

Layer 3 Switching

A Layer 3 switch is really a router with some of the functions implemented in hardware to improve performance. In other words, some of the OSI model network layer routing functions are performed in high-performance ASICs rather than in software.

KEY POINT

The functions performed by routers (as described in the earlier "Routing" section) can be CPUintensive. Offloading the switching of the packet to hardware can result in a significant increase in performance.

A Layer 3 switch performs all the same functions as a router; the differences are in the physical implementation of the device rather than in the functions it performs. Therefore, functionally, the terms router and Layer 3 switch are synonymous.

Layer 4 switching is an extension of Layer 3 switching that includes examination of the contents of the Layer 3 packet. For example, the protocol number in the IP packet header (as described in the "IP Datagrams" section) indicates which transport layer protocol (for example, TCP or UDP) is being used, and the port number in the TCP or UDP segment indicates the application being used (as described in the "TCP/IP Transport Layer Protocols" section). Switching based on the protocol and port numbers can ensure, for example, that certain types of traffic get higher priority on the network or take a specific path.

Within Cisco switches, Layer 3 switching can be implemented in two different ways—through multilayer switching or through Cisco Express Forwarding, as described in Chapter 4.

Was this article helpful?

0 0

Post a comment