LAN Switching
Step 7 The PC can now connect to the Web server.
The two ARP broadcasts (Steps 1 and 5) are sent out all switch ports because switches and bridges do not perform the broadcast firewall function that a router performs. After the switching table (often called the address table) is built, the switch forwards unicasts only out of the appropriate ports. In other words, frames sent from the client to the Web server, and vice versa (which are unicasts), are never sent out port E2.
The switch network has created three separate Ethernet segments, as compared to the transparent bridge network in Figure 4-7, which creates two LAN segments. Each segment is called a collision domain because frames sent by any device on that segment could collide with other frames on the segment. Switches can be used to create many collision domains.
Another feature of switches is that they forward broadcasts and multicasts on all ports. However, they reduce the impact of collisions because devices on separate switch ports are on separate Ethernet segments (which are separate collision domains). This behavior of switches resulted in the creation of the terms collision domain and broadcast domain. Figure 4-9 shows a network with six collision domains—six sets of interface cards for which CSMA/CD logic is used to share the LAN segment.
Each collision domain is separated by either a transparent bridge, a switch, or a router. The figure suggests that the segments on either side of the bridge could be 10Base2, 10Base5, or any shared hub. The segment between the router and switch, and between the switch and the PCs on the right, can be a single cable, as shown. In either case, if a bridge (transparent bridge or switch) or routing function separates devices, the devices are in separate collision domains.
Bridging, Switching, and Spanning Tree 151
Figure 4-9 Collision Domains
NOTE Many vendors, including Cisco, sell cards in switches that do not switch on all ports. In other words, the equivalent of a shared hub with several ports is built into a card rather than each port being treated as its own collision domain. Frames destined for a MAC address off one of these ports are sent out all these ports by the switch. The switch ports in the figures in this chapter are all switched, unless otherwise specified.
The broadcast domain concept is similar to the concept of collision domains; however, only routers stop the flow of broadcasts. Figure 4-10 provides the broadcast domains for the same network depicted in Figure 4-9.
The broadcast domain is not affected by the inclusion or exclusion of switches or bridges. The router creates its own broadcasts (RIP, IGRP, SAP, and so on), but the router does not forward broadcasts received in the left-side interface out the right-side interface. In other words, broadcasts created and sent by a device in one broadcast domain are not sent to devices in another broadcast domain.
152 Chapter 4: Bridges/Switches and LAN Design
Figure 4-10 Broadcast Domains
General definitions for collision domain and broadcast domain are as follows:
A collision domain is a set of interface cards (NICs) for which a frame sent by one NIC could result in a collision with a frame sent by any other NIC in the collision domain. A broadcast domain is a set of NICs for which a broadcast frame sent by one NIC will be received by all other NICs in the broadcast domain.
Layer 3 addressing is affected whenever a router is added to a network. For example, if only bridges and switches had existed in the network in Figure 4-10, and if the router was later added, Layer 3 IP and IPX addresses would have changed. To use the terminology in Chapter 3, two separate address groupings (for example, IP subnets) would be used for IP—one for the devices to the left of the router and another for devices to the right of the router. A definition of Layer 3 address groupings on LANs will help you understand VLANs better:
NOTE All devices in the same broadcast domain (Layer 2) will be in the same Layer 3 address
grouping—in other words, the same IP subnet or same IPX network.
The internal processing on the switch can decrease latency for frames. Transparent bridges use store-and-forward processing, meaning that the entire frame is received before the first bit of
Bridging, Switching, and Spanning Tree 153
the frame is forwarded. Switches can use store-and-forward as well as cut-through processing logic. With cut-through processing, the first bits of the frame are sent out the outbound port before the last bit of the incoming frame is received instead of waiting for the entire frame to be received. In other words, as soon as the switching port receives enough of the frame to see the destination MAC address, the frame is transmitted out the appropriate outgoing port to the destination device. The unfortunate side effect is that because the frame check sequence (FCS) is in the Ethernet trailer, the forwarded frame may have bit errors that the switch would have noticed with store-and-forward logic. And, of course, if the outbound port is busy, the switch will store the frame until the port is available.
The internal processing algorithms used by switches vary among models and vendors; regardless, the internal processing can be categorized as one of the methods listed in Table 4-6.
Full Duplex and Switches
Frames can be forwarded concurrently through a switch. Consider Figure 4-11, with Fred sending a frame to Wilma, and Barney sending a frame to Betty.
In this figure, the switch forwards the frame coming in Port 1 out Port 3 and does the same for the frame coming in Port 2 and out Port 4. These frames also are in four different collision domains. For these reasons, no collision occurs. A four-port transparent bridge would behave the same way, but switches are optimized for concurrent frame forwarding, so latency is likely to be less with a switch.
In conjunction with switches, full-duplex Ethernet can add other benefits. Figure 4-12 shows a server (Pebbles) that is both sending and receiving a frame at the same time. Betty and Wilma are in different collision domains, so Pebbles cannot undergo a collision due to the nature of full-duplex Ethernet.
Table 4-6 Switch Internal Processing
Switching Method Description
Store-and-forward The switch fully receives all bits in the frame (store) before forwarding the frame (forward). This allows the switch to check the FCS before forwarding the frame. (FCS is in the Ethernet trailer.)
Cut-through The switch performs the address table lookup as soon as the destination address field in the header is received. The first bits in the frame can be sent out the outbound port before the final bits in the incoming frame are received. This does not allow the switch to discard frames that fail the FCS check. (FCS is in the Ethernet trailer.)
FragmentFree This performs like cut-through, but the switch waits for 64 bytes to be received before forwarding the first bytes of the outgoing frame. According to Ethernet specifications, collisions should be detected during the first 64 bytes of the frame; frames in error due to collision will not be forwarded. The FCS still cannot be checked.
154 Chapter 4: Bridges/Switches and LAN Design
Figure 4-11 Concurrently Switching Frames in a Switch
Figure 4-12 Full-Duplex Ethernet and Switches
1 2 3 4 Fred Barney Wilma Betty Pebbles Wilma Betty Full-Duplex
Bridging, Switching, and Spanning Tree 155