What is Transmission Control Protocol (TCP) and How Does It Work?
TCP(Transmission Control Protocol) is a fundamental protocol in internet suite which ensures reliable and ordered data transmission between device. It works by breaking data into packets, adding headers containing information about the sender, receiver and sequence numbers and then transmitting these packets across the internet.
TCP/IP was developed in the 1970s by the U**.S. Department of Defense for ARPANET**, the precursor to the internet. It was adopted as a standard protocol suite in 1983 and has since become the backbone of modern networking.
Properties :
Connection-Oriented protocol - It establishes a virtual connection between the sender and receiver. It ensures that both the parties (client and server) are ready to communicate.
Reliable delivery - Reliability is assured by the following :
Sequencing - Each packet is assigned a sequence number to ensure that packets are reassembled in correct order.
Acknowledgement - The receiver sends acknowledgement packets to the sender to confirm the receipt of data.
Retransmission - If a packet is lost, TCP retransmits it until it is successfully delivered.
Flow Control - TCP regulates the amount of data sent to prevent the receiver from being overwhelmed.
Congestion Control - TCP adjusts the transmission rate to avoid overloading of the internet.
A TCP segment consists of data bytes to be sent and a header that is added to the data by TCP. Headers contain some additional data for proper delivery of data.
3 Way handshake
3 way handshake is a fundamental process which establishes a reliable connection between the two parties. It has 3 steps :
SYN - The sender sends a SYN packet to the receiver, indicating its desire to establish a connection.
SYN-ACK - The receiver responds with a SYN-ACK packet and its willingness to establish a connection.
ACK - The sender sends an ACK packet to the receiver, confirming the connection establishment.
This is how TCP establishes a reliable connection between the client and the server. No let us learn about 4 Way handshake.
4 Way handshake
This process terminates a connection between the sender and the receiver. It has 4 steps :
FIN - The sender sends a FIN packet to the receiver, indicating its desire to close the connection.
ACK - The receiver responds with ACK packet, acknowledging the FIN packet.
FIN - The receiver sends a FIN packet to the sender, indicating its desire to close the connection.
ACK - The sender responds with ACK packet, acknowledging the FIN packet.
This is how a TCP connection is closed between client and the server.
Advantages of TCP -
It is a reliable protocol.
It provides an error-checking mechanism as well as one for recovery.
It gives flow control.
It makes sure that the data reaches the proper destination in the exact order that it was sent.
It is a well-documented and widely implemented protocol, maintained by standards organizations like the IETF (Internet Engineering Task Force).
It works in conjunction with IP (Internet Protocol) to establish connections between devices on a network.
Disadvantages of TCP -
TCP is made for Wide Area Networks, thus its size can become an issue for small networks with low resources.
TCP runs several layers so it can slow down the speed of the network.
It is not generic in nature. Meaning, it cannot represent any protocol stack other than the TCP/IP suite. E.g., it cannot work with a Bluetooth connection.
No modifications since their development around 30 years ago.
Conclusion ๐
TCP (Transmission Control Protocol) is a vital component of internet communication, ensuring that data is transmitted reliably and accurately between devices.