A network switch is a device used in computer networking that connects devices together on a local area network (LAN). It operates at the data link layer (Layer 2) of the OSI model and uses MAC addresses to forward data between network devices.
A network switch receives data frames from multiple devices connected to its ports and forwards them to their destination based on their MAC addresses. This enables multiple devices to communicate with each other on the same network without interference or collisions. Switches can also help to improve network performance by filtering and prioritizing network traffic.
Switches come in various sizes, from small desktop devices with a few ports to large enterprise-grade switches with hundreds or even thousands of ports. Some switches also offer advanced features such as VLANs (Virtual LANs), QoS (Quality of Service), and port mirroring for network monitoring.