How Does a Router Work? [Technology Explained]

Ads by Google

routerLately, the Technology Explained articles have talked about the Internet and communications in general. This article will add to that series by explaining a very important piece of equipment – the router.

In order for a computer to connect to more than one other computer, you need a router or a hub. Two very different pieces of equipment that perform somewhat similar jobs. We’ll focus on the router since you very well may have one in your house.

Let me take a moment to explain to the more technically inclined that I understand that there are such things as token ring networks that don’t require a router or a hub. Yet, our average Internet user isn’t going to employ a token ring, so leave that alone, please.

Many of you will have wireless routers, a few of you may have wired routers. How the information gets to and from the router isn’t that important to this discussion. What is important is how does a router work – what happens inside the router with all that data coursing through it. To keep it simple, I’m going to use a 3 computer network to explain the routing principles.

So, let’s say you have three computers in your home and a connection to the Internet. This will give us a network that looks like such:

how does a router work

Ads by Google


In the middle of that, is the wireless router. I know you knew that, but it had to be said. Wirelessly attached to it are a laptop, a PC, and a Mac (just for you Jackson!). Actually, the Mac is in there to show that the computers don’t necessarily need to be the same kind or platform. One might be sending up a file to work, one might be downloading something from YouTube and one is reading MakeUseOf.com – of course. All this information is coming down from, and up to, the Internet.

Believe it or not, the router can only talk to one of these things at a time! The process I’m about to talk about just happens so fast that it seems to happen all at once.

Let’s say that the Mac is uploading a file to work, the laptop is watching YouTube and the PC is surfing MakeUseOf.com.

Each communication happens in small packets of data. You might recall this from the How the Internet Works article I did awhile back. The IP address in that article was the important thing that allowed packets to find their way to your computer. Here’s a packet:

how does a router work

The important parts, for this article, are the Source Address and the Destination Address. These will be Internet Protocol (IP) addresses.

However, if you are using a router, your computer’s IP address is going to begin with either 198.168.0 or 10.0.0. This is because the powers-that-be decided that those IP address would be reserved for local network use. Like in a home network.

Here’s the catch. There are millions of local networks out there. So, at any point in time, there are millions of people using an IP address exactly like the one your computer is using on your home network. Your router will have to keep track of that AND tag the outgoing packets with the true IP address that your Internet Service Provider has given to your modem. I’ll call that the external IP address. How does the router do that? That’s the question.

I am going to oversimplify this, not to speak down, but to keep this article a reasonable length. The router takes your computer’s local IP address out of the packet’s Source Address and puts it in a table. It then puts the external IP into the packets Source Address space. The router also copies the Destination Address IP from the packet and puts it in the table associated with your local IP. Confuzzled? Me too. I really had to think about how to say this in everyday speak and not geek-speak. Here’s a picture:

how does a router work

arrow

how does a wireless router work

When the packet comes back from that server somewhere out on the Internet, the Destination Address IP is now your external IP and the Source Address IP is now the IP address of the server sending you a packet. (Note: that is the IP address of Telus.com – not my home IP address.)

Think of it like a letter. You send a friend a letter and the return address is yours, and the send-to address is theirs. They write a letter back and the return address is theirs and the send-to address is yours. See how that works? We should write more letters.

how does a wireless router work

Well, the router looks at the Source Address IP of the incoming packet and looks it up in the table as a former Destination Address IP. When it finds it, the router says, “Aha! Guy’s computer sent a packet to that IP address. His computer must be waiting for a reply! Here’s Guy’s local IP address so I’ll pull out the external IP address, pop his local IP address in and send it on its way!” That’ll do router, that’ll do.

how does a wireless router work

You can imagine, with how many thousands of packets travel in and out of your home every minute, how fast this sorting process has to be! It happens so fast, you never even notice the fact that at one moment the router is talking to the Mac, then the laptop, then maybe the Mac again, and then the PC. Miracles everywhere – just stop and notice.

I hope you enjoyed this article on how a router works, and now have a better appreciation of what’s going on in that silly box of electronics next to your modem. If there are any other technologies you’d like me, or our other great writers, to break down for you, I’d be glad to hear about it in the comments!

Image Credit: A.Mohsen Alhendi

Join live MakeUseOf Groups on Grouvi App Join live Groups on Grouvi
Technology Explained
Technology Explained
35 Members
Ads by Google
Comments (36)
  • James Knott

    My point was that your comment about token ring is equally valid with Ethernet. You can have either without a router, if you don’t want to go beyond the local network and both require a router if you do.

  • James Knott

    “Let me take a moment to explain to the more technically inclined that I understand that there are such things as token ring networks that don’t require a router or a hub.”

    Actually, both Ethernet and Token Ring are the same in this respect. You need a router to get off the local network and you don’t need one if you don’t go beyond the local network. For example, you could set up a stand alone network with either and it would work just fine. Both are layer 2 technologies that can be used to carry a level 3 protocol such as IP. Twenty years ago, token ring had some advantages over Ethernet, in that it was “deterministic”, that is you could put a hard limit on how long a frame would have to wait before being sent. With the old collision domain Ethernet, where multiple devices shared a hub or coax cable, the random nature of the collisions meant you had a probable maximum wait, but not a hard maximum. However that difference disappeared when switches replaced hubs. With managed switches, you can even control priority etc. Token ring used a device called a “Multiple Access Unit” or “MAU” to connect the various computers, routers, etc. The MAU prevented loss of the ring, should a cable be disconnected, a computer shut down or other event that would otherwise break the ring.

    BTW, I used to work with token ring at IBM and I’m also a Cisco CCNA.

    • Guy

      That’s all true, of course. But beyond the scope of the article.

  • crapwoman

    I live in a LARGE house chopped up having multiple rooms on different levels, Wi-Fi is included the problem is it is very slow.
    Do I need to get a more powerful router, and have a router for each level?

  • tarun

    Thanks for explaining complex things in an easy manner.

  • Achu

    I really wondering how router communicate between the interfaces its having …I mean how do a wan port(fast Ethernet 0) communicate to LAN port(Fast Ethernet 1) in the same router.?..Does it have any correct explanation or its just coz both interfaces are in same device..

    • Guy

      Physically the ports are the same. They use the same packets and routing protocols. The only true difference is whether the devices attached are local (local area network) or part of a wider area (wide area network).

      If the router determines that the packet is intended for a device on the WAN (by IP address), it will pass the packet to another router or device that can get that packet to it’s location. If it sees that the packet is intended for a device in the local area network, it will direct it to that device.

Load 10 more
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.