

Datagrams sent from a client to a server are typically only sent to well-known or registered ports (although there are exceptions).

The private, or dynamic, port numbers are used by clients and not servers. But no matter what port numbers are used, UDP port 1000 is a different application than TCP port 1000, even though both applications might perform the same function. It just means that it’s easier to maintain one list rather than two. This does not imply that applications can use TCP or UDP as they choose.

In practice, most of the applications indexed by port numbers are the same in UDP or TCP (although a few applications can use either protocol), excepting a handful that are maintained for historical reasons. Technically, UDP port numbers are independent from TCP port numbers. Ports used on clients are ephemeral (“lasting a short time,” although the term technically means “lasting a day”) in the sense that they “come and go” as the user runs client applications. Ports used on servers are persistent in the sense that they last for a long time, or at least as long as the application is running. It should be noted that it is getting harder and harder to register new applications in the space below 1023 (these often use registered ports in the range 1024 to 49151).

These ports are sometimes called “privileged” ports, although a number of applications that formerly ran in “privileged” mode, such as HTTP servers, do not run this way anymore except when binding to the port. The well-known port number for DNS is 53, and that’s where the server process should be listening for client requests. For example, a client process wanting to contact a DNS process running on a server must send the datagram to some destination port. The use of well-known ports allows client applications to easily locate the corresponding server application processes on other hosts. Port numbers from 0 to 1023 are reserved for common TCP/IP applications and are called well-known ports. Walter Goralski, in The Illustrated Network (Second Edition), 2017 Well-Known Ports
