What is the "connection" in TCP-oriented connection, reliable and unreliable

Source: Internet
Author: User
Tags ack

Some of the answers collected online:


The connection was maintained on state, and I understood so

is actually maintaining a variable on both the client and server side, this variable maintains the current state of data transmission, such as what is being transmitted, what data is to be transmitted next, and so on, and so on, it's not really what we think is really connected to both ends, because there's a network cable for either connection or no connection. (excluding wireless networks), so the connection is not really something to connect them, the real meaning is what I said above, both sides maintain a state variable.


UDP traffic has four parameters: source IP, source port, destination IP, and destination port. TCP traffic has at least six parameters: source IP, source port, destination IP and destination port, and serial number and answer number.
Serial number and answer number are the specific parameters of TCP communication, TCP communication uses serial number and answer number to maintain and confirm the correlation and correctness of data, is determined in three times handshake, incorrect serial number and answer number will cause not normal communication. Therefore, the connection concept of TCP connection can be easily understood as compared with UDP communication, the serial number and answer number are used to determine the connection characteristics between each other to ensure the correctness of data transmission.

TCP is reliable, connection-oriented and UDP is not reliable, non-connection-oriented, UDP header length far less than the TCP header length. TCP uses three basic mechanisms to implement connection-oriented services: 1 uses serial numbers for labeling, so that TCP receive services can correct the sequence of messages before the data is passed to the destination, and 2 TCP uses confirmation, checksum, and timer systems to provide reliability. 3 TCP attaches a header to the application-layer data, and the header includes the serial Number field and other necessary information about these mechanisms, such as the address field called the port number, which identifies the source point and target application of the data.


I remember the book I read as if UDP sent the package is no matter, the other side will not answer whether received. When TCP sends a packet, the other person responds with a complete receipt.
You can take a similar operation to create a TCP connection at the time of the contract, send a message, then give an ACK, and then send a message to send an ACK, so that the success of sending.
Through the simplest retransmission confirmation can achieve the effect of QQ now, simply said that the sender has been sending data until received feedback from the receiver and then stop.





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.