Switching Fundamentals
1. MAC Address Learning
MAC Address Learning is a fundamental process used by network switches to build and maintain a MAC address table. This table maps MAC addresses to the switch's physical ports, enabling the switch to forward frames only to the appropriate port, reducing unnecessary network traffic.
Example: When a switch receives a frame on one of its ports, it examines the source MAC address of the frame. If this MAC address is not already in the MAC address table, the switch adds it along with the port number. Later, when the switch needs to forward a frame to that MAC address, it can look up the port in the table and send the frame directly to that port.
2. Frame Forwarding
Frame Forwarding is the process by which a switch determines how to send a received frame to its destination. Switches use the MAC address table to make forwarding decisions. If the destination MAC address is in the table, the switch forwards the frame directly to the corresponding port. If not, the switch floods the frame to all ports except the incoming port.
Example: Suppose a switch receives a frame with a destination MAC address that is not in its MAC address table. The switch will flood the frame to all ports except the one it was received on. If the destination device is on the network, it will respond, allowing the switch to learn its MAC address and update the table for future frames.
3. Loop Avoidance
Loop Avoidance is a critical function in network switches to prevent network loops, which can cause broadcast storms and network instability. Spanning Tree Protocol (STP) is a common method used to detect and prevent loops by creating a loop-free logical topology.
Example: In a network with redundant links, STP selects one active path and blocks the others to prevent loops. For instance, if two switches are connected by two different cables, STP will designate one cable as the active path and block the other. If the active path fails, STP will automatically reactivate the blocked path to maintain connectivity.