A switch is a networking hardware device that connects devices on a computer network by using packet switching to receive and forward data to the destination device. It is a multiport network bridge that uses MAC addresses to forward data at the data link layer (layer 2) of the OSI model. Switches can also forward data at the network layer (layer 3) by incorporating routing functionality, and such switches are commonly known as layer-3 switches or multilayer switches. Unlike repeater hubs, which broadcast the same data out of each port and let the devices pick out the data addressed to them, a network switch learns the identities of connected devices and then only forwards data to the port connected to the device to which it is addressed.
Switches are responsible for relaying information between different endpoints and offer a plethora of benefits. They form the majority of network devices in modern data networks and carry huge amounts of traffic in telecommunications provider networks. They offer full-duplex communication, connect network segments, boost network performance, and improve network security.
It is important to note that the term "switch" can also refer to other types of switches, such as Nintendo Switch, which is a gaming console that can be played at home and on-the-go.