Do routers and switches generally have the same hardware? That is to say, if one flashed the firmware of a router on a switch, would it effectively be a router?

  • That's actually a good question. As far as I know router handle packets (network layer) and a switch handles frames (data link layer). Maybe you could configure a switch working as a router but I wouldn't recommend it. For example you don't have a physical firewall built into your switch. – vkvau Nov 20 '14 at 9:03
  • The answer to your question generally is no – Mike Pennington Nov 20 '14 at 9:58
  • All ethernet routers are also switches. Albeit, generally a very low port density switch. However, not all ethernet switches are routers. Switches forward frames based on layer 2 information. Routers route packets based on layer 3 information, and then switch the frames based on layer 2 information. Switches marketed as layer 3 switches are actually routers. But like Mike said above, the answer to your question is generally no. – Ryan Nov 20 '14 at 15:11
  • 1
    @Ryan, I have to disagree strongly with the statement that "All ethernet routers are also switches." Many routers do not have L2 ASICs to give them the L2 forwarding performance of a switch (and most that do have them installed on the module doing the switching, not on the RP). – YLearn Nov 20 '14 at 19:33
  • @YLearn, I completely agree with you regarding the L2 ASICs and performance. However, without taking time to look up any technical definitions, and staying high-level, a switch's job is to look at the frame header, check integrity, look up the destination MAC, switch it out the correct interface. A router does the same thing, albeit not nearly as efficiently as a switch. I guess the point of my comment was that a network device performs the functions of the OSI layers below that of which is its primary function. I think we agree in concept, but disagree on terminology. – Ryan Nov 20 '14 at 20:33

Mike Pennington already said that the answer was generally "no", and that's a good answer as far as it goes.

The answer really comes down to definitional questions. The term "switch" is really pretty poorly defined and used in a lot of contexts, so its almost impossible to give an absolute answer.

"Layer 3 switching" was originally a (very marketingish) term for a router that forwards packets based on inspection of layer 3 header information using "hardware" such as an ASIC to do the forwarding, rather than using software running on a general purpose CPU.

Nowadays, most routers of any significant scale use ASICs (or FPGAs) in the data plane to forward packets. Hardware based routers turn out to be able to do switching at Layer 2 or routing at Layer 3 with essentially no performance differences, so the definition between "switch" and "router" has really become very blurry with modern gear.

Whether traffic if forwarded based on layer 2 header information or layer 3 information has become a matter of configuration on modern high end gear rather than hardware.

To pick one example, with the right set of blades, you could take every blade out of a Cisco 6500 "Switch" (as they label it on their website) and slide them into a 7600 "Router" (again, as they label it on their website), and the behavior essentially doesn't change at all.

That having been said, you can still get gear that only does layer 2 switching and isn't capable of doing layer 3 switching based on the capabilities of the ASICs included in the equipment. You'll also could find examples where a device is released with a certain set of capabilities (say layer 2 switching only), but the hardware is capable of more and the software to control it just hasn't been written, yet. Later releases of the firmware/software for the device can then enable those capabilities that had been physically available, just not turned on by software.

So...the answer can really only be, "it depends." Sorry, I know that's typically an unsatisfying answer, but its the best that can really be done without narrowing down the scope a bit.

| improve this answer | |
  • I should probably clarify on the Cisco 6500 vs 7600 distinction...both platforms are capable of forwarding at either layer 2 or layer 3, and, as with most modern gear of reasonable scale, to do both at the same time depending on configuration of the individual ports. The distinction between "switch" and "router" as it exists on Cisco's website with respect to these two platforms is purely a marketing/sales positioning distinction as the two platforms are almost identical in capabilities. – Jeff McAdams Nov 20 '14 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.