Ethernet Switches (6.3.4)–Cisco Network Design and the Access Layer

An Ethernet switch is a device that is used at the access layer. When a host sends a message to another host connected to the same switched network, the switch accepts and decodes the frames to read the physical (MAC) address portion of the message, and then sends the message to the destination, as shown in Figure 6-11.

   

Figure 6-11 A Switch Operation

A table on the switch, called a MAC address table, contains a list of all of the active ports and the host MAC addresses that are attached to them. When a message is sent between hosts, the switch checks to see if the destination MAC address is in the table. If it is, the switch builds a temporary connection, called a circuit, between the source and destination ports. This new circuit provides a dedicated channel over which the two hosts can communicate. Other hosts attached to the switch do not share bandwidth on this channel and do not receive messages that are not addressed to them. A new circuit is built for every new conversation between hosts. These separate circuits allow many conversations to take place at the same time, without collisions occurring. Ethernet switches also allow for the sending and receiving of frames over the same Ethernet cable simultaneously. This improves the performance of the network by eliminating collisions.

Video—MAC Address Tables (6.3.5)

Refer to the online course to view this video.

The MAC Address Table (6.3.6)

What happens when the switch receives a frame addressed to a new host that is not yet in the MAC address table? If the destination MAC address is not in the table, the switch does not have the necessary information to create an individual circuit. When the switch cannot determine where the destination host is located, it uses a process called flooding to forward the message out to all attached hosts except for the sending host. Each host compares the destination MAC address in the message to its own MAC address, but only the host with the correct destination address processes the message and responds to the sender.

How does the MAC address of a new host get into the MAC address table? A switch builds the MAC address table by examining the source MAC address of each frame that is sent between hosts. When a new host sends a message or responds to a flooded message, the switch immediately learns its MAC address and the port to which it is connected. The table is dynamically updated each time the switch reads a new source MAC address. In this way, a switch quickly learns the MAC addresses of all attached hosts. Figures 6-12 through 6-15 demonstrate this operation.

   

Figure 6-12 Source Sends a Message to the Destination

In Figure 6-12, Source PC H3 sends data to Destination PC H7. The switch does not yet have a MAC address for H7.

In Figure 6-13, the switch floods the frame received from H3 out every other port.

   

Figure 6-13 Switch Floods the Message

In Figure 6-14, after H7 receives the frame, the IP address of the encapsulated packet matches H7‛s IP address. Therefore, H7 replies to H3.

   

Figure 6-14 The Destination Replies to the Message

In Figure 6-15, the switch updates its table with the MAC address for H7 to map the MAC address to the port.

   

Figure 6-15 The Switch Records the MAC Address for the Destination