<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[TCP: 3-Way HandShaking]]></title><description><![CDATA[TCP: 3-Way HandShaking]]></description><link>https://tcp-three-way-handshaking.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 05:44:17 GMT</lastBuildDate><atom:link href="https://tcp-three-way-handshaking.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></title><description><![CDATA[Lets Assume what will happen when we transfer the data over the internet without any rules.
Some data packets would be lost without any directions, data will be tampered and its confused from which source send or receive the data, there will be no co...]]></description><link>https://tcp-three-way-handshaking.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</link><guid isPermaLink="true">https://tcp-three-way-handshaking.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</guid><category><![CDATA[TCP Handshake]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Rakesh Mehta]]></dc:creator><pubDate>Sun, 01 Feb 2026 16:32:55 GMT</pubDate><content:encoded><![CDATA[<p>Lets Assume what will happen when we transfer the data over the internet without any rules.</p>
<p>Some data packets would be lost without any directions, data will be tampered and its confused from which source send or receive the data, there will be no confirmation how much data should be received or sent so overall there will be no control on the data for communication between two system, server or client.</p>
<p>To solve these problems some protocols where introduced for transferring the data between the server and client like: TCP and UDP.</p>
<p>TCP are most common and reliable protocol used for controlling the data.</p>
<h2 id="heading-what-is-tcp-and-why-it-is-needed"><strong>What is TCP and why it is needed</strong></h2>
<p>TCP(Transmission Control protocol) is a primary communication protocol or set of rules for transferring the data over the whole internet.</p>
<p>When the sender request for some data from the receiver first the DNS Server mechanism resolve the query for the IP of the root location where the data should be sent.</p>
<p>Once The IP is detected the TCP starts stabling the connection between the receiver and sender. The TCP Protocol provides the:</p>
<ol>
<li><p>More reliable</p>
</li>
<li><p>Order will be maintained means the data transfer as it is.</p>
</li>
<li><p>No data packets will be lost if its detected retransmission will start if needed.</p>
</li>
</ol>
<h2 id="heading-what-is-the-tcp-3-way-handshake"><strong>What is the TCP 3-Way Handshake</strong></h2>
<p>Before sharing any data the sender and receiver did the three way handshaking between them.</p>
<p><strong>The three ways are SYN, SYN-ACK, and ACK</strong></p>
<p><strong>SYN →</strong> it is known as synchronization. In this step first The sender and receiver made the connection by initializing the request from the sender to the receiver end.</p>
<p><strong>SYN-ACK → it</strong> is known as synchronization and Acknowledgment. when in first step the connection requests to other end the receiver acknowledge the connection(sync) request.</p>
<p><strong>ACK →</strong> it is known as Acknowledgement and this is the third and last step of handshaking where at last sender acknowledged that communication message.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769866820965/c55278c7-768f-4f88-8596-6db73895b2cb.png" alt /></p>
<h2 id="heading-how-data-transfer-works-in-tcp"><strong>How data transfer works in TCP</strong></h2>
<p>Before sending the data the TCP model first break the data packets into small parts called segments. Each segments carry some additional info such as sequence numbers and control detail that helps in transfer properly and correctly.</p>
<p>When the data packets are sent to the receiver the receiver scents the acknowledgment to the sender for successful delivery. If sender does not get the acknowledgment within some time it assumes that data were lost and retransmit the data.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769867428446/8aabd92c-a431-4500-8229-464cd6f709c4.png" alt /></p>
<h2 id="heading-how-tcp-ensures-reliability-order-and-correctness"><strong>How TCP ensures reliability, order, and correctness</strong></h2>
<p>Using the above, TCP ensures that data is transferred reliably, in the correct order, and without loss.</p>
<h2 id="heading-how-a-tcp-connection-is-closed"><strong>How a TCP connection is closed</strong></h2>
<p>Similarly before the data transfer three way handshaking are working before closing the communication 4-way handshake will complete. four ways are : FIN, ACK, FIN, ACK.</p>
<p><strong>FIN →</strong> At first step the sender sent final signal to the receiver for closing the connection.</p>
<p><strong>ACK →</strong> Second step the receiver acknowledge that request from the sender.</p>
<p><strong>FIN →</strong> Third step again receiver sent the final FIN from his own end for closing the connection</p>
<p><strong>ACK →</strong> and at the end sender acknowledge that response from the receiver.</p>
]]></content:encoded></item></channel></rss>