A switch is an electronic device that changes the flow of current in a circuit, routing data packets between devices in a network. It operates at the data link layer (Layer 2) of the OSI model, using MAC addresses to forward data to the correct destination.
Switches use a process called MAC address learning to build a table of device locations. When a packet arrives, the switch checks the destination MAC address against its table. If the address is known, the packet is forwarded only to that port. If unknown, the switch sends the packet to all ports except the source.
| Type | Description | Example Use |
|---|---|---|
| Unmanaged | Basic plug-and-play switches with no configuration options | Home networks |
| Managed | Configurable switches with advanced features like VLANs and QoS | Enterprise networks |
| PoE | Switches that provide power over Ethernet to connected devices | IP cameras and VoIP phones |
Many confuse switches with hubs. Hubs broadcast data to all ports indiscriminately, while switches direct data only to the intended recipient. This targeted approach reduces network collisions and improves efficiency.
In an office environment, a managed switch connects multiple computers, printers, and servers. It ensures data meant for the accounting department's computer doesn't go to the marketing team's devices, maintaining network efficiency and security.
For more on maintaining proper network behavior, see our guide on netykieta co to jest.