What are various steps of connection establishment and connection termination in TCP-connection?

Connection Establishment in TCP:-  

Communicating hosts go through a synchronization process to establish a virtual connection.

This synchronization process ensures that both sides are ready for data transmission and allows the devices to determine the initial sequence numbers.  

Connection establishment and connection termination in TCP-Connection

Sequence numbers are reference numbers between the two devices. The sequence numbers give each host a way to ACK the SYN, so the receiver knows which connection request the sender is responding to.

Sender initiates the process of connection establishment by sending a TCP packet in which SYN flag must be set. Receiver will acknowledge this SYN Packet. After getting the acknowledgement of SYN packet sender will carry on the normal procedure of packet transmission.

Connection Termination:-  At the end of the communication, sender sends last packet with FIN flag as set. It indicates that this is the last packet from sender side. Receiver acknowledges the last packet. After it sender sends a packet with RST flag as set.  RST flag indicates that the earlier connection has been terminated and reset successfully.     


Feel free to contact the admin for any suggestions and help.