A network switch operates at Layer 2-the Data Link Layer-of the OSI reference model. When a successful connection is established on a port, the switch's internal CPU maps the device's MAC address to that port, creating a MAC address table. In subsequent communications, data packets destined for that MAC address are forwarded only to the corresponding port rather than to all ports. Consequently, a switch can segment Data Link Layer traffic (specifically, collision domains) but cannot segment Network Layer traffic (broadcast domains).
Switches feature a high-bandwidth backplane bus and an internal switching matrix. All ports connect to this backplane bus; upon receiving a data packet, the control circuitry consults an address lookup table in memory to identify which port hosts the NIC (Network Interface Card) associated with the destination MAC address. The packet is then rapidly transferred to the destination port via the internal switching matrix. If the destination MAC address is not found in the table, the packet is broadcast to all ports; once the receiving port responds, the switch "learns" the new MAC address and adds it to its internal MAC address table. Switches also enable network segmentation; by referencing IP address tables, they allow only necessary traffic to pass through. Through this process of filtering and forwarding, switches effectively reduce collision domains.
