Home > Networking Tips > Routing and Switching > How routers work
Networking Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ROUTING AND SWITCHING

How routers work


David Davis
04.03.2007
Rating: -4.31- (out of 5)


Routing and switching news, advice and technical information
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Routers are an essential part of the network's plumbing. Organizations depend on routers so that employees can check email or access Web applications. Network engineers must configure these routers correctly to keep all the network traffic flowing smoothly. But how does a router actually work? Find out in this tip.

How routing fits into the OSI model

The OSI model is just a theoretical model, but it is a great way to visualize how all of these protocols, addresses and network devices (like routers) fit together.

Layers 2 and 3 of the OSI model are what apply here. Layer 2, the Data Link layer, is where the Ethernet protocol, MAC addresses and switches fit in. Layer 3, the Network layer, is where the IP protocol, IP addresses and routers fit in. Remember that all traffic is sent from your computer starting with Layer 7 (your network application) and going down to Layer 1 (physical). With the physical layer, the traffic is going across your network medium (such as your network cable or your wireless airwaves).

Traffic goes to a router only if it is not on your local LAN. Routers work primarily at Layer 3 but must understand Layers 1-3, at a minimum. Many routers understand traffic all the way up to Layers 4-7 in varying ways, but we like to think of them as working only at Layer 3 (network) because that is their primary function.

How routers use Ethernet MAC addresses and IP addresses

As I said, in Layer 2 is your Ethernet protocol and Ethernet addressing -- the MAC address (a.k.a. physical address or Ethernet address). In Layer 3 is your IP protocol and IP addressing. Today, almost all networking is done using Ethernet and IP. Thus, in general, every packet on your network has an Ethernet MAC address source and destination -- and an IP address source and destination. Keep this in mind.

I believe everyone who is interested in computers should, at some time or another, use a network protocol analyzer to really see all the pa


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Routing and Switching
Secure Cisco routers against IOS flaw attack
Network summarization -- Supernetting and wildcard masks
Routing: Five common, easily avoided errors
Router Expert: Building a WLAN proxy server, implementing ASR
Router Expert: Building a WLAN proxy server, implementing WPAD
Cisco IOS IP routing -- dynamic routing
Cisco IOS IP routing: Static routes
Router Expert: Building a WLAN proxy server, DHCP services: Part 2
Router Expert: Building a WLAN proxy server, DHCP services: Part 1
DNS for a wireless network: Router Expert

Network Hardware
Q&A: Nortel's data networking chief discusses the future
Nortel routers and switches may go to buyer of telephony business
3Com hopes to win enterprise networking customers with global H3C push
Extreme's port extender can replace consumer devices at network edge
Cisco unveils Unified Computing, merging servers, storage and networks
Network change and configuration management vendors see big changes
Scalable network lifecycle management processes can reduce costs
Physical network security key to fighting low-tech threats
Cisco expands Nexus data center switch line with eye on virtualization
HP ProCurve unveils data center network strategy
Network Hardware Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
core router  (SearchNetworking.com)
fiber jumper  (SearchNetworking.com)
flow routing  (SearchNetworking.com)
foreign agent  (SearchNetworking.com)
foreign network  (SearchNetworking.com)
hardware load-balancing device  (SearchNetworking.com)
logical router  (SearchNetworking.com)
mrouter  (SearchNetworking.com)
patch cord  (SearchNetworking.com)
port interface card (PIC)  (SearchNetworking.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


ckets that are going to and from the computer. This is true even when you aren't using it! In a protocol analyzer, you would see this Ethernet source/destination and IP address source/destination.

What a router does with your network traffic

Routers understand these Ethernet and IP addresses. Routers are primarily interested in the destination IP address of the packet you are sending to the router. The router takes this destination (say it is 63.248.129.2) and looks that up in its routing table. Here is an example of a routing table:

Routes in the routing table are learned from either static routes (entered by you) or dynamic routes. Using the routing table, the router tries to find the best route for your traffic. There may be only one route. Often, this is a "default route" (a.k.a. "gateway of last resort"). The default route just says: "If there are no better routes to send this traffic, send it here."

Just about every home and small business user has just a single Internet connection. In that case, they have a default route and all traffic is sent to their Internet service provider (ISP). In the case of ISPs, however, there may be many places they can send this traffic. Their routers must compare many hundreds of thousands of routes and select the best one for your traffic. This happens in milliseconds. And to get your traffic through the Internet and back, it may pass through hundreds of routers. To you, it appears almost instantaneously (depending on many factors).

If it doesn't find a valid route for your traffic, the router discards (yes, throws away) your traffic and sends an ICMP "destination unreachable" message back to you. When the router does find the best route and is ready to send your traffic, it has to do a number of things:

On the other side of the link, the destination router is performing all of these same tasks, but in reverse. This happens for every packet sent and every response received.

To see a real production routing table from an ISP, you can telnet to public Cisco route servers around the world. From here, you can do a show ip route and see what a real ISP's routing table looks like.

About the author:
David Davis (CCIE #9369, CWNA, MCSE, CISSP, Linux+, CEH) has been in the IT industry for 15 years. Currently, he manages a group of systems/network administrators for a privately owned retail company and authors IT-related material in his spare time. He has written more than 50 articles, eight practice tests and three video courses, and has co-authored one book. His Web site is HappyRouter.com.

Rate this Tip
To rate tips, you must be a member of SearchNetworking.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Networking Solutions for Business

Alcatel-Lucent Network Business Communications Solutions

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts