Introduction to 1.1 TCP protocol

Source: Internet
Author: User

Bring up the network protocol stack, the most natural is the TCP/IP protocol stack. As one of the core protocols of TCP/IP protocol stack, TCP has already become the preferred tool for network application developers to implement reliable data transmission, HTTP, FTP, Telnet and other protocols are implemented based on TCP. So what kind of protocol does TCP have? What are some of the features that will win the favor of everyone?

TCP (Transmission control Protocol) Transmission Control protocol is a connected, reliable, byte-throttling transport layer (transport Layer) communication protocols, formally presented in 1981 by the IETF RFC 793.
The main function of TCP is to provide reliable, connection-oriented interprocess communication services in the Internet. Its basic function is as follows:
1) Basic data transmission
TCP can transmit a continuous byte stream in each direction (i.e. Full-duplex) between the two sides of the communication, and encapsulate a certain number of bytes into segments and then transmit over the Internet.
2) Reliability
TCP can recover data from corruption, loss, repetition, and chaos.
3) Flow control
TCP can provide data senders with the means to control the amount of data sent.
4) Reuse
Allows multiple processes within one host to use TCP concurrently.
5) connection-oriented
TCP is a connection-oriented protocol that means that both parties must establish a connection before they can transmit data, and the connection must be closed after the data transfer has ended. Providing services in a connection-oriented manner enables TCP to better provide reliable data delivery by saving connection information. This means that TCP cannot support multicast, and multicast can only be done using UDP-type connectionless protocols.

To achieve reliable data transmission, TCP is a good choice. Users do not care about data corruption, loss, duplication, chaos and so on, as long as the data to TCP, and then wait to return the results. Of course, TCP also has a situation that does not apply. For example, using TCP to transmit high real time video or audio data, if the network condition is not good, may cause the video or the audio appears the flower screen or the card phenomenon. But the video audio application to the data integrity requirements is not high, so as to use UDP a kind of connectionless protocol suitable. For the data to be transmitted using TCP or connectionless protocol depends on the actual requirements of the developer in terms of reliability and real-time and other factors to weigh.

For the developers who are determined to use TCP, the next question is how to use it. The main method of using TCP is the UNIX socket API, where parameters can be adjusted using the SYS file system, the proc file system, and the Sysctl kernel parameter setup tool. If the use of TCP compared to driving, API, sys file system, proc file system and sysctl kernel parameter Settings tool, is the car's steering wheel, gear, throttle, etc. the implementation of TCP in the kernel, the equivalent of the car's gear, gearbox, bearings and so on. Understanding the operation mode of the internal parts of the car when the gear is on and on the accelerator is good for driving a car; Similarly, learning how TCP works in the kernel can also benefit. What TCP does after performing a socket API call. How it guarantees the reliable transmission of data. How TCP supports high concurrent I/O. Under the code, no secrets. Let's go to the Linux kernel code to find the answer to the question and start the TCP secret trip together.

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.