Just this last week several customers have ironically all asked me the exact same question. “Can we use an Ethernet switch instead of a router for our Internet EBGP peering to our ISP(s)?” While switches have gained more routing capabilities in recent years there are some caveats you should be aware of when making this decision.
Switches have high performance numbers because switch designers have optimized the amount of high-speed packet buffers per Gigabit Ethernet switchport. This means that when packets are coming into several ports all destined for the same output port those packets can be buffered to minimize any packet loss and keep the output forwarding and line rate. Switches use Application Specific Integrated circuits (ASICs) and therefore have performance advantages over routers that use a central CPU and perform many control plane functions in software.
Routers have been historically required to terminate TDM WAN circuits like T1/E1s, DS3s, STM1, and POS links. Since most of these WAN connections today are Ethernet customers are looking at devices that have all Gigabit Ethernet interfaces. While modern routers typically come with Gigabit Ethernet interfaces they don’t have the performance numbers of an Ethernet switch. It is not uncommon for an Ethernet switch to have throughput ratings between 32Gbps to 64Gbps to many hundreds of Gbps. High-speed routers have performance ratings of just a few Gbps.
In recent years Ethernet switches have gained the ability to run more routing protocols. This is causing customers to consider switches in favor of routers. OSPF and EIGRP are not new tricks for Ethernet switches but BGP provides some interesting challenges. BGP performance really depends on the number of neighbors/peers and the number of BGP messages received. If you have a single EBGP peer to a single ISP and you are only receiving a default route then a switch may be a good choice. However, if you have many EBGP peers receiving the full Internet routing table (~300,000 routes) then you may need more CPU horsepower that a traditional router provides. A rough calculation might be to allocate 1KB of memory for each BGP route. Therefore, if you have to store the full Internet table you are looking at 300MB of storage. This could be an impasse for an Ethernet switch with 128MB or 256MB or memory.
Both routers and switches have the ability to use VLANs, VRFs, and use 802.1Q trunks. Therefore, both support network virtualization goals. Both routers and switches have the ability to be secured with AAA, SSH, and managed easily via enterprise-level NMSs. Routers and switches are now configures similarly so they are both equally easy to configure and operate. Routers and switches can support multicast routing and virtually all enterprise switches support IGMPv3/MLDv2 snooping. And of course both routers and switches can both easily operate in a dual-protocol (IPv4/IPv6) environment.
Here is a list of advantages that switches have.
- High bandwidth/performance – fast backplane – line rate performance
- Lower cost per Gigabit Ethernet port
- All the requisite routing protocols are now available
- High quantity of Ethernet Switch ports
Here is a list of advantages that routers have.
- Full enterprise routing functionality
- Higher CPU capacity for control-plane tasks
- The ability to add interfaces for both Ethernet and other types of WAN circuits (modular chassis)
- Ability to run NetFlow/sFlow, QoS, MPLS, security features, etc.
- The ability to integrate firewall, IPS, deep packet inspection, WAN acceleration functions
I would suggest that if you are receiving only the default route from a single upstream ISP then a switch may be a low-cost option to a router. However, if you are peering with multiple ISPs and you need to store the full BGP table from multiple peers then a router is the way to go. Furthermore, if you really need enterprise routing functionality and want the extra control then you may not be satisfied with fewer features on a switch and full router software is what you want. In just about every customer conversation that I have had recently the answer has been in favor of routers instead of switches.
Can you think of any other reasons why someone might chose a router or switch for the job of Internet router?