Google News
logo
Site Reliability Engineer (SRE) - Interview Questions
Explain TCP. Also, different TCP connection states.
A TCP connection state is a relationship between a client TCP endpoint and a server TCP endpoint. These states are defined by the TCP three-way handshake process.

The three-way handshake process allows TCP to establish a connection between two endpoints, where one side initiates a connection setup using an SYN packet, while the other side responds with an ACK packet.

Once both sides have sent and received their respective SYN and ACK packets, an established connection is created. After the connection is established, a client can initiate data transfer over this connection by initiating a FIN packet, which will cause the server to send back an ACK packet indicating that all outstanding data has been successfully received and stored in memory. This process of sending and receiving packets works as long as there is no unexpected network congestion or other unforeseen events that cause either side to disconnect.

The different states of a TCP connection are defined as follows :

* LISTEN - The server is listening on a certain port, such as port 80 for HTTP.

* SYNC-SENT - Sent an SYN request and is awaiting a response.

* RECEIVED SYN - (Server) Waiting for an ACK occurs after the server sends an ACK.

* ESTABLISHED - The three-way TCP handshake has been finished.
Advertisement