TCP Life cycle

Anojan Vanniyasingam
3 min readJul 6, 2022

--

Transmission Control Protocol

TCP is an abbreviation for Transmission Control Protocol, a communications standard that allows application programs and computing devices to exchange messages across a network. It sends packets across the internet and ensures the successful transmission of data and messages across networks. TCP is a connection-oriented communications protocol that allows computing devices in a network to exchange messages. It is the most commonly used protocol in Internet Protocol (IP) networks.

Internet Protocol

Internet Protocol (IP) a set of rules that govern how data is transmitted over a public network (Internet). TCP/IP refers to how it works in conjunction with the transmission control protocol (TCP), which divides traffic into packets for efficient transport over the Internet.

TCP 3-way Handshake

3 Way HandShake is a process to establish the connection and sending messages between client and server in a network. Before the actual data communication process begins, both the client and server must exchange synchronization and acknowledgment packets.

As the first step Client tries to connect to the server. It sends a connection packet with SYN and informs the server that the client should begin communication and what its sequence number should be.

Then the server responds to the client request by sending the SYN-ACK signal. ACK allows you to indicate the response of a received segment, and SYN indicates what sequence number it should be able, to begin with, the segments.

When the server receives the SYN packet from the client node, it responds with an ACK packet or SYN/ACK packet. There are two sequence numbers in this packet.

Then in the final stage, the client acknowledges the Server’s response, and they both establish a stable connection before beginning the actual data transfer process.

Here is a simple project in Springboot to test the TCP handshake.

When we start the spring boot project and test the TCP connections on Wireshark , we can clearly see the TCP handshake process which starts with client SYN and end with the FIN packet.

The below interface shows the client-server communication in localhost 127.0.0.1 in the default port.

In below interface, we can see for a single request connection between client and server starts and after the request server and client send the FIN packet and close the connection

--

--