Understanding TCP persistent connection and TCP persistent connection

Source: Internet
Author: User

Understanding TCP persistent connection and TCP persistent connection

I often see the persistent connection concept mentioned in various applications. How can I understand this persistent connection? The so-called persistent connection will usually consume too much resources and time to establish TCP connections and port TCP connections (three handshakes are required for TCP connection establishment and four waves are required for disconnection ), once the connection is established, it is continuously enabled, which saves a lot of resources.

Here, we add that after the connection is established, the client only needs to send data to the server. If the data is sent cyclically, the resources saved by the persistent connection are considerable. In addition, TCP is A reliable connection. After A sends data to B, if B receives the data, it sends A confirmation message to A. Otherwise, A does not receive the data packet returned by B within A certain time range (timeout) will be resend.


What is tcp persistent connection and short connection?

For more information, see
Gowtd.blog.sohu.com/3649038.html

TCP Window

TCP is used everywhere. Understanding the working principles of TCP helps administrators correctly diagnose network communication faults.
The TCP protocol is complex. But don't worry. We didn't ask you to read RFC 793. This is just an initial lecture. In this lecture, we will only introduce the knowledge required for the next lecture on TCP protocol. After learning this article, you will understand some TCP-related terms and the components of the TCP packet header. Then, we will focus on some common TCP problems in the next article, including TCP Window scalability, blocking, and TCP connection mechanism.
We sometimes hear people mention "TCP/IP protocol stack ". This means they are talking about Layer 1 to Layer 4 and Layer 7 issues, where the TCP protocol is located on Layer 4. It represents the Transmission Control Protocol ). Do you still remember the composition of the protocol header in the IP Protocol article? When a packet is encapsulated, the layer-3 certainly has an IP protocol header followed by the TCP protocol header. The TCP header is the "data" in the IP header ". Just as other protocols have their own terms, TCP also has their own special terms, such as Ethernet frames, IP datagram, and current TCP segments. You can treat them as data packets. However, when communication between them, you must use the correct terminology.
TCP is an end-to-end protocol. Using TCP does not have any broadcast or similar concepts. To use the TCP protocol to communicate with another computer, the two machines must be connected like a phone call, and each end is prepared for the call. Stream delivery is another common term for TCP. The meaning of this phrase is that the TCP protocol is mainly used to process data streams and can correctly process unordered data packets. The TCP protocol even allows the loss or damage of data packets. In the end, it can obtain the data packets again. You may hear a programmer talking about the concept of "stream. It refers to the fact that it is hard to tell when data is sent. You can also send unstructured data in a TCP stream. TCP caches data in its own way. However, the cache process is transparent to programmers and users.
Each packet sent by the TCP protocol receives a confirmation message. This transmission/response mode is the only way to provide reliable protocols: You must let the recipient know whether you have received the data. Of course, this will also cause some performance losses, and people need to improve the system efficiency is not high. Therefore, the piggybacking ACKs method is introduced. The reason why the TCP protocol is full-duplex is that this "accept with validation" message allows both parties to send data simultaneously. This is achieved by carrying the confirmation information of the previously received data in the current data packet. From the perspective of improving network utilization, this is much better than simply sending a packet that notifies the other party that the information has been received. Finally, there is also the concept of batch validation: that is, more than one data packet is confirmed at a time, indicating that "I have received all the data packets including this data packet ".
In the IP protocol, a single packet we process is part of a larger datagram. Remember that a TCP segment is a single TCP packet. TCP is a data stream. Therefore, there is no other concept to worry about except for "connection. The maximum message segment length (MSS) is negotiated during connection, but it is constantly changing. The default maximum packet segment length is 536 bytes, Which is 576 bytes (the minimum packet length guaranteed by the IP protocol) the length after the 20 bytes used for the IP header and the 20 bytes used for the TCP header. The TCP protocol should avoid segment at the IP level. Therefore, TCP always starts from 536 bytes.
The most attractive features of TCP are retained. This is the sliding window protocol. This window is actually the total number of "no receipt confirmation" data that has been sent. This window can be enlarged or reduced as needed. This is interesting. In the next lecture, we will introduce this aspect.
The header of a TCP packet is 20 bytes, just like an IP packet. If some options are used, IP addresses and TCP headers can be enlarged. TCP Header ...... remaining full text>
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.