Home > other >  How did - data creation
How did - data creation

Time:10-20

The latest data between client and server are there to send and return to the process of need to create a TCP connection thing;
Because of the concept of the TCP no connection is only the request and response, the request and response are all packets between them have been founded by TCP a initiated from the client, the server receives a similar connection, this connection can be kept, the HTTP request is sent on the basis of this connection;

On a TCP connection is can send multiple HTTP requests, different versions of this model is different,

In the HTTP/1.0 the TCP connection is created in the HTTP request time synchronization, the HTTP request is sent to the server, the server after the response, the TCP connection is closed;
HTTP/1.1 can be declared in a certain way keep the connection, a request to transfer after, another request can then transfer, this advantage is: in the process of creating a TCP connection to the consumption of "three-way handshake", "three-way handshake" three times on behalf of the network transmission,
If a TCP connection to keep, a second request is sent, there is no this "three-way handshake" consumption, HTTP/2 in the same TCP connection can also concurrently in the HTTP request,

Second, TCP packet format description


The more important fields include:

(1) serial number (sequence number) : Seq number, 32 bits, used to identify from the TCP source end sends a stream of bytes to the destination end sponsors when sending data to tag,

(2) the confirmation number (acknowledgement number) : Ack number, 32 bits, only the Ack flag bit to 1, to confirm the serial number field is valid, Ack=Seq + 1,

(3) Flags (Flags) : a total of six, namely URG, ACK, PSH, RST, SYN, FIN, etc., specific meaning is as follows:

URG: emergency pointer (urgent pointer),

ACK: confirm the serial number is valid,

PSH: the recipient should be as soon as possible to the message to the application layer,

RST: reset the connection,

SYN: initiate a new connection,

FIN: release a connection,

  • Related