By Erik Rozman
A port is an identifier for an application (or a session inside an application) within a computer, meaning that when you use an application to connect to a computer and request a service the local operating system assigns the requesting application a random port number (client side) and then turns to the requested services (server side) well known port. Ports are defined between the Application (Winsock , Socks) and Transport(TCP, UDP) layer of TCP/IP-traditionally they are added either to TCP or UDP depending on the Transport layer protocol you use. When the requested service answers the answer is sent from the server side service to the client side requesting applications randomly assigned port number.
The network user (188.8.131.52) wants to receive the web site located on the web server (184.108.40.206) using a web browsing application.
The network user opens a web client application through which he contacts the web server. When he contacts the web server his client application is assigned a random (yet specific for the current session) port number (3000) by the OS. The client sends his IP address and randomly assigned Port number to the web server.
Source IP :220.127.116.11
Source port :3000(randomly assigned by OS)
Destination IP :18.104.22.168
The web servers replies and sends the data to the client at the IP address 22.214.171.124 and port number 3000(the uniquely assigned port number by the OS).
Well known ports
As you see in order to reach a specific server on a specific computer you have to know a computers IP and port number (when they are joined together they are called sockets). This can cause a problem; if you don’t know the specific port number you can’t reach specific services.
To clear the confusion IANA (Internet Assigned Numbers Authority) created a list known as “Well Known Port Numbers” in which they define specific ports for specific services. The total number of available ports is 65535, the portion of “Well Known Ports” is from 0-1023 all other ports can be freely used although port numbers ranging between 1024 to 65535 are called “Registered Ports”-even though it isn’t a mandatory registration ICANN tries to keep a tab on the ports by requiring you to register a specific port for public and published use.
The full listing can be found in RFC 1700. Note that there are some internal TCP/IP mechanisms that will not need port numbers since they are unique on an interface thus an IP address is enough to designate it as unique.
Well Known Ports-examples
By Erik Rozman MCT, MCSE, MCSA, MCP+I, CCNA, CNA