Can TCP and UDP bind the same port at the same time?
Can TCP and UDP bind the same port at the same time? Before answering this question, we need to first understand what TCP and UDP are, and what network ports are.
Introduction to TCP and UDP
TCP and UDP are two independent protocols of IP (Internet Protocol). They both work at the network layer in the OSI model. The biggest difference between TCP and UDP is connection-oriented and connectionless-oriented.
When the reliability of the data that needs to be transmitted is very important, we generally use TCP for transmission, because the data transmitted by the TCP protocol is transmitted in sequence. If the data receiver does not receive the data transmitted by the sender, TCP will resend the packet after a specific time. This is what we often call the packet loss retransmission mechanism, as well as congestion control, flow control, etc. The reliability of TCP is precisely because of these characteristics.
UDP (User Datagram Protocol) is a connectionless service. UDP data will not be transmitted in order like TCP. The receiver will not retransmit the data regardless of whether it has been received or not. Therefore, UDP has lower performance than TCP. Delay. UDP is more commonly used in applications where time priority is higher than data reliability, such as video calls and online games that are commonly used. Because for these applications, time is more important than data consistency.
What is a network port? What does the port do?
There are many communication programs on our computers. After our computers receive data packets, how do they accurately distribute the data packets to different applications? We can understand it this way, the IP address in the network is equivalent to the community name in our real life, and the port number is like the specific house number.
The role of the port is to allow various application processes in the application layer to deliver their data downward to the transport layer through the port, and to let the transport layer know that the data in its message segments should be delivered upward to the application layer process through the port. In order to distinguish the ports, each port is numbered, which is the port number. When we send data from one device to another, it goes to a specific TCP or UDP port, depending on the protocol we use to communicate.
0コメント