Any Port in a Packet Storm More and more you may hear somebody talk about port numbers, but do you know what they are or how they are used? Layers First, a brief lesson on the Transport Control Protocol / Internet Protocol (TCP/IP) stack. All Internet communication uses TCP/IP. It has four layers, and each layer uses a different form of addressing. The Application Layer uses host names for addressing, the Transport Layer uses port numbers, the Internet Layer uses IP addresses, and the Network Layer uses MAC addresses. Application Layer addressing is a no brainer: Every computer on a network has to have an IP address, and it would be impossible to remember the IP address of every site on the Internet! It is much easier to remember a regular name, like www.pcnineoneone.com, than it is to remember the IP address. Domain Name Resolution (DNS) takes care of finding the IP address for you. But what about port numbers at the Transport Layer? Each application needs a unique port number, just like each web site needs a unique IP address. When you click on your web browser's icon, the TCP/IP stack assigns a unique port number to your web browser as it is loading. Since port numbers below 1024 are reserved for services (more on this later), your web browser will be assigned a port number greater than 1023. Example As an example I'm going to say that you have two web browser windows open, in the first one you are reading this page and in the second you are reading www.dalantech.com. Window number one was assigned port number 1025 and window number two was assigned 2045. When you click on a hyperlink in window number one, the packet that you send to www.pcnineoneone.com was "tagged" with port number 1025 (source port). When the server that contains the PC 911 web page responds to your request for data, it sends a packet to you with port number 1025 in the destination port field of the packet. When your computer receives the packet it knows which application to give the data to by looking at the port number. The same thing happens when you click on a hyperlink at www.dalantech.com (or any web site). The packets get tagged with port number 2045 (the second window) and when the server for Da LanTech sends a reply the packet has a destination port number of 2045 and the information loads into the second window. You could have several browser windows open, but each one will have a unique port number randomly assigned to it. The only requirement is that the port numbers for client applications (a browser window, for example) have to be above 1023 -the port numbers from 1 to 1023 are reserved. Source and Destination Remember when we sent a packet to PC911? Well, we actually sent two port numbers, a source port (the port number of the browser window that you are running) and a destination port. The destination port was port 80, because port 80 is reserved for the Hyper Text Transport Protocol (HTTP, web page servers) and we were accessing a web page. e-mail servers listen for Simple Mail Transport Protocol (SMTP) requests on port 25. Domain Name Servers (DNS, they resolve host names to IP addresses) listen for DNS requests on port 53. Unlike the random port numbers assigned to client side applications like web browsers, all services have unique ports reserved for them -and those ports do not change. For example: an http server (an Internet site like PC911) will always listen for requests on port 80. The server that holds your e-mail will always listen to port 25 to receive e-mail from other e-mail servers. If you download your e-mail to your computer from your e-mail server, then your request went to port 110 (Post Office Protocol, POP). The application that you use to read e-mail was assigned a random port number above port number 1023 (just like your web browser) and your e-mail server used that port number to reply to you. Summary To review: All of the Ethernet packets that you send from your computer to the Internet have two port numbers, one source and one destination. The source port number is the port number of the application that generated the Ethernet packet, and it can be any number greater than 1023. The destination port number is the port number of the service that you are requesting, and it will be a port number below 1024. All port numbers below 1024 are reserved for specific services. Every application on your computer is assigned a unique port number so that when data returns from the Internet, the Transport Layer on your PC knows which application generated the request for data and the information gets passed to the correct application. You wouldn't want Da Lan Tech loading into your PC911 window, would ya'? http://www.PCNineOneOne.com