These days, broadband internet is just about everywhere. Hospitals, restaurants, hotels, and of course homes are all connected with these nice, fast pipes. The problem is that your internet provider likely just gives you a single connection with a single address, no matter how many people or devices plan to use that internet connection. Here, we enter the world of home networking.
Often, just the words “computer network” are enough to draw up images of some complicated mess of cables and boxes with blinking lights. People see acronyms like LAN, WAN, TCP/IP and a host of others, and think this whole network thing must be the domain of pocket-protector wielding geeks. The truth is, once you get the basic idea of how it all fits together, you’ll find that it’s really not that complicated, and home networking can be done by just about anyone.
Way back in the day, when I first switched from dialup to broadband, I was thrilled. Not only did everything go so much faster, but I had heard that my computer and my family’s computer could be online at the same time! Gasp! So naturally, on the day it was hooked up, I tried to get both computers online. To my surprise, it didn’t work. Each one could get online when they were the only computer connected, but as soon as I tried connecting both through a hub, it failed.
It was then that I began learning the world of IP addresses. Every device on the internet, from desktop computers to cell phones to smart toasters, has an IP address. Typically, this is a unique number assigned to each of those devices. IP addresses come in the form of “x.x.x.x”, each x being a number from 0 to 254. For example, the server that’s hosting Google.com has an IP address of “18.104.22.168”. If you were to type that number into your web browser’s address bar, you’d get the Google homepage.
Places like Google, Yahoo, and of course MakeTechEasier.com keep the same IP address all the time. This is because they’re providing content to the world, and we want to make it as easy as possible for people and devices to find us.
Your home computer, on the other hand, is probably not serving web pages or providing some kind of content to the outside world. This means that your internet provider does not have to worry about giving you the same address every time you connect. Each time you connect to the internet, your computer asks your ISP for an address to use. Most of the time, it’s not the same one you had a few days, weeks, or months earlier. They see your computer’s request for an address, search in their system for an available one, and assign you the first unused address they have. For the sake of simplicity in this article, I’m going to use “22.214.171.124” to represent the IP address given to you by your ISP.
Back to my old internet sharing problem: what was going on was that my internet provider was only giving me ONE address. I could hook up 2, 10, or 700 computers but my ISP was still only giving me ONE address. Well how in the world was I to hook up all my computers when I only have 1 address to use? Network Address Translation.
Network Address Translation
It’s a fancy name for a pretty simple concept. NAT basically means converting that one, single, internet address (126.96.36.199 in our example) into separate addresses for your home network. To make this easier to understand, I’m going to compare internet routing to the existing postal system here in the US.
In the preceding example picture, we have College University as the destination for our letter. Even though the college is split into multiple buildings, it has a single street address. When the mail room gets a letter, it checks the letter to see which building it should go to, and which department in that building. Compare that to a similar example of an incoming internet data packet:
As you can see, it follows a very similar method to the postal example. The outside world sees every computer in your home only under your “main” IP address, in this case “188.8.131.52”. The router, which equates to the Mail Room in our example, checks all the incoming data to figure out which computer it should go to.
Note: I won’t be covering exactly how it figures that out, as that’s a bit beyond the scope of what I’m covering here, and the postal-to-internet analogy isn’t a perfect 1:1 comparison
You may be wondering about the IP addresses shown in the example. As I said earlier, every device on the internet has an IP address, but your ISP usually only gives you one at a time. Where did these other ones come from?
In short, IP addresses starting with “192.168.x.x” are private addresses. They only exist inside your home network. This is the key part of NAT. Even though you only have one “real” IP address of 184.108.40.206, your router basically “makes up” new ones for all your computers.
I know, I know, we’re getting into the complicated stuff and I said it wouldn’t be complicated. Essentially, what happens is that all the websites you visit or people you chat with on AIM/Yahoo/Skype/etc only see that your “street address”, your real IP of 220.127.116.11. When they send you a message, they send it to 18.104.22.168. It’s your router that knows, when it gets that message, which computer to send it to. The rest of the world doesn’t need to know anything but your main outside IP address. All the 192.168.x.x addresses are completely private and nothing but your router knows, or cares, that they exist.
Lets say College University has a LOT of Biology teachers. Some have classrooms in Building 1, while others are in Buildings 2 or 3. If someone writes a letter addressed to the Biology Department, where does it go? For something like this, you’d want the mail room staff to know that all letters for the Biology Department should go to the head of the department in Building 1.
Similarly, if someone on the internet tries to pull up a webpage from your IP address (22.214.171.124), which computer does the router send that traffic to? You’ve got to tell the router that all webpage requests should go to your web server at 192.168.1.101.
Different types of internet traffic run on different “ports”. WWW traffic usually runs on port 80. Whether you know it or not, when you open up “MakeTechEasier.com” you’re really opening up “MakeTechEasier.com port 80”. Go ahead and try it, you can put “maketecheasier.com:80” into your address bar. What you’re doing is asking for our web site’s WWW department. That same address, with a different port number, wouldn’t give you anything. Try “maketecheasier.com:99”. Nothing, right? That’s because you’re asking your web browser the equivalent of “Show me MakeTechEasier.com’s Pancake Department”. Well, sad to say, we don’t have a pancake department.
Port numbers can go up above 65,000. Some port numbers are reserved for certain kinds of common internet traffic, like port 80 for WWW traffic or port 23 for telnet. Most of those 65,000 or so are available to be used at your own discretion. If I want to run, say, a music streaming server from my home computer, that streaming software will be set to use a certain port number like 8080. If someone wants to access my music share, they would look for it at my IP address with a port number of 8080, such as “http://126.96.36.199:8080”. I would need to tell my router to send all traffic for port 8080 to my computer (192.168.1.100).
Most routers can be accessed by entering their IP address into your web browser, most commonly “192.168.1.1”. You log in with the router’s username and password, and look for port forwarding (sometimes called Virtual Servers) settings. You’ll need the source port (8080) as well as the computer that will be getting that traffic (192.168.1.x) and all requests for port 8080 will be forwarded to the computer you specified.
Obviously, there’s a lot more that could be said about home networking. Things like DNS, firewalls, PPPoE, all these can change the way your computer connects to the internet. The subjects listed here are the ones people deal with every day when it comes to things like web browsing, gaming, and file sharing. Some routers will give out addresses completely different from our examples (such as 10.0.0.x) but the same principles apply. Everything has an IP address, and for traffic to go both ways you sometimes need to know about how NAT and ports affect your connection. Next time your torrents run too slow, or you want to host files over FTP for your friends, you’ll be prepared.