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.