Routing versus switching
10.2.2 This page will compare and contrast routing and switching. Routers and switches may seem to perform the same function. The primary difference is that switches operate at Layer 2 of the OSI model and routers operate at Layer 3. This distinction indicates that routers and switches use different information to send data from a source to a destination.
The relationship between switching and routing can be compared to local and long-distance telephone calls. When a telephone call is made to a number within the same area code, a local switch handles the call. The local switch can only keep track of its local numbers. The local switch cannot handle all the telephone numbers in the world. When the switch receives a request for a call outside of its area code, it switches the call to a higher-level switch that recognizes area codes. The higher-level switch then switches the call so that it eventually gets to the local switch for the area code dialed.
The router performs a function similar to that of the higher-level switch in the telephone example. Figure shows the ARP tables for Layer 2 MAC addresses and routing tables for Layer 3 IP addresses. Each computer and router interface maintains an ARP table for Layer 2 communication. The ARP table is only effective for the broadcast domain to which it is connected. The router also maintains a routing table that allows it to route data outside of the broadcast domain. Each ARP table entry contains an IP-MAC address pair.
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. This router is also known as its default gateway. The host uses the MAC address of the router as the destination MAC address.
A switch interconnects segments that belong to the same logical network or subnetwork. For non-local hosts, the switch forwards the frame to the router based on the destination MAC address. The router examines the Layer 3 destination address of the packet to make the forwarding decision. Host X knows the IP address of the router because the IP configuration of the host contains the IP address of the default gateway.
Just as a switch keeps a table of known MAC addresses, the router keeps a table of IP addresses known as a routing table. MAC addresses are not logically organized. IP addresses are organized in a hierarchy. A switch can handle a limited number of unorganized MAC addresses since it only has to search its table for addresses within its segment. Routers require an organized address system that can group similar addresses together and treat them as a single network unit until the data reaches the destination segment.
If IP addresses were not organized, the Internet would not work. This could be compared to a library that contained millions of individual pages of printed material in a large pile. This material is useless because it is impossible to locate an individual document. If the pages are identified and organized into books and each book is listed in a book index, it will be a lot easier to locate and use the data.
Another 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 and bandwidth control than switches.
The next page will compare routing and routed protocols.
Thursday, March 18, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment