Understanding of TCP stream

Source: Internet
Author: User

TCP streams understand that TCP is a stream protocol. Unlike UDP, when sendto sends a message, the other end will inevitably receive the complete message or no message. When a message is sent using TCP send, the other end may only receive part of the message at a certain time point, and the other part can be received at the next time point. If a message is small, can the other end receive the complete message at a certain time? After sending is called, TCP copies the data to the buffer zone. There may be more than one user message in the buffer. According to a certain algorithm, TCP packs data in the buffer zone into 1-n tcp packets and sends them to the IP layer. The TCP packet is the minimum sending unit of the TCP protocol, and its size should be variable. If it is lost, it will be resending. # It is not guaranteed that a TCP packet must contain all one user message. Therefore, even if the message is small, the other end may only receive some IP addresses at some time to load the TCP packet into the IP packet, then send the Ethernet frame to the link layer. # theoretically, the size of the IP package should be smaller than that of MTU. Once the IP package is larger than MTU, it means that the route on the network will help you cache multiple Ethernet frames, and you will know how to route the packets to the next node after splicing the IP package. The route to the next node must be split into multiple Ethernet frames for sending # The TCP packet should be smaller than the MTU packet.

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.