Routers are the traffic directors of the global internet. All routers maintain complex routing tables which allow them to determine appropriate paths for packets destined for any address. Routers communicate with each other, and forward network packets out of or into a network. Here’s an example:
You want to search for something on the internet using a search engine. You open a browser on your workstation. The browser opens to a blank page (not usually the default, but appropriate for this example). You type “http://www.google.com” into the URL (Universal Resource Locator) address line of the browser. The browser software packages up the URL you typed, and sends it with a request for an IP address to the DNS (Domain Name Server) that has been set in your network adapter’s configuration. The domain server returns an IP, such as 188.8.131.52 (actual address returned by DNS for google.com on June 7th, 2011). The browser ships the request for that IP address off to the network card, which bundles the request into an ethernet packet, destined for 184.108.40.206. The network card sends the packet to the gateway of your network, which opens the header of the packet, and makes a determination that the packet is traveling out of your network, in search of 220.127.116.11. Your network’s router has routing tables which it has been building from communicating with other routers, and potentially augmented with “static routes”, which are specific paths added by your network’s administrators to make the task of accessing certain networks easier, or faster, or in some cases, not possible. In this case, I find that my router knows about another router at my ISP(Internet Service Provider), which in turn has several more routers that are all on networks of which I am just a small node, much like finding an atom of a molecule of a piece of dust on a rock on a moon of a planet of a sun of a galaxy of the universe. In any case, the packet gets passed from router to router, each time moving out of the subnets of the packet sender, towards a router that will know where the desired server is. The packet finally reaches the router of the network at 18.104.22.168, which dutifully delivers the packet to the server at that IP address. The server carefully crafts a response, and sends a reply back, which follows the same process to get the response “Yes. Go ahead” back to the requester. Whew. And that’s just the initial request.
While bridges know the addresses of all computers on each side of the network, routers know the addresses other routers which in turn know about their own networks. Routers can even “listen” to entire networks to determine which sections are busiest – they can then redirect data around those sections until traffic congestion clears.
So, routers are network gateways. They move network packets from one network to another, and many can convert from one network protocol to another as necessary. Routers select the best path to route a message, based on the destination address of the packet. The router can direct traffic to prevent head-on collisions, and is smart enough to know when to direct traffic along back roads and shortcuts.
If you have a school LAN that you want to connect to the Internet, you will need to purchase a router. In this case, the router serves as the forwarder between the information on your LAN and the Internet. It also determines the best route to send the data over the Internet.