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
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.
Send a message. Then break a cable or a router, and send it again.
| To reach the… | hand it to | hops |
|---|---|---|
| Library network | R2 | 1 |
| Office network | R2 | 2 |
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
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
| Switch | Router | |
|---|---|---|
| Connects | Computers in one network | Different networks with the same protocol |
| Sends data | To the right computer in the network | Towards the right network, along the best route |
| Finds computers or networks by | MAC address | Network (IP) address |
| Where you find it | In the middle of a LAN | Where a network meets other networks |
4Check yourself
What is the main job of a router?
In the lab, the cable between R1 and R2 is cut. What happens to a message from the School to the Office?