The port number is a multi- digit number used to identify the services of a computer. When a data packet reaches a target computer, the computer forwards it to the corresponding program. For this reason there is a data field for the port number in the protocol headers.
There are 2 bytes each for the port numbers of sender and receiver. For the standardization of the network services these port numbers are assigned by ICANN( Internet Corporation for Assigned Names and Numbers). Fixed port numbers are assigned for certain frequently used application processes. These are referred to as Assigned Numbers. All data exchange between the User Datagram Protocol( UDP) or the Transmission Control Protocol( TCP) and the application processes takes place via the port numbers. Port numbers are assigned to application processes dynamically and randomly.
IANA has divided the port numbers into groups and reserved them for specific services. Port numbers 0 to 1,023 are reserved for known services, referred to as Well Known Services. Port numbers above this, from 1,024 to 49,151, are reserved for registered ports, and ports above this, up to port number 65,535, are called dynamic or private ports.
The most well-known port numbers include the services of Ping (7), FTP Data Channel (20), FTP Data (21), Telnet (23), Simple Mail Transfer Protocol ( SMTP) (25), Domain NameSystem( DNS) (53), Trivial File Transfer Protocol ( TFTP) (69), Gopher (70), HTTP (80), Post Office Protocol( POP 3) (110), Network News Transfer Protocol ( NNTP) (119), Simple Network Management Protocol( SNMP) (161), or HTTP Secure( HTTPS) (443). Port numbers between 1,024 and 49,151 are called Registered Ports, which are assigned and registered by IANA upon request. This is to prevent the same port number from being used by different applications, resulting in conflicts.
Dynamic/Private Ports have port numbers between 49,152 and 65,535 and are free to use and can be registered with the Internet Assigned Numbers Authority (IANA). The port numbers are dealt with in TCP/ IP standard document( RFC) 6335.