A switch is a Layer 2 networking device that connects devices within a local network and forwards data based on MAC addresses.
Switches reduce collisions, improve performance, and send data only to the intended destination instead of all devices.
A MAC address table (CAM table) stores MAC addresses and their associated switch ports. Switches use this table to forward frames efficiently.
When a switch receives a frame, it learns the source MAC address and records it in the MAC table with the incoming port.
If the destination MAC address is unknown, the switch sends the frame out of all ports except the source port.
Once the destination MAC address is known, the switch forwards the frame only to the correct port.
- Collision Domain: Each switch port is one collision domain
- Broadcast Domain: All ports belong to one broadcast domain (unless VLANs are used)