<?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[Suraj Jena]]></title><description><![CDATA[Suraj Jena]]></description><link>https://surajjena.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 04:28:18 GMT</lastBuildDate><atom:link href="https://surajjena.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How DNS Resolution Works]]></title><description><![CDATA[How does the browser actually turn google.com into an IP address? It feels instant. You type a name, hit Enter, and the website loads. But under the hood, an elegant multi-layer lookup system kicks into action.
This post walks through DNS resolution ...]]></description><link>https://surajjena.hashnode.dev/how-dns-resolution-works-1</link><guid isPermaLink="true">https://surajjena.hashnode.dev/how-dns-resolution-works-1</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[dns]]></category><category><![CDATA[#DNS Resolution]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sun, 15 Feb 2026 09:25:09 GMT</pubDate><content:encoded><![CDATA[<p>How does the browser actually turn google.com into an IP address? It feels instant. You type a name, hit Enter, and the website loads. But under the hood, an elegant multi-layer lookup system kicks into action.</p>
<p>This post walks through DNS resolution exactly the way the internet does it, using the <code>dig</code> command to peel back each layer; root, TLD, authoritative until the answer appears.</p>
<h2 id="heading-what-is-dns-and-why-name-resolution-exists"><strong>What Is DNS and Why Name Resolution Exists</strong></h2>
<p>Computers don’t understand names. They understand IP addresses like: 142.250.182.14 We humans, on the other hand, prefer: www.google.com</p>
<p>DNS (Domain Name System) exists to translate between the two. It is the phonebook of the internet.</p>
<p>You ask for a name → DNS gives you a number → Your browser connects to that number</p>
<p>That translation process is called DNS resolution.</p>
<h2 id="heading-enter-dig-seeing-dns-in-action"><strong>Enter</strong> <code>dig</code>: Seeing DNS in Action</h2>
<p><code>dig</code> (Domain Information Groper) is a command-line tool that lets you inspect DNS resolution manually.</p>
<p>It answers questions like:</p>
<ul>
<li><p>Which servers are responsible for a domain?</p>
</li>
<li><p>Where does resolution start?</p>
</li>
<li><p>Who gives the final answer?</p>
</li>
</ul>
<p><code>dig</code> is like an X-ray for DNS lookups. We’ll use it to trace how google.com is resolved.</p>
<hr />
<h2 id="heading-the-dns-resolution-hierarchy"><strong>The DNS Resolution Hierarchy</strong></h2>
<p>DNS works in layers, not as one single database. It uses a distributed, hierarchical network of resolvers, root servers, Top-Level Domain (TLD) servers, and authoritative name servers to quickly map URLs to IPs.</p>
<p>Each layer knows only enough to point you to the next one. That’s the key idea.</p>
<h2 id="heading-sthttpswwwgooglecomsearchqauthoritativenameserverampscaesv918b344881a48eb7amprlz1c1ytuhenin1007in1007ampsxsrfanbl-n4h30bmmcrz1n5f3ia1gwgfmzodlq3a1771167636105ampeiln-ray-obvivsemptmo-yaqampbiw1536ampbih730ampved2ahukewi28mnz5dusaxvgr2wghdaiesqgk4qegyiaqgdeaqampuact5ampoqhowdoesdnsworkampgslpegxnd3mtd2l6lxnlcnaiewhvdybkb2vzigrucyb3b3jrmgsqabiabbikbrirajileaaygaqyiguykqiycxaagiaegiofgjecmguqabiabdifeaaygaqybraagiaemguqabiabdifeaaygaqybraagiaemguqabiabejojlcoaliujhafeagqaqcyaagboagxe6obbdaumjg4aqpiaqd4aqgyahqgaq0uqaiuwginecmygaqyiguy6giyj8icbxajgoocgcfcag0qlhiabbikbrjqahgnwgiweaaygaqyiguyqxjnbhjqahi0atgbacicbbajgcfcahaqlhiabbikbrhdgmcbgnedwgileaaygaqysqmygwhcag4qabiabbikbrixaxidacicbraugiaewgioec4ygaqysqmyxwey0qpcaggqabiabbixa8icexaugiaegiofgemysqmyxwey0qpcagoqabiabbikbrhdwgihecmysqiyj8icbxaagiaegarcagsqlhiabbjharivacicbxaugiaegarcagwqlhiabbgkgasysqpcagkqabiabbgkgavcaheqabiabbgkgasysqmy-qeyrsicdbaagiaegaoycxixa8icdxaugiaegaoycxjharjra8ickxaagiaegaoycxixaxj5arhggjcfgiwfgn0egeyy-qey9amy9qmy9gpyaqhcaggqlhiabbixa8iccxaagiaegiofgledwgikecmygaqyiguyj8icdhaugiaegiofgledgimbwgigeaayfhgemaml8quaqlqulrqt3bogbggbeaeyazihbduumjggb8w0abihbdaumjg4b40uwgcimc42lje3ljpib3kacaeampsclientgws-wiz-serpep-1httpswwwgooglecomsearchqtldserverampscaesv918b344881a48eb7amprlz1c1ytuhenin1007in1007ampsxsrfanbl-n4h30bmmcrz1n5f3ia1gwgfmzodlq3a1771167636105ampeiln-ray-obvivsemptmo-yaqampbiw1536ampbih730ampved2ahukewi28mnz5dusaxvgr2wghdaiesqgk4qegyiaqgdeaiampuact5ampoqhowdoesdnsworkampgslpegxnd3mtd2l6lxnlcnaiewhvdybkb2vzigrucyb3b3jrmgsqabiabbikbrirajileaaygaqyiguykqiycxaagiaegiofgjecmguqabiabdifeaaygaqybraagiaemguqabiabdifeaaygaqybraagiaemguqabiabejojlcoaliujhafeagqaqcyaagboagxe6obbdaumjg4aqpiaqd4aqgyahqgaq0uqaiuwginecmygaqyiguy6giyj8icbxajgoocgcfcag0qlhiabbikbrjqahgnwgiweaaygaqyiguyqxjnbhjqahi0atgbacicbbajgcfcahaqlhiabbikbrhdgmcbgnedwgileaaygaqysqmygwhcag4qabiabbikbrixaxidacicbraugiaewgioec4ygaqysqmyxwey0qpcaggqabiabbixa8icexaugiaegiofgemysqmyxwey0qpcagoqabiabbikbrhdwgihecmysqiyj8icbxaagiaegarcagsqlhiabbjharivacicbxaugiaegarcagwqlhiabbgkgasysqpcagkqabiabbgkgavcaheqabiabbgkgasysqmy-qeyrsicdbaagiaegaoycxixa8icdxaugiaegaoycxjharjra8ickxaagiaegaoycxixaxj5arhggjcfgiwfgn0egeyy-qey9amy9qmy9gpyaqhcaggqlhiabbixa8iccxaagiaegiofgledwgikecmygaqyiguyj8icdhaugiaegiofgledgimbwgigeaayfhgemaml8quaqlqulrqt3bogbggbeaeyazihbduumjggb8w0abihbdaumjg4b40uwgcimc42lje3ljpib3kacaeampsclientgws-wiz-serp-dig-ns-the-root-of-everything"><a target="_blank" href="https://www.google.com/search?q=Authoritative+Name+Server&amp;sca_esv=918b344881a48eb7&amp;rlz=1C1YTUH_enIN1007IN1007&amp;sxsrf=ANbL-n4H30bMmCRZ1N5F3IA1GWgFMzODlQ%3A1771167636105&amp;ei=lN-RaY-OBviVseMPtMO-yAQ&amp;biw=1536&amp;bih=730&amp;ved=2ahUKEwi28MnZ5duSAxVgR2wGHdAIE_sQgK4QegYIAQgDEAQ&amp;uact=5&amp;oq=how+does+dns+work&amp;gs_lp=Egxnd3Mtd2l6LXNlcnAiEWhvdyBkb2VzIGRucyB3b3JrMgsQABiABBiKBRiRAjILEAAYgAQYigUYkQIyCxAAGIAEGIoFGJECMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABEjOJlCoAliuJHAFeAGQAQCYAagBoAGXE6oBBDAuMjG4AQPIAQD4AQGYAhqgAq0UqAIUwgINECMYgAQYigUY6gIYJ8ICBxAjGOoCGCfCAg0QLhiABBiKBRjqAhgnwgIWEAAYgAQYigUYQxjnBhjqAhi0AtgBAcICBBAjGCfCAhAQLhiABBiKBRhDGMcBGNEDwgILEAAYgAQYsQMYgwHCAg4QABiABBiKBRixAxiDAcICBRAuGIAEwgIOEC4YgAQYsQMYxwEY0QPCAggQABiABBixA8ICExAuGIAEGIoFGEMYsQMYxwEY0QPCAgoQABiABBiKBRhDwgIHECMYsQIYJ8ICBxAAGIAEGArCAgsQLhiABBjHARivAcICBxAuGIAEGArCAgwQLhiABBgKGAsYsQPCAgkQABiABBgKGAvCAhEQABiABBgKGAsYsQMY-QEYRsICDBAAGIAEGAoYCxixA8ICDxAuGIAEGAoYCxjHARjRA8ICKxAAGIAEGAoYCxixAxj5ARhGGJcFGIwFGN0EGEYY-QEY9AMY9QMY9gPYAQHCAggQLhiABBixA8ICCxAAGIAEGIoFGLEDwgIKECMYgAQYigUYJ8ICDhAuGIAEGIoFGLEDGIMBwgIGEAAYFhgemAML8QUAQLquLrQt3boGBggBEAEYAZIHBDUuMjGgB8W0AbIHBDAuMjG4B40UwgcIMC42LjE3LjPIB3KACAE&amp;sclient=gws-wiz-serp"><strong>St</strong></a><a target="_blank" href="https://www.google.com/search?q=TLD+server&amp;sca_esv=918b344881a48eb7&amp;rlz=1C1YTUH_enIN1007IN1007&amp;sxsrf=ANbL-n4H30bMmCRZ1N5F3IA1GWgFMzODlQ%3A1771167636105&amp;ei=lN-RaY-OBviVseMPtMO-yAQ&amp;biw=1536&amp;bih=730&amp;ved=2ahUKEwi28MnZ5duSAxVgR2wGHdAIE_sQgK4QegYIAQgDEAI&amp;uact=5&amp;oq=how+does+dns+work&amp;gs_lp=Egxnd3Mtd2l6LXNlcnAiEWhvdyBkb2VzIGRucyB3b3JrMgsQABiABBiKBRiRAjILEAAYgAQYigUYkQIyCxAAGIAEGIoFGJECMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABEjOJlCoAliuJHAFeAGQAQCYAagBoAGXE6oBBDAuMjG4AQPIAQD4AQGYAhqgAq0UqAIUwgINECMYgAQYigUY6gIYJ8ICBxAjGOoCGCfCAg0QLhiABBiKBRjqAhgnwgIWEAAYgAQYigUYQxjnBhjqAhi0AtgBAcICBBAjGCfCAhAQLhiABBiKBRhDGMcBGNEDwgILEAAYgAQYsQMYgwHCAg4QABiABBiKBRixAxiDAcICBRAuGIAEwgIOEC4YgAQYsQMYxwEY0QPCAggQABiABBixA8ICExAuGIAEGIoFGEMYsQMYxwEY0QPCAgoQABiABBiKBRhDwgIHECMYsQIYJ8ICBxAAGIAEGArCAgsQLhiABBjHARivAcICBxAuGIAEGArCAgwQLhiABBgKGAsYsQPCAgkQABiABBgKGAvCAhEQABiABBgKGAsYsQMY-QEYRsICDBAAGIAEGAoYCxixA8ICDxAuGIAEGAoYCxjHARjRA8ICKxAAGIAEGAoYCxixAxj5ARhGGJcFGIwFGN0EGEYY-QEY9AMY9QMY9gPYAQHCAggQLhiABBixA8ICCxAAGIAEGIoFGLEDwgIKECMYgAQYigUYJ8ICDhAuGIAEGIoFGLEDGIMBwgIGEAAYFhgemAML8QUAQLquLrQt3boGBggBEAEYAZIHBDUuMjGgB8W0AbIHBDAuMjG4B40UwgcIMC42LjE3LjPIB3KACAE&amp;sclient=gws-wiz-serp"><strong>ep 1:</strong></a> <code>dig . NS</code> The Root of Everything</h2>
<p><code>dig . NS</code> command asks “Who is responsible for the root of DNS?” You’ll see a list like:</p>
<pre><code class="lang-xml">a.root-servers.net
b.root-servers.net
...
m.root-servers.net
</code></pre>
<p>All of these are root name servers. They don’t know IPs for websites. They only know who manages each TLD. Root servers are like the master directory of the internet. They don’t know street addresses only which country handles which addresses.</p>
<p>There are 13 designated, logical DNS root server addresses(named A-M), but over <strong>1</strong>,900+ physical server instances (as of Feb 2026) operating globally. These 13 IP addresses are operated by 12 independent organizations and ensure the internet’s root zone is functional, secure, and highly available.</p>
<h2 id="heading-step-2-dig-com-ns-the-tld-layer"><strong>Step 2:</strong> <code>dig com NS</code> The TLD Layer</h2>
<p><code>dig com NS</code> asks “Who manages the <code>.com</code> domain?” Here we will see name servers like:</p>
<pre><code class="lang-xml">a.gtld-servers.net
b.gtld-servers.net
</code></pre>
<p>All of these are TLD (Top-Level Domain) servers. They manage the <code>.com</code> domain. They don’t know the IP Addresses of any website but they know which authoritative name servers manage a particular domain. TLD servers are like national post offices. They don’t deliver mail but they know which city office does.</p>
<h2 id="heading-step-3-dig-googlecom-ns-authoritative-name-servers"><strong>Step 3:</strong> <code>dig</code> <code>google.com</code> <code>NS</code> Authoritative Name Servers</h2>
<p><code>dig google.com</code> asks Which authoritative name server for google.com? Here we see servers like:</p>
<pre><code class="lang-xml">ns1.google.com
ns2.google.com
</code></pre>
<p>NS records tell us that these servers hold the official DNS records for this domain. Only authoritative servers can give final answers. Authoritative servers are like the city office that actually knows the street addresses.</p>
<h2 id="heading-step-4-dig-googlecom-the-final-answer"><strong>Step 4:</strong> <code>dig</code> <code>google.com</code> The Final Answer</h2>
<pre><code class="lang-xml">dig google.com
</code></pre>
<p>This returns:</p>
<pre><code class="lang-xml">google.com.  A  142.250.182.14
</code></pre>
<p>Now we have it. The resolver:</p>
<ol>
<li><p>Started at root servers</p>
</li>
<li><p>Asked TLD servers</p>
</li>
<li><p>Reached Google’s authoritative servers</p>
</li>
<li><p>Got the IP address</p>
</li>
</ol>
<p>This IP is what your browser uses to connect.</p>
<h2 id="heading-what-your-browser-actually-does-behind-the-scenes"><strong>What Your Browser Actually Does (Behind the Scenes)</strong></h2>
<p>The browser doesn’t run all these steps by itself. Instead, it talks to a recursive resolver (usually your ISP or a public resolver like 8.8.8.8). Recursive resolver’s job does the full lookup on your behalf, caches results, returns the final IP quickly.</p>
<h3 id="heading-resolution-flow"><strong>Resolution flow</strong></h3>
<ol>
<li><p>The user types a URL, and the browser checks its cache for the IP address.</p>
</li>
<li><p>If not cached, the query goes to a DNS Recursive Resolver <a target="_blank" href="https://www.google.com/search?q=DNS+Recursive+Resolver&amp;sca_esv=918b344881a48eb7&amp;rlz=1C1YTUH_enIN1007IN1007&amp;sxsrf=ANbL-n4H30bMmCRZ1N5F3IA1GWgFMzODlQ%3A1771167636105&amp;ei=lN-RaY-OBviVseMPtMO-yAQ&amp;biw=1536&amp;bih=730&amp;ved=2ahUKEwi28MnZ5duSAxVgR2wGHdAIE_sQgK4QegYIAQgCEAA&amp;uact=5&amp;oq=how+does+dns+work&amp;gs_lp=Egxnd3Mtd2l6LXNlcnAiEWhvdyBkb2VzIGRucyB3b3JrMgsQABiABBiKBRiRAjILEAAYgAQYigUYkQIyCxAAGIAEGIoFGJECMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABDIFEAAYgAQyBRAAGIAEMgUQABiABEjOJlCoAliuJHAFeAGQAQCYAagBoAGXE6oBBDAuMjG4AQPIAQD4AQGYAhqgAq0UqAIUwgINECMYgAQYigUY6gIYJ8ICBxAjGOoCGCfCAg0QLhiABBiKBRjqAhgnwgIWEAAYgAQYigUYQxjnBhjqAhi0AtgBAcICBBAjGCfCAhAQLhiABBiKBRhDGMcBGNEDwgILEAAYgAQYsQMYgwHCAg4QABiABBiKBRixAxiDAcICBRAuGIAEwgIOEC4YgAQYsQMYxwEY0QPCAggQABiABBixA8ICExAuGIAEGIoFGEMYsQMYxwEY0QPCAgoQABiABBiKBRhDwgIHECMYsQIYJ8ICBxAAGIAEGArCAgsQLhiABBjHARivAcICBxAuGIAEGArCAgwQLhiABBgKGAsYsQPCAgkQABiABBgKGAvCAhEQABiABBgKGAsYsQMY-QEYRsICDBAAGIAEGAoYCxixA8ICDxAuGIAEGAoYCxjHARjRA8ICKxAAGIAEGAoYCxixAxj5ARhGGJcFGIwFGN0EGEYY-QEY9AMY9QMY9gPYAQHCAggQLhiABBixA8ICCxAAGIAEGIoFGLEDwgIKECMYgAQYigUYJ8ICDhAuGIAEGIoFGLEDGIMBwgIGEAAYFhgemAML8QUAQLquLrQt3boGBggBEAEYAZIHBDUuMjGgB8W0AbIHBDAuMjG4B40UwgcIMC42LjE3LjPIB3KACAE&amp;sclient=gws-wiz-serp"><strong>(</strong></a>usually managed by the ISP), which acts as a middleman.</p>
</li>
<li><p>The resolver queries a Root Nameserver, which directs the request to a specific TLD server</p>
</li>
<li><p>The TLD server directs the request to the correct Authoritative Name Server for that domain.</p>
</li>
<li><p>The authoritative server finally returns the specific IP address.</p>
</li>
<li><p>The resolver returns the IP to the browser, which then connects to the web server to load the site</p>
</li>
</ol>
<p><code>dig</code> just lets you manually inspect each stage.</p>
<h2 id="heading-mapping-dig-commands-to-dns-layers"><strong>Mapping</strong> <code>dig</code> Commands to DNS Layers</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>DNS Layer</td></tr>
</thead>
<tbody>
<tr>
<td><code>dig . NS</code></td><td>Root</td></tr>
<tr>
<td><code>dig com NS</code></td><td>TLD</td></tr>
<tr>
<td><code>dig</code> <a target="_blank" href="http://google.com/"><code>google.com</code></a> <code>NS</code></td><td>Authoritative</td></tr>
<tr>
<td><code>dig</code> <a target="_blank" href="http://google.com/"><code>google.com</code></a></td><td>Final resolution</td></tr>
</tbody>
</table>
</div><p>Once you see this mapping, you can’t unsee this. If you unsee this please see this again.</p>
<h2 id="heading-why-dns-is-designed-this-way"><strong>Why DNS Is Designed This Way</strong></h2>
<p>This layered approach gives DNS:</p>
<ul>
<li><p>Scalability (billions of domains)</p>
</li>
<li><p>Decentralization (no single point of failure)</p>
</li>
<li><p>Delegation (each level controls its part)</p>
</li>
</ul>
<p>System-design wise, it’s a masterpiece.</p>
<h2 id="heading-connecting-this-to-real-systems"><strong>Connecting This to Real Systems</strong></h2>
<p>When you deploy a backend service or a load balancer, CDN, microservice architecture. DNS is doing constant work:</p>
<ul>
<li><p>Routing users geographically</p>
</li>
<li><p>Failing over between servers</p>
</li>
<li><p>Pointing domains to cloud infrastructure</p>
</li>
</ul>
<p>Understanding resolution helps debug latency, fix “DNS not propagating” issues, design resilient systems.</p>
<h2 id="heading-final-mental-model"><strong>Final Mental Model</strong></h2>
<p>DNS is not a lookup table. It’s a chain of referrals, starting from the root and ending at authority. Each server answers only one question: “Who should I ask next?” Until finally: “Here is the IP.”</p>
<p>Once that clicks, DNS resolution becomes intuitive and tools like <code>dig</code> become a powerful tool.</p>
]]></content:encoded></item><item><title><![CDATA[Getting Started with cURL]]></title><description><![CDATA[How do programs talk to servers? Every time you open a website, log in, or use an app, your device is talking to a server somewhere on the internet. As programmers, we often want to:

Test those conversations

Debug APIs

Send requests without openin...]]></description><link>https://surajjena.hashnode.dev/getting-started-with-curl</link><guid isPermaLink="true">https://surajjena.hashnode.dev/getting-started-with-curl</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[curl]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sun, 15 Feb 2026 09:23:25 GMT</pubDate><content:encoded><![CDATA[<p>How do programs talk to servers? Every time you open a website, log in, or use an app, your device is talking to a server somewhere on the internet. As programmers, we often want to:</p>
<ul>
<li><p>Test those conversations</p>
</li>
<li><p>Debug APIs</p>
</li>
<li><p>Send requests without opening a browser</p>
</li>
</ul>
<p>That’s where curl(client URL) comes in. This is a simple guide to make curl feel friendly.</p>
<p>What Is a Server? A server is a computer or software that stores and distributes data to another computer or software called client. It receives requests from clients and sends back responses.</p>
<p>You ask: “Hey, give me this webpage.” The server replies: “Sure, here it is.” That’s the entire relationship.</p>
<h2 id="heading-what-is-curl"><strong>What Is cURL?</strong></h2>
<p>curl is a tool that lets you send messages to a server from the terminal. If a browser sends requests using buttons and tabs, curl sends requests using commands.</p>
<p>It is simply a command line tool for talking to servers. It supports over 25 protocols including HTTP, HTTPS, FTP, and SFTP. It is widely used by developers to test APIs, download files, and automate network interactions.</p>
<h2 id="heading-why-programmers-need-curl"><strong>Why Programmers Need cURL</strong></h2>
<p>Browsers are great but they hide too much(probably for the best since not everyone needs to know all of that goes behind the scenes). Programmers use curl to:</p>
<ul>
<li><p>Test APIs quickly</p>
</li>
<li><p>See raw responses from servers</p>
</li>
<li><p>Debug backend issues</p>
</li>
<li><p>Automate requests</p>
</li>
<li><p>Learn how HTTP actually works</p>
</li>
</ul>
<p>If you build or consume APIs, curl becomes a quiet superpower.</p>
<h2 id="heading-your-first-curl-request"><strong>Your First cURL Request</strong></h2>
<p>Let’s fetch a webpage.</p>
<pre><code class="lang-xml">curl https://example.com
</code></pre>
<p>No flags. No options. So what happened?</p>
<p>curl sent a request to <a target="_blank" href="http://example.com"><code>example.com</code></a> → The server sent back a response → curl printed the response to your terminal</p>
<p>This is the same thing the browser does just without the visuals.</p>
<h2 id="heading-understanding-request-and-response"><strong>Understanding Request and Response</strong></h2>
<p>The request says “Hello, please give me this resource.”</p>
<p>The response includes: <strong>Status</strong> (did it work?) + <strong>Data</strong> (HTML, JSON, text, etc.)</p>
<pre><code class="lang-xml">Request → Server → Response
</code></pre>
<h2 id="heading-browser-request-vs-curl-request"><strong>Browser Request vs cURL Request</strong></h2>
<p>Conceptually, they’re identical.</p>
<pre><code class="lang-xml">Browser  → Server → Webpage
cURL     → Server → Raw response
</code></pre>
<p>The difference is that browsers render HTML while curl shows you what the server actually sent. This is incredibly useful when building backends.</p>
<h2 id="heading-making-a-get-request-the-default"><strong>Making a GET Request (The Default)</strong></h2>
<p>When you run: <code>curl</code> <a target="_blank" href="https://api.example.com/users"><code>https://api.example.com/users</code></a>; You’re making a GET request. A GET request is an HTTP method used to retrieve data from a specified resource on a server. GET simply means: “Please give me data.”</p>
<p>Most API reading happens with GET. No extra flags are needed, GET is curl’s default behavior.</p>
<h2 id="heading-using-curl-to-talk-to-apis"><strong>Using cURL to Talk to APIs</strong></h2>
<p>APIs usually return JSON, not HTML. Example: <code>curl</code> <a target="_blank" href="https://api.github.com"><code>https://api.github.com</code></a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771175173187/bc9b010c-9806-4031-81cd-db2a55134c5c.png" alt /></p>
<p>You’ll see structured data instead of a webpage. This is how backend services talk to each other quietly, constantly, and without browsers.</p>
<h2 id="heading-making-a-post-request-sending-data"><strong>Making a POST Request (Sending Data)</strong></h2>
<p>POST means “I’m sending data to you.” Example (conceptual):</p>
<pre><code class="lang-xml">curl -X POST https://api.example.com/login
</code></pre>
<p>The key idea is: <strong>GET</strong> → receive data <strong>POST</strong> → send data</p>
<p>That mental model is enough for now.</p>
<h2 id="heading-understanding-the-response-at-a-high-level"><strong>Understanding the Response (At a High Level)</strong></h2>
<p>Every response answers two questions: Did it work? What did you get back?</p>
<p>Even when things fail, servers still respond and curl lets you see that clearly. This visibility is why curl is so valuable for debugging.</p>
<h2 id="heading-common-beginner-mistakes"><strong>Common Beginner Mistakes</strong></h2>
<p><strong>1. Expecting pretty output:</strong> curl shows raw data. That’s the point.</p>
<p><strong>2. Forgetting the protocol:</strong> This fails:</p>
<pre><code class="lang-xml">curl example.com
</code></pre>
<p>This works:</p>
<pre><code class="lang-xml">curl https://example.com
</code></pre>
<p><strong>3. Thinking curl is only for APIs:</strong> It works just fine with websites, APIs, internal services local servers etc.</p>
<p><strong>4. Getting overwhelmed by flags:</strong> You don’t need most flags on day one. Start simple. Build confidence first.</p>
<h2 id="heading-where-curl-fits-in-backend-development"><strong>Where cURL Fits in Backend Development</strong></h2>
<p>curl is used in backend development for transferring data via various network protocols. It fits into the workflow primarily for testing, debugging, and automation tasks. You’ll use it to:</p>
<ul>
<li><p>Test endpoints before writing frontend code</p>
</li>
<li><p>Verify deployments</p>
</li>
<li><p>Debug production issues</p>
</li>
<li><p>Understand request/response behavior</p>
</li>
</ul>
<p>Many senior engineers still reach for curl daily.</p>
<h2 id="heading-simple-mental-models"><strong>Simple Mental Models</strong></h2>
<p>curl flow is basically:</p>
<pre><code class="lang-xml">curl → Server → Response
</code></pre>
<h3 id="heading-http-basics"><strong>HTTP Basics</strong></h3>
<pre><code class="lang-xml">Request:
  Method (GET/POST)
  URL

