What is a router? How it works?

By | August 25, 2011

The topic of interest for this week is a router, what is a router? How is it related to internet? How it works?  Let’s say there wouldn’t be an internet without a router as internet is the network of computers that they are communicating over protocols and what routers allow is to transform information between different levels of communication.

You may ask what the levels of communications are; well there is an OSI model which is Open System Interconnection model which defines logical layers of similar communication for each layer. A layer provides services to upper layer while receiving services from the layer below. Here is an image that shows the 7 layers of OSI:

Routers usually deal with the first three layers or media layer meaning physical, datalink and network:

Physical layer is where hubs live, bits are simply voltage transitions, and physical layer function is to connect a device to a medium.

The Datalink is where interesting things start to happen, this layer provides error free delivery of data between two machines, and switches operate at datalink layer. A switch is a device that filters and forwards packets between LAN segments.

The network layer is where IP works and all routing is take place at network layer and therefore routers live in this layer. A router is a device forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its ISP.s network. Routers are located at gateways, the places where two or more networks connect. Routers use headers and forwarding tables to determine the best path for forwarding the packets, and they use protocols such as ICMP to communicate with each other and configure the best route between any two hosts. Without a router you cannot communicate in a global system.

Now talk about a little how routers work, usually traffic in internet goes in the format of packet and a router’s job is to route packets to other networks until that packet ultimately reaches its destination. and each router has a routing table which provides the fastest route and it is dynamic. One of the key features of a packet is that it not only contains data, but the destination address of where it’s going. Using headers and forwarding tables, routers determine the best path for forwarding the packets. Router use protocols such as ICMP or osfp to communicate with each other and configure the best route between any two hosts.

So, in short, a hub glues together an Ethernet network segment, a switch can connect multiple Ethernet segments more efficiently and a router can do those functions plus route tcp/ip packets between multiple LANs and/or WANs; and much more of course.