TCP/IP - Port Numbers

Sometimes I think of the internet as a kind of black box. I often refer to an old cartoon which shows a scientist writing a huge equation across a blackboard. The equation covers the left side and right side of the blackboard, and in the middle is the words "and the a miracle occurs."

That's how most people think of the internet. They browse the internet and send email and just assume that some kind of voodoo-like magic sends and receives the information.

Actually, there is about as much magic involved as there is in an engine for a car. The internet is just a huge machine, made up of smaller machines, which are in turn made up of yet smaller machines.

One of the major components (if you can call it that) of the internet is TCP/IP. If the internet were a body, then TCP/IP would be the nerve impulses which make it do things (that's a very rough analogy, but it will serve).

A TCP/IP number is a set of four smaller numbers, separated by dots, which represent the address of a single machine on the internet. Every single machine on a TCP/IP network has a unique number which other machines can use to send messages to that machine.

Thus to send, say, a web page to a machine a web server might send it to a TCP/IP address of 167.34.23.1. How does it know where to send it? The machine which asked for the web page (the user entered a URL in a browser) sent along it's address in the request. The web server merely sends the data back to that address.

Here's where port numbers come into play. Let's say you want to look at a web page and you enter the URL into your browser. This gets sent out to the internet, and through various means winds up at a machine which receives browser requests and returns graphics, web pages and perhaps video and sound.

That machine probably does a number of things. Of course, it handles requests for web pages and such, but it also must send email (using a program called sendmail), receive mail (using POP or Post Office Protocol), responds to PING requests (a way to determine if a machine is up or has crashed), talk to the name servers so that the internet knows it exist and any of a hundred other things.

How does the machine know the difference?

The answer is a port number is used. Each of the services that the machine performs is done by a program. Each program does something called listening on a port. A port number is actually a number between 1 and 65535 which identifies to the receiving computer what function you want to perform.

Your web browser normally makes requests on port 80 (the URL http://msn.com is actually sent as http://msn.com:80, the 80 being the port number). The receiving machine (the web server) has an application which listens on port 80. When it sees a request on that port number, the machine knows the request should be sent to the web server application. On the other hand, requests on port 21 are sent to the FTP application, and requests on port 110 go to the email POP3 application.

 

 

 

Internet Tips Contents
404 Errors Advertising Autoresponse Awardmaster Basics Browsers Careers Chatting Disasters Domains Email Emoticons Ezines Free Stuff Fun Stuff FTP Graphics Homepages HTML Reference HTML Tutorial Interactive Legal Links Msg Boards Microsoft Money Multimedia Networks Newsgroups Newsletter Products RFC's Ringmaster Searches Security Sticky Sites Surfing TANSTAAFL Telnet Viral Webmaster Your System