Response:
  Status
  Data
</code></pre>
<h2 id="heading-final-takeaway"><strong>Final Takeaway</strong></h2>
<p>curl isn’t advanced. It’s honest. It strips away UI and shows you how software systems actually talk. If you can make a GET request or understand that a server responds you already understand the core idea. Everything else headers, auth, flags, formats can come later.</p>
]]></content:encoded></item><item><title><![CDATA[TCP vs UDP: When to Use What, and How TCP Relates to HTTP]]></title><description><![CDATA[How does data actually move across the internet without turning into chaos?
Every message you send opening a website, watching a video, joining a call travels as tiny packets across networks you don’t control. To prevent complete anarchy, the interne...]]></description><link>https://surajjena.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</link><guid isPermaLink="true">https://surajjena.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</guid><category><![CDATA[TCP]]></category><category><![CDATA[tcp vs udp]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sun, 01 Feb 2026 18:26:43 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-how-does-data-actually-move-across-the-internet-without-turning-into-chaos">How does data actually move across the internet without turning into chaos?</h2>
<p>Every message you send opening a website, watching a video, joining a call travels as tiny packets across networks you don’t control. To prevent complete anarchy, the internet relies on rules.</p>
<p>Two of the most important rule-sets are TCP and UDP. They solve the same problem (sending data), but in very different ways. Let’s understand them without diving into protocol internals.</p>
<h2 id="heading-first-why-the-internet-needs-rules-at-all"><strong>First: Why the Internet Needs Rules at All</strong></h2>
<p>The internet is not one big wire. Data:</p>
<ul>
<li><p>Gets split into packets</p>
</li>
<li><p>Takes different paths</p>
</li>
<li><p>Can arrive late, out of order, or not at all</p>
</li>
</ul>
<p>So the big question is: Do you care more about reliability or speed?</p>
<p>That single question is what separates TCP and UDP.</p>
<h2 id="heading-what-are-tcp-and-udp-very-high-level"><strong>What Are TCP and UDP? (Very High Level)</strong></h2>
<h3 id="heading-tcp-transmission-control-protocol"><strong>TCP - Transmission Control Protocol</strong></h3>
<p>TCP is:</p>
<ul>
<li><p>Reliable</p>
</li>
<li><p>Ordered</p>
</li>
<li><p>Careful</p>
</li>
</ul>
<p>It makes sure data arrives:</p>
<ul>
<li><p>Completely</p>
</li>
<li><p>In the right order</p>
</li>
<li><p>Without duplication</p>
</li>
</ul>
<h3 id="heading-udp-user-datagram-protocol"><strong>UDP - User Datagram Protocol</strong></h3>
<p>UDP is:</p>
<ul>
<li><p>Fast</p>
</li>
<li><p>Lightweight</p>
</li>
<li><p>Best-effort</p>
</li>
</ul>
<p>It sends data and does not wait to check if it arrived.</p>
<p>The Core Difference (In One Sentence) - TCP cares about correctness. UDP cares about speed. Everything else flows from that.</p>
<h2 id="heading-tcp-explained"><strong>TCP Explained</strong></h2>
<h3 id="heading-what-tcp-does-for-you"><strong>What TCP does for you</strong></h3>
<ul>
<li><p>Establishes a connection first</p>
</li>
<li><p>Confirms packets are received</p>
</li>
<li><p>Retransmits lost data</p>
</li>
<li><p>Delivers data in order</p>
</li>
</ul>
<h3 id="heading-analogy-courier-delivery"><strong>Analogy: Courier Delivery</strong></h3>
<p>TCP is like Sending a package with tracking, signature required, and resend if lost. Slower but safe.</p>
<h3 id="heading-when-tcp-shines"><strong>When TCP shines</strong></h3>
<ul>
<li><p>Web pages</p>
</li>
<li><p>APIs</p>
</li>
<li><p>File downloads</p>
</li>
<li><p>Emails</p>
</li>
<li><p>Anything where missing data is unacceptable</p>
</li>
</ul>
<p>If even one missing piece breaks everything, TCP is your friend.</p>
<h2 id="heading-udp-explained"><strong>UDP Explained</strong></h2>
<h3 id="heading-what-udp-does"><strong>What UDP does</strong></h3>
<ul>
<li><p>No connection setup</p>
</li>
<li><p>No confirmation</p>
</li>
<li><p>No retransmission</p>
</li>
<li><p>No ordering guarantee</p>
</li>
</ul>
<p>It sends data and moves on.</p>
<h3 id="heading-analogy-live-announcement"><strong>Analogy: Live Announcement</strong></h3>
<p>UDP is like: Making announcements over a loudspeaker. If someone misses it, you don’t repeat it.</p>
<h3 id="heading-when-udp-shines"><strong>When UDP shines</strong></h3>
<ul>
<li><p>Live video streaming</p>
</li>
<li><p>Online gaming</p>
</li>
<li><p>Voice calls</p>
</li>
<li><p>DNS queries</p>
</li>
</ul>
<p>If: Speed matters more than perfection or Occasional loss is acceptable UDP wins.</p>
<h2 id="heading-tcp-vs-udp-side-by-side"><strong>TCP vs UDP (Side-by-Side)</strong></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>Guaranteed</td><td>Not guaranteed</td></tr>
<tr>
<td>Ordering</td><td>Preserved</td><td>Not preserved</td></tr>
<tr>
<td>Speed</td><td>Slower</td><td>Faster</td></tr>
<tr>
<td>Connection setup</td><td>Required</td><td>Not required</td></tr>
<tr>
<td>Use cases</td><td>Web, APIs, files</td><td>Streaming, gaming, DNS</td></tr>
</tbody>
</table>
</div><h2 id="heading-when-should-you-use-tcp"><strong>When Should You Use TCP?</strong></h2>
<p>Use TCP when:</p>
<ul>
<li><p>Data must arrive intact</p>
</li>
<li><p>Order matters</p>
</li>
<li><p>You can tolerate slight delays</p>
</li>
</ul>
<p>Examples:</p>
<ul>
<li><p>Loading a website</p>
</li>
<li><p>Submitting a form</p>
</li>
<li><p>Calling an API</p>
</li>
<li><p>Downloading a file</p>
</li>
</ul>
<p>A broken response is worse than a slow one.</p>
<h2 id="heading-when-should-you-use-udp"><strong>When Should You Use UDP?</strong></h2>
<p>Use UDP when:</p>
<ul>
<li><p>Speed is critical</p>
</li>
<li><p>Real-time matters</p>
</li>
<li><p>Some loss is okay</p>
</li>
</ul>
<p>Examples:</p>
<ul>
<li><p>Video calls</p>
</li>
<li><p>Live streams</p>
</li>
<li><p>Multiplayer games</p>
</li>
<li><p>DNS lookups</p>
</li>
</ul>
<p>A late packet is often worse than a lost one.</p>
<h2 id="heading-real-world-examples-you-already-use"><strong>Real-World Examples You Already Use</strong></h2>
<h3 id="heading-tcp-in-everyday-life"><strong>TCP in everyday life</strong></h3>
<ul>
<li><p>Browsing websites</p>
</li>
<li><p>Watching non-live videos (buffered)</p>
</li>
<li><p>Sending emails</p>
</li>
<li><p>Cloud APIs</p>
</li>
</ul>
<h3 id="heading-udp-in-everyday-life"><strong>UDP in everyday life</strong></h3>
<ul>
<li><p>Zoom / Teams calls</p>
</li>
<li><p>Online gaming</p>
</li>
<li><p>Live sports streams</p>
</li>
<li><p>DNS resolution (usually)</p>
</li>
</ul>
<p>You switch between TCP and UDP constantly without knowing it.</p>
<h2 id="heading-so-what-is-http"><strong>So… What Is HTTP?</strong></h2>
<p>Here’s where beginners often get confused.</p>
<h3 id="heading-http-is-not-a-transport-protocol"><strong>HTTP is NOT a transport protocol</strong></h3>
<p>HTTP is an application-level protocol.</p>
<p>Its job is to define:</p>
<ul>
<li><p>Requests (GET, POST)</p>
</li>
<li><p>Responses</p>
</li>
<li><p>Status codes</p>
</li>
<li><p>Headers</p>
</li>
<li><p>Data formats</p>
</li>
</ul>
<p>It answers: “How should a browser and server <em>talk</em>?” Not: “How do packets move across the network?”</p>
<h2 id="heading-where-http-fits-in-the-stack"><strong>Where HTTP Fits in the Stack</strong></h2>
<p>Think in layers:</p>
<pre><code class="lang-xml">Application Layer → HTTP
Transport Layer   → TCP (or sometimes UDP)
Network Layer     → IP
</code></pre>
<p>HTTP sits on top of TCP.</p>
<h2 id="heading-relationship-between-tcp-and-http"><strong>Relationship Between TCP and HTTP</strong></h2>
<p>HTTP uses TCP to move its data. TCP provides reliable delivery. HTTP defines the meaning of the messages. HTTP is like the language of a conversation. TCP is like the phone line making sure every word arrives in order. HTTP does not replace TCP it depends on it.</p>
<h2 id="heading-is-http-the-same-as-tcp-common-confusion"><strong>Is HTTP the Same as TCP? (Common Confusion)</strong></h2>
<p>No. Very different roles:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Protocol</td><td>Role</td></tr>
</thead>
<tbody>
<tr>
<td>TCP</td><td>Moves data reliably</td></tr>
<tr>
<td>HTTP</td><td>Defines web communication</td></tr>
</tbody>
</table>
</div><p>You can have:</p>
<ul>
<li><p>TCP without HTTP (databases, SSH)</p>
</li>
<li><p>HTTP without caring how TCP works</p>
</li>
</ul>
<p>But you cannot have HTTP without some transport underneath.</p>
<h2 id="heading-a-simple-flow-http-over-tcp"><strong>A Simple Flow: HTTP Over TCP</strong></h2>
<pre><code class="lang-xml">Browser
   ↓  HTTP request
