top of page

Ever wondered what a 'Router' is all about?

Updated: Jan 15, 2023

There you go then!



Table of contents.



It is a networking device. It helps us to forward data packets from one network to another network. It is a device usually in connection with two or more different networks. It is that, which helps you to get access to internet by connecting your LAN with the internet.




But how does it work ?


Of course, in an interesting way. It collects and examines the data packets arriving at its port to read the destination IP address, in order to learn about the destination the data packets should be send to.


Then it refers to its routing table, which is unique to each router and is stored in the RAM. The routing table shows the list of networks with known routes.


Using this information the router determines to which interface the packet should be sent to.



What are Routing tables?

A table with a set of rules, which is used to decide where data packets travelling over a internet protocol (IP) network should be directed to. This table is used by all IP enabled devices, including routers and switches.



What is that a routing table does?


It contains the information to identify the best path for the data packets to reach its destination. Hence directs the device with instructions to send the data packets to the next hop on the best route across the network.






What is included in an entry of a routing table?

Each entry in a routing table consist of;


  • Network ID - The corresponding route`s network ID or destination.

  • Subnet Mask - The mask that is used to match the destination IP address to the network ID

  • Next hop - The next IP address to which the packet will be forwarded.

  • Outgoing Interface - The interface the packet should reach in order to get to the destination.

  • Metric - Usually used to measure the minimum number of hops (the router crossed) to the network ID .

What does these entries store?



Routing table entries can be used to store the following types of routes;



  • Directly attached network IDs.

  • Remote network IDs.

  • Host routes.

  • Default routes.

  • Destination.



How are routing tables populated?


  • Manually through static routing.

  • Automatically through dynamic routing.

  • Directly connected networks (added automatically)


Network administrators update the routing tables of static network devices manually.

During dynamic routing with the usage of routing protocols devices exchange information about their surrounding network topologies and build and maintain their own routing table automatically. In this scenario devices are allowed to "listen" to the network and respond to situations such as device failure and network congestions.



How to find the Subnet ID using Routing Tables?



The process of finding the subnet ID using routing tables is also known as Route Determination Process.


For example if a network is sub netted into four subnets with IP addresses as follows;


  1. 200.1.2.0 (Subnet a)

  2. 200.1.2.64 (Subnet b)

  3. 200.1.2.128 (Subnet c)

  4. 200.1.2.192 (Subnet d)


Range of S1 :

200.1.2.00000000

200.1.2.00111111


Range of S2 :

200.1.2.01000000

200.1.2.01111111


Range of S3 :

200.1.2.10000000

200.1.2.10111111



Range of S4 :

200.1.2.11000000

200.1.2.11111111






This is how the routing table maintained by the internal router will look like;

Destination

Subnet Mask

Interface

200.1.2.0

255.255.255.192

a

200.1.2.64

255.255.255.192

b

200.1.2.128

255.255.255.192

c

200.1.2.192

255.255.255.192

d

Default

0.0.0.0

e


The subnet mask of default route is always 0.0.0.0.The entry corresponding to the default gateway configuration is a network destination of 0.0.0.0 with a network mask (netmask) of 0.0.0.0



By ANDing the destination IP address on the data packet and all the subnet masks one by one, the router performs a bitwise operation to find the right subnet (subnet ID).


  • If only one match found, router forwards the data packet on to the corresponding interface.

  • If two or more matches found, router forwards the data packet on to the interface corresponding to the longest subnet mask.

  • If no match found, router forwards the data packet on to the interface corresponding to the default entry.


It is important to note that routing tables are not specific for CISCO devices.

Using the ' route print ' command the routing table of your Window Operating system can be viewed.


2 views0 comments

Comments


bottom of page