A network switch connects devices in a network to each other, enabling them to talk by exchanging data packets. Switches can be hardware devices that manage physical networks or software-based virtual devices. A network switch operates on the data-link layer, or Layer 2, of the Open Systems Interconnection (OSI) model.