TCP connection
   ↓
Internet
   ↓
Server
   ↑  HTTP response
</code></pre>
<p>HTTP messages ride inside a TCP connection.</p>
<h2 id="heading-why-http-doesnt-just-use-udp"><strong>Why HTTP Doesn’t Just Use UDP</strong></h2>
<p>Because:</p>
<ul>
<li><p>Web pages must load correctly</p>
</li>
<li><p>Missing HTML or CSS breaks everything</p>
</li>
<li><p>Reliability matters more than raw speed</p>
</li>
</ul>
<p>(Some modern versions like HTTP/3 use UDP—but that’s an optimization built <em>on top</em> of UDP, not a replacement conceptually.)</p>
<h2 id="heading-simplified-osi-tcp-ip-mapping"><strong>Simplified OSI / TCP-IP Mapping</strong></h2>
<pre><code class="lang-xml">Application → HTTP
Transport   → TCP / UDP
Network     → IP
</code></pre>
<p>Each layer has one responsibility.</p>
<h2 id="heading-final-mental-model-keep-this"><strong>Final Mental Model (Keep This)</strong></h2>
<ul>
<li><p>TCP: Safe, ordered, reliable delivery</p>
</li>
<li><p>UDP: Fast, best-effort delivery</p>
</li>
<li><p>HTTP: Rules for web communication</p>
</li>
<li><p>HTTP runs on top of TCP, not instead of it</p>
</li>
</ul>
<p>Once you separate How data moves vs what data means. Networking becomes much less intimidating.</p>
<h2 id="heading-final-takeaway"><strong>Final Takeaway</strong></h2>
<p>The internet isn’t fast by accident—it’s fast because it chooses when to be careful and when to be reckless.</p>
<ul>
<li><p>TCP is careful</p>
</li>
<li><p>UDP is reckless (on purpose)</p>
</li>
<li><p>HTTP is just the language spoken on top</p>
</li>
</ul>
<p>If you’re building:</p>
<ul>
<li><p>APIs → think TCP</p>
</li>
<li><p>Real-time systems → think UDP</p>
</li>
<li><p>Web apps → think HTTP over TCP</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></title><description><![CDATA[What Happens If Data Is Sent Without Rules?
Imagine sending a stack of letters to a friend without any order or envelopes. Some letters might get lost, arrive out of order, or be duplicated. You’d struggle to understand the message, right?
This is wh...]]></description><link>https://surajjena.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</link><guid isPermaLink="true">https://surajjena.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</guid><category><![CDATA[TCP]]></category><category><![CDATA[TCP Handshake]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sun, 01 Feb 2026 18:24:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771179072012/9eff4947-8581-442d-a885-02d2a73ff945.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-happens-if-data-is-sent-without-rules">What Happens If Data Is Sent Without Rules?</h2>
<p>Imagine sending a stack of letters to a friend without any order or envelopes. Some letters might get lost, arrive out of order, or be duplicated. You’d struggle to understand the message, right?</p>
<p>This is what happens in computer networks <strong>without TCP</strong>. Data packets might:</p>
<ul>
<li><p>Arrive late or out of order</p>
</li>
<li><p>Be duplicated or missing</p>
</li>
<li><p>Be corrupted during transmission</p>
</li>
</ul>
<p>Clearly, we need a <strong>system to organize, check, and confirm delivery</strong>. That’s where TCP comes in.</p>
<h2 id="heading-what-is-tcp-and-why-is-it-needed">What Is TCP and Why Is It Needed?</h2>
<p><strong>TCP (Transmission Control Protocol)</strong> is a communication protocol used by computers to send data <strong>reliably</strong> over networks.</p>
<p>It ensures:</p>
<ul>
<li><p>Data arrives <strong>complete</strong></p>
</li>
<li><p>Data arrives <strong>in order</strong></p>
</li>
<li><p>Lost packets are <strong>detected and retransmitted</strong></p>
</li>
</ul>
<p>Think of TCP as a <strong>postal service for the internet</strong>—it guarantees that every “letter” (data packet) reaches its destination correctly.</p>
<h2 id="heading-problems-tcp-is-designed-to-solve">Problems TCP Is Designed to Solve</h2>
<p>TCP solves several problems that can occur in network communication:</p>
<ul>
<li><p><strong>Packet loss</strong>: Lost packets are retransmitted.</p>
</li>
<li><p><strong>Out-of-order delivery</strong>: TCP reorders packets correctly.</p>
</li>
<li><p><strong>Data corruption</strong>: TCP checks for errors using checksums.</p>
</li>
<li><p><strong>Duplication</strong>: Duplicate packets are ignored.</p>
</li>
</ul>
<p>Without TCP, applications like web browsing, email, and file transfers would be <strong>unreliable</strong>.</p>
<h2 id="heading-the-tcp-3-way-handshake-making-a-connection">The TCP 3-Way Handshake: Making a Connection</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771179127786/bf75f986-911f-4e9b-a48a-7872197f1728.png" alt class="image--center mx-auto" /></p>
<p>Before sending data, TCP establishes a connection using a <strong>3-way handshake</strong>.</p>
<p>Think of it as a <strong>conversation between two people</strong> who haven’t met before:</p>
<ul>
<li><p>Alice says: “Hi, I want to talk!”</p>
</li>
<li><p>Bob replies: “Hi Alice, I’m ready. Are you sure?”</p>
</li>
<li><p>Alice confirms: “Yes, I’m ready too. Let’s start talking.”</p>
</li>
</ul>
<p>In TCP terms, these steps are: <strong>SYN → SYN-ACK → ACK</strong>.</p>
<h3 id="heading-step-1-syn-synchronize">Step 1: SYN (Synchronize)</h3>
<ul>
<li><p>The client wants to start a connection.</p>
</li>
<li><p>It sends a <strong>SYN packet</strong> to the server.</p>
</li>
<li><p>SYN includes a <strong>sequence number</strong>, which is like a starting point for numbering the data.</p>
</li>
</ul>
<p>Analogy: Alice saying, “Hi, let’s start a conversation. I’m starting at point #100.”</p>
<h3 id="heading-step-2-syn-ack-synchronize-amp-acknowledge">Step 2: SYN-ACK (Synchronize &amp; Acknowledge)</h3>
<ul>
<li><p>The server receives the SYN and responds with <strong>SYN-ACK</strong>.</p>
</li>
<li><p>This packet:</p>
<ul>
<li><p>Acknowledges the client’s SYN</p>
</li>
<li><p>Sends its own sequence number for the server</p>
</li>
</ul>
</li>
</ul>
<p>Analogy: Bob replies, “Hi Alice! I got your message. I’m starting at point #500. Are you ready?”</p>
<h3 id="heading-step-3-ack-acknowledgement">Step 3: ACK (Acknowledgement)</h3>
<ul>
<li><p>The client receives the SYN-ACK and sends <strong>ACK</strong>.</p>
</li>
<li><p>The connection is now established, and both sides are synchronized.</p>
</li>
</ul>
<h2 id="heading-how-data-transfer-works-in-tcp">How Data Transfer Works in TCP</h2>
<p>Once the connection is established:</p>
<ul>
<li><p><strong>Data is broken into packets</strong>.</p>
</li>
<li><p>Each packet gets a <strong>sequence number</strong>.</p>
</li>
<li><p>The receiver sends an <strong>acknowledgement (ACK)</strong> for received packets.</p>
</li>
<li><p>Lost packets are <strong>retransmitted</strong>.</p>
</li>
</ul>
<p>For example:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Packet #</td><td>Status</td></tr>
</thead>
<tbody>
<tr>
<td>1</td><td>Received → ACK sent</td></tr>
<tr>
<td>2</td><td>Lost → client retransmits</td></tr>
<tr>
<td>3</td><td>Received → ACK sent</td></tr>
</tbody>
</table>
</div><p>TCP ensures that the <strong>data arrives completely and in the correct order</strong>, even if the network drops or delays some packets.</p>
<h2 id="heading-how-tcp-ensures-reliability-order-and-correctness">How TCP Ensures Reliability, Order, and Correctness 🛠️</h2>
<ul>
<li><p><strong>Reliability:</strong> ACKs confirm every packet is received. Lost packets are resent.</p>
</li>
<li><p><strong>Order:</strong> Sequence numbers allow the receiver to <strong>reassemble packets in the correct order</strong>.</p>
</li>
<li><p><strong>Error checking:</strong> Checksums detect corrupted packets; corrupted packets are discarded and retransmitted.</p>
</li>
</ul>
<p>Analogy: It’s like a <strong>delivery company</strong> that tracks every package, re-sends missing ones, and ensures nothing arrives broken.</p>
<h2 id="heading-closing-a-tcp-connection-fin-amp-ack">Closing a TCP Connection: FIN &amp; ACK</h2>
<p>When the conversation is over, TCP closes the connection gracefully. It closes the connection carefully to make sure:</p>
<ul>
<li><p>All data is delivered</p>
</li>
<li><p>Nothing is cut off midway</p>
</li>
</ul>
<p>This process uses <strong>FIN</strong> and <strong>ACK.</strong> Think of it like politely ending a phone call.</p>
<h2 id="heading-step-1-fin-finish">Step 1: FIN (Finish)</h2>
<p>One side says:</p>
<blockquote>
<p>“I’m done sending data.”</p>
</blockquote>
<p>It sends a <strong>FIN</strong> packet.</p>
<p>Analogy:<br />Alice says, “I’ve finished talking.”</p>
<h2 id="heading-step-2-ack">Step 2: ACK</h2>
<p>The other side replies:</p>
<blockquote>
<p>“Okay, I heard you.”</p>
</blockquote>
<p>It sends an <strong>ACK</strong>.</p>
<p>Analogy:<br />Bob says, “Got it.”</p>
<h2 id="heading-step-3-fin-from-the-other-side">Step 3: FIN (From the Other Side)</h2>
<p>Now the second side also sends:</p>
<blockquote>
<p>“I’m done too.”</p>
</blockquote>
<p>Another <strong>FIN</strong> is sent.</p>
<h2 id="heading-step-4-final-ack">Step 4: Final ACK</h2>
<p>The first side replies with a final <strong>ACK</strong>.</p>
<p>Connection is now fully closed.</p>
<h2 id="heading-tcp-connection-lifecycle">TCP Connection Lifecycle</h2>
<p><img src="https://miro.medium.com/v2/resize%3Afit%3A1400/1%2AWOivqFR3C8S4r5KAHoxiXw.png" alt="https://miro.medium.com/v2/resize%3Afit%3A1400/1%2AWOivqFR3C8S4r5KAHoxiXw.png" /></p>
<p>Flow: Establish → Transfer Data → Close</p>
<p>TCP always opens and closes connections properly.</p>
<h1 id="heading-how-data-transfer-works-in-tcp-1">How Data Transfer Works in TCP</h1>
<p>After the 3-way handshake:</p>
<ul>
<li><p>Data is broken into small pieces (segments)</p>
</li>
<li><p>Each segment gets a <strong>sequence number</strong></p>
</li>
<li><p>The receiver sends back <strong>ACK numbers</strong></p>
</li>
<li><p>Missing segments are retransmitted</p>
</li>
</ul>
<p>Let’s understand this slowly.</p>
<h2 id="heading-sequence-numbers">Sequence Numbers</h2>
<p>Every byte of data is numbered.</p>
<p>Example:</p>
<p>If you send:</p>
<pre><code class="lang-plaintext">HELLO
</code></pre>
<p>It might be numbered like:</p>
<p>H = 1<br />E = 2<br />L = 3<br />L = 4<br />O = 5</p>
<p>If packets arrive out of order:</p>
<p>3, 4, 1, 2, 5</p>
<p>The receiver reorders them correctly using sequence numbers.</p>
<h2 id="heading-acknowledgements-ack">Acknowledgements (ACK)</h2>
<p>After receiving data, the receiver says:</p>
<blockquote>
<p>“I have received up to number X.”</p>
</blockquote>
<p>Example:</p>
<p>If bytes 1–100 arrived safely, the receiver sends:</p>
<p>ACK = 101</p>
<p>Meaning:</p>
<p>“I’m expecting byte 101 next.”</p>
<p>This makes communication organized.</p>
<h1 id="heading-what-happens-if-a-packet-is-lost">What Happens If a Packet Is Lost?</h1>
<p>Let’s say:</p>
<p>Packet 2 is lost.</p>
<p>Receiver gets:</p>
<p>1 → OK<br />3 → Wait… where is 2?</p>
<p>It does <strong>not</strong> acknowledge beyond the missing packet.</p>
<p>The sender realizes:</p>
<p>“No ACK for packet 2? I must resend it.”</p>
<p>That’s retransmission.</p>
<h2 id="heading-packet-loss-amp-retransmission-flow">Packet Loss &amp; Retransmission Flow</h2>
<p><img src="https://www.researchgate.net/publication/382092781/figure/fig1/AS%3A11431281259508197%401720533616113/TCP-packet-loss-detection-and-retransmission-triggered-by-a-timeout-or-by-three-duplicate.ppm" alt="https://www.researchgate.net/publication/382092781/figure/fig1/AS%3A11431281259508197%401720533616113/TCP-packet-loss-detection-and-retransmission-triggered-by-a-timeout-or-by-three-duplicate.ppm" /></p>
<p>TCP constantly checks:</p>
<ul>
<li><p>Was it received?</p>
</li>
<li><p>Was it acknowledged?</p>
</li>
<li><p>Was it corrupted?</p>
</li>
</ul>
<p>If is fails, resend.</p>
<h1 id="heading-how-tcp-ensures-reliability-order-and-correctness-1">How TCP Ensures Reliability, Order, and Correctness</h1>
<p>Let’s summarize it clearly.</p>
<h3 id="heading-reliability">Reliability</h3>
<p>Every packet must be acknowledged.<br />If no ACK → resend.</p>
<h3 id="heading-order">Order</h3>
<p>Sequence numbers allow proper reassembly.</p>
<p>Even if packets arrive as:<br />3, 1, 2</p>
<p>They are rearranged into:<br />1, 2, 3</p>
<h3 id="heading-error-detection">Error Detection</h3>
<p>Each segment has a checksum.</p>
<p>If data is corrupted:</p>
<ul>
<li><p>It is discarded</p>
</li>
<li><p>Sender retransmits</p>
</li>
</ul>
<h1 id="heading-the-tcp-3-way-handshake">The TCP 3-Way Handshake</h1>
<p><img src="https://static.afteracademy.com/images/what-is-a-tcp-3-way-handshake-process-three-way-handshaking-establishing-connection-6a724e77ba96e241.jpg" alt="https://static.afteracademy.com/images/what-is-a-tcp-3-way-handshake-process-three-way-handshaking-establishing-connection-6a724e77ba96e241.jpg" /></p>
<p>Step-by-step summary:</p>
<ol>
<li><p>Client → SYN</p>
</li>
<li><p>Server → SYN-ACK</p>
</li>
<li><p>Client → ACK</p>
</li>
</ol>
<p>Now both sides:</p>
<ul>
<li><p>Agree to communicate</p>
</li>
<li><p>Agree on starting sequence numbers</p>
</li>
<li><p>Are synchronized</p>
</li>
</ul>
<h1 id="heading-why-tcp-is-needed">Why TCP Is Needed</h1>
<p>Without TCP:</p>
<ul>
<li><p>Web pages could load incorrectly</p>
</li>
<li><p>Files could be corrupted</p>
</li>
<li><p>Emails might arrive incomplete</p>
</li>
<li><p>Data could be jumbled</p>
</li>
</ul>
<p>TCP ensures:</p>
<ul>
<li><p>Complete delivery</p>
</li>
<li><p>Correct order</p>
</li>
<li><p>Error detection</p>
</li>
<li><p>Controlled communication</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[CSS Selectors 101: Targeting Elements with Precision]]></title><description><![CDATA[Why CSS Selectors Are Needed
Imagine you are at a big party, and you want to talk to someone.

Do you shout randomly?

Do you point to one person?

Or do you gather a specific group to speak to them?


CSS selectors work the same way. They help you “...]]></description><link>https://surajjena.hashnode.dev/css-selectors-101-targeting-elements-with-precision</link><guid isPermaLink="true">https://surajjena.hashnode.dev/css-selectors-101-targeting-elements-with-precision</guid><category><![CDATA[CSS]]></category><category><![CDATA[CSS3]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sun, 01 Feb 2026 18:20:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771178197525/eb527180-907d-4dbf-bd41-014a6937839d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-why-css-selectors-are-needed">Why CSS Selectors Are Needed</h2>
<p>Imagine you are at a big party, and you want to talk to someone.</p>
<ul>
<li><p>Do you shout randomly?</p>
</li>
<li><p>Do you point to one person?</p>
</li>
<li><p>Or do you gather a specific group to speak to them?</p>
</li>
</ul>
<p>CSS selectors work the same way. They help you “target” exactly which HTML elements you want to style.</p>
<p>Without selectors, styling every element would be chaotic. You’d be applying styles blindly, which is inefficient and messy. Selectors are the foundation of CSS ,they allow your styles to be <strong>precise, organized, and reusable</strong>.</p>
<h2 id="heading-element-selector-the-basic-target">Element Selector: The Basic Target</h2>
<p>The simplest selector is the <strong>element selector</strong>. It targets all instances of a specific HTML element.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">&lt;p&gt;This is a paragraph.&lt;/p&gt;
&lt;p&gt;This is another paragraph.&lt;/p&gt;
</code></pre>
<p>CSS:</p>
<pre><code class="lang-plaintext">p {
  color: blue;
}
</code></pre>
<p>Result: All <code>&lt;p&gt;</code> elements turn blue.</p>
<p>Analogy: You’re calling everyone named “paragraph” at the party.</p>
<h2 id="heading-class-selector-target-a-group">Class Selector: Target a Group</h2>
<p>Sometimes, you want to style only a specific group, not every element of a type. That’s where classes come in.</p>
<p>HTML:</p>
<pre><code class="lang-plaintext">&lt;p class="highlight"&gt;Important paragraph&lt;/p&gt;
&lt;p&gt;Regular paragraph&lt;/p&gt;
</code></pre>
<p>CSS:</p>
<pre><code class="lang-plaintext">.highlight {
  background-color: yellow;
}
</code></pre>
<p>Result: Only the paragraph with <code>class="highlight"</code> gets a yellow background.</p>
<p>Analogy: Imagine wearing a badge only people with the badge get your attention. Classes allow you to <strong>group elements</strong> for targeted styling.</p>
<h2 id="heading-id-selector-target-one-unique-element">ID Selector: Target One Unique Element</h2>
<p>When you need to target a single, unique element, use an ID selector.</p>
<p>HTML:</p>
<pre><code class="lang-plaintext">&lt;p id="main-heading"&gt;Welcome!&lt;/p&gt;
&lt;p&gt;Subheading&lt;/p&gt;
</code></pre>
<p>CSS:</p>
<pre><code class="lang-plaintext">#main-heading {
  font-size: 2rem;
  color: red;
}
</code></pre>
<p>Result: Only the element with <code>id="main-heading"</code> is styled.</p>
<p>Analogy: This is like calling a specific person by name—you know exactly who should respond.</p>
<h2 id="heading-group-selectors-target-multiple-types-together">Group Selectors: Target Multiple Types Together</h2>
<p>What if you want to style multiple different elements the same way? You can group them using commas.</p>
<p>HTML:</p>
<pre><code class="lang-plaintext">h1&gt;Heading&lt;/h1&gt;
h2&gt;Subheading&lt;/h2&gt;
p&gt;Paragraph&lt;/p&gt;
</code></pre>
<p>CSS:</p>
<pre><code class="lang-plaintext">h1, h2, p {
  font-family: Arial, sans-serif;
}
</code></pre>
<p>Result: All headings and paragraphs use the same font.</p>
<p>Analogy: You’re sending a message to multiple people at once.</p>
<h2 id="heading-descendant-selectors-target-elements-inside-others">Descendant Selectors: Target Elements Inside Others</h2>
<p>Sometimes you don’t want to style an element everywhere, only inside another element. That’s where descendant selectors come in.</p>
<p>HTML:</p>
<pre><code class="lang-plaintext">&lt;div class="card"&gt;
  &lt;p&gt;Card content&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Outside content&lt;/p&gt;
