Routers and Switches

January 31, 1999

It is a networking wonder for the student why some Networking Administrators uses Routers while others use Switches. It is the students purpose to explain first the difference why some prefer to use Routers in one instance over Switches and vice versa. To began the explanation, it is first necessary to explain what a Router is, as well as, what is a
Switch.
To begin the answer to these questions it is necessary to explain how information is passed along a Network for one workstation to the next. Information are broken down and put into what we call packets (which are segments of a message to make it easier for information to be passed along the Network. They are labeled with the proper trailer and header so that they will arrive in a timely fashion to the right, or should we say, properly intended workstation.) Packets are only passed to the network segment they are destined for. They work similar to bridges and switches in that they filter out unnecessary network traffic and remove it from network segments. Routers generally work at the protocol level. Routers were devised in order to separate networks logically. For instance, a TCP/IP router can segment the network based on groups of TCP/IP addresses. Filtering at this level (on TCP/IP addresses, also known as level 3 switching) will take longer than that of a bridge or switch, which only looks at the MAC layer.
Most routers can also perform bridging functions. A major feature of routers, because they can filter packets at a protocol level, is to act as a firewall. This is essentially a barrier, which prevents unwanted packets either entering or leaving designated areas of the network. Typically, an organization, which connects to the Internet, will install a router as the main gateway link between their network and the outside world. By configuring the router with access lists (which define what protocols and what hosts have access) this enforces security by restricted (or allowing) access to either internal or external hosts.
For example, an internal WWW server can be allowed IP access from external networks, but other company servers which contain sensitive data can be protected, so that external hosts outside the company are prevented access (you could even deny internal workstations access if required). A router works at the Network Layer or higher, by looking at information embedded within the data field, like a TCP/IP address, then forwards the frame to the appropriate segment upon which the destination computer resides.
Router does several things such as:
 uses dynamic routing
 operates at the protocol level
 remote administration and configuration via SNMP
 support complex networks, the more filtering done
 the lower the performance, provides security
 segment networks logically, broadcast storms can be isolated
 often provide bridge functions also
 more complex routing protocols used [such as RIP, IGRP, OSPF]
Now it is time to talk about what a Switch or rather an Ethernet Switch is. An Ethernet switches increase network performance by decreasing the amount of extraneous traffic on individual network segments attached to the switch. They also filter packets a bit like a router does. In addition, Ethernet switches work and function like bridges at the MAC layer, but instead of reading the entire incoming Ethernet frame before forwarding it to the destination segment, they usually only read the destination address in the frame before retranslating it to the correct segment. In this way, switches forward frames faster than bridges, offering fewer delays through the network, hence better performance.
When a packet arrives, the header is checked to determine which segment the packet is destined for, and then its forwarded to that segment. If the packet is destined for the same segment that it arrives on, the packet is dropped and not retransmitted. This prevents the packet being "broadcasted" onto unnecessary segments, reducing the traffic.
Nodes, which inter-communicate frequently, should be placed on the same segment. Switches work at the MAC layer level. Switches divide the network into smaller collision domains [a collision domain is a group of workstations that contend for the same bandwidth]. Each segment into the switch has its own collision domain (where the bandwidth is competed for by workstations in that segment). As packets