What is a network switch?
A network switch connects devices in a network (often a local area network or LAN*) and forwards data packets to and from these devices. Unlike a router, a switch sends data only to the single device it is intended for (which could be another switch, a router, or a user's computer), not to multi-device networks.
What is a layer 2 switch? What is a layer 3 switch?
Network switches can operate at either OSI layer 2 (the data link layer) or layer 3 (the network layer). Layer 2 forwards data based on the destination's MAC address (see below for definition), while Layer 3 forwards data based on the destination's IP address. Some switches can do both.
However, most switches are layer 2 switches. Layer 2 switches are usually connected to the devices on the network using Ethernet cables. Ethernet cables are physical cables that connect to devices via Ethernet ports.