</code></pre>
<p>CSS:</p>
<pre><code class="lang-plaintext">.card p {
  color: green;
}
</code></pre>
<p>Result: Only the paragraph inside the <code>.card</code> div turns green.</p>
<p>Analogy: You’re talking <strong>only to people sitting at a specific table</strong>, ignoring the rest.</p>
<h2 id="heading-basic-selector-priority">Basic Selector Priority</h2>
<p>Sometimes, more than one selector targets the same element.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">&lt;p id="intro" class="highlight"&gt;Hello World&lt;/p&gt;
</code></pre>
<pre><code class="lang-plaintext">p {
  color: blue;
}

.highlight {
  color: green;
}

#intro {
  color: red;
}
</code></pre>
<p>Which color will it be? <strong>Red,</strong> Why? Because ID selectors have higher priority than class selectors, and class selectors have higher priority than element selectors.</p>
<p>Very simple rule (for beginners):</p>
<pre><code class="lang-plaintext">ID  &gt;  Class  &gt;  Element
</code></pre>
<p>Think of it like importance levels:</p>
<ul>
<li><p>Calling someone by full name (ID)</p>
</li>
<li><p>Calling a group with badges (Class)</p>
</li>
<li><p>Calling everyone by general category (Element)</p>
</li>
</ul>
<p>You don’t need to memorize deep specificity rules yet, just remember this basic order.</p>
<h1 id="heading-before-amp-after-example">Before &amp; After Example</h1>
<h3 id="heading-html">HTML</h3>
<pre><code class="lang-plaintext">&lt;div class="card"&gt;
  &lt;h2 id="title"&gt;Welcome&lt;/h2&gt;
  &lt;p class="highlight"&gt;Important message&lt;/p&gt;
  &lt;p&gt;Regular message&lt;/p&gt;
&lt;/div&gt;
</code></pre>
<h3 id="heading-css">CSS</h3>
<pre><code class="lang-plaintext">p {
  color: black;
}

.highlight {
  color: orange;
}

#title {
  color: blue;
}

.card p {
  font-style: italic;
}
</code></pre>
<h3 id="heading-what-happens">What Happens?</h3>
<ul>
<li><p>All paragraphs are black by default</p>
</li>
<li><p><code>.highlight</code> paragraph becomes orange</p>
</li>
<li><p><code>#title</code> becomes blue</p>
</li>
<li><p>Paragraphs inside <code>.card</code> become italic</p>
</li>
</ul>
<p>This shows how selectors can:</p>
<ul>
<li><p>Target broadly</p>
</li>
<li><p>Target groups</p>
</li>
<li><p>Target specific elements</p>
</li>
<li><p>Target elements inside other elements</p>
</li>
</ul>
<p>Selectors give you control.</p>
<h1 id="heading-selector-targeting-flow">Selector Targeting Flow</h1>
<p><img src="https://quizzets.wgu.edu/assets/images/tutorial/css-selectors.png" alt="https://quizzets.wgu.edu/assets/images/tutorial/css-selectors.png" /></p>
<p>You can imagine it like this:</p>
<ol>
<li><p>CSS looks at your selector</p>
</li>
<li><p>It scans the HTML</p>
</li>
<li><p>It finds matching elements</p>
</li>
<li><p>It applies styles</p>
</li>
</ol>
<h1 id="heading-class-vs-id">Class vs ID</h1>
<p>Some basic rules to follow are</p>
<h3 id="heading-use-class-when">Use Class When:</h3>
<ul>
<li><p>You want to style multiple elements</p>
</li>
<li><p>You want reusable styles</p>
</li>
<li><p>You’re designing components</p>
</li>
</ul>
<h3 id="heading-use-id-when">Use ID When:</h3>
<ul>
<li><p>The element is unique</p>
</li>
<li><p>It appears only once on the page</p>
</li>
<li><p>You need a specific target</p>
</li>
</ul>
<p>In modern development, classes are used far more often than IDs for styling.</p>
<p>IDs are typically used for:</p>
<ul>
<li><p>Unique sections</p>
</li>
<li><p>JavaScript hooks</p>
</li>
<li><p>Page anchors</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771177982510/2ed254a8-d41e-4511-b5c9-fd903674c567.webp" alt class="image--center mx-auto" /></p>
<h1 id="heading-reinforcing-the-core-idea">Reinforcing the Core Idea</h1>
<p>CSS selectors are not just a feature of CSS. They are the foundation of CSS.</p>
<p>Without selectors:</p>
<ul>
<li><p>You can’t choose elements</p>
</li>
<li><p>You can’t control styling scope</p>
</li>
<li><p>You can’t structure your design system</p>
</li>
</ul>
<p>Selectors allow:</p>
<ul>
<li><p>Precision</p>
</li>
<li><p>Reusability</p>
</li>
<li><p>Clean organization</p>
</li>
</ul>
<h1 id="heading-clean-summary-for-your-blog-ending">Clean Summary for Your Blog Ending</h1>
<p>CSS selectors are ways to choose elements.</p>
<p>They allow you to:</p>
<ul>
<li><p>Target all elements of a type (Element selector)</p>
</li>
<li><p>Target a group (Class selector)</p>
</li>
<li><p>Target a unique element (ID selector)</p>
</li>
<li><p>Target multiple elements together (Group selector)</p>
</li>
<li><p>Target elements inside others (Descendant selector)</p>
</li>
</ul>
<p>And when conflicts happen:</p>
<pre><code class="lang-plaintext">ID &gt; Class &gt; Element
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Emmet for HTML: A Beginner’s Guide to Writing Faster Markup]]></title><description><![CDATA[Feeling Slow Writing HTML?
If you’ve ever written HTML from scratch, you know the struggle:
<div class="container">
  <header>
    <h1>Welcome</h1>
  </header>
  <main>
    <p>Hello, world!</p>
  </main>
  <footer>
    <p>© 2026</p>
  </footer>
</div...]]></description><link>https://surajjena.hashnode.dev/emmet-for-html-a-beginners-guide-to-writing-faster-markup</link><guid isPermaLink="true">https://surajjena.hashnode.dev/emmet-for-html-a-beginners-guide-to-writing-faster-markup</guid><category><![CDATA[HTML5]]></category><category><![CDATA[HTML tags ]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sun, 01 Feb 2026 18:16:40 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-feeling-slow-writing-html">Feeling Slow Writing HTML?</h2>
<p>If you’ve ever written HTML from scratch, you know the struggle:</p>
<pre><code class="lang-plaintext">&lt;div class="container"&gt;
  &lt;header&gt;
    &lt;h1&gt;Welcome&lt;/h1&gt;
  &lt;/header&gt;
  &lt;main&gt;
    &lt;p&gt;Hello, world!&lt;/p&gt;
  &lt;/main&gt;
  &lt;footer&gt;
    &lt;p&gt;© 2026&lt;/p&gt;
  &lt;/footer&gt;
