Hubs, Switches And Routers - What's The Difference?
The backbone of a computer network uses 3 types of devices to interconnect computers -- hubs, switches and routers. Each is important and serves a different role in facilitating communication between networked computers. From the outside these devices may look similar -- small, metal boxes with multiple connectors or ports where ethernet cables are attached (routers may also expose other types of connectors). The terms 'hub', 'switch', and 'router' are often used interchangeably and misused -- in fact, the devices are quite different. Hubs are used to simply interconnect individual computers. Switches do the same (but more efficiently). However, routers interconnect different networks (as opposed to individual machines).
network hub:
Compared to switches and routers, hubs are the least expensive, simplest device on the network. All data that enters one port of the hub is sent out all the other ports. Hence, all computers connected to the same hub see each other's network communications. The hub doesn't pay any attention to the transmitted data, it simply passes it along to its other ports. A hub's value lies in the fact it is inexpensive and offers a quick and easy way to connect computers in a small network.
network switch:
The job of a switch is similar to a hub's -- but it does it more efficiently. Each packet of data (ethernet frame) that is transmitted on the network has a source and destination MAC address. A switch has the ability to remember the address of each computer attached to its ports and will act as a traffic cop -- only passing transmitted data to the destination machine and not all the others. This can have a significant positive affect on network performance because it eliminates unnecessary transmissions and frees-up network bandwidth. A switch can be thought of as the central component of a single network. It is used to interconnect devices on the network and to deliver layer 2 (OSI model) frames. A switch differs from a hub in that it does not retransmit frames to all other devices -- rather, a switch makes a direct link between the transmitting and receiving devices.
network router:
Compared to switches, routers are slow and relatively expensive. A router is an intelligent device that interconnects two or more networks for the purpose of delivering layer 3 (OSI model) packets. Since there may be more than one possible path, a router takes into account multiple criteria when determining which path to send the data packets. The fact that switches and routers operate at different layers of the OSI model indicates they rely on different information (contained in the frames or packets) to send data from a source to a destination.
An important difference between switched and routed networks is switched networks do not block broadcasts. As a result, switches can be overwhelmed by broadcast storms. routers block lan broadcasts, so a broadcast storm only affects the broadcast domain from which it originated. Since routers block broadcasts, they also provide a higher level of security than switches.
Analogy
Here's an analogy to help explain the difference between a router and switch -- a corporation's mail room. When an employee sends a letter it may (a) be delivered to its final destination by the company's internal mail delivery system or, (b) taken to the local Post office (if the recipient resides outside the company). A switch represents the corporation's mail room, and a router the local Post office.
A switch does not look inside the mail or examine the type of mail being delivered. The only logic behind a switch is a table of MAC addresses (one for each computer on the network) and which port a destination MAC is connected. That is, the switch stores a table of company employees and their office numbers and is responsible for delivering internal mail directly to employees. So, if mail arrives at the switch that is destined for an employee then a switch knows how to deliver it. A router, on the other hand, is responsible for delivering mail destined for individuals outside the company. In addition, routers can look inside the mail and delivery rules can be applied based on the mail's contents. This feature allows routers to play an important role in network security.
How a switch Operates:
Switches are essentially multi-port bridges. They were designed to reduce the size of collision domains. In addition to faster CPUs and memory, two other technological advances made switches possible -- content Addressable Memory (CAM) and application-specific integrated circuits (ASIC). cam is memory that works backward compared to conventional memory -- that is, given a data value the memory returns the associated address. This allows a switch to directly find the port associated with a MAC address (the data value). An ASIC is a device that can be programmed to perform functions at logic speeds in hardware. The use of cam and ASIC technologies greatly reduced the delays caused by software processing and enabled a switch to keep pace with the demands of high data rates in ethernet networks.
Switches can operate in one of three modes -- store-and-forward, cut-through and fragment-free. The trade-offs are performance versus reliability. In store-and-forward switching the switch reads the entire frame and checks for errors. In cut-through switching the switch reads the beginning of the frame up through the destination MAC address. In fragment-free switching the first 64 bytes of a frame are read -- enough to determine whether or not it is a collision fragment (which account for the majority of frame errors).
The Layer 2 switch builds its forwarding table using MAC addresses. When a host has data for a non-local IP address, it sends the frame to the closest router (also known as its default gateway). The host uses the MAC address of the router as the destination MAC address.
How a router Operates:
Just as a switch keeps a table of known MAC addresses, a router keeps a table of IP addresses known as a routing table. An important function of a router is to maintain these tables and make sure other routers are notified of changes in the network topology. This function is performed using routing protocols to communicate with other routers. When packets arrive at a router's interface it applies various criteria and protocols to determine the best path on which to transmit the packet to its next destination.
A router can be programmed to apply sophisticated rules based on the contents of the data packets that it sees. For example, routers can be programmed to act as hardware firewalls, can implement network address translation (NAT) and provide DHCP services to the network.
Because of their built-in intelligence, routers are generally considered the most complex devices on a network. In addition to directing packet traffic, routers can be configured to monitor network traffic, adapt to changes in the network that they detect dynamically, and protect networks by filtering packets and determining which packets will be blocked or allowed through.
Steve Leytus is a senior software engineer and develops applications for NutsAboutNets.com. For more information about AirSleuth 2.4 GHz Spectrum Analyzer and other low cost, PC-based diagnostic tools for installing, optimizing and trouble-shooting 802.11 (Wi-Fi) wireless networks please visit www.NutsAboutNets.com.
Yoga Meditation Retreat Asia