Layer 2, Layer 3, and Layer 4 Switches

What Is a Layer?

A network switch connects devices and switches data between ports. Switches use addressing information from the data packets they transfer to send data to the correct ports. The addressing information complies with the Open Systems Interconnection (OSI) seven-layer model.

layer 2 3 and 4

OSI is a layered network design framework that establishes a communication standard between devices so that they can work together without issue. Therefore, network switches that operate on the different layers of the OSI model are described as Layer 2, Layer 3, or Layer 4 switches. The layer in which a switch operates is determined by how much addressing information it reads as data passes through.

Layer 2 Switch

Layer 2 switches (L2 switches) use physical network addresses. Physical addresses, also known as link-layer, hardware, or MAC-layer addresses, identify individual devices. Most hardware devices are permanently assigned this number during the manufacturing process.

Switches operating at Layer 2 are very fast because they only sort physical addresses. However, they usually aren’t very smart — that is, they don’t look at the data packet very closely to learn anything about where it’s headed.

Layer 3 Switch

Layer 3 switches (L3 switches) use a network or IP addresses to identify locations on the network. They read network addresses more closely than Layer 2 switches. They identify network locations as well as the physical device. A location can be a LAN workstation, a location in a computer’s memory, or even a different packet of data traveling through a network.

Switches operating at Layer 3 are smarter than Layer 2 devices and incorporate routing functions to actively calculate the best way to send a packet to its destination. But they may not be as fast if their algorithms, fabric, and processor don’t support high speeds.

Note: The L2+ switch offers some Layer 3 features, such as DHCP snooping.

Layer 4 Switch

Layer 4 of the OSI Model coordinates communications between systems. Layer 4 switches (L4 switches) are capable of identifying which application protocols (HTTP, SNTP, FTP, and so forth) are included with each packet, and they use this information to hand off the packet to the appropriate higher-layer software. Layer 4 switches make packet-forwarding decisions based on the MAC address, IP address, and the application to which a packet belongs.

Because Layer 4 devices enable you to establish priorities for network traffic based on application, you can assign a high priority to packets belonging to vital in-house applications, such as PeopleSoft. Additionally, you can assign different forwarding rules to low-priority packets, such as generic HTTP-based internet traffic.

Layer 4 switches also provide an effective wire-speed security shield for your network because any company- or industry-specific protocols can be confined to only authorized switched ports or users. This security feature is often reinforced with traffic filtering and forwarding features.

Note: The L3+ switch offers some Layer 4 features, including traffic classification according to socket number.

Which Switch Should You Use?

Layer 2 switches are perfect for applications with small networks that do not transmit a ton of data.

The majority of networks use a mix of Layer 2 and Layer 3 switches to support their operations. Layer 3 switches are more intelligent than Layer 2 switches. Layer 3 switches also feature all the functionality of Layer 2 switches. Therefore, Layer 2 switches are used to provide cheap and easy workgroup connectivity, and Layer 3 switches are used to segment and control internal networks with no loss of bandwidth.

Likewise, Layer 4 switches provide you with all of the functionality of Layer 3 switches plus some other useful features, like enhanced security. Layer 4 switches also give you the best control over your network traffic.

You need to choose a switch that matches your needs to create maximum networking efficiency. Below you will find key features of each switch.

OSI Layer 2
  • Sort packets by MAC address
  • Feature more than two ports — usually four or more
  • May support multiple network speeds and have autosensing ports
  • Ports may be the same media type or may be mixed media (copper and fiber)
  • They are fast and easy to configure
OSI Layer 3
  • Sort packets by MAC address
  • Route packets by IP address
  • Feature more than two ports — usually four or more
  • May support multiple network speeds and have autosensing ports
  • Ports may be the same media type or may be mixed media (copper and fiber)
  • They are slower and consume more power than Layer 2 switches
OSI Layer 4
  • Sort packets by MAC address
  • Route packets by IP address
  • Prioritize packets by application
  • Feature more than two ports — usually four or more
  • May support multiple network speeds and have autosensing ports
  • Ports may be the same media type or may be mixed (copper and fiber)
  • They are slower and consume more power than Layer 3 switches

Before making your final decision on a switch, it would also be smart to educate yourself on managed and unmanaged switches. The Black Box Explains article “The Difference between Unmanaged, Managed, and Web-Smart Switches” details the difference between these devices.

Subscribe Now