&lt;/div&gt;
</code></pre>
<p>It’s a lot of typing, and small mistakes, like missing a closing tag which can break your layout. What if you could type a few characters and instantly generate all of this? That’s exactly what <strong>Emmet</strong> does.</p>
<h2 id="heading-what-is-emmet">What Is Emmet?</h2>
<p>Emmet is a shortcut language for writing HTML and CSS.</p>
<p>Think of it like a magic abbreviation system: instead of typing every tag manually, you type a condensed version, press Tab, and Emmet expands it into full code.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">ul&gt;li*3
</code></pre>
<p>Expands into:</p>
<pre><code class="lang-plaintext">&lt;ul&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
<p>Suddenly, writing repetitive markup feels effortless.</p>
<h2 id="heading-why-emmet-is-useful-for-beginners">Why Emmet Is Useful for Beginners</h2>
<ul>
<li><p><strong>Saves time</strong>: Generate multiple elements in seconds.</p>
</li>
<li><p><strong>Reduces mistakes</strong>: Less chance of forgetting closing tags.</p>
</li>
<li><p><strong>Improves workflow</strong>: Focus more on content and structure, not repetitive typing.</p>
</li>
<li><p><strong>Easy to learn</strong>: Start small and grow your shortcuts gradually.</p>
</li>
</ul>
<p>Even if you don’t use all the advanced features, Emmet can speed up daily coding tasks from day one.</p>
<h2 id="heading-how-emmet-works-inside-code-editors">How Emmet Works Inside Code Editors</h2>
<p>Most modern editors, like VS Code, Sublime Text, Atom, or WebStorm, come with Emmet built-in.</p>
<p>Here’s the workflow:</p>
<ol>
<li><p>You type an Emmet abbreviation.</p>
</li>
<li><p>Press Tab (or the editor’s expand key).</p>
</li>
<li><p>The abbreviation expands into full HTML.</p>
</li>
</ol>
<p>It works anywhere you type HTML or CSS. No special setup is needed in most editors.</p>
<h2 id="heading-basic-emmet-syntax-and-abbreviations">Basic Emmet Syntax and Abbreviations</h2>
<p>Let’s start with the fundamentals. Here’s what Emmet can do:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Symbol</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr>
<td><code>&gt;</code></td><td>Child element</td></tr>
<tr>
<td><code>+</code></td><td>Sibling element</td></tr>
<tr>
<td><code>*</code></td><td>Repeat elements</td></tr>
<tr>
<td><code>.</code></td><td>Class</td></tr>
<tr>
<td><code>#</code></td><td>ID</td></tr>
<tr>
<td><code>[]</code></td><td>Attributes</td></tr>
</tbody>
</table>
</div><p>We’ll see these in action with small examples.</p>
<h2 id="heading-creating-html-elements-using-emmet">Creating HTML Elements Using Emmet</h2>
<p>Want a single <code>&lt;div&gt;</code>? Type:</p>
<pre><code class="lang-plaintext">div
</code></pre>
<p>Press <strong>Tab</strong>, and you get:</p>
<pre><code class="lang-plaintext">&lt;div&gt;&lt;/div&gt;
</code></pre>
<p>Want an <code>&lt;h1&gt;</code>? Just type:</p>
<pre><code class="lang-plaintext">h1
</code></pre>
<p>Expands to:</p>
<pre><code class="lang-plaintext">&lt;h1&gt;&lt;/h1&gt;
</code></pre>
<p>It’s simple, but it starts building muscle memory for faster typing.</p>
<h2 id="heading-adding-classes-ids-and-attributes">Adding Classes, IDs, and Attributes</h2>
<p>Adding a class or ID in standard HTML:</p>
<pre><code class="lang-plaintext">&lt;div class="container" id="main"&gt;&lt;/div&gt;
</code></pre>
<p>With Emmet:</p>
<pre><code class="lang-plaintext">div#main.container
</code></pre>
<p>Expands to the same HTML.</p>
<p>For attributes:</p>
<pre><code class="lang-plaintext">a[href="https://example.com"]
</code></pre>
<p>Expands into:</p>
<pre><code class="lang-plaintext">&lt;a href="https://example.com"&gt;&lt;/a&gt;
</code></pre>
<p>You can combine multiple classes and IDs:</p>
<pre><code class="lang-plaintext">div#header.logo.main
</code></pre>
<h2 id="heading-creating-nested-elements">Creating Nested Elements</h2>
<p>Nested elements mean elements inside other elements.</p>
<p>Without Emmet, you would write:</p>
<pre><code class="lang-plaintext">&lt;div&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</code></pre>
<p>With Emmet:</p>
<pre><code class="lang-plaintext">div&gt;ul&gt;li
</code></pre>
<p>Press <strong>Tab</strong>, and it expands to:</p>
<pre><code class="lang-plaintext">&lt;div&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</code></pre>
<h3 id="heading-what-does-gt-mean">What does <code>&gt;</code> mean?</h3>
<p><code>&gt;</code> means <strong>‘</strong>inside<strong>’</strong> or child of.</p>
<p>So:</p>
<pre><code class="lang-plaintext">div&gt;p
</code></pre>
<p>Means:</p>
<pre><code class="lang-plaintext">&lt;div&gt;
  &lt;p&gt;&lt;/p&gt;
&lt;/div&gt;
</code></pre>
<p>Think of <code>&gt;</code> as saying: “Put this inside that.”</p>
<h2 id="heading-creating-sibling-elements">Creating Sibling Elements</h2>
<p>If you want elements next to each other (not inside), use <code>+</code>.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">h1+p
</code></pre>
<p>Expands to:</p>
<pre><code class="lang-plaintext">&lt;h1&gt;&lt;/h1&gt;
&lt;p&gt;&lt;/p&gt;
</code></pre>
<p>Here:</p>
<ul>
<li><p><code>&gt;</code> = inside</p>
</li>
<li><p><code>+</code> = next to</p>
</li>
</ul>
<h2 id="heading-repeating-elements-using-multiplication">Repeating Elements Using Multiplication</h2>
<p>Let’s say you want 5 list items.</p>
<p>Normally:</p>
<pre><code class="lang-plaintext">&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
</code></pre>
<p>With Emmet</p>
<pre><code class="lang-plaintext">li*5
</code></pre>
<p>Expands into:</p>
<pre><code class="lang-plaintext">&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
</code></pre>
<p>You can combine nesting and repetition</p>
<pre><code class="lang-plaintext">ul&gt;li*3
</code></pre>
<p>Expands to:</p>
<pre><code class="lang-plaintext">&lt;ul&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771177197003/33b203f6-f7e6-4260-b7d1-1371cfa4795a.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-side-by-side-abbreviation-html">Side-by-Side: Abbreviation → HTML</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Emmet</td><td>Expands To</td></tr>
</thead>
<tbody>
<tr>
<td><code>div</code></td><td><code>&lt;div&gt;&lt;/div&gt;</code></td></tr>
<tr>
<td><code>ul&gt;li*3</code></td><td><code>&lt;ul&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;li&gt;&lt;/li&gt;&lt;/ul&gt;</code></td></tr>
<tr>
<td><code>div#main.container</code></td><td><code>&lt;div id="main" class="container"&gt;&lt;/div&gt;</code></td></tr>
<tr>
<td><code>a[href="#"]</code></td><td><code>&lt;a href="#"&gt;&lt;/a&gt;</code></td></tr>
</tbody>
</table>
</div><h1 id="heading-generating-full-html-boilerplate">Generating Full HTML Boilerplate</h1>
<p>This is where beginners get amazed. Instead of typing:</p>
<pre><code class="lang-plaintext">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>You just type:</p>
<pre><code class="lang-plaintext">!
</code></pre>
<p>Press <strong>Tab</strong> — and the entire structure appears instantly. This alone saves beginners a lot of time.</p>
<h2 id="heading-how-emmet-works-internally">How Emmet Works Internally</h2>
<p>Here’s what happens:</p>
<ol>
<li><p>You type an abbreviation</p>
</li>
<li><p>The editor detects Emmet syntax</p>
</li>
<li><p>It converts the abbreviation into structured HTML</p>
</li>
<li><p>It inserts properly nested, formatted code</p>
</li>
</ol>
<p>You can think of Emmet as, a mini translator inside your editor.</p>
<h2 id="heading-emmet-abbreviation-expansion-flow">Emmet Abbreviation → Expansion Flow</h2>
<p><img src="https://images.openai.com/thumbnails/url/-_nWHHicu5mVUVJSUGylr5-al1xUWVCSmqJbkpRnoJdeXJJYkpmsl5yfq5-Zm5ieWmxfaAuUsXL0S7F0Tw4MLXCMqLIMqkry9nZKC4mqCLWMysy38DIzKw_1N8kIijDTTQvwzijxKTMydXFyiiyNVCsGAHt7JeI" alt="https://code.visualstudio.com/assets/docs/languages/emmet/emmet-multi-cursor.gif" /></p>
<p><img src="https://images.openai.com/static-rsc-1/Vb8E0Y72WsI-KKqXdYuYrgT6X8upRpBFt43_YHDV8dv7-lL-Fv25dGKZ7nYLc4zFYQJIJ1nm4bGcBQIhVHjmSmMxf-2eiD5P3Dx4vsrI1RJq_5oheD8h9v_VWj8-BiXve6BFCXmXaIfudLJ3SgvP9A" alt="https://web.simmons.edu/~grabiner/comm244/weekfour/tree.gif" /></p>
<p>Flow: You type → Editor recognizes Emmet → Press Tab → Structured HTML appears</p>
]]></content:encoded></item><item><title><![CDATA[How a Browser Works: A Beginner-Friendly Guide to Browser Internals]]></title><description><![CDATA[A Simple Question That Starts Everything
You open your browser, type a website address, and press Enter. Within a fraction of a second, text appears, images load, and the page feels alive. Most of us stop thinking at that point the browser did its jo...]]></description><link>https://surajjena.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</link><guid isPermaLink="true">https://surajjena.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</guid><category><![CDATA[Browsers]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sun, 01 Feb 2026 18:12:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771176157725/bf6aef61-1aaa-44d8-b8fa-c378e7fd6fcc.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-a-simple-question-that-starts-everything">A Simple Question That Starts Everything</h2>
<p>You open your browser, type a website address, and press Enter. Within a fraction of a second, text appears, images load, and the page feels alive. Most of us stop thinking at that point the browser did its job. But behind the scenes, something much more interesting happen actually.<br />Your browser didn’t simply open a website. It performed a carefully coordinated series of steps involving networking, parsing, building structures, applying styles, calculating layouts, and finally painting pixels on your screen.</p>
<p>Let’s walk through this journey together slowly, visually, and without drowning in technical terminology.</p>
<h2 id="heading-what-is-a-browser-in-real">What Is a Browser in real?</h2>
<p>At a basic level, a browser is a software application that understands web languages and turns them into interactive pages.</p>
<p>Those languages are mainly:</p>
<ul>
<li><p><strong>HTML</strong> for structure</p>
</li>
<li><p><strong>CSS</strong> for styling</p>
</li>
<li><p><strong>JavaScript</strong> for behavior</p>
</li>
</ul>
<p>You can think of the browser as a translator and builder combined. It takes text-based instructions written by developers and converts them into something humans can see and use.</p>
<p>Instead of seeing the browser as a single tool, it’s better to imagine it as a team of specialized components working together.</p>
<h2 id="heading-the-big-picture-main-parts-of-a-browser">The Big Picture: Main Parts of a Browser</h2>
<p>Before diving deeper, let’s zoom out.</p>
<p>A browser is made up of several major parts:</p>
<ul>
<li><p>User Interface</p>
</li>
<li><p>Browser Engine</p>
</li>
<li><p>Rendering Engine</p>
</li>
<li><p>Networking</p>
</li>
<li><p>JavaScript Engine</p>
</li>
<li><p>Data Storage</p>
</li>
</ul>
<p>You don’t need to memorize this list. The goal is simply to understand that each part has a specific job, and no single component does everything.</p>
<h2 id="heading-the-user-interface-where-you-interact">The User Interface: Where You Interact</h2>
<p>This is the most familiar part of the browser.</p>
<p>It includes:</p>
<ul>
<li><p>The address bar</p>
</li>
<li><p>Tabs</p>
</li>
<li><p>Navigation buttons</p>
</li>
<li><p>Menus and settings</p>
</li>
</ul>
<p>The User Interface is how you communicate with the browser. When you type a URL and press Enter, the interface hands that request to the browser’s internal systems and steps aside.</p>
<p>From this point on, the heavy lifting happens behind the scenes.</p>
<h2 id="heading-browser-engine-vs-rendering-engine">Browser Engine vs Rendering Engine</h2>
<p>These two terms often confuse beginners, so let’s keep it simple.</p>
<ul>
<li><p>The Browser Engine acts as a coordinator. It connects the user interface with the rendering process and manages the overall flow.</p>
</li>
<li><p>The Rendering Engine is responsible for turning code into visuals. It reads HTML and CSS and decides what should appear on the screen.</p>
</li>
</ul>
<p>Different browsers use different rendering engines:</p>
<ul>
<li><p>Chrome and Edge use Chromium</p>
</li>
<li><p>Firefox uses Gecko</p>
</li>
</ul>
<h2 id="heading-networking-fetching-the-website-from-the-internet">Networking: Fetching the Website from the Internet</h2>
<p>Once you press Enter, the browser doesn’t magically have the page. It has to request it from somewhere else.</p>
<p>The networking layer handles this process:</p>
<ul>
<li><p>It figures out where the website is located</p>
</li>
<li><p>Sends a request over the internet</p>
</li>
<li><p>Receives the response</p>
</li>
</ul>
<p>That response usually contains:</p>
<ul>
<li><p>An HTML file</p>
</li>
<li><p>Links to CSS files</p>
</li>
<li><p>References to JavaScript files</p>
</li>
<li><p>Images and fonts</p>
</li>
</ul>
<p>You can imagine this like ordering furniture online. The browser doesn’t build anything until the materials arrive.</p>
<h2 id="heading-parsing-how-browsers-understand-code">Parsing: How Browsers Understand Code</h2>
<p>Before anything can be displayed, the browser needs to understand the files it receives.</p>
<p>This process is called <strong>parsing</strong>.</p>
<p>Parsing means breaking information into smaller pieces and analyzing how those pieces fit together.</p>
<h3 id="heading-a-simple-parsing-example">A Simple Parsing Example</h3>
<p>Consider this expression:</p>
<pre><code class="lang-plaintext">3 + 5 × 2
</code></pre>
<p>To understand it correctly, you don’t just read it left to right. You recognize structure and rules. Multiplication happens before addition.</p>
<p>Browsers do something similar when reading HTML and CSS.</p>
<h2 id="heading-html-parsing-and-dom-creation">HTML Parsing and DOM Creation</h2>
<p>When the browser receives HTML, it starts reading it from top to bottom.</p>
<p>As it parses the HTML, it builds a structure called the DOM (Document Object Model).</p>
<p>The DOM is best imagined as a <strong>tree</strong>:</p>
<ul>
<li><p>The <code>&lt;html&gt;</code> element is the root</p>
</li>
<li><p>Inside it are <code>&lt;head&gt;</code> and <code>&lt;body&gt;</code></p>
</li>
<li><p>Inside the body are headings, paragraphs, images, buttons, and more</p>
</li>
</ul>
<p>Each element becomes a node in this tree.</p>
<p>This structure allows the browser to:</p>
<ul>
<li><p>Understand the relationships between elements</p>
</li>
<li><p>Modify content dynamically</p>
</li>
<li><p>Respond to JavaScript interactions</p>
</li>
</ul>
<p>The DOM is not the page itself—it’s the browser’s internal representation of the page.</p>
<h2 id="heading-css-parsing-and-cssom-creation">CSS Parsing and CSSOM Creation</h2>
<p>HTML defines what exists. CSS defines how it looks.</p>
<p>When the browser encounters CSS, it parses it and builds another structure called the <strong>CSSOM (CSS Object Model).</strong></p>
<p>If the DOM is a tree of elements, the CSSOM is a tree of styling rules.</p>
<p>For example:</p>
<pre><code class="lang-plaintext">p {
  color: blue;
  font-size: 18px;
}
</code></pre>
<p>The browser reads this and understands:</p>
<ul>
<li><p>Target: all <code>&lt;p&gt;</code> elements</p>
</li>
<li><p>Style rules: blue text, 18px font size</p>
</li>
</ul>
<p>Just like HTML becomes a DOM tree, CSS becomes a structured tree of styling instructions.</p>
<h1 id="heading-dom-cssom-the-render-tree">DOM + CSSOM → The Render Tree</h1>
<p>Now comes the magic moment.</p>
<p>The browser takes:</p>
<ul>
<li><p>The <strong>DOM</strong> (structure)</p>
</li>
<li><p>The <strong>CSSOM</strong> (styles)</p>
</li>
</ul>
<p>And combines them into something called the:</p>
<h2 id="heading-render-tree"><strong>Render Tree</strong></h2>
<p>Think of it like this:</p>
<ul>
<li><p>DOM = The skeleton of a house</p>
</li>
<li><p>CSSOM = The paint, colors, decoration rules</p>
</li>
<li><p>Render Tree = The final decorated blueprint ready to build</p>
</li>
</ul>
<p>Important detail:</p>
<p>The Render Tree only includes visible elements.</p>
<p>If something has:</p>
<pre><code class="lang-plaintext">display: none;
</code></pre>
<p>It exists in the DOM, but it does not appear in the Render Tree.</p>
<h2 id="heading-visual-flow-so-far">Visual Flow So Far</h2>
<p><img src="https://web.dev/static/articles/critical-rendering-path/render-tree-construction/image/dom-cssom-are-combined-8de5805b2061e.png" alt="https://web.dev/static/articles/critical-rendering-path/render-tree-construction/image/dom-cssom-are-combined-8de5805b2061e.png" /></p>
<p>Flow: HTML → DOM , CSS → CSSOM , DOM + CSSOM → Render Tree</p>
<h1 id="heading-layout-calculating-positions">Layout: Calculating Positions</h1>
<p>Now the browser knows: What to display and how it should look. But it still doesn’t know: Where things should go and how big they should be. This step is called <strong>Layout</strong> (also known as Reflow).</p>
<p>During layout, the browser calculates:</p>
<ul>
<li><p>Element width</p>
</li>
<li><p>Element height</p>
</li>
<li><p>Margins</p>
</li>
<li><p>Padding</p>
</li>
<li><p>Position on screen</p>
</li>
</ul>
<p>For example:</p>
<ul>
<li><p>This div is 300px wide</p>
</li>
<li><p>This image is centered</p>
</li>
<li><p>This button sits below the paragraph</p>
</li>
</ul>
<p>It’s like arranging furniture inside a room.</p>
<p>If something changes later (like resizing the window), layout may happen again that’s why it’s sometimes called <strong>reflow</strong>.</p>
<h1 id="heading-paint-filling-in-the-colors">Paint: Filling in the Colors</h1>
<p>After layout, the browser knows the size, position and structure. Now it needs to actually draw. This step is called painting.</p>
<h2 id="heading-painting"><strong>Painting</strong></h2>
<p>Here the browser perform all this task</p>
<ul>
<li><p>Draws text</p>
</li>
<li><p>Fills colors</p>
</li>
<li><p>Applies shadows</p>
</li>
<li><p>Renders borders</p>
</li>
<li><p>Displays images</p>
</li>
</ul>
<p>Think of layout as outlining shapes in pencil.<br />Paint is filling them with color.</p>
<h1 id="heading-display-showing-pixels-on-screen">Display: Showing Pixels on Screen</h1>
<p>Finally, the painted layers are:</p>
<ul>
<li><p>Combined</p>
</li>
<li><p>Sent to the screen</p>
</li>
<li><p>Converted into pixels</p>
</li>
</ul>
<p>And you see the webpage and all of this happens in milliseconds.</p>
<h2 id="heading-the-full-journey-from-url-to-pixels">The Full Journey: From URL to Pixels</h2>
<p><img src="https://media2.dev.to/dynamic/image/width%3D800%2Cheight%3D%2Cfit%3Dscale-down%2Cgravity%3Dauto%2Cformat%3Dauto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnmgeburj0q5o1vazjkxr.png" alt="https://media2.dev.to/dynamic/image/width%3D800%2Cheight%3D%2Cfit%3Dscale-down%2Cgravity%3Dauto%2Cformat%3Dauto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnmgeburj0q5o1vazjkxr.png" /></p>
<p><img src="https://webperf.tips/static/4e73c9992ce3b9177bcc80a2113b3138/906b5/BrowserRenderingPipeline01.png" alt="https://webperf.tips/static/4e73c9992ce3b9177bcc80a2113b3138/906b5/BrowserRenderingPipeline01.png" /></p>
<p>Here’s the complete story:</p>
<ul>
<li><p>You type a URL</p>
</li>
<li><p>Browser sends network request</p>
</li>
<li><p>Server responds with HTML</p>
</li>
<li><p>Browser parses HTML → builds DOM</p>
</li>
<li><p>Browser parses CSS → builds CSSOM</p>
</li>
<li><p>DOM + CSSOM → Render Tree</p>
</li>
<li><p>Layout (calculate positions)</p>
</li>
<li><p>Paint (draw elements)</p>
</li>
<li><p>Display pixels on screen</p>
</li>
</ul>
<h1 id="heading-where-does-javascript-fit">Where Does JavaScript Fit?</h1>
<p>We kept JavaScript light on purpose.</p>
<p>JavaScript can:</p>
<ul>
<li><p>Modify the DOM</p>
</li>
<li><p>Change CSS styles</p>
</li>
<li><p>Add or remove elements</p>
</li>
</ul>
<p>If JavaScript changes something:</p>
<ul>
<li><p>The DOM updates</p>
</li>
<li><p>The Render Tree may update</p>
</li>
<li><p>Layout and Paint may run again</p>
</li>
</ul>
<p>That’s how pages become interactive.</p>
<h1 id="heading-very-simple-parsing-analogy">Very Simple Parsing Analogy</h1>
<p>Parsing means breaking something into parts and understanding structure.</p>
<p>Sentence example: The cat sat.<br />You understand: Subject → The cat , Verb → sat</p>
<p>Math example:</p>
<p>3 + 5 × 2</p>
<p>You build a structure internally:</p>
<pre><code class="lang-plaintext">   +
  / \
 3   ×
    / \
   5   2
