Skip to main content

How do Routers work?

We discussed about switches in a previous post and this post will explain you about routers.


Routers vs Switches


Consider the following two networks.


Fig 1 : Network at the start

Suppose you want to connect the computers in the first network together, you could use a switch for that purpose. Same thing could be done with the second network. However, if you want to communicate from one of the computers in the first network with that of a second network, can you just use switches? The answer is no. This is where routers come in to play.

Use of routers for such connections serves many purposes. But most importantly, routers enable you to connect to all sorts of networks like local area networks (LANs), metropolitan area networks (MANs) or even wide area networks (WANs, such as the Internet).

For example, assume the first network in some part of Asia and the second network in US. Then you have to connect each other with a wide variety of networks before reaching the destination either way. Routers enable you to make such connections through various technologies available in them. So, you can connect your computers easily in geographically separated locations as follows :


Fig 2 : Use of routers

Routers maintain routing tables and are much more intelligent devices than switches. Routers work in the layer 3 or the network layer of the OSI model while switches work in the layer 2 data link layer. 

Use of routing tables  

The routing table lists the routes to particular destinations, by storing a list of IP addresses. Through these IP addresses, a router recognizes its nearest routers and the network topologies (discussed in another blog post) surrounding it.

The size of the routing table depends upon the network to which it is connected. For example, since home network routers often connect to another router using an ISP connection, their routing tables are small compared to that of large networks where the details about many neighboring routers may need to be stored.

Some routing tables could be updated by network administrators. Such techniques are known as static routing while some routing tables are automatically assigned when you connect to a network. The latter process is called dynamic routing.

How data packets are transferred by a router


Consider the following network.


Fig 3 : How data packets are transferred by a router

Now when a packet is sent by the computer to the router, the router should first examine whether the packet should be delivered to a computer within its LAN or MAN or should be sent out for another network.

For this purpose, routers use what is known as a subnet mask(a 32 bit number that divides the IP address into network address and host address). The subnet mask divides the available computers in the network and those outside by utilizing part of the IP address (the network part) and then finding the targeted computer in the network by using the host part.

Comments

Popular posts from this blog

Mesh / Fully connected topology

In the last blog posts we discussed about the star topology and bus topology . This is the third of the series of blog posts on network topologies. This blog post will explain about the mesh/fully connected topology, its pros and cons and the typical usage of its architecture. Mesh or Fully connected topology -  In a mesh or fully connected topology all the nodes are interconnected with each other without the use of a common media. In this blog post: Advantages of Mesh / Fully connected Topology Disadvantages of Mesh / Fully connected topology Usages of Mesh / Fully connected topology For example, as we discussed, in a star topology , all the networking devices were interconnected using a switch or a hub and in the bus topology , all the devices were interconnected using a bus line. More topologies to discover: Bus Topology Ring topology Star topology However, in mesh or fully connected topology, as the name implies, all the devices are inter

Bus topology

In the last blog post , we discussed about a brief introduction to network topologies and focused particularly on the ">star topology . In this blog post we will discuss about the features, pros and cons and the usage of bus topology. In this blog post- Advantages of using bus topologies Disadvantages of using bus topologies Usage Bus topology -  In a bus topology, all the devices are connected to a central cable (called the bus), through interface connectors (BNC connectors), as shown below: More topologies to discover: Star Topology Mesh or Fully Connected topology Ring topology In a bus topology, terminators are added, as shown by the red squares in the above figure at the ends, to prevent reflection of signals. In a bus topology, only one device may communicate at a time. To avoid collision of packets, all other devices should wait until the bus line is free for them to communicate. A protocol called Distribute Access Protocol (DAP)

Ring topology

We have already discussed about the introduction to topologies , star topology , bus topology and mesh or fully connected topology . This is the last of a series of blog posts on network topologies. In this blog post we will discuss about the ring topology, its pros and cons and the typical usage of its architecture.  Ring topology -  In ring topology all the nodes are connected to make a closed loop as shown in the diagram below :  However, data can travel in a ring network only in one direction with the help of a token. A token contains some information and along with this information data is sent throughout the network.  In this blog post: Advantages of Ring Topology Disadvantages of Ring Topology Usages For example, suppose A wants to send data to C and let us assume that the token is moving along the loop counter clockwise. Then first E receives the token and since the addresses do not match E passes further. Then D receives it and similar

Introduction and Star topology

Network topologies are all about how the networking devices are connected. Suppose you are provided with a switch and 4 computers, there are numerous ways that these can be connected. The following diagram illustrates some ways of connecting them : Therefore, network topologies is about studying and connecting such computers in different patterns. When we connect in different orientations,we have to particularly pay attention to the pros and cons of each method rather than just using a particular topology randomly. Therefore, this blog post will discuss about the different topologies, their pros and cons and where each of these topologies are typically used. Star topology- A star topology, as shown below, is a topology where all the computers are connected to one centralized hub or switch. Therefore, each of these equipment are given the same opportunity (direct) to contact the switch and all devices radially span out from the centralized hub or switch. In this

How emails are sent [the action of the SMTP servers]

What is SMTP? SMTP stands for Simple Mail Transfer Protocol and is used by email carriers to send and receive emails. SMTP uses the store and forward technique to send emails between two connections. [Actually, there are two different servers running on a server machine : the SMTP server and the POP3 or IMAP server. We will focus only on the SMTP and the functionality of the SMTP server in this blogpost]. How does SMTP work [or how emails use SMTP?] ? Consider the following expected communication between John and Brendon: Fig 1 : Expected communication between John and Brendon Suppose John is going to send his email using Outlook express. First, Outlook express should connect to John's network and then to the SMTP server using Port 25 (SMTP usually uses TCP port 25 for connections). Then Outlook express should notify the server the message to be sent, the address of the sender and that of the recipient. Suppose Brendon's address is Brendon@pqr.com. Fig 2
DMCA.com Protection Status