What is a Layer 3 switch really?

What is a Layer 3 switch really?

Depending on who you ask, the answer will be different. It seems everyone has an opinion about what a Layer 3 switch is. I have my own personal definition, which is based on the OSI model.

Also, some definitions really beat around the bush. All of this creates confusion in the mind of newbies people concerned and clearly, when you try to make it clear, the answer is not simple, although specialists usually manage to get out of it without too much trouble.

Let’s see what are different definitions we find of Layer 3 switching on the Internet.

1) A hardware router (ASIC)

When you type “L3 switch” on Google, the first link you find explains to you that it’s nothing else but a very fast router, where the software operations are made by some specialized hardware.

So it’s really like a router :
  • it’s got the same number of interfaces (like 2 or 3),
  • uses the same routing protocols and achieve the same goals,
  • but “the key difference between Layer 3 switches and routers lies in the hardware technology used to build the unit. The hardware inside … replaces some of a router’s software logic with hardware to offer better performance in some situations.”
In short, a L3 switch is an ASIC Router.

2) An Inter-VLAN switch

Now if you look further into Google, a L3 switch is a switch with routing capabilities:

  • it’s got 24+ ports (like a Ethernet switch)
  • there’s no WAN link
  • ip routing is enabled on it
  • … and it works very quickly (fortunately)
So it means that in this case, I’d take a Cisco 2960 or a HP Procurve Ethernet Switch, type ip routing and BAM! it’s a L3 switch.

Then, a L3 switch is an Ethernet switch with ip routing capabilities.

3) A software-improved router
Now if you dig a bit deeper into the internets, you’ll find another definition (the one I agree with). For example (sorry I’ve got to justify with links, they are so rare) :

Cisco Express Forwarding (CEF) is an advanced layer 3 switching technology used mainly in large core networks or the Internet to enhance the overall network performance.
Routers do normal routing lookup, but by introducing fast switching and CEF, packets are also now switched on a router.
(to be clear, we activate a feature on a router)

When you think about it, switching really is when you direct a bunch of data to a interface (and not a next-hop identified by a Layer 3 address), so in most cases, there’s a matching between a destination address and an output interface.
For example :
  • Ethernet switching : association between destination MAC address an output interface
  • Frame-Relay : association between a DLCI and an output interface
  • MPLS : association between a label and an output interface (in its original idea)
Following that logic, Layer 3 switching, in its concept, would be the association between destination IP address and output interface.

And guess what, it’s exactly what Fast Switching and CEF do!

PS : The fact that it can be done by ASIC rather than software does not matter. It’s not what it makes its essence. Anything can be done by ASICs, yet it does not transform them into some other type of machines (just faster ones).