TCP Connection Termination
each side terminates its end of the connection by sending a special message with the FIN (finish) bit set.This bit serves as a connection termination request to the other device. Both the sides have to finished the shut down procedure to end the connection completely. Thus connection termination is is a pair of two-way handshakes. . the TCP on the device receiving the initial termination request must inform its application process and wait for a signal that the process is ready to proceed.
Connection Establishment
The "Three-Way Handshake" :
This process involves an exchange of messages that transitions both devices from their initial connection state (CLOSED) to the normal operating state (ESTABLISHED). it creates a connection suitable for data exchange:
-Contact and Communication:
The client and server make contact with each other and establish communication by sending each other messages.
-Parameter Exchange:
parameters that control the operation of the TCP connection are exchanged by the two devices.
-Sequence Number Synchronization:
Each device lets the other know what initial sequence number it wants to use for its first transmission.
For more details, visit this link:
http://tcpipguidefree/t_TCPConnectionEstablishmentProcessTheThreeWayHandsh.htm:
http://tcpipguidefree/t_TCPConnectionTermination-2.htm
http://en.wikipediawiki/Transmission_Control_Protocol