There are six ‘control bits’ defined in TCP, one or more of which is defined in each packet. The control bits are ‘SYN’, ‘ACK’, ‘PSH’, ‘URG’, ‘RST’, and ‘FIN’. TCP uses these bits to define the purpose and contents of a packet.
SYN bit is used in establishing a TCP connection to synchronize the sequence numbers between both endpoints.
ACK bit is used to acknowledge the remote host’s sequence numbers, declaring that the information in the acknowledgment field is valid.
PSH flag is set on the sending side, and tells the TCP stack to flush all buffers and send any outstanding data up to and including the data that had the PSH flag set. When the receiving TCP sees the PSH flag, it too must flush its buffers and pass the information up to the application.
URG bit indicates that the urgent pointer field has a valid pointer to data that should be treated urgently and be transmitted before non-urgent data.
RST bit tells the receiving TCP stack to immediately abort the connection.
FINbit is used to indicate that the client will send no more data (but will continue to listen for data).