Understanding HTTP and TCP protocol

HTTP (Hypertext Transfer Protocol), the most widely used network protocol on the Internet. Www All documents must comply with this standard. HTTP is a client and server request and response standard (TCP); customer initiates a designated port of HTTP request to the server through a browser. Typically, a request initiated by the HTTP client, server to establish a designated port TCP connection. HTTP server that is sent over the port to listen for client requests. Upon receiving a request, the server (the client) sends back a status. The reason HTTP uses TCP instead of UDP is to (open) a page must transfer a lot of data, while TCP protocol provides transmission control, in order to organize data, and error correction.

To ensure reliable TCP packet transmission, give each packet a sequence number, but also ensures that the serial number sent to the receiver sequentially receiving packet entity. Then the receiving side has successfully received byte entity sends back a corresponding acknowledgment (the ACK); If the sender entity does not receive the acknowledgment within a reasonable round-trip time (RTT), then the corresponding data (assuming lost) It will be retransmitted. TCP is the transport layer protocol in the Internet, using a three-way handshake protocol, three-way handshake is completed, the client and server-side TCP connection is successfully established, you can begin transmitting data. Establish a connection requires three-way handshake, and terminate a connection to go through the four-way handshake.  TCP provides a connection-oriented, reliable byte stream service. Connection-oriented means that the two applications using TCP (usually a client and a server) to each other before exchanging packets must first establish a TCP connection. This process is similar to making a phone call, first dial ringing, wait for the other hook to say "Hello" before explained who it was. In a TCP connection, only two parties communicate with each other.

Guess you like

Origin www.cnblogs.com/vole/p/12107833.html