TCP/IP HTTP socket notes

Source: Internet
Author: User
Tags ack

1, TCP/IP protocol is the Transport Layer protocol, the main solution to the data in the network transmission

HTTP is an application-layer protocol that primarily addresses how data is packaged

2. Three handshake for TCP connection

First handshake: The client sends the SYN packet to the server and enters the Syn_send state, waiting for the server to confirm

Second handshake: The server receives the SYN packet, must confirm the customer's SYN, and also sends a SYN packet, namely the Syn+ack packet, when the server enters the SYN_RECV state

Third handshake: The client receives the server's Syn+ack packet, sends the acknowledgment packet ack to the server, the packet is sent, the client and server enter the established state, and the three handshake is completed.

The data is not included in the packet that is delivered during the handshake, and the client and server formally begin transmitting the data after the three handshake is complete.

Ideally, once a TCP connection is established, the TCP connection is maintained until either side of the communication actively closes the connection. Both the server and the client can initiate a request to disconnect the TCP connection when the connection is disconnected, and the disconnect process requires a "four-time" handshake

3. The difference between TCP and UDP

1, TCP is connection-oriented, although the security of the network instability determines how many times the handshake can not guarantee the reliability of the connection, but the TCP three-time handshake at a minimum to ensure the reliability of the connection

And UDP is not connection-oriented, UDP transmission data before the connection with the other, the docking received data does not send a confirmation signal, the sender does not know whether it will be received correctly, of course, there is no need to resend so that UDP is a non-connected, unreliable transmission protocol

2, due to the characteristics of 1, so that the cost of UDP smaller data transfer rate is higher, because the initial data is not necessary to confirm, so the real-time UDP is better

TCP/IP HTTP socket notes

Related Article

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.