tcp and http transmission efficiency popular explanation

You can go to look at notes before I do: https: //www.cnblogs.com/xtxt1127/p/12341530.html

Today do not know the original project http protocol change tcp protocol What is the difference, would not be a little higher efficiency http wow,

So I Baidu a bit "high tcp and http which transport efficiency," this issue and found that the problem is really a problem issue, absurd. .

1. Two different levels of agreement can not be compared.

  HTTP is an application layer protocol, TCP is the transport layer protocol, IP is a network layer protocol, it is not comparable in nature.

2. Moreover, the HTTP protocol is based on TCP connections.

  This comparison is like to compare people on the aircraft speed and speed of the aircraft as fast. People on the plane, by the speed of the aircraft impact, HTTP like people, TCP is like an aircraft.

  People on the plane ran, the man faster than airplanes. Haha, joking

3. Others say

   Bureau network tcp / ip fast, wide network http fast. (I do not know right or wrong)

 

Popular to say,

TCP / IP protocol is the porter , moving to ensure that things are not damaged  

Ensure the reliability of the connection, I do not care anything sent to you, there must be a set of protocols to ensure that no loss
such as TCP protocol is such that no matter what data the upper let him pass, he is through with the IP protocol, these things segments, and delivery, while ensuring in the process, the data will not be lost, if a lost one, he had to find a way to pass once again.


http protocol is to do business , to decide whether or not carrying, and how to transport, handling where to go 

http which sets out how we can when visiting a web page caching, and what format of the request. And so on, mainly to allow people time to access web pages faster, safer, and provides a lot of parameters.

 

HTTP and TCP that represent what is it?

HTTP responsibility is to define the data when two computers to transmit information to each other, HTTP specifies each piece of data is the expression can be understood by the computer the other one in what form.

The TCP to be defined is between stable and efficient transfer to computer data should be how transfer.

HTTP core concepts

in addition to HTTP application layer is present in addition, there are five characteristics of the agreement.

1. HTTP standards based on the two computers as different roles: client and server. Client to the server sends different requests (request), and the server responses correspond each request is given (response).

2. HTTP belonging stateless protocol (Stateless). This indicates that there is no correlation between each of the request. In the rules of the protocol server does not record any client operations, each request is independent. (Recording user browsing behavior will be achieved through other techniques)

request 3. The client is defined within the meaning of verbs. The longest is used GET and POST, other verbs also include DELETE, HEAD, and so on.

4. The server response is defined between several status code: 5 indicates the beginning of a server error, the error indicates that the client beginning 4, 3 denotes the beginning of the need for further processing, beginning 2 success, 1 represents the beginning of the processing of the request is accepted while providing the additional information.

5. Whether to respond to the client's request or a server, both sides have a header information (Header). Custom header information, which purpose is to pass additional information (browser information, the content type of the request, the appropriate language).

TCP is the core concept

in the HTTP specification, the interaction of the two computers is considered a transfer request and response. In the actual operation of TCP, the transmission of information will be more complex than a simple transfer request and response. By establishing TCP communications often require multiple exchange of information between computers to complete a request or response.

Core Transport TCP data that the data is divided into several segments and each segment data sequence tag. Sequence of the marker may be received in a different order, and other data back to the full integration. The computer will make corresponding to each segment successfully received data to ensure the integrity of all data.

TCP relies upon transfer of data to achieve the defined several tags (the Flags) communicating the whereabouts of the other position and status of the connection data:

* F.: The FIN - end; end session
* S: SYN - synchronization; indicates the start of a session request
* R : RST - reset; interrupt a connection
* P: pUSH - push; packet sent immediately
* a: ACK - answer
* U: URG - emergency
* E: ECE - explicit congestion alert response
* W: CWR - congestion window reduction

is TCP can achieve three times (three ways handshake) based on these markers and four-way handshake (four ways tear down). Three-way handshake is the initial establishment of mechanisms for connection, and four-way handshake is broken links. Operation is substantially the same, A link is established between the two sent (SYN) or link disconnect request (FIN) A, B recognition (ACK) request is then issued which the same request to the A and A in the acknowledgment awaiting. After the two sides recognized the link was established or disconnected.

There are two questions:

1. Why A request and obtain the approval as well as repeating the same action B?

In the process of establishing a connection in the SYN flag is representative of a random number sequence, since the time when the file is not cut off from the first notification or the file fragment 1 sequence start flag of each segment, so both need to be transmitted SYN 0 What number sequence.

2. Why is the same mechanism, establish the number of links needed to shake hands and break the link different?

Three and four-way handshake difference is that, in establishing the connection, SYN ACK B and A will be sent back together, but when you break a link because after B sends an ACK after other processing needs to be done to return FIN ,, so the two step apart.
----------------
Taken: https: //blog.csdn.net/weixin_40784198/article/details/81434530

 

Guess you like

Origin www.cnblogs.com/xtxt1127/p/12497569.html