Hi,
Thanks for posting in Q&A platform.
Programs are assigned a port number between 0 and 65,535. The first 1,024 ports are called well-known ports and have been assigned to specific programs. Programs listening for connections use consistent port numbers to make it easier for client programs to connect. The Internet Assigned Numbers Authority (IANA) assigns port numbers, known as well-known port numbers, to specific Application Layer protocols.
If a program listens on a non-standard port number, then you need to specify the port number when connecting to it. Client programs typically use a random source port number above 1024 (1025-65535).
Typically, the server side of an Application Layer protocol listens on the well-known port number. The client side of an Application Layer protocol uses either the well-known port number or, more commonly, a dynamically allocated port number. These dynamically allocated port numbers are used for the duration of the process and are also known as ephemeral or short-lived ports.
So if you want to bind a specific port for a program, you could use 1025-65535.
The following article identifies well-known ports which registered by IANA for your reference.
Service Name and Transport Protocol Port Number Registry
Please Note: Since the websites are not hosted by Microsoft, the links may change without notice. Microsoft does not guarantee the accuracy of this information.
Best Regards,
Sunny
----------
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.