"TCP/IP detailed" Reading notes (chapter 17)-TCP Transmission Control Protocol

Source: Internet
Author: User

1.TCP of services

in a TCP connection, only two parties communicate with each other. TCP provides reliability in the following ways:

1) The application data is segmented into the data block that TCP considers most suitable for sending. This is completely different from UDP, where the application-generated datagram length remains the same. The unit of information that is passed to the IP by TCP is referred to as a message segment or segment.

2) When TCP sends a segment, it initiates a timer, waiting for the destination to acknowledge receipt of the message segment. If a confirmation cannot be received in time, the message segment will be re-sent, which will be discussed in the retransmission strategy in chapter 21.

3) When TCP receives data from the other end of the TCP connection, it sends an acknowledgment. This acknowledgement is not sent immediately, and will be deferred by a fraction of a second, which will be discussed in Chapter 19.

4) TCP will keep its header and data checked and. This is an end-to-end test and is intended to detect any changes in the data file during transmission. TCP discards this segment and does not acknowledge receipt of this segment (expecting the originator to expire and re-send) if the segment and the test and errors are received

5) Since TCP packets are transmitted as IP datagrams, and the arrival of IP datagrams can be out of order, the arrival of TCP packets may also be out of sequence. If necessary, TCP will reorder the received data and hand the received data to the application tier in the correct order.

6) Since the IP datagram will be re-sent, TCP receives the carbonyl must discard the duplicate data.

7) TCP can also provide flow control. Each side of a TCP connection has a fixed-size buffer space. The receiving side of TCP only allows the other end to send the data that the receiving buffer can accept. This prevents faster hosts from causing buffer overruns for slower hosts.

TCP provides a connection-oriented, reliable byte-stream service.


The 2.TCP header

TCP data is encapsulated in an IP datagram: (IP header <20 byte >, TCP Header <20 byte >, TCP Data), such as:


Port number:Identifies the receive and send process
Serial Number:Represents the first data byte in a datagram
Confirm Serial Number:Indicates that the sender expects the next sequence number to be received, so the confirmation sequence should be the last time the data byte sequence number plus 1 has been successfully received.
Header Length:Represents the number of 32Bit in the header, which is required because the length of the optional field is variable. This field accounts for 4bit, so TCP has a maximum of 60 bytes header. But, there is no optional field, the normal length is 20 bytes.
There are 6 flag bits in the TCP header
URG Emergency pointer Valid
ACK Confirmation ordinal valid
PSH receiver to deliver the message to the application layer as soon as possible
RST Reset Connection
SYN initiates a connection
FIN Originator completes sending task
Window Size:The ability to provide traffic control by declaring the window size at each end.
Checksum:Covers the entire TCP packet segment: TCP header and TCP data. This is a mandatory field that must be computed and stored by the originator and validated with the receiving end.

Emergency pointer: the number of the last byte of the emergency data is added for a positive offset, and the ordinal number is summed, only if the URG flag is placed 1 o'clock the emergency pointer is valid. The emergency mode of TCP is a way of sending an emergency data to the other end.

Maximum message Length (MSS): The most common optional fields, each of which indicates this option through the first message segment of the communication (the segment in which the SYN flag is set for establishing the connection). It indicates the maximum length of the message segment that can be received on this side.

author original, reprint please mark the same place: http://blog.csdn.net/xifeijian/article/details/ 44264079

"TCP/IP detailed" Reading notes (chapter 17)-TCP Transmission Control Protocol

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.