In this article, we will try to clear our concept of switching. The switch frame forwarding is common in networking and telecommunication. LAN, WAN, and PSTN use different types of switches. the basic concept of switching decision is based on the following two criteria.
- Ingress port
- Destination address
The traffic forwarding decision is completed in relation to the traffic flow. The term ingress is used to explain where a frame enters to the device on a particular port. To describe the frames leaving the device from the particular port the term egress is used. When a switch makes a frame forwarding decision; it is based on the ingress port and the address of the destination host. The networking switch also maintains a MAC address table.
The switch takes a decision from the MAC address table where to send traffic. The figure below illustrates the switch MAC address table.
- If a data enters to switch port 1 and the message has a destination address of DB-CD-AC-3D-26-25
- Then the switch forwards the data out to port 7.
- If a data enters to switch port 6 and the message has a destination address of C3-A3-A2-35-A6-66
- Then the switch forwards the data out port 8.
- If a data enters switch port 2 and has a destination address of EE-01-A1-AF-00-01
- Then the switch forwards the data out port 1.
The network switch has only one intelligence, the ability to keep up MAC address table and make a decision to send traffic based on the ingress port and the destination address of the message. Every switch has only one master table that describes an association between address and port. The Cisco switches forward Ethernet frames based on the destination MAC address of the frames.
The concept of Dynamically Populating a MAC Address Table
Network Switches use MAC address table to send network traffic towards destination through the proper port. It is also necessary for a switch to know which port to use to send data. The switch must first learn which devices exist on each port. When the switch learns the devices connected to each port, its prepare MAC address. The table also called content addressable memory (CAM) table. The high-speed searching application uses switch CAM memory. The switches decide how to handle incoming data frames by maintaining the table of MAC addresses.
The switch builds MAC address table by reading the MAC address of each device connected to the port of a switch and then uses MAC address table to send frames destined for a particular out the specific port which has been assigned to that device. The switch populates the table of the MAC address based on the source MAC addresses. When a switch receives an incoming frame with a destination MAC address. If the destination MAC address not available in the table; the switch forwards the frame out of all ports except for the ingress port of the frame; this technique called flooding of data.
When destination device responds, the switch adds the source MAC address of the frame and the port where the just received to the MAC address table. Network, where multiple switches are interconnected, The MAC address table has also multiple addresses for a single port. The switch kept MAC address for a specific time, the aging time is five minutes for a single host entry. The steps below describe the process of the building MAC address table.
The following steps describe the process of building the MAC address table:
- The switch receives a frame from Host 1 on Port 1, the MAC address table is empty (Figure 1).
- The switch examines the MAC address of the source (Host 1) and compares it to the MAC address table.
- If the address is not found in the MAC address table; it associates the MAC address of host 1 with port 1 (ingress port) in the MAC address table. (Figure 2)
- If the MAC address already exists in the table, it resets the aging timer for an entry.
- when the switch has recorded the source address information in the MAC table then switch examines the destination MAC address.
- If the destination address is not already recorded in the MAC table or if it’s a broadcast MAC address containing all Fs, the switch floods the data frame to all ports, except the ingress port (Figure 3).
- The destination Host (Host 4) will reply to the frame with a unicast frame addressed to Host 1 (Figure 4). The switch enters the source MAC address of Host 4 and the port number of the ingress port into the address table. The destination address (Host 1) of the frame and its associated egress ports found in the MAC address table.
- The switch now complete entries for host 1 and host 4 and they can now send frames between these source and destination devices without flooding.