How Does a Router Work? [Technology Explained]

router   How Does a Router Work? [Technology Explained]Lately, 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:

home network1   How Does a Router Work? [Technology Explained]


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:

packet   How Does a Router Work? [Technology Explained]

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:

packet to router1   How Does a Router Work? [Technology Explained]

arrow   How Does a Router Work? [Technology Explained]

packet to external   How Does a Router Work? [Technology Explained]

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.

packet from external   How Does a Router Work? [Technology Explained]

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.

packet to local   How Does a Router Work? [Technology Explained]

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

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

25 Comments -

Yonathan

Great article. Thanks.

neolex

the standard home network ip address starts with 192.168.x.x, not 198.168.x.x, though it can be re-defined by the administrator to another number. typo, perhaps?

very well written. not geeky or techie at all. keep it up!

Guy McDowell

Yep, typo!

vogent

But what will happen, if two packets for two different computers come back from one external IP address?

axl456

nothing..

the router will “route” the packet to the right computer..

Guy McDowell

I think vogent is wondering how the router knows which packet goes back to what computer, if the incoming packets have the same Sender Address – based on what I wrote in the article. Well, there is more to the packet header and routing tables than I’ve talked about in this article. If you look at the sample packet header, you’ll see spaces for other information about the packet. Based on these, the router will determine the appropriate computer to send it to.

volgent

Thanks

Jaspal

Hello , i need a little help in regard of the router. I have a three different operating systems .. One PC, One MAC & One Linux (UBUNTU). all are Wifi enabled , but the problem is that of range.

My modem cum router is placed such that it can’t give enough signal to all the three.

I want to know that can a additional router can help in improving signals and strength ..

like can the additional router can receive signal and at the same time can deliver the signal too ..

if yes , then how ?

axl456

yes, you have to configure the second router as a wireless bridge

Guy McDowell

There are only two ways to increase signal strength as long as all other things are equal. Increase wattage or increase antenna length. You can get directional antennas that you can attach to your wireless card in your desktop – if it has an external antenna to begin with.

You can also read Prasanth Chandra’s article How To Make A WiFi Antenna Out of A Pringles Can. This can extend your range as well.

I honestly don’t know if a second router can be used as a repeater. Some routers do have the ability to increase or decrease signal strength within the administration screen. Maybe look at that first.

Anyone else have any ideas?

neolex

using range extenders will also work. my wifi network in my old pad used a router and a range extender to ensure coverage over the entire area.

Jaspal

I have used it as a repeater by connecting both routers with a wire , but the ugly wire has to be replaced .. i was wondering that .. if wire can make the second router a repeater than it would be possible that this same thing can be achieved with a wireless method .. i think the second router needs to be some sort of wireless receiver and transmitter .. as it is working fine with wires ..

neolex

most routers have the option to be used as a wireless access point. check the manual or the menus in your router. the simplest method to extend (for me), is to simply use a range extender with your router to increase the area of coverage for your wifi signals.

ILoveFreeSoftware

Guy – This is a great article. Very well explained.

Guy McDowell

Thank you.

JBu92

First a post on making your own cat5 and now this… did y’all hire a new networking guy or something?
don’t forget the class B private address range of 172.16.X.X :-)

Guy McDowell

I remember that range being used on the college’s network.

You gave me an idea to do an article on how to make different cables, like null modem, at home. So much cheaper! And who doesn’t enjoy a little solder iron burn every now and again?

varun

Where does the ISP come fit into?

Jack Cola

The ISP gives you an external IP Address. This is to allow your computer to communicate to other computers on the Internet. You computer will use to IP Addresses. An Internal one which as stated 192.196.x.x that allows your computers in your home to talk to each other and an external one, that your ISP provides. This allows your computer to talk to other computers on the internet such as web servers.
You can find some more information at this link. http://www.techmanhelp.com/blog/faqs/introduction_ip_address

Hoped this helped.

Guy McDowell

Thanks for fielding that one Jack! Good answer.

Fran

It’s crazy how many times I’ve had to explain a router to my friends and colleagues who still don’t understand internet basics. Thanks for sharing!

Oh the vawncast of it…

Rahul Rathore

Very usefull information. I am student of BCA.

Lou

Very cool site…..was just tuned on to it bay a friend.

Anuj

It’s really great article.
It’s very thankful to me.

Raman

very well explanation. i really help me ?

thanks a lot
Can you explain whole process with diagram and including all major deviecs and there function and need explation?