<?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]]></title><description><![CDATA[tcp working]]></description><link>https://tcp-working.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 15:19:10 GMT</lastBuildDate><atom:link href="https://tcp-working.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Understanding TCP: Explaining the 3-Way Handshake and Reliable Communication]]></title><description><![CDATA[1. What is TCP and why it is needed
tcp stands for transmission control protocol ,its use to transer data one end to other end ,
its working on set of rules ,tcp working as bridge between software like our chrome,
or any application to connect lower ...]]></description><link>https://tcp-working.hashnode.dev/understanding-tcp-explaining-the-3-way-handshake-and-reliable-communication</link><guid isPermaLink="true">https://tcp-working.hashnode.dev/understanding-tcp-explaining-the-3-way-handshake-and-reliable-communication</guid><category><![CDATA[SYN SYN-ACK ACK]]></category><category><![CDATA[Reliable Data Transfer]]></category><category><![CDATA[Acknowledgment (ACK)]]></category><category><![CDATA[TCP Connection Termination]]></category><category><![CDATA[CN Exam Preparation]]></category><category><![CDATA[TCP]]></category><category><![CDATA[transmission control protocol]]></category><category><![CDATA[computer networks]]></category><category><![CDATA[networkingbasics]]></category><category><![CDATA[tcp-3-way-handshake]]></category><category><![CDATA[flow-control]]></category><category><![CDATA[Congestion Control in TCP 🚦]]></category><category><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></category><category><![CDATA[networking for beginners]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[NITESH SHEDGE]]></dc:creator><pubDate>Sun, 25 Jan 2026 19:11:20 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-1-what-is-tcp-and-why-it-is-needed"><mark>1. What is TCP and why it is needed</mark></h2>
<p>tcp stands for transmission control protocol ,its use to transer data one end to other end ,</p>
<p>its working on set of rules ,tcp working as bridge between software like our chrome,</p>
<p>or any application to connect lower network.</p>
<h2 id="heading-2-problems-tcp-is-designed-to-solve"><mark>2. Problems TCP is designed to solve</mark></h2>
<p>suppose there we not used tcp to sending data, so there are many problems occures such as:</p>
<p>1. packates missing</p>
<p>2.change data ordering</p>
<p>3. less reliable</p>
<p>4.no reverse chaking whether all data recived or not</p>
<p>this some problems solved by tcp protocol. its gives us benifites such as :</p>
<ol>
<li><p>reverse chaking all data packets recieved</p>
</li>
<li><p>more relaible</p>
</li>
<li><p>maintaing ordering the data</p>
</li>
<li><p>etc</p>
</li>
</ol>
<h2 id="heading-3-tcp-3-way-handshake">3. TCP 3-Way Handshake</h2>
<p>for the initialize the connection between server and client need to handshak both the praties ,</p>
<p>both parties should have permited and acknoledge the connction for communication.</p>
<h2 id="heading-4-step-by-step-working-of-syn-syn-ack-and-ack"><mark>4. Step-by-step working of SYN, SYN-ACK, and ACK</mark></h2>
<p><mark>step 1:</mark></p>
<p>first client send sync flag request to server and</p>
<p>segment number(eg.1001) for establishing connection.</p>
<p>example , assume you want to connect some random girl the first step to identifying the name or sending</p>
<p>message to her.</p>
<p><mark>step2 :</mark></p>
<p>then server if its accepts then responding flag sync-ack and</p>
<p>segment no(eg.2000) means server to be ready to connection.</p>
<p>exmaple: after message part she will sync means see the message and acknolegde with replie</p>
<p><mark>step3:</mark></p>
<p>then cilent sends acknolege flag ,syn-ask server sends and</p>
<p>set the acknolege sengment number (eg.2001) this means now you ready to communicates.</p>
<p>exmple: then you sends message then she replies this is how u established communication</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768934034497/08af67e4-3a9b-4fb5-a1ac-0e528ee2d0e9.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-5-how-data-transfer-works-in-tcp"><mark>5. How data transfer works in TCP'</mark></h2>
<p>in tcp there is 3 way handshake happend when client intiate reqest server ,firstly client sent sync req,after</p>
<p>server requested sync+ack req after last client sent ack request so here connection established.</p>
<p>after data bracking into segments, tcp does not share info in single block ot always make segment or small data packets ,each segment wrap into tcp headers.</p>
<p>the header contains sequence Number,this ensure the data packet go in safly order in reciver end.</p>
<h3 id="heading-6how-tcp-ensures-reliability-order-and-correctness"><mark>6.How TCP ensures reliability, order, and correctness</mark></h3>
<p>tcp actually build for giving this three piller:</p>
<ol>
<li><mark>reliability</mark></li>
</ol>
<p>TCP ensures reliability by guaranteeing that all transmitted data reaches the receiver correctly.</p>
<ul>
<li><p><strong>Acknowledgments (ACKs):</strong><br />  Every segment sent by the sender must be acknowledged by the receiver. If an acknowledgment is not received within a specific time, the sender retransmits the data.</p>
</li>
<li><p><strong>Retransmission Mechanism:</strong><br />  Lost or corrupted segments are retransmitted using <strong>timeout</strong> and <strong>duplicate ACK detection</strong>.</p>
</li>
<li><p><strong>Sequence Numbers:</strong><br />  Each byte of data is assigned a sequence number, allowing TCP to detect missing data.</p>
</li>
</ul>
<ol start="2">
<li><mark>order</mark></li>
</ol>
<p>TCP ensures that data is delivered to the application in the <strong>same order</strong> in which it was sent.</p>
<ul>
<li><p><strong>Sequence Numbers in TCP Header:</strong><br />  Sequence numbers help the receiver arrange received segments in the correct order.</p>
</li>
<li><p><strong>Reordering at Receiver Side:</strong><br />  If segments arrive out of order, TCP temporarily stores them and rearranges them before delivering to the application.</p>
</li>
</ul>
<ol start="3">
<li><mark>correctness</mark></li>
</ol>
<p>TCP ensures correctness by detecting and handling errors during transmission.</p>
<ul>
<li><p><strong>Checksum:</strong><br />  Each TCP segment contains a checksum that verifies the integrity of the data. If the checksum fails, the segment is discarded.</p>
</li>
<li><p><strong>Error Detection and Recovery:</strong><br />  Corrupted segments are detected and retransmitted to ensure correct data delivery.</p>
</li>
</ul>
<h3 id="heading-7-how-a-tcp-connection-is-closed"><mark>7. How a TCP connection is closed</mark></h3>
<p>tcp use four way handshak technique to ensure that <strong>all data is delivered</strong> before the connection is closed.</p>
<p><mark>Step 1: FIN</mark></p>
<p>client or server send FIN sengment to other side.</p>
<p><mark>Step 2: ACK</mark></p>
<p>receiving side sends an <strong>ACK</strong> to confirm the FIN.</p>
<p><mark>Step 3: FIN</mark> → other side fin</p>
<p>When the second side finishes sending its data, it sends its own <strong>FIN</strong>.</p>
<p><mark>Step 4: Final ACK</mark></p>
<p>The first side sends an <strong>ACK</strong> for the second FIN.</p>
<p>Now this connection is fully closed.</p>
]]></content:encoded></item></channel></rss>