What is TCP and what is it used for?
What is TCP and what is it used for?
Description of TCP :
The TCP or Transmission Control Protocol is one of the main protocols of the Internet protocol suite. It originated in the initial network implementation in which it complemented the Internet Protocol (IP). Therefore, the entire suite is commonly referred to as TCP/IP. Internet applications such as the World Wide Web, email, remote administration, and file transfer rely on TCP.
TCP Connection Termination :
Source - Wikipedia
Connection establishment :
- SYN: The active open is performed by the client sending a SYN to the server. The client sets the segment's sequence number to a random value A.
- SYN-ACK: In response, the server replies with a SYN-ACK. The acknowledgment number is set to one more than the received sequence number i.e. A+1, and the sequence number that the server chooses for the packet is another random number, B.
- ACK: Finally, the client sends an ACK back to the server. The sequence number is set to the received acknowledgement value i.e. A+1, and the acknowledgement number is set to one more than the received sequence number i.e. B+1.
Now, both the client and server have received an acknowledgment of the connection.