<?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 Working: 3-Way Handshake]]></title><description><![CDATA[TCP Working: 3-Way Handshake]]></description><link>https://tcpworking3wayhandshakebyyashveer.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Nov 2026 12:40:17 GMT</lastBuildDate><atom:link href="https://tcpworking3wayhandshakebyyashveer.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[What we are studying in this article : What is TCP and why it is needed Problems TCP is designed to solve What is the TCP 3-Way Handshake Step-by-step…]]></description><link>https://tcpworking3wayhandshakebyyashveer.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</link><guid isPermaLink="true">https://tcpworking3wayhandshakebyyashveer.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</guid><category><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Yashveer]]></dc:creator><pubDate>Thu, 29 Jan 2026 14:05:38 GMT</pubDate><content:encoded><![CDATA[<p>What we are studying in this article :</p>
<ol>
<li><p>What is TCP and why it is needed</p>
</li>
<li><p>Problems TCP is designed to solve</p>
</li>
<li><p>What is the TCP 3-Way Handshake</p>
</li>
<li><p>Step-by-step working of SYN, SYN-ACK, and ACK</p>
</li>
<li><p>How data transfer works in TCP</p>
</li>
<li><p>How TCP ensures reliability, order, and correctness</p>
</li>
<li><p>How a TCP connection is closed</p>
</li>
</ol>
<h2 id="heading-1-what-is-tcp-and-why-it-is-needed">1. What is TCP and why it is needed</h2>
<p>TCP (Transmission Control Protocol) is a transport-layer protocol that provides reliable communication between applications over a network.</p>
<h3 id="heading-why-tcp-is-needed">Why TCP is needed</h3>
<p>The Internet (IP layer) is unreliable:</p>
<ul>
<li><p>Packets can be lost</p>
</li>
<li><p>Packets can arrive out of order</p>
</li>
<li><p>Packets can be duplicated</p>
</li>
<li><p>No guarantee packets reach the destination</p>
</li>
</ul>
<p>TCP fixes these problems, so applications don’t have to.</p>
<hr />
<h2 id="heading-2-problems-tcp-is-designed-to-solve">2. Problems TCP is designed to solve</h2>
<p>TCP solves the following problems:</p>
<ul>
<li><p>Packet loss → Retransmission</p>
</li>
<li><p>Out-of-order delivery → Sequencing</p>
</li>
<li><p>Duplicate packets → Duplicate detection</p>
</li>
<li><p>Network congestion → Flow &amp; congestion control</p>
</li>
<li><p>Unknown delivery status → Acknowledgments</p>
</li>
</ul>
<hr />
<h2 id="heading-3-what-is-the-tcp-3-way-handshake">3. What is the TCP 3-Way Handshake</h2>
<p>The 3-Way Handshake is how TCP:</p>
<ul>
<li><p>Establishes a connection</p>
</li>
<li><p>Synchronizes sequence numbers</p>
</li>
<li><p>Confirms both sides are ready</p>
</li>
</ul>
<h3 id="heading-why-3-steps">Why 3 steps?</h3>
<p>To ensure both sender and receiver agree to communicate and know each other’s initial sequence numbers.</p>
<h3 id="heading-4-step-by-step-working-of-syn-syn-ack-and-ack"><strong>4. Step-by-step working of SYN, SYN-ACK, and ACK</strong></h3>
<p>Step 1: SYN</p>
<ul>
<li><p>Client sends SYN</p>
</li>
<li><p>Says: “I want to connect”</p>
</li>
<li><p>Includes initial sequence number (x)</p>
</li>
</ul>
<p>Step 2: SYN-ACK</p>
<ul>
<li><p>Server responds with SYN + ACK</p>
</li>
<li><p>Says: “I accept + here’s my sequence number (y)”</p>
</li>
<li><p>Acknowledges client’s SYN (x+1)</p>
</li>
</ul>
<p>Step 3: ACK</p>
<ul>
<li><p>Client sends ACK</p>
</li>
<li><p>Acknowledges server’s SYN (y+1)</p>
</li>
</ul>
<h3 id="heading-5-how-data-transfer-works-in-tcp"><strong>5.</strong> How data transfer works in TCP</h3>
<ul>
<li><p>Data is split into segments</p>
</li>
<li><p>Each segment has a sequence number</p>
</li>
<li><p>Receiver sends ACKs for received data</p>
</li>
</ul>
<h3 id="heading-6-how-tcp-ensures-reliability-order-and-correctness"><strong>6.</strong> How TCP ensures reliability, order, and correctness</h3>
<p>Reliability</p>
<p>Ordered delivery</p>
<p>Correctness</p>
<p>Flow control</p>
<p>Congestion control</p>
<h3 id="heading-7-how-a-tcp-connection-is-closed"><strong>7.</strong> How a TCP connection is closed</h3>
<p>Step-by-step:</p>
<ol>
<li><p>One side sends FIN (no more data)</p>
</li>
<li><p>Other side sends ACK</p>
</li>
<li><p>Other side sends its own FIN</p>
</li>
<li><p>First side sends ACK</p>
</li>
</ol>
<p>Both sides agree to close</p>
]]></content:encoded></item></channel></rss>