</code></pre>
<p>Browsers do this with HTML and CSS.</p>
<p>They don’t just read text.<br />They build structured trees.</p>
<h1 id="heading-high-level-browser-architecture">High-Level Browser Architecture</h1>
<p>Let’s recap once more,</p>
<p>A browser is a collection of cooperating systems:</p>
<ul>
<li><p><strong>User Interface</strong> → where you type and click</p>
</li>
<li><p><strong>Browser Engine</strong> → the coordinator</p>
</li>
<li><p><strong>Rendering Engine</strong> → builds and paints pages</p>
</li>
<li><p><strong>Networking</strong> → fetches files</p>
</li>
<li><p><strong>JavaScript Engine</strong> → executes scripts</p>
</li>
<li><p><strong>Storage</strong> → saves cookies, cache, local data</p>
</li>
</ul>
<p>Examples of rendering engines:</p>
<ul>
<li><p>Chromium (used by Chrome &amp; Edge)</p>
</li>
<li><p>Gecko (used by Firefox)</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Getting Started with HTML Tags and Elements]]></title><description><![CDATA[In general term HTML is a language for website creation , and generally referred a the foundation of the web. It is generally used for the creation and structure of sections, paragraphs, and links using HTML elements (the building blocks of a web pag...]]></description><link>https://surajjena.hashnode.dev/getting-started-with-html-tags-and-elements</link><guid isPermaLink="true">https://surajjena.hashnode.dev/getting-started-with-html-tags-and-elements</guid><category><![CDATA[HTML5]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[HTML tags ]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sun, 01 Feb 2026 18:01:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771174600846/56d6c210-3e72-4917-b914-0b9f4ea976b1.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769952007082/f235682e-f619-4e59-9325-0cfa6154b29e.png" alt class="image--center mx-auto" /></p>
<p>In general term HTML is a language for website creation , and generally referred a the foundation of the web. It is generally used for the creation and structure of sections, paragraphs, and links using HTML elements (the building blocks of a web page) such as tags and attributes.</p>
<p>Before the visuals wow us and the interactions amaze us, every great website starts with a script <strong>HTML</strong>.<br /><strong>HTML</strong> doesn’t make pages pretty, it makes them readable, just like a book’s structure. You are able to read this because of html.</p>
<p>Lets deep dive into and learn what HTML is and how its work.</p>
<h2 id="heading-html-document-structure">HTML Document Structure</h2>
<p>The above code shows the basic boilerplate code for the HTML.</p>
<p><code>&lt;!DOCTYPE html&gt;</code> - This declaration notify the browser about the document type and version of HTML used, ensuring proper rendering and preventing potential issues.</p>
<p><code>&lt;html&gt;&lt;/html&gt;</code> - This element act as a wrapper holding the entire page and is sometimes known as the base element. It includes the <code>lang</code> attribute, setting the primary language of the document.</p>
<p><code>&lt;head&gt;&lt;/head&gt;</code> - This element holds the document’s metadata and configuration data rather than user-facing content. It contains SEO-related information, stylesheet references, character set definitions, and other resources required for proper page rendering.</p>
<p><code>&lt;meta charset="utf-8"&gt;</code> -This element specifies UTF-8 as the document’s character encoding, enabling broad multilingual character support and reducing the risk of text-rendering problems.</p>
<p><code>&lt;meta name="viewport" content="width=device-width"&gt;</code> - This viewport element tells the browser to match the page width to the device’s screen width, preventing mobile browsers from displaying the page at a larger width and scaling it down</p>
<p><code>&lt;title&gt;&lt;/title&gt;</code> - This sets the title of your page, which is the title that appears in the browser tab the page is loaded in. It is also used to describe the page when you bookmark/favorite it.</p>
<p><code>&lt;body&gt;&lt;/body&gt;</code> - This contains <em>all</em> the content that you want to show to web users when they visit your page, whether that's text, images, videos, games, playable audio tracks, or whatever else.</p>
<h1 id="heading-html-the-skeleton-of-a-webpage">HTML — The Skeleton of a Webpage</h1>
<p>Think of a website like a human body:</p>
<ul>
<li><p><strong>HTML</strong> → Skeleton (structure)</p>
</li>
<li><p>CSS → Skin (style)</p>
</li>
<li><p>JavaScript → Muscles (behavior)</p>
</li>
</ul>
<p>HTML does not make a page beautiful — it gives it <strong>structure and meaning</strong>.</p>
<h1 id="heading-what-is-an-html-tag">What is an HTML Tag?</h1>
<p>An <strong>HTML tag</strong> is a keyword enclosed in angle brackets <code>&lt; &gt;</code>.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">&lt;p&gt; This is a paragraph tag &lt;/p&gt;
</code></pre>
<p>You can think of a tag like a <strong>label on a box</strong>.<br />It tells the browser what kind of content is inside.</p>
<p>For example:</p>
<ul>
<li><p><code>&lt;p&gt;</code> → This is a paragraph</p>
</li>
<li><p><code>&lt;h1&gt;</code> → This is a main heading</p>
</li>
<li><p><code>&lt;div&gt;</code> → This is a container</p>
</li>
<li><p><code>&lt;span&gt;</code> → This is a small inline container</p>
</li>
</ul>
<h1 id="heading-opening-tag-closing-tag-and-content">Opening Tag, Closing Tag, and Content</h1>
<p>Most HTML tags which we use come in pairs:</p>
<pre><code class="lang-plaintext">&lt;p&gt;This is a paragraph&lt;/p&gt;
</code></pre>
<pre><code class="lang-plaintext">&lt;p&gt;        → Opening tag  
This is a paragraph → Content  
&lt;/p&gt;       → Closing tag
</code></pre>
<p>The closing tag has a forward slash /.</p>
<h3 id="heading-box-analogy">Box Analogy</h3>
<p>Think of it like a box:</p>
<pre><code class="lang-plaintext">Opening Tag  →  box with open lids
Content      →  content inside the box
Closing Tag  →  closed box
</code></pre>
<hr />
<h1 id="heading-what-is-an-html-element">What is an HTML Element?</h1>
<p>An <strong>HTML element</strong> is everything together:</p>
<pre><code class="lang-plaintext">Opening Tag + Content + Closing Tag
</code></pre>
<p>Example:</p>
<pre><code class="lang-plaintext">&lt;h1&gt;Welcome&lt;/h1&gt;
</code></pre>
<p>Here:</p>
<ul>
<li><p><code>&lt;h1&gt;</code> → Tag</p>
</li>
<li><p><code>Welcome</code> → Content</p>
</li>
<li><p><code>&lt;/h1&gt;</code> → Closing tag</p>
</li>
<li><p>Entire thing → <strong>Element</strong></p>
</li>
</ul>
<h3 id="heading-difference-between-tag-and-element">🔎 Difference Between Tag and Element</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Term</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr>
<td>Tag</td><td>Just the label (<code>&lt;p&gt;</code>)</td></tr>
<tr>
<td>Element</td><td>Full structure (<code>&lt;p&gt;Hello&lt;/p&gt;</code>)</td></tr>
</tbody>
</table>
</div><h1 id="heading-self-closing-void-elements">Self-Closing (Void) Elements</h1>
<p>Some HTML elements <strong>do not need a closing tag</strong>.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">&lt;img src="image.jpg"&gt;
&lt;br&gt;
&lt;hr&gt;
</code></pre>
<p>These are called <strong>void elements</strong>. Why? Because they do not wrap content.</p>
<p>Examples:</p>
<ul>
<li><p>&lt;img&gt; → Displays an image</p>
</li>
<li><p>&lt;br&gt; → Line break</p>
</li>
<li><p>&lt;hr&gt; → Horizontal line</p>
</li>
</ul>
<h1 id="heading-block-level-vs-inline-elements">Block-Level vs Inline Elements</h1>
<h2 id="heading-block-level-elements">Block-Level Elements</h2>
<p>A block-level element always starts on a new line, and the browsers automatically add some space (a margin) before and after the element.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">&lt;h1&gt;Heading&lt;/h1&gt;
&lt;p&gt;Paragraph text&lt;/p&gt;
&lt;div&gt;Container&lt;/div&gt;
</code></pre>
<h3 id="heading-visual-idea">Visual Idea:</h3>
<pre><code class="lang-plaintext">[Heading          ]
[Paragraph        ]
[Another Section  ]
</code></pre>
<p>Each appears on a new line.</p>
<h2 id="heading-inline-elements">Inline Elements</h2>
<p><strong>Inline elements</strong> in HTML are elements that do not start on a new line and only take up as much width as necessary to display their content.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">&lt;span&gt;Hello&lt;/span&gt;
&lt;span&gt;World&lt;/span&gt;
</code></pre>
<h3 id="heading-visual-idea-1">Visual Idea:</h3>
<pre><code class="lang-plaintext">Hello World
</code></pre>
<h1 id="heading-commonly-used-html-tags-beginner-level">Commonly Used HTML Tags (Beginner Level)</h1>
<h3 id="heading-headings">Headings</h3>
<pre><code class="lang-plaintext">&lt;h1&gt;Main Heading&lt;/h1&gt;
&lt;h2&gt;Subheading&lt;/h2&gt;
</code></pre>
<h3 id="heading-paragraph">Paragraph</h3>
<pre><code class="lang-plaintext">&lt;p&gt;This is a paragraph.&lt;/p&gt;
</code></pre>
<h3 id="heading-division-container">Division (Container)</h3>
<pre><code class="lang-plaintext">&lt;div&gt;This is a section&lt;/div&gt;
</code></pre>
<h3 id="heading-span-inline-container">Span (Inline container)</h3>
<pre><code class="lang-plaintext">&lt;span&gt;Inline text&lt;/span&gt;
</code></pre>
<h3 id="heading-link">Link</h3>
<pre><code class="lang-plaintext">&lt;a href="https://example.com"&gt;Visit Website&lt;/a&gt;
</code></pre>
<h3 id="heading-image">Image</h3>
<pre><code class="lang-plaintext">&lt;img src="photo.jpg" alt="My Photo"&gt;
</code></pre>
<h1 id="heading-simple-mini-example">Simple Mini Example</h1>
<pre><code class="lang-plaintext">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;My Title&lt;/title&gt;         //title of the Webpage
&lt;/head&gt;
&lt;body&gt;
  &lt;h1&gt;Welcome&lt;/h1&gt;
  &lt;p&gt;This is my first website.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
]]></content:encoded></item><item><title><![CDATA[DNS Record Type]]></title><description><![CDATA[Ever thought each time you type a website like google.com into your browser, the internet somehow knows where to send your request. But how does your browser know which server hosting the site?The answer is DNS, also called phonebook of the internet....]]></description><link>https://surajjena.hashnode.dev/how-dns-record-type</link><guid isPermaLink="true">https://surajjena.hashnode.dev/how-dns-record-type</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[dns]]></category><category><![CDATA[dns-records]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sat, 31 Jan 2026 18:29:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771167071867/6d8aa9c9-149c-4936-84b6-0c370e4eb562.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ever thought each time you type a website like google.com into your browser, the internet somehow knows where to send your request. But how does your browser know which server hosting the site?<br />The answer is DNS, also called phonebook of the internet.</p>
<p>DNS (Domain Name System) translates human-friendly names into addresses computers can use to deliver web pages, emails, and other services. Let’s break it down in simple terms.</p>
<h1 id="heading-what-is-dns">What Is DNS?</h1>
<p><strong>DNS (Domain Name System)</strong> translates human-friendly domain names into machine-friendly IP addresses.</p>
<p>Humans remember:</p>
<pre><code class="lang-plaintext">google.com
chaicode.com
github.com
</code></pre>
<p>Computers communicate using numbers:</p>
<pre><code class="lang-plaintext">142.250.190.14
</code></pre>
<p>DNS bridges that gap.</p>
<p>Without DNS, you would need to memorize IP addresses for every website you visit. Worse, if a website changes its hosting provider and its IP changes, everyone would need the new number manually. DNS makes infrastructure flexible and scalable.</p>
<h1 id="heading-why-dns-exists-beyond-the-phonebook-analogy">Why DNS Exists (Beyond the Phonebook Analogy)</h1>
<p>The ‘phonebook’ analogy is useful, but DNS is much more powerful than a simple lookup table.</p>
<p>DNS enables:</p>
<ul>
<li><p>Infrastructure changes without changing domain names</p>
</li>
<li><p>Load balancing across multiple servers</p>
</li>
<li><p>Failover and high availability</p>
</li>
<li><p>Email routing</p>
</li>
<li><p>Security verification</p>
</li>
<li><p>CDN integration</p>
</li>
<li><p>Global traffic management</p>
</li>
</ul>
<p>DNS is not just a directory, it is a distributed control system for the internet.</p>
<h1 id="heading-how-dns-resolution-actually-happens">How DNS Resolution Actually Happens</h1>
<p>When you type:</p>
<pre><code class="lang-plaintext">www.chaicode.com
</code></pre>
<p>Here’s what happens behind the scenes:</p>
<ul>
<li><p>Your browser checks its cache.</p>
</li>
<li><p>Your operating system checks its DNS cache.</p>
</li>
<li><p>Your system queries a recursive DNS resolver (usually from your ISP).</p>
</li>
<li><p>The resolver:</p>
<ul>
<li><p>Contacts root name servers</p>
</li>
<li><p>Then TLD servers (.com, .org, etc.)</p>
</li>
<li><p>Then authoritative name servers</p>
</li>
</ul>
</li>
<li><p>The authoritative server returns the correct IP address.</p>
</li>
<li><p>Your browser connects to that IP.</p>
</li>
</ul>
<p>This entire process usually takes milliseconds.</p>
<h1 id="heading-why-dns-records-are-needed">Why DNS Records Are Needed</h1>
<p>DNS works because of <strong>DNS</strong> records.</p>
<p>Think of DNS records as instructions stored in a global distributed database. They tell the internet, if someone asks for this name, here’s what to do.</p>
<p>Without DNS records:</p>
<ul>
<li><p>Websites wouldn’t load</p>
</li>
<li><p>Emails wouldn’t arrive</p>
</li>
<li><p>Domain ownership couldn’t be verified</p>
</li>
<li><p>Services couldn’t connect properly</p>
</li>
</ul>
<p>Let’s break down the most important record types.</p>
<h1 id="heading-ns-record-who-is-responsible-for-the-domain">NS Record — Who Is Responsible for the Domain</h1>
<p>NS stands for ‘nameserver,’ and the nameserver record indicates which DNS server is authoritative for that domain <a target="_blank" href="https://www.cloudflare.com/learning/dns/glossary/what-is-a-domain-name/">(</a>i.e. which server contains the actual DNS records)</p>
<h3 id="heading-what-it-does">What it does:</h3>
<p>Specifies which name servers are authoritative for your domain.</p>
<h3 id="heading-why-it-matters">Why it matters:</h3>
<p>It defines delegation and control.</p>
<p>If your domain uses:</p>
<pre><code class="lang-plaintext">ns1.cloudflare.com
ns2.cloudflare.com
</code></pre>
<p>That means those servers are responsible for answering DNS questions about your domain.</p>
<h3 id="heading-analogy">Analogy:</h3>
<p>Think of it as a registry office that says, if you want information about this street, go talk to this office.</p>
<p>Without NS records, the DNS hierarchy would not work.</p>
<h1 id="heading-a-record-domain-ipv4-address">A Record — Domain → IPv4 Address</h1>
<h3 id="heading-what-it-does-1">What it does:</h3>
<p>Maps a domain name to an IPv4 address.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">example.com → 93.184.216.34
</code></pre>
<h3 id="heading-why-it-matters-1">Why it matters:</h3>
<p>This is what browsers ultimately need.</p>
<p>Without an A record, a website cannot be reached via IPv4.</p>
<h3 id="heading-real-world-impact">Real-World Impact:</h3>
<ul>
<li><p>You can point multiple domains to one server.</p>
</li>
<li><p>You can point one domain to multiple IPs for load balancing.</p>
</li>
</ul>
<h1 id="heading-aaaa-record-domain-ipv6-address">AAAA Record — Domain → IPv6 Address</h1>
<h3 id="heading-what-it-does-2">What it does:</h3>
<p>Maps a domain name to an IPv6 address.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">example.com → 2606:2800:220:1:248:1893:25c8:1946
</code></pre>
<h3 id="heading-why-it-exists">Why it exists:</h3>
<p>IPv4 addresses are limited (~4.3 billion total).<br />IPv6 supports a vastly larger address space.</p>
<p>Modern systems often use both A and AAAA records to support both protocols.</p>
<h1 id="heading-cname-record-alias-to-another-domain">CNAME Record — Alias to Another Domain</h1>
<h3 id="heading-what-it-does-3">What it does:</h3>
<p>Points one domain name to another domain name.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">www.example.com → example.com
</code></pre>
<p>Important distinction:</p>
<ul>
<li><p>A record → points to IP</p>
</li>
<li><p>CNAME → points to another name</p>
</li>
</ul>
<h3 id="heading-why-its-powerful">Why it’s powerful:</h3>
<p>Useful when integrating third-party services like:</p>
<ul>
<li><p>CDNs</p>
</li>
<li><p>SaaS tools</p>
</li>
<li><p>Hosting providers</p>
</li>
</ul>
<p>Instead of pointing to an IP directly, you point to a hostname they manage.</p>
<p>If their IP changes, you don’t need to update anything.</p>
<h1 id="heading-mx-record-email-routing">MX Record — Email Routing</h1>
<h3 id="heading-what-it-does-4">What it does:</h3>
<p>Specifies which server handles email for your domain.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">example.com → mail.example.com
</code></pre>
<h3 id="heading-why-it-matters-2">Why it matters:</h3>
<p>If someone sends an email to:</p>
<pre><code class="lang-plaintext">info@example.com
</code></pre>
<p>The sending mail server checks the MX record to determine where to deliver it.</p>
<h3 id="heading-key-detail">Key detail:</h3>
<p>MX records include priority numbers.</p>
<p>Lower number = higher priority.</p>
<p>If the primary mail server is down, email is delivered to the backup.</p>
<h1 id="heading-txt-record-metadata-and-verification">TXT Record — Metadata and Verification</h1>
<h3 id="heading-what-it-does-5">What it does:</h3>
<p>Stores arbitrary text information.</p>
<h3 id="heading-common-uses">Common Uses:</h3>
<ul>
<li><p>SPF records (prevent email spoofing)</p>
</li>
<li><p>DKIM verification</p>
</li>
<li><p>Domain ownership verification</p>
</li>
<li><p>Service configuration</p>
</li>
<li><p>Security policies</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-plaintext">v=spf1 include:_spf.google.com ~all
</code></pre>
<p>TXT records are critical for modern email security and service authentication.</p>
<h1 id="heading-how-all-dns-records-work-together">How All DNS Records Work Together</h1>
<p>A typical domain might have:</p>
<ul>
<li><p>NS records → define who manages DNS</p>
</li>
<li><p>A / AAAA records → define web server IPs</p>
</li>
<li><p>CNAME records → create aliases</p>
</li>
<li><p>MX records → route email</p>
</li>
<li><p>TXT records → enable security &amp; verification</p>
</li>
</ul>
<p>When a user visits:</p>
<pre><code class="lang-plaintext">www.example.com
</code></pre>
<p>The browser:</p>
<ol>
<li><p>Finds the authoritative name servers (via NS records).</p>
</li>
<li><p>Gets the A/AAAA record.</p>
</li>
<li><p>Connects to the IP address.</p>
</li>
<li><p>Loads the website.</p>
</li>
</ol>
<p>When someone sends email to:</p>
<pre><code class="lang-plaintext">admin@example.com
</code></pre>
<p>Mail servers:</p>
<ol>
<li><p>Query MX records.</p>
</li>
<li><p>Find mail server.</p>
</li>
<li><p>Deliver the message.</p>
</li>
</ol>
<p>DNS quietly orchestrates all of this.</p>
<h1 id="heading-common-confusions-cleared">Common Confusions Cleared</h1>
<h3 id="heading-a-vs-cname">A vs CNAME</h3>
<ul>
<li><p>A → Points to IP address</p>
</li>
<li><p>CNAME → Points to another domain name</p>
</li>
</ul>
<h3 id="heading-ns-vs-mx">NS vs MX</h3>
<ul>
<li><p>NS → Who controls the DNS</p>
</li>
<li><p>MX → Where emails go</p>
</li>
</ul>
<h3 id="heading-dns-vs-hosting">DNS vs Hosting</h3>
<p>DNS does not host your website.<br />It only tells users where the website is hosted.</p>
<h1 id="heading-dns-in-system-design">DNS in System Design</h1>
<p>For developers and backend engineers, DNS is critical because it enables:</p>
<h3 id="heading-1-horizontal-scaling">1. Horizontal Scaling</h3>
<p>Multiple IPs for one domain.</p>
<h3 id="heading-2-failover">2. Failover</h3>
<p>Traffic shifts if one server goes down.</p>
<h3 id="heading-3-global-load-distribution">3. Global Load Distribution</h3>
<p>Users routed to closest data center.</p>
<h3 id="heading-4-service-decoupling">4. Service Decoupling</h3>
<p>Frontend and backend services can live on different infrastructure.</p>
<p>DNS is part of the internet’s control plane.</p>
<p>It determines where traffic should go before any data is transferred.</p>
<h1 id="heading-final-takeaway">Final Takeaway</h1>
<p>DNS is one of the most foundational systems on the internet.</p>
<p>It:</p>
<ul>
<li><p>Translates names to IPs</p>
</li>
<li><p>Routes web traffic</p>
</li>
<li><p>Directs email</p>
</li>
<li><p>Enables security verification</p>
</li>
<li><p>Allows infrastructure flexibility</p>
</li>
</ul>
<p>Understanding DNS records gives you the power to:</p>
<ul>
<li><p>Debug website issues</p>
</li>
<li><p>Troubleshoot email delivery</p>
</li>
<li><p>Configure domains properly</p>
</li>
<li><p>Design scalable systems</p>
</li>
</ul>
<p>It may look simple on the surface — but DNS is one of the most important distributed systems ever built.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Network Devices]]></title><description><![CDATA[Modern Software System require a medium so as to work like API calls , database queries, web request which travel trough a chain of networking devices . Understanding these devices helps us reason about latency, scalability, security and production f...]]></description><link>https://surajjena.hashnode.dev/understanding-network-devices</link><guid isPermaLink="true">https://surajjena.hashnode.dev/understanding-network-devices</guid><category><![CDATA[networking]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sat, 31 Jan 2026 18:21:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771164751749/1f12b033-0ddf-47cb-8102-cc4f689e2f1f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Modern Software System require a medium so as to work like API calls , database queries, web request which travel trough a chain of networking devices . Understanding these devices helps us reason about latency, scalability, security and production failure.</p>
<p>Network Devices are physical devices or appliances which are required for communication and interaction computers or computer network systems. This article explains modems, routers, switches, hubs, firewalls and load balancers, how they work individually, and how they fit together in a real-world setup.</p>
<h2 id="heading-high-level-view-how-the-internet-reaches-a-home-or-office">High-Level View: How the Internet Reaches a Home or Office</h2>
<p>When a user opens a website or calls an API, traffic flows roughly like this:</p>
<p><code>Internet → Modem → Router → Firewall → Switch → Servers/PC</code></p>
<p>In cloud environments, some of these devices are physica<strong>l</strong>, while others are virtualized, but the working remain the same.</p>
<h2 id="heading-what-is-a-modem">What Is a Modem?</h2>
<p><strong>Primary responsibility:</strong><br />It connects your home network with the Internet Service Provider (ISP).The modem can perform both the task of modulation and demodulation simultaneously.</p>
<p><strong>What it does:</strong></p>
<ul>
<li><p>It converts digital signals (fiber, cable, DSL) into analog signals or vice-versa.</p>
</li>
<li><p>Acts as the entry point to the internet</p>
</li>
<li><p>Modems can modulate as well as demodulate the signals simultaneously.</p>
</li>
<li><p>Modem allows to connect only a specific number of devices to the internet.</p>
</li>
</ul>
<p>Analogy:<br />The modem is the post office that connects your house to the outside world.</p>
<p><strong>Key point:</strong><br />A modem does not manage traffic or security. It only brings the internet into your network.</p>
<h2 id="heading-what-is-a-router">What Is a Router?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771164884703/8a95ac50-7c9e-4a39-95f3-65b46f71d320.jpeg" alt class="image--center mx-auto" /></p>
<p>A router is a device which connects two or more networks or sub-networks. It serves two primary functions, managing traffic between these networks by forwarding data packets to their intended IP addresses, and allowing multiple devices to use the same Internet connection</p>
<p>There are several types of routers, but most routers pass data between LANs (local area networks) and WANs (wide area networks).</p>
<p><strong>What it does:</strong></p>
<ul>
<li><p>Routes traffic between networks (LAN ↔ Internet)</p>
</li>
<li><p>Assigns IP addresses (via DHCP)</p>
</li>
<li><p>Performs Network Address Translation (NAT)</p>
</li>
</ul>
<p><strong>Router vs Modem (Clear Difference):</strong></p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Modem</td><td>Router</td></tr>
</thead>
<tbody>
<tr>
<td>Connects to ISP</td><td>Connects networks</td></tr>
<tr>
<td>Signal conversion</td><td>Traffic direction</td></tr>
<tr>
<td>No routing logic</td><td>Routing intelligence</td></tr>
</tbody>
</table>
</div><p>Analogy:<br />The router is like a traffic police officer.</p>
<p><strong>Backend relevance:</strong><br />Routers affect latency, packet loss, and connectivity — all critical for API reliability.</p>
<h2 id="heading-switch-vs-hub-how-local-networks-actually-work">Switch vs Hub: How Local Networks Actually Work</h2>
<h3 id="heading-hub-mostly-obsolete">Hub (Mostly Obsolete)</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771165046069/d30a0301-d596-4d7f-af2b-ebf084772d1e.jpeg" alt class="image--center mx-auto" /></p>
<p>A hub is a physical layer networking device which is used to connect multiple devices in a network. They are generally used to connect computers in a LAN.</p>
<p><strong>Analogy:</strong><br />Someone shouting a message in a crowded room.</p>
<p><strong>Problems:</strong></p>
<ul>
<li><p>Massive collisions</p>
</li>
<li><p>Security risks</p>
</li>
<li><p>Inefficient</p>
</li>
</ul>
<h3 id="heading-switch-modern-standard">Switch (Modern Standard)</h3>
<p>The Switch is a network device that is used to segment the networks into different subnetworks called subnets or LAN segments. It is responsible for filtering and forwarding the packets between LAN segments based on MAC address.</p>
<p><strong>What it does:</strong></p>
<ul>
<li><p>It operates in the Data Link Layer in the OSI Model.</p>
</li>
<li><p>It performs error checking before forwarding data.</p>
</li>
<li><p>It transfers the data only to the device that has been addressed.</p>
</li>
<li><p>It operates in full duplex mode.</p>
</li>
</ul>
<p><strong>Analogy:</strong><br />A post office delivering mail to exact addresses.</p>
<p><strong>Switch vs Hub (Clear Difference):</strong></p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Hub</td><td>Switch</td></tr>
</thead>
<tbody>
<tr>
<td>Broadcasts to all</td><td>Sends to specific device</td></tr>
<tr>
<td>Slow &amp; noisy</td><td>Fast &amp; efficient</td></tr>
<tr>
<td>Rarely used</td><td>Industry standard</td></tr>
</tbody>
</table>
</div><p><strong>Backend relevance:</strong><br />Switches enable low-latency communication between servers in data centers.</p>
<h2 id="heading-what-is-a-firewall">What Is a Firewall?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771165477114/060ae536-9d7c-4e36-99c1-3c5b868454e6.jpeg" alt class="image--center mx-auto" /></p>
<p>A firewall is a network security system, available as hardware or software, that monitors and controls incoming and outgoing traffic based on predefined rules. It acts like a security guard, filtering data packets to either accept, reject or drop.</p>
<p><strong>What it does:</strong></p>
<ul>
<li><p>Filters packets based on rules</p>
</li>
<li><p>Blocks malicious traffic</p>
</li>
<li><p>Enforces security policies</p>
</li>
</ul>
<p><strong>Analogy:</strong><br />A security gate checking IDs before entry.</p>
<p><strong>Why security lives here:</strong></p>
<ul>
<li><p><strong>Prevent Unauthorized Access:</strong> Like a locked door with a guard, only trusted users and traffic are allowed through.</p>
</li>
<li><p><strong>Block Malicious Traffic:</strong> Harmful data such as viruses, phishing attempts, or denial-of-service (DoS) attacks are stopped before reaching the system.</p>
</li>
<li><p><strong>Protect Sensitive Information:</strong> Safeguards personal and business data from theft or accidental leaks.</p>
</li>
<li><p><strong>Control Network Usage:</strong> Enforces policies such as parental controls, workplace restrictions, or government filtering.</p>
</li>
<li><p><strong>Mitigate Insider Risks:</strong> Detects suspicious applications or data exfiltration attempts from within the network.</p>
</li>
</ul>
<p><strong>Backend relevance:</strong><br />Firewalls protect APIs, databases, and internal services from direct exposure.</p>
<h2 id="heading-what-is-a-load-balancer">What Is a Load Balancer?</h2>
<p>A load balancer is a solution that acts as a traffic proxy and distributes network or application traffic across endpoints on a number of servers. Load balancers are used to distribute capacity during peak traffic times, and to increase reliability of applications.</p>
<p><strong>What it does:</strong></p>
<ul>
<li><p><strong>Traffic Distribution:</strong> To keep any one server from becoming overburdened, load balancers divide incoming requests evenly among several servers.</p>
</li>
<li><p><strong>Scalability:</strong> By making it simple to add servers or resources to meet growing traffic demands, load balancers enable horizontal scaling.</p>
</li>
<li><p><strong>Optimization:</strong> Load balancers optimize resource utilization, ensuring efficient use of server capacity and preventing bottlenecks.</p>
</li>
<li><p><strong>Health Monitoring:</strong> Load balancers often monitor the health of servers, directing traffic away from servers experiencing issues or downtime.</p>
</li>
<li><p><strong>SSL Termination:</strong> Some load balancers can handle SSL/TLS encryption and decryption, offloading this resource-intensive task from servers.</p>
</li>
</ul>
<p><strong>Analogy:</strong><br />A toll booth system spreading cars across multiple lanes.</p>
<p><strong>Why scalable systems need it:</strong><br />Load balancers enable:</p>
<ul>
<li><p>High availability</p>
</li>
<li><p>Fault tolerance</p>
</li>
<li><p>Zero-downtime deployments</p>
</li>
</ul>
<p><strong>Backend relevance:</strong><br />Every modern backend (microservices, cloud apps, APIs) relies on load balancers.</p>
<h2 id="heading-how-these-devices-work-together-real-world-setup">How These Devices Work Together (Real-World Setup)</h2>
<h3 id="heading-a-production-backend-system">A Production Backend System</h3>
<pre><code class="lang-plaintext">Internet
   ↓
