<?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 VS UDP]]></title><description><![CDATA[TCP VS UDP]]></description><link>https://devesh9.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 13:30:27 GMT</lastBuildDate><atom:link href="https://devesh9.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How Data Travels on the Internet: TCP, UDP & HTTP]]></title><description><![CDATA[Introduction
Imagine if the internet had no rules.
Data is being sent, but:

Did it reach or not?

Did it arrive in the correct order?

Did it get lost in between?


To make the internet work properly, rules are needed.These rules are defined by TCP ...]]></description><link>https://devesh9.hashnode.dev/how-data-travels-on-the-internet-tcp-udp-and-http</link><guid isPermaLink="true">https://devesh9.hashnode.dev/how-data-travels-on-the-internet-tcp-udp-and-http</guid><category><![CDATA[TCP]]></category><category><![CDATA[UDP]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[devesh gaynar]]></dc:creator><pubDate>Sat, 31 Jan 2026 17:29:35 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Imagine if the internet had <strong>no rules</strong>.</p>
<p>Data is being sent, but:</p>
<ul>
<li><p>Did it reach or not?</p>
</li>
<li><p>Did it arrive in the correct order?</p>
</li>
<li><p>Did it get lost in between?</p>
</li>
</ul>
<p>To make the internet work properly, <strong>rules are needed</strong>.<br />These rules are defined by <strong>TCP and UDP</strong>.</p>
<hr />
<h2 id="heading-what-are-tcp-and-udp">What are TCP and UDP?</h2>
<p>TCP and UDP are <strong>Transport Layer protocols</strong>.</p>
<p>Their main job is:</p>
<p><strong>Send data from one computer to another</strong></p>
<p>But their working style is <strong>completely different</strong>.</p>
<hr />
<h2 id="heading-tcp-safe-and-reliable-courier">TCP – Safe and Reliable Courier</h2>
<p>TCP works like a <strong>trusted courier service</strong>.</p>
<p>TCP features:</p>
<ul>
<li><p>Creates a connection first</p>
</li>
<li><p>Sends data in the correct order</p>
</li>
<li><p>Gets confirmation for every packet</p>
</li>
<li><p>If data is lost, it resends it</p>
</li>
</ul>
<p>Courier example:</p>
<p>“Package delivered or not? Signature required.”</p>
<p>So TCP focuses on <strong>accuracy and reliability</strong>.</p>
<hr />
<h2 id="heading-udp-fast-but-risky-announcement">UDP – Fast but Risky Announcement</h2>
<p>UDP is all about <strong>speed</strong>.</p>
<p>UDP logic:</p>
<ul>
<li><p>No connection</p>
</li>
<li><p>No confirmation</p>
</li>
<li><p>Data is sent once</p>
</li>
<li><p>Very fast delivery</p>
</li>
</ul>
<p>Loudspeaker example:</p>
<p>“If you heard it, good. If you missed it, no problem.”</p>
<p>UDP does <strong>not care</strong> if some data is lost.</p>
<hr />
<h2 id="heading-key-differences-tcp-vs-udp">Key Differences: TCP vs UDP</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Feature</td><td>TCP</td><td>UDP</td></tr>
</thead>
<tbody>
<tr>
<td>Reliability</td><td>High</td><td>Low</td></tr>
<tr>
<td>Speed</td><td>Slower</td><td>Faster</td></tr>
<tr>
<td>Order guarantee</td><td>Yes</td><td>No</td></tr>
<tr>
<td>Connection</td><td>Required</td><td>Not required</td></tr>
<tr>
<td>Data loss handling</td><td>Retransmit</td><td>Ignore</td></tr>
</tbody>
</table>
</div><hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769701107737/f69e2dcb-efd1-4394-9433-897c02daf1d8.jpeg" alt /></p>
<h2 id="heading-when-to-use-tcp">When to Use TCP?</h2>
<p>Use TCP when <strong>data is important</strong>:</p>
<ul>
<li><p>Web browsing</p>
</li>
<li><p>File downloads</p>
</li>
<li><p>Emails</p>
</li>
<li><p>API calls</p>
</li>
<li><p>Login systems</p>
</li>
</ul>
<p><strong>Rule:</strong><br />If data must not be lost → <strong>Use TCP</strong></p>
<hr />
<h2 id="heading-when-to-use-udp">When to Use UDP?</h2>
<p>Use UDP when <strong>speed matters more than perfection</strong>:</p>
<ul>
<li><p>Live video streaming</p>
</li>
<li><p>Online gaming</p>
</li>
<li><p>Voice calls</p>
</li>
<li><p>Video calls</p>
</li>
<li><p>Live broadcasts</p>
</li>
</ul>
<p><strong>Rule:</strong><br />Small data loss is okay, delay is not → <strong>Use UDP</strong></p>
<hr />
<h2 id="heading-real-world-examples">Real-World Examples</h2>
<ul>
<li><p>WhatsApp text messages → <strong>TCP</strong></p>
</li>
<li><p>Online multiplayer games → <strong>UDP</strong></p>
</li>
</ul>
<hr />
<h2 id="heading-what-is-http">What is HTTP?</h2>
<p>HTTP stands for <strong>HyperText Transfer Protocol</strong>.</p>
<p>HTTP:</p>
<ul>
<li><p>Defines how a request should look</p>
</li>
<li><p>Defines the response format</p>
</li>
</ul>
<p>Important point:<br /><strong>HTTP does not send data</strong><br />It only defines <strong>how to talk</strong></p>
<hr />
<h2 id="heading-where-does-http-fit">Where Does HTTP Fit?</h2>
<p>Simple layer view:</p>
<ul>
<li><p><strong>HTTP</strong> → What to say</p>
</li>
<li><p><strong>TCP</strong> → How safely to send</p>
</li>
<li><p><strong>IP</strong> → Where to send</p>
</li>
</ul>
<p>HTTP works <strong>on top of TCP</strong></p>
<hr />
<h2 id="heading-relationship-between-tcp-and-http">Relationship Between TCP and HTTP</h2>
<p>Flow explained simply:</p>
<ol>
<li><p>TCP connection is created</p>
</li>
<li><p>HTTP request is sent using that connection</p>
</li>
<li><p>Server sends HTTP response</p>
</li>
<li><p>TCP makes sure data reaches correctly</p>
</li>
</ol>
<p>HTTP is <strong>not reliable without TCP</strong></p>
<hr />
<h2 id="heading-common-beginner-confusion">Common Beginner Confusion</h2>
<p><strong>Question:</strong> “Is HTTP the same as TCP?”<br /><strong>No</strong></p>
<ul>
<li><p>TCP = Delivery system</p>
</li>
<li><p>HTTP = Message format</p>
</li>
</ul>
<p>Example:</p>
<p>Courier service ≠ Letter content</p>
]]></content:encoded></item></channel></rss>