What is a Router?
Definition
When a computer requests information from another computer, data packets are exchanged in order to complete the process. When that information exchange occurs between two networks those data packets require directions in order to navigate toward the destination. A router is a computer networking device that forwards those packets toward their destinations.
The Internet is an example of a network connected by routers. Every time a web page is accessed routers help to navigate the packet exchange between the computer and the web server.
A router performs a 'routing' function which is at layer 3 of the OSI reference model. These devices exchange a list of destination networks known as a 'routing table'. A router must always reference its routing table in order to forward packets toward their destination.
Routing tables are exchanged between neighboring routers using 'routing protocols'. The routing protocol used to exchange Internet routes between Internet Service Providers (ISPs) is called BGP (Border Gateway Protocol).
Routers operate at layer 3 of the OSI reference model. The most popular and best known layer 3 protocol is IP.
Router Icon
In a network diagram, a router icon is represented by a circle with four arrows engraved on top. This icon is used to represent Layer 3 routing devices only.
What is a router used for?
Computers are hosted inside a Local Area Network (LAN). When information is required that resides outside the boundaries of that LAN routers are required in order to navigate the packets toward their destination.
A router also allows many computers on a network to share a connection. For example, a number of home computers may be connected to the same network using a switch and that network in turn is connected to other networks (including the Internet) via a router.
Larger routers such as those used in larger organizations or by service providers maintain large lists of external networks. These lists are used to determine the shortest path to the destination when there are two or more possible paths. These lists are known as routing tables. The Internet routing table consists of hundreds of thousands of routes. All routers maintain a routing table, even if that table consists of just one entry - the default route.
What is a Network
A router hosts logical segments known as networks. Routing protocols exchange information about known networks.
A network is defined by a combination of the IP address and the subnet mask. Whenever a packet is destined to any address that does not fall within the range of the locally defined network a router must be used to forward the packets toward the destination network.
What is the difference between routing and switching?
In summary, routers connect networks together while switches connect computers within a network together. Each process is complimentary, when a router delivers a packet to its destination network switches use the layer 2 physical address to deliver the packet to the physical computer. When a computer need to communicate outside the boundaries of its immediate network routers are used to identify the path toward the destination network.
Switching involves forwarding frames using OSI layer 2 addresses (MAC addresses are the most common OSI layer 2 address).
Routing involves forwarding packets using logical OSI layer 3 addresses.
What is the difference between a modem and a router?
A modem converts anlogue signals to digital signals. While a router is a device that forwards packets toward destination networks. Because both of these functions are required in order to connect home computers to the Internet via telephone cabling, manufacturers often build a single device that can do both.
This is why most ADSL modems today have built in routers. Whilst the ADSL connection requires the modem to connect using the phone line, a built in router is used to navigate the IP packets from a home network to the Internet.
Router Architecture
Two distinct architectures are used to achieve the routing function in routers.
The control plane - Allows the router to store information about other networks. This information is ultimately used to maintain the routing table which is usually dynamically populated by routing protocols such as BGP, OSPF, EIGRP or RIP. These protocols operate in the control plane.
The forwarding plane - Is used to achieve the function of forwarding packets from ingress (inbound to the router) to the egress (outbound to the router) interfaces. The forwarding plane uses information from the control plane to determine which egress interface is the best path to the destination.