<?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 Handshake & Reliable]]></title><description><![CDATA[TCP: 3-Way Handshake & Reliable]]></description><link>https://tcp-3-way-handshake-and-reliable.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 05:15:11 GMT</lastBuildDate><atom:link href="https://tcp-3-way-handshake-and-reliable.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[TCP Made Simple: Reliable Communication Explained]]></title><description><![CDATA[Understanding TCP: Reliable Communication Made Simple
Imagine you are sending a letter to a friend. Now, what happens if you just throw your letter in the air and hope it reaches them? Sometimes it may reach, sometimes it may get lost, and sometimes ...]]></description><link>https://tcp-3-way-handshake-and-reliable.hashnode.dev/tcp-made-simple-reliable-communication-explained</link><guid isPermaLink="true">https://tcp-3-way-handshake-and-reliable.hashnode.dev/tcp-made-simple-reliable-communication-explained</guid><category><![CDATA[#TCPProtocol #TCP3WayHandshake #ReliableDataTransfer #NetworkingTutorial #LearnTCP #ComputerNetworkingBasics #PacketLoss #TCPConnection #DataReliability #TCPForBeginners]]></category><dc:creator><![CDATA[Aqleem orakzai]]></dc:creator><pubDate>Sun, 01 Feb 2026 12:48:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769949910330/b9edb1e1-1315-4460-bf7f-b427a2d9c509.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-understanding-tcp-reliable-communication-made-simple">Understanding TCP: Reliable Communication Made Simple</h1>
<p>Imagine you are sending a letter to a friend. Now, what happens if you just throw your letter in the air and hope it reaches them? Sometimes it may reach, sometimes it may get lost, and sometimes your friend may get it in the wrong order.</p>
<p>This is exactly what happens in computer networks when data is sent <strong>without rules</strong>. That’s where <strong>TCP (Transmission Control Protocol)</strong> comes in it makes sure your data reaches safely, in order, and correctly.</p>
<hr />
<h2 id="heading-why-tcp-is-needed">Why TCP is Needed</h2>
<p>TCP solves many problems in networking:</p>
<ul>
<li><p><strong>Data loss:</strong> Sometimes packets get lost in the network. TCP can detect this and resend them.</p>
</li>
<li><p><strong>Out-of-order delivery:</strong> Packets may arrive in the wrong sequence. TCP rearranges them correctly.</p>
</li>
<li><p><strong>Reliability:</strong> Ensures that the data you send is the data your friend receives, without errors.</p>
</li>
</ul>
<p>In short, TCP <strong>ensures reliable communication</strong> between two computers.</p>
<hr />
<h2 id="heading-the-tcp-3-way-handshake">The TCP 3-Way Handshake</h2>
<p>Before sending data, TCP makes a connection using a <strong>3-way handshake</strong>. Think of it like a small conversation between client and server:</p>
<ol>
<li><p><strong>SYN (Client → Server):</strong> “Hello server, can we talk?”</p>
</li>
<li><p><strong>SYN-ACK (Server → Client):</strong> “Hello client, yes we can talk, I am ready.”</p>
</li>
<li><p><strong>ACK (Client → Server):</strong> “Great, let’s start talking.”</p>
</li>
</ol>
<p>After this handshake, the communication channel is ready, just like two friends agreeing to chat on the phone.</p>
<hr />
<h2 id="heading-step-by-step-tcp-connection">Step-by-Step TCP Connection</h2>
<ol>
<li><p><strong>Client sends SYN:</strong> Client chooses a random number (called <strong>sequence number</strong>) and asks to connect.</p>
</li>
<li><p><strong>Server responds with SYN-ACK:</strong> Server acknowledges the client’s number and sends its own sequence number.</p>
</li>
<li><p><strong>Client sends ACK:</strong> Client acknowledges the server’s sequence number.</p>
</li>
</ol>
<p><strong>Now the connection is established</strong>, and data transfer can begin.</p>
<hr />
<h2 id="heading-how-data-transfer-works">How Data Transfer Works</h2>
<p>Once connected, TCP transfers data in small packets. Each packet has:</p>
<ul>
<li><p><strong>Sequence numbers:</strong> To keep packets in order</p>
</li>
<li><p><strong>Acknowledgements (ACK):</strong> To confirm the packet reached safely</p>
</li>
</ul>
<p>If a packet is <strong>lost</strong>, TCP detects it and <strong>retransmits</strong>. This ensures reliability.</p>
<hr />
<h2 id="heading-how-tcp-ensures-reliability">How TCP Ensures Reliability</h2>
<ul>
<li><p><strong>Acknowledgements:</strong> Every packet is confirmed by the receiver</p>
</li>
<li><p><strong>Sequence numbers:</strong> Packets are rearranged in the correct order</p>
</li>
<li><p><strong>Retransmission:</strong> Lost packets are resent automatically</p>
</li>
<li><p><strong>Error detection:</strong> Checksums ensure data is correct</p>
</li>
</ul>
<hr />
<h2 id="heading-closing-a-tcp-connection">Closing a TCP Connection</h2>
<p>When the chat is over, the connection is closed using <strong>FIN and ACK messages</strong>:</p>
<ol>
<li><p><strong>Client sends FIN:</strong> “I am done, closing connection.”</p>
</li>
<li><p><strong>Server sends ACK + FIN:</strong> “Okay, closing from my side too.”</p>
</li>
<li><p><strong>Client sends ACK:</strong> “Bye, connection closed.”</p>
</li>
</ol>
<p>And just like that, the connection is safely terminated.</p>
<hr />
<h2 id="heading-diagrams-optional">Diagrams (Optional)</h2>
<ul>
<li><p><strong>TCP 3-way handshake:</strong> Client ↔ Server</p>
</li>
<li><p><strong>Data transfer:</strong> Showing sequence numbers and ACKs</p>
</li>
<li><p><strong>Packet loss and retransmission flow</strong></p>
</li>
<li><p><strong>Connection lifecycle:</strong> Establish → Transfer → Close</p>
</li>
</ul>
<hr />
<h2 id="heading-summary">Summary</h2>
<p>TCP may sound technical, but it is basically a set of <strong>rules</strong> that make sure your data reaches safely, in order, and correctly.</p>
<ul>
<li><p>Without TCP → Data can be lost, jumbled, or incomplete</p>
</li>
<li><p>With TCP → Reliable, orderly, and accurate communication</p>
</li>
</ul>
<p>In short, TCP is the <strong>friend who makes sure your letters reach on time and in the right order</strong>.</p>
]]></content:encoded></item></channel></rss>