TCP Header
TCP is a protocol supported by the transport layer in the TCP/IP protocol stack, and TCP has its own header information.
The TCP header information is shown in the following table:
TCP is a connection-oriented, reliable transport protocol. This reliable transmission function is achieved by 32-bit serial number and 32-bit acknowledgment sequence number. the flag bit of the TCP header
There are six flag bits in the TCP header: Urg/ack/psh/rst/syn/fin.
Syn
In TCP three handshake, if a is the initiator, a sends a SYN message to the server. Indicates that a connection was established.
Ack
Send an ACK message when the data or request is received and the response is sent.
Rst
Indicates a connection reset
FIN
TCP four times when waving, means to close the connection
PSH
The sender needs to send a piece of data that needs to be delivered to the receiving end as soon as it is received. The receiving end delivers the data to the application layer quickly when it receives the data of the PSH flag position. So PSH is also called urgent bit.
But there is no need to deliver the data to the application tier now, as these effects can already be handled on the TCP stack itself.
URG
Urg becomes an emergency pointer, meaning that the Urg is a valid packet, it is an urgent need to deal with the packet, the receiver needs to be processed quickly after receiving. the difference between PSH and Urg
Said so much, is not found PSH and Urg effect similar, but the smart computer network creator will put two of the same logo bit together. Obviously not, so what is the difference between PSH and Urg.
First, the similarity between PSH and Urg is that both packets are packets that need to be processed by the receiving end.
The difference is that when the PSH bit is valid, the current data is also sent to the receiver's buffer, and the buffer is flushed to deliver all the data in the current buffer to the previous layer-the application tier. The
PSH bit is used to notify the receiving Party to submit the received message immediately together with the data in the TCP receive cache to the application process processing, generally appear in the sender encapsulates the last application field in the TCP message, for the TCP interactive application, so long as the encapsulation has the Application field TCP message, will be PSH position 1. Of course, the application developer, as needed, in an application function module or an application operation, all encapsulate the Application field TCP message PSH position 1, in order to improve the processing efficiency of both parties, which theoretically should be feasible. The
Urg-bit valid packets are also processed immediately at the receiving end of the current message, but the current message does not need to pass through the buffer at the receiving end, bypassing the buffer directly and delivering it to the application layer at the receiving end.