LAN switches build tables of Media Access Control (MAC) addresses and associated switch ports assigned to TCP/IP devices within the network that are visible to the switch at Layer 2. The switches build their MAC tables by inspecting Address Resolution Protocol (ARP) requests that are traveling through the switch from TCP/IP devices, such as firewalls, routers, clients, and origin servers. Figure 3-1 illustrates the process of MAC learning in a small network, using the ARP request-response example discussed previously in Figure 2-16 from Chapter 2.
Figure 3-1. Basic MAC Address Learning Using Transparent Switching
In Figure 3-1, Switch B receives the ARP frame at Layer 2 from Client B on Port 2 and creates the entry [0050.ba28.0f6b via Port 2] in its MAC table. The entry contains the MAC address of Client B, and the port number where the request was received. Because Switch B is unaware of the location of the router in the network, it broadcasts the frame, unmodified, to all ports (except the port the request was received onPort 2). When the frame is received by Switch A from Switch B, the entry [0050.ba28.0f6b via Port 2] is created and stored in its MAC table. Switch A is unaware of the local port to which the router is connected and broadcasts the frame out all ports, except Port 2. The router receives the ARP request and responds with an ARP response, directly back to Client B. When Switch A receives the ARP response frame, it creates the entry [0030.4a3f.1f3a via Port 4] containing the router MAC and connected port. Switch A then sends the ARP response out Port 2, based on its existing entry for Client B.
Even though Client B is connected through an intermediary Layer 2 switch (Switch B), the router MAC entry is still located in Switch B's local MAC table [0050.ba28.0f6b via Port 2] and is pointing to the port connected to the "next-hop" switch (Port 2). The reason for this is that the switches are in the same broadcast domain and thus receive the ARP request-response Ethernet frames without modification from both the client and router.
With the MAC tables populated, Client B sends an application request to the Internet server with IP 188.8.131.52 via its default router 10.1.1.1. The switches transparently switch the frame according to the MAC entries for the router. Additionally, the return traffic from the Internet server is switched by the LAN switches using the MAC entries for Client B.
With some operating systems, workstations broadcast gratuitous ARP (GARP) frames to the LAN when it boots to advertise its IP-to-MAC association. Most Windows-based clients and servers use this facility to avoid duplicate IP addresses on the network. This facility is also beneficial for populating switch MAC forwarding tables.
Figure 3-1 illustrates a basic switched network; however, without fault-tolerance at Layer 2, if any single component fails, such as a switch or individual uplink, your entire network will be unusable. To provide resiliency to a Layer 2 network, you should consider enabling the following features in your switched network: