# Network switch

> A box with many ports that connects devices on the same local network.

- Level: Basic
- Topics: Networks
- URL: https://tidbit.legios.com.ar/network-switch/
- In Spanish: [Switch de red](https://tidbit.legios.com.ar/es/network-switch/)

A **network switch** is a box full of Ethernet ports that joins the devices of a local network: computers, printers, cameras, access points. When one device sends data to another, the switch looks at the destination MAC address and sends it out of the single port where that device is plugged in, instead of copying it to everyone.

To do that it learns as it goes. Each time a frame arrives, it notes which MAC address came in through which port and keeps that table in memory. Older hubs simply repeated everything to every port, which wasted capacity and let anyone see everyone else's traffic.

At home you rarely buy one because the router already has a small switch built in: those three or four ports on the back. In an office or a data center, rows of switches with dozens of ports each connect hundreds of machines, and bigger models can split one physical network into several VLANs.

## An analogy

A mail sorter in a building. Instead of shouting every letter in the lobby, the sorter learns which apartment each person lives in and slips each letter under the right door.

## Keep in mind

- A switch connects devices within one local network; a router connects different networks.
- It sends each frame only to the port of its destination, using MAC addresses.
- Home routers include a small switch: the extra Ethernet ports.
- Managed switches can split a network into VLANs.

## Go deeper

- [Network switch on Wikipedia](https://en.wikipedia.org/wiki/Network_switch)

## Related terms

- [Ethernet](https://tidbit.legios.com.ar/ethernet/): The standard way to connect computers to a network with a cable.
- [LAN and WAN](https://tidbit.legios.com.ar/lan-and-wan/): A LAN connects devices in one place; a WAN connects places far apart.
- [MAC address](https://tidbit.legios.com.ar/mac-address/): The built-in name of a network card, used to deliver data inside a local network.
- [Port](https://tidbit.legios.com.ar/port/): The numbered door on a computer that says which program a connection is for.
- [Router](https://tidbit.legios.com.ar/router/): The box that connects your devices to each other and to the internet.
- [Data center](https://tidbit.legios.com.ar/data-center/): A building full of servers where the internet, the cloud and AI actually run.
- [VLAN](https://tidbit.legios.com.ar/vlan/): A way to split one physical network into several separate ones, using software rules.
