Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the network protocols TCP and UDP

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to understand TCP and UDP network protocols". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian to study and learn "how to understand TCP and UDP network protocols" together.

The International Organization for Standardization (ISO) specifies a system of standards for the interconnection of computer or communication systems, commonly known as the OSI Reference Model or the Seven-Layer Model. The front-end must deal with the network, so there must be network protocols in the front-end knowledge stack.

First of all, UDP and TCP work at the transport layer of the seven-layer model. Then we need to understand the characteristics of these two protocols and use them in appropriate scenarios.

TCP Transmission Control Protocol connection-oriented

Before TCP transmits data, it establishes a connection, which is called connection-oriented. Transmission of data by establishing a connection is to ensure the integrity and consistency of data, so it is called a reliable transmission protocol. TCP handshake operations are required to establish and disconnect connections.

TCP establishes connections in a way called a three-way handshake.

The first handshake. The client sends a connection request message segment to the server.

A second handshake. After receiving the connection request message segment, the server sends a response after agreeing.

Third handshake. When the client receives the connection approval response, it sends an acknowledgement message to the server and enters the connection success state at the same time. After receiving the message, the server also enters the connection success state. At this point, the connection is complete and data transmission begins.

TCP disconnects in a way called four waves.

The first wave. The client sends a connection release request to the server.

Waving a second time. The server receives the release request and sends an acknowledgement packet, and enters the waiting shutdown state at the same time. At this point the server no longer accepts data, but can still send data.

Waving a third time. After sending the data, the server sends a connection release request to the client. Then the server enters the final confirmation phase.

Fourth wave. After receiving the release request, the client sends an acknowledgement to the server and enters a waiting state. The state lasts for 2MSL (maximum message lifetime). If there is no retransmission request received from the server, the server enters the closed state. After receiving the acknowledgement, the server also enters the closed state.

Dual-mode communication means that both sides of communication can send data at the same time.

Traffic control refers to the use of some method to control the speed of data transmission at the transceiver end, so as to maintain the balance of network data transmission. TCP uses variable volume sliding windows to control flow.

Network congestion occurs when the demand for a resource exceeds the supply of that resource at some point in time. TCP congestion control includes four algorithms: slow start, congestion avoidance, fast retransmission, fast recovery.

Flow control and congestion control work similarly, but on different principles. Traffic control is to solve the problem of data loss caused by the different speeds of the sender and receiver; congestion control is to prevent excessive data injection into the network, resulting in network collapse.

UDP User Datagram Protocol

Features of UDP transmission:

UDP is a connectionless, maximum possible delivery transport protocol

Support one-to-one, one-to-many, many-to-one, many-to-many transmission modes

UDP is connectionless and does not need to establish a connection before transmitting data, and UDP only serves the transport of data packets, does not guarantee the orderly and complete delivery of data to the destination, and does not have mechanisms such as traffic control and congestion control.

UDP seems to have many disadvantages compared to TCP, but in fact UDP is very efficient because it does not have those complicated things, and it uses very few resources.

Protocol Comparison

Use a diagram to clearly compare the two protocols:

TCP and UDP are like one-on-one tutoring and classroom instruction (/doge).

TCP ensures that what the teacher says can be remembered by the students, and ensures a certain environment when lecturing. The content of the teacher should be within the acceptance range of the students. It does not require progress, but requires the students to learn what they say.

UDP is like, no matter whether the teacher understands or not, how much should be said in a lesson, the progress can not fall behind, so the progress is very fast.

Because UDP is very time-sensitive, it can be used in video telephony, live broadcasting and other scenarios; TCP has higher requirements for data integrity, so it is often used for file transmission.

Thank you for reading, the above is "network protocols TCP and UDP how to understand" the content, after the study of this article, I believe we have a deeper understanding of how to understand the network protocols TCP and UDP this problem, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report