LambdaLabTM
Computer Networks · Class 12 · Network Devices
networksdevices⏱️ 6 min read

Router

A switch is brilliant inside one network. But your school’s network is not the only one in the world, and a message to a friend’s school has to leave yours, cross other networks and arrive in theirs. Getting it there is the router’s job.

1What a router is

Router
A router is a network device that connects different networks together with the same protocol. It receives data, looks at where it is going, and sends it on towards that network along the best route.

A protocol is the set of rules a network uses to pack and address its data — its language. Your school’s network, the library’s and the Internet all follow the same Internet protocols. So a router can pass data from one to the next without rewriting it; it only has to choose where to send it. Joining networks that follow different protocols needs a gateway, the next lesson.

Between big networks there is usually more than one way to go. Each jump from one router to the next is called a hop. Every router keeps a table that says, for each network, which router to hand the data to next. No router knows the whole journey — each one only knows the next hop.

Routers between networks

Send a message. Then break a cable or a router, and send it again.

From the School to
Send a message from the school to the Office. Each router picks the next router on the shortest route.
Router R1’s table
To reach the…hand it tohops
Library networkR21
Office networkR22

Simplified: here routers choose the route that crosses the fewest routers. Real routers also weigh speed and traffic, and tell each other about broken links automatically.

Think of road signs at a junction

A sign at a junction does not show the whole way to Chennai. It only says which road to take from here. At the next junction there is another sign. Follow the signs one junction at a time and you arrive. Routers are the junctions; their tables are the signs.

Routers find networks by their addresses. On the Internet these are IP addresses, which you will meet in Data Communication. For now, it is enough that every network has an address the routers can look up.

2What else a router does

  • Connects a LAN to the Internet. Your school’s network reaches the outside world through a router.
  • Resizes the pieces when it must. If the next network can only carry data in smaller pieces, the router splits it into smaller pieces before sending it on. The rules stay the same; only the size of the pieces changes.
  • Can be wired or wireless. A wireless router also gives Wi-Fi to phones and laptops, and usually has a few ports for cables too.

3Router vs switch

SwitchRouter
ConnectsComputers in one networkDifferent networks with the same protocol
Sends dataTo the right computer in the networkTowards the right network, along the best route
Finds computers or networks byMAC addressNetwork (IP) address
Where you find itIn the middle of a LANWhere a network meets other networks
The box at home
The “router” your internet company gives you is really several devices in one: a router, a small switch for the cable ports, a Wi-Fi access point, and often a modem too.

4Check yourself

Quick Check

What is the main job of a router?

Quick Check

In the lab, the cable between R1 and R2 is cut. What happens to a message from the School to the Office?