ISP Modem
   ↓
Router (NAT, Routing)
   ↓
Firewall (Security Rules)
   ↓
Load Balancer (Traffic Distribution)
   ↓
Switch
   ↓
Backend Servers (APIs, DBs, Services)
</code></pre>
<p>Each device has one clear responsibility, reducing complexity and improving reliability.</p>
<h2 id="heading-connecting-this-to-backend-systems-amp-production-deployments">Connecting This to Backend Systems &amp; Production Deployments</h2>
<p>For software engineers:</p>
<ul>
<li><p>Latency issues often come from routing or switching problems</p>
</li>
<li><p>Downtime can occur without load balancers</p>
</li>
<li><p>Security breaches often trace back to firewall misconfigurations</p>
</li>
<li><p>Scalability depends on network architecture, not just code</p>
</li>
</ul>
<p>In cloud platforms (AWS, Azure, GCP), these devices are often software-defined, but their behavior mirrors physical hardware.</p>
<h2 id="heading-final-takeaway">Final Takeaway</h2>
<p>Networking devices are not just infrastructure they are core components of system design.</p>
<p>Understanding how modems, routers, switches, firewalls, and load balancers work together allows backend engineers to:</p>
<ul>
<li><p>Design scalable systems</p>
</li>
<li><p>Debug production issues faster</p>
</li>
<li><p>Build more secure applications</p>
</li>
</ul>
<p>Good software architecture starts with solid network foundations.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Git Internals: The Purpose of .git Folder]]></title><description><![CDATA[Ever wondered how Git works internally. What exactly gets created when you run git init,and what changes occur inside Git when you execute commands like git add?Lets explores what happen behind the scenes of so-called .git folder?
The .git Folder
Whe...]]></description><link>https://surajjena.hashnode.dev/understanding-git-internals-the-purpose-of-git-folder</link><guid isPermaLink="true">https://surajjena.hashnode.dev/understanding-git-internals-the-purpose-of-git-folder</guid><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Sat, 31 Jan 2026 18:06:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769882765525/005eaa44-e9f4-4f1b-8160-8ec2b76a01c6.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ever wondered how Git works internally. What exactly gets created when you run <strong>git init</strong>,<br />and what changes occur inside Git when you execute commands like <strong>git add</strong>?<br />Lets explores what happen behind the scenes of so-called .git folder?</p>
<h2 id="heading-the-git-folder">The .git Folder</h2>
<p>When you run the git init in the terminal , it results in creation of a .git folder which is generally hidden. This folder various key components responsible for the tracking and storing of changes made.</p>
<ul>
<li><p><code>refs</code>: Short for "references." This stores pointers to commit objects (like where your branches and tags are).</p>
</li>
<li><p><code>config</code>: Contains project-specific settings (like your remote URLs)</p>
</li>
<li><p><code>HEAD</code>: A file that points to the branch you are currently on.</p>
</li>
<li><p><code>index</code>: Also known as the <strong>Staging Area</strong>. It’s a binary file that lists what will go into your next commit.</p>
</li>
<li><p><code>objects</code>: The heart of the database. This is where all your file content and commit history are stored.</p>
</li>
<li><p><code>hooks</code>: They are event-driven scripts that Git executes when you run specific commands like <code>commit</code>, <code>push</code>, or <code>merge</code>.</p>
</li>
<li><p><code>info</code>: This is used to store repository-specific information and configuration, primarily for excluding certain patterns and housing supplementary objects.</p>
</li>
</ul>
<h2 id="heading-git-internalgit-object">Git Internal/git object</h2>
<p>Git primary operates by using three primary objects.</p>
<h3 id="heading-blob">Blob</h3>
<p>It generally stores the raw content of the file. If it contain identical files , the content produce the same hash blob, disabling duplication.</p>
<h3 id="heading-tree">Tree</h3>
<p>It represents a directory structure. It contains references (hashes) to blobs and others trees<br />along with filenames and permissions.</p>
<h3 id="heading-commit">Commit</h3>
<p><strong>Captures a complete snapshot of the project at a point in time</strong>. It points to a root tree, includes metadata (author, timestamp, message), and references parent commits to form a history chain.</p>
<h2 id="heading-what-happens-during-git-add-and-git-commit"><strong>What Happens During</strong> <code>git add</code> and <code>git commit</code>?</h2>
<p>Let’s deep dive into the internal flow of .git folder</p>
<h3 id="heading-step-1-git-add"><strong>Step 1:</strong> <code>git add</code></h3>
<p>When you stage a file, Git:</p>
<p>Takes the current content of the file and then Hashes it to Creates a Blob in the <code>objects/</code> folder.<br />Updates the index (staging area) to map the filename to that new Blob hash.</p>
<h3 id="heading-step-2-git-commit"><strong>Step 2:</strong> <code>git commit</code></h3>
<p>When you commit, Git:</p>
<p>Creates a Tree object that represents the current state of the index and a Commit object that points to that Tree and the previous commit (the parent). Moves the pointer of your current branch (in <code>refs/heads/</code>) to this new Commit hash.</p>
<h2 id="heading-why-its-important">Why it’s important</h2>
<p>Understanding Git is easier once you realize it is mostly about pointers and snapshots.<br />A branch is just a file that points to a commit. Switching branches simply moves that pointer.<br />When you run <code>git add</code>, Git already stores your data as objects, even before you commit.<br />And Git doesn’t rebuild your project by replaying every change—it just checks out the snapshot stored in the commit’s tree.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Git is a content-addressed key-value store where objects are indexed by SHA-1 hashes.<br />The version control features are built on top of this storage model.<br />Understanding <code>.git</code> reveals how Git actually works.</p>
]]></content:encoded></item><item><title><![CDATA[Your First Steps in Git: Essential Commands]]></title><description><![CDATA[What is GIT?
Git is a tool that helps you manage changes to your code over time. It notes every changes or updates you make. It also has the liability to undo mistakes or look back to previous version if needed. So in simple term, ‘Git can be referre...]]></description><link>https://surajjena.hashnode.dev/your-first-steps-in-git-essential-commands</link><guid isPermaLink="true">https://surajjena.hashnode.dev/your-first-steps-in-git-essential-commands</guid><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:31:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769779424260/07c66da7-7e7f-4603-9a24-fa0fb406caef.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-git">What is GIT?</h2>
<p>Git is a tool that helps you manage changes to your code over time. It notes every changes or updates you make. It also has the liability to undo mistakes or look back to previous version if needed. So in simple term, ‘Git can be referred to as a camera that takes snapshot of your work. Everything you do like edit, updates or tiny changes is captured and stored safely inside hidden .git folder’.</p>
<h2 id="heading-what-is-the-purpose-of-using-git">What is the purpose of using Git?</h2>
<p>Generally git is used for its powerful, flexible and user friendly features, allows for team collaboration, manages changes to your code in a safe and easy way. Not only this but also features like code merge, detect conflict, parallel programming and many more.</p>
<h2 id="heading-some-basics-and-core-terminologies">Some Basics and Core Terminologies</h2>
<h3 id="heading-repositoryrepo">Repository(Repo)</h3>
<p>A storage space which contain all project files and their revision history. Here the storage space can be local or remote according to requirement.</p>
<p>To initialize a git repo:</p>
<pre><code class="lang-plaintext">git init
</code></pre>
<h3 id="heading-working-directory">Working Directory</h3>
<p>Local folder where you can update or edit files.<br />When you are working on your project folder like modifying, you are working in the working directory.</p>
<pre><code class="lang-plaintext">git init
git revert
</code></pre>
<h3 id="heading-staging-area">Staging Area</h3>
<p>It is a temporary place where the changes are stored before committing to the .git folder</p>
<pre><code class="lang-plaintext">git add .               //Add the main file and correspondence/sub files within it
git add filename.txt    //add only the named file
</code></pre>
<h3 id="heading-commit">Commit</h3>
<p>It captures the changes that have been staged at that moment, which is generally referred as snapshot of the staged content and has a hash id for each commit.</p>
<pre><code class="lang-plaintext">git commit -m "referrence for what action been performed"
git commit -am "ref."    //here is perform the action for git add and git commit altogether.
</code></pre>
<h3 id="heading-branch">Branch</h3>
<p>This helps in managing the workflow by allowing parallel workflow, where the main branch holds the main-project whereas the sub branches carryout the experimental features, bug, etc.</p>
<pre><code class="lang-plaintext">git branch &lt;branch-name&gt;   //to create a new branch
git chechout -b &lt;branch-name&gt;  //to switch to particular branch
</code></pre>
<h3 id="heading-merge">Merge</h3>
<p>Generally combine changes from one branch to another.</p>
<pre><code class="lang-plaintext">git merge &lt;branch-name&gt;  //merge the content from the sub branch to the main branch
</code></pre>
<h3 id="heading-push">Push</h3>
<p>Uploading of the content of the .git folder which is local to online server(remote).</p>
<pre><code class="lang-plaintext">git push &lt;remote&gt; &lt;branch&gt;
</code></pre>
<h3 id="heading-pull">Pull</h3>
<p>To fetch and merge remote changes to the local system.</p>
<pre><code class="lang-plaintext">git pull &lt;remote&gt; &lt;branch&gt;
</code></pre>
<h3 id="heading-remote">Remote</h3>
<p>It is a reference to the repository which is remotely present / online.</p>
<h2 id="heading-common-git-commands">Common Git Commands</h2>
<p>git add -move to staging area<br />git commit -save changes(move the snapshot to .git folder)<br />git log -view commit history<br />git status - provides a real-time summary of your git repo.<br />git branch -display and manage branch</p>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists: The Pendrive Problem]]></title><description><![CDATA[Version Control is a system that records changes in a file or a set of files over time. It helps keep track of what are the changes been made, who made the changes and when and also enables collaboration between multiple developers.
Here the question...]]></description><link>https://surajjena.hashnode.dev/why-version-control-exists-the-pendrive-problem</link><guid isPermaLink="true">https://surajjena.hashnode.dev/why-version-control-exists-the-pendrive-problem</guid><category><![CDATA[version control]]></category><category><![CDATA[Git]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Suraj Jena]]></dc:creator><pubDate>Fri, 23 Jan 2026 13:25:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768672152734/a7180304-f564-4bae-9cc9-5ddb25944e9a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Version Control is a system that records changes in a file or a set of files over time. It helps keep track of what are the changes been made, who made the changes and when and also enables collaboration between multiple developers.</p>
<p>Here the question arise, How did things work back then before version control existed?</p>
<p>Before modern version control systems, developers relied on laid down resources like local system files, folders, zip files, pendrive, emails. Lets deep dive into the evolution from local-based code sharing(pendrive) to sophisticated version control systems.</p>
<h2 id="heading-the-human-powered-file-transfer-era">The “Human-Powered File Transfer” Era</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769173238647/88e6f647-adb3-4ad9-8198-d6b1969b78ae.png" alt class="image--center mx-auto" /></p>
<p>Imagine you and I are working together on a simple website project. You’re building the homepage on your laptop, adding content and styling. I’m working on the contact page on mine, fixing layout issues and improving the form.</p>
<p>We don’t have Git, GitHub, or any shared repository. The only way we exchange updates is through a pendrive.</p>
<h2 id="heading-how-our-work-happens"><strong>How our work happens:</strong></h2>
<p>Imagine you’re working on a small project on your laptop — maybe a simple website or a college assignment. At the same time, I’m helping you by editing another part of the project on mine. There’s no Git, no GitHub, no shared repository. The only way we exchange updates is through a pendrive.</p>
<p>You finish tweaking the Contact file, save it, and copy it . You hand it over to me so I can merge it with my changes. I plug it into my laptop, replace my old copy, make a few updates to the homepage, and then copy the modified files back to the same pendrive. Now I hand it back to you so you can continue.</p>
<p>At first, this feels simple, almost harmless. But the moment we both start making changes at the same time, things starts to fall apart.</p>
<h1 id="heading-issues-we-face-during-this-practice">Issues we face during this practice</h1>
<h3 id="heading-version-conflicts">Version Conflicts</h3>
<p>There’s no automatic way for either of us to know which file contains which changes. Who has the latest version. Which changes are newer. If you edit a file on your laptop while I edit the same file on mine…One of our versions will be overwritten and lost forever. Neither of us will knows.</p>
<h3 id="heading-file-naming-chaos">File Naming Chaos</h3>
<p>To avoid losing work, we start renaming files:</p>
<p><code>final.html</code></p>
<p><code>please_work_final.html</code></p>
<p><code>latest_final.html</code></p>
<p><code>save_my_soul.html</code></p>
<p>Soon, even we can’t tell which file actually contains the real, working version.</p>
<h3 id="heading-manual-syncing-takes-time">Manual Syncing Takes Time</h3>
<p>Every update forces a full manual cycle: make the change, copy it to the pendrive, physically carry and deliver it, and overwrite the existing files. This constant back-and-forth disrupts the work-flow, slows progress, and turns collaboration into a repetitive, time-consuming task.</p>
<h3 id="heading-no-history-no-backup">No History / No Backup</h3>
<p>If a file is overwritten accidentally, there is no undo, no version history, and no way to recover earlier changes. Once lost, the work is gone — unless separate manual backups were created in advance</p>
<h3 id="heading-high-risk-of-data-loss">High Risk of Data Loss</h3>
<p>Pendrives are inherently unreliable—they can become corrupted, be lost, or fail without warning. When the latest version of a project exists only on such a device, a single failure can instantly erase days or even weeks of work. This forces developers to constantly create manual backups, double-check every copy, to tackle the constant fear of accidental data loss.</p>
<p>This back-and-forth process might work for a small file or a single person, but the moment two people collaborate, it becomes chaotic. This is exactly why modern version control systems were created.</p>
<h2 id="heading-adopting-a-modern-version-control-workflow">Adopting a Modern Version Control Workflow</h2>
<p>All these issues highlight a bigger truth: the problem was never the pendrive, it was the lack of a system that understood collaboration. When developers rely on manual file transfers, everything becomes fragile.</p>
<p>At some point, it became clear that software development needed more than just a storage device.<br />It needed a <strong>system</strong> one that could track changes, record history, manage conflicts, and ensure that no one’s work is lost just because the wrong file got copied.</p>
<p>This exact need led to the creation of Version Control Systems (VCS).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769173787122/14a90a77-4b0d-489c-b8b2-88461868a5bd.png" alt class="image--center mx-auto" /></p>
<p>VCS introduced ideas that were impossible in the ‘pendrive era':</p>
<ul>
<li><p>A single, reliable source of truth</p>
</li>
<li><p>Automatic change tracking</p>
</li>
<li><p>Branching to allow parallel work</p>
</li>
<li><p>Conflict detection instead of silent overwrites</p>
</li>
<li><p>The ability to revert, compare, and merge safely</p>
</li>
</ul>
<p>Systems like Git took this further by making collaboration fast, safe, and scalable, enabling teams of any size to work on the same project without fear of losing progress.</p>
<p>This is why VCS exists; to replace a fragile, manual, error-prone workflow with a reliable, automated, and collaborative one.</p>
]]></content:encoded></item></channel></rss>