Those ports in the transport layer protocol UDP/TCP

This section will introduce some knowledge points of some ports as a section in my column "Computer Network Protocol Quick Start Tutorial".

The previous article elaborated on the UDP and TCP protocols in detail, and the port as the address of the transport layer can effectively identify the application. In fact, not only the UDP protocol, but also the TCP protocol uses ports as the representation of application communication. The concept of a port is not difficult to understand, but there are certain differences in the usage of the port between the server and the client, which will be explained in detail in this section.

port range

No matter in the UDP protocol or the TCP protocol, the port is represented by two bytes, so its range is 0-65535. Theoretically, the ports in these ranges can act on both TCP and UDP protocols. But in fact it may be different, see the analysis below.

Client
Generally speaking, there are obvious differences between the client port and the server port we see, as shown in Figure 1:
insert image description here

Figure 1
The source port in Figure 1 is 55632, which indicates the port used by the client browser to access the web page. The Destination port is 80, which means the port that the web server opens to the outside world. It can be seen that the port of the client is usually very large, while the port of the server is generally small. Figures 2 and 3 are the distribution of client and server ports during a web page visit:

Guess you like

Origin blog.csdn.net/javajiawei/article/details/125829047