<?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[anants11: Networking Basics]]></title><description><![CDATA[anants11: Networking Basics]]></description><link>https://anants11-networking-basics.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 25 Jun 2026 07:38:46 GMT</lastBuildDate><atom:link href="https://anants11-networking-basics.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></title><description><![CDATA[What is TCP and why it is needed
The internet is not a single wire between two computers.Data travels through many routers, networks, and paths before reaching its destination.
If data were sent without rules:

some parts could get lost

some could a...]]></description><link>https://anants11-networking-basics.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</link><guid isPermaLink="true">https://anants11-networking-basics.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</guid><category><![CDATA[TCP]]></category><category><![CDATA[tcp/ip-model]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Anant Sethi]]></dc:creator><pubDate>Thu, 29 Jan 2026 17:33:46 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-what-is-tcp-and-why-it-is-needed">What is TCP and why it is needed</h2>
<p>The internet is not a single wire between two computers.<br />Data travels through many routers, networks, and paths before reaching its destination.</p>
<p>If data were sent <strong>without rules</strong>:</p>
<ul>
<li><p>some parts could get lost</p>
</li>
<li><p>some could arrive late</p>
</li>
<li><p>some could arrive out of order</p>
</li>
<li><p>some could get corrupted</p>
</li>
</ul>
<p>Yet applications like websites, emails, and file downloads need <strong>correct and complete data</strong>.</p>
<p><strong>TCP (Transmission Control Protocol)</strong> exists to solve this problem.</p>
<p>TCP is a <strong>transport protocol</strong> that ensures data is delivered:</p>
<ul>
<li><p>reliably</p>
</li>
<li><p>in the correct order</p>
</li>
<li><p>without corruption</p>
</li>
</ul>
<hr />
<h2 id="heading-problems-tcp-is-designed-to-solve">Problems TCP is designed to solve</h2>
<p>TCP is designed to handle the natural unreliability of networks.</p>
<p>It solves these key problems:</p>
<ul>
<li><p><strong>Packet loss</strong><br />  Some data may never arrive.</p>
</li>
<li><p><strong>Out-of-order delivery</strong><br />  Data may arrive in the wrong sequence.</p>
</li>
<li><p><strong>Data corruption</strong><br />  Data may get damaged during transmission.</p>
</li>
<li><p><strong>Network congestion</strong><br />  Sending too fast can overwhelm receivers.</p>
</li>
</ul>
<p>TCP does not assume the network is reliable.<br />It actively <strong>checks, corrects, and controls</strong> communication.</p>
<hr />
<h2 id="heading-what-is-the-tcp-3-way-handshake">What is the TCP 3-Way Handshake</h2>
<p>Before sending real data, TCP first <strong>establishes a connection</strong> between two computers.</p>
<p>This setup process is called the <strong>3-Way Handshake</strong>.</p>
<p>Its purpose is to:</p>
<ul>
<li><p>confirm both sides are reachable</p>
</li>
<li><p>synchronize communication</p>
</li>
<li><p>prepare for reliable data transfer</p>
</li>
</ul>
<p>Think of it as starting a phone call before having a conversation.</p>
<hr />
<h2 id="heading-step-by-step-working-of-syn-syn-ack-and-ack">Step-by-step working of SYN, SYN-ACK, and ACK</h2>
<h3 id="heading-step-1-syn-can-we-talk">Step 1: SYN – “Can we talk?”</h3>
<p>The client sends a message asking to start a connection.</p>
<p>Meaning:</p>
<ul>
<li><p>“I want to communicate”</p>
</li>
<li><p>“Here is my starting point”</p>
</li>
</ul>
<p>This message is called <strong>SYN</strong> (synchronize).</p>
<p>No application data is sent yet.</p>
<hr />
<h3 id="heading-step-2-syn-ack-yes-i-hear-you">Step 2: SYN-ACK – “Yes, I hear you”</h3>
<p>The server replies back.</p>
<p>Meaning:</p>
<ul>
<li><p>“I received your request”</p>
</li>
<li><p>“I am ready to communicate too”</p>
</li>
</ul>
<p>This response is called <strong>SYN-ACK</strong>.</p>
<p>Now both sides know the other is reachable.</p>
<hr />
<h3 id="heading-step-3-ack-great-lets-start">Step 3: ACK – “Great, let’s start”</h3>
<p>The client sends a final confirmation.</p>
<p>Meaning:</p>
<ul>
<li><p>“I know you’re ready”</p>
</li>
<li><p>“Let’s begin data transfer”</p>
</li>
</ul>
<p>This message is called <strong>ACK</strong> (acknowledgement).</p>
<p>After this step, the TCP connection is established.</p>
<hr />
<h2 id="heading-how-data-transfer-works-in-tcp">How data transfer works in TCP</h2>
<p>Once the connection is open:</p>
<ul>
<li><p>data is broken into small pieces</p>
</li>
<li><p>each piece is numbered</p>
</li>
<li><p>pieces are sent across the network</p>
</li>
</ul>
<p>The receiver:</p>
<ul>
<li><p>checks which pieces arrived</p>
</li>
<li><p>confirms successful delivery</p>
</li>
<li><p>waits for missing pieces if needed</p>
</li>
</ul>
<p>Applications only see <strong>complete and ordered data</strong>.</p>
<hr />
<h2 id="heading-how-tcp-ensures-reliability-order-and-correctness">How TCP ensures reliability, order, and correctness</h2>
<h3 id="heading-reliability">Reliability</h3>
<p>If a piece of data is lost:</p>
<ul>
<li><p>TCP notices it was not acknowledged</p>
</li>
<li><p>TCP resends the missing piece</p>
</li>
</ul>
<p>Nothing is silently dropped.</p>
<hr />
<h3 id="heading-order">Order</h3>
<p>Each piece of data has a position number.</p>
<p>Even if data arrives out of order:</p>
<ul>
<li><p>TCP rearranges it correctly</p>
</li>
<li><p>applications receive data in sequence</p>
</li>
</ul>
<hr />
<h3 id="heading-correctness">Correctness</h3>
<p>TCP checks data for errors.</p>
<p>If corrupted data is detected:</p>
<ul>
<li><p>it is discarded</p>
</li>
<li><p>it is sent again</p>
</li>
</ul>
<p>This prevents broken files and incorrect messages.</p>
<hr />
<h3 id="heading-flow-control">Flow control</h3>
<p>TCP adjusts speed based on the receiver’s ability to handle data.</p>
<p>This prevents fast senders from overwhelming slower receivers.</p>
<hr />
<h2 id="heading-how-a-tcp-connection-is-closed">How a TCP connection is closed</h2>
<p>Just like a connection is opened carefully, it is also <strong>closed cleanly</strong>.</p>
<p>When communication is finished:</p>
<ul>
<li><p>one side signals it is done sending data</p>
</li>
<li><p>the other side acknowledges</p>
</li>
<li><p>the connection is closed only after both agree</p>
</li>
</ul>
<p>This prevents:</p>
<ul>
<li><p>half-open connections</p>
</li>
<li><p>wasted system resources</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[TCP vs UDP: When to Use What, and How TCP Relates to HTTP]]></title><description><![CDATA[Why the internet needs rules to send data
When two computers talk over the internet, they don’t send thoughts — they send data.
That data:

travels long distances

passes through many networks

can arrive late, out of order, or not at all


So the in...]]></description><link>https://anants11-networking-basics.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</link><guid isPermaLink="true">https://anants11-networking-basics.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</guid><category><![CDATA[TCP]]></category><category><![CDATA[UDP]]></category><category><![CDATA[http]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[Anant Sethi]]></dc:creator><pubDate>Thu, 29 Jan 2026 17:23:47 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-why-the-internet-needs-rules-to-send-data">Why the internet needs rules to send data</h2>
<p>When two computers talk over the internet, they don’t send thoughts — they send <strong>data</strong>.</p>
<p>That data:</p>
<ul>
<li><p>travels long distances</p>
</li>
<li><p>passes through many networks</p>
</li>
<li><p>can arrive late, out of order, or not at all</p>
</li>
</ul>
<p>So the internet needs <strong>rules</strong> to decide <strong>how data should be sent and received</strong>.<br />These rules are called <strong>protocols</strong>.</p>
<p>Two of the most important ones are <strong>TCP</strong> and <strong>UDP</strong>.</p>
<hr />
<h2 id="heading-what-are-tcp-and-udp-very-high-level">What are TCP and UDP (very high level)</h2>
<p><strong>TCP and UDP are transport protocols.</strong></p>
<p>That means:</p>
<ul>
<li><p>they decide <em>how data moves</em> between two computers</p>
</li>
<li><p>they sit <strong>below applications</strong> like browsers and APIs</p>
</li>
</ul>
<p>Think of them as <strong>delivery methods</strong>, not messages themselves.</p>
<hr />
<h2 id="heading-tcp-safe-and-reliable">TCP: safe and reliable</h2>
<p><strong>TCP (Transmission Control Protocol)</strong> focuses on <strong>correctness</strong>.</p>
<p>What TCP cares about:</p>
<ul>
<li><p>data arrives completely</p>
</li>
<li><p>data arrives in the correct order</p>
</li>
<li><p>lost data is resent</p>
</li>
</ul>
<p>Analogy:<br />A <strong>courier service with tracking and signature required</strong>.</p>
<p>If something goes wrong, TCP slows down and fixes it.</p>
<hr />
<h2 id="heading-udp-fast-but-risky">UDP: fast but risky</h2>
<p><strong>UDP (User Datagram Protocol)</strong> focuses on <strong>speed</strong>.</p>
<p>What UDP cares about:</p>
<ul>
<li><p>sending data as fast as possible</p>
</li>
<li><p>no waiting, no checking</p>
</li>
</ul>
<p>What UDP does <em>not</em> guarantee:</p>
<ul>
<li><p>delivery</p>
</li>
<li><p>order</p>
</li>
<li><p>retries</p>
</li>
</ul>
<p>Analogy:<br />A <strong>live announcement over a loudspeaker</strong> — if you miss it, it’s gone.</p>
<hr />
<h2 id="heading-key-differences-between-tcp-and-udp">Key differences between TCP and UDP</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>TCP</td><td>UDP</td></tr>
</thead>
<tbody>
<tr>
<td>Reliable</td><td>Unreliable</td></tr>
<tr>
<td>Ordered</td><td>Not ordered</td></tr>
<tr>
<td>Slower</td><td>Faster</td></tr>
<tr>
<td>Error checking</td><td>Minimal checking</td></tr>
<tr>
<td>Retries data</td><td>No retries</td></tr>
</tbody>
</table>
</div><p>Simple rule:</p>
<ul>
<li><p>TCP = correctness first</p>
</li>
<li><p>UDP = speed first</p>
</li>
</ul>
<hr />
<h2 id="heading-when-to-use-tcp">When to use TCP</h2>
<p>Use TCP when:</p>
<ul>
<li><p>data <strong>must not be lost</strong></p>
</li>
<li><p>order matters</p>
</li>
<li><p>correctness is more important than speed</p>
</li>
</ul>
<p>Examples:</p>
<ul>
<li><p>loading a website</p>
</li>
<li><p>sending emails</p>
</li>
<li><p>file downloads</p>
</li>
<li><p>database communication</p>
</li>
</ul>
<p>If even one byte is missing, TCP makes sure it’s resent.</p>
<hr />
<h2 id="heading-when-to-use-udp">When to use UDP</h2>
<p>Use UDP when:</p>
<ul>
<li><p>speed matters more than perfection</p>
</li>
<li><p>small losses are acceptable</p>
</li>
<li><p>real-time experience is important</p>
</li>
</ul>
<p>Examples:</p>
<ul>
<li><p>video calls</p>
</li>
<li><p>online gaming</p>
</li>
<li><p>live streaming</p>
</li>
<li><p>voice communication</p>
</li>
</ul>
<p>If a packet is lost, UDP moves on instead of slowing everything down.</p>
<hr />
<h2 id="heading-common-real-world-examples">Common real-world examples</h2>
<p><strong>TCP examples</strong></p>
<ul>
<li><p>Web browsing</p>
</li>
<li><p>Email (SMTP, IMAP)</p>
</li>
<li><p>File transfer</p>
</li>
<li><p>APIs</p>
</li>
</ul>
<p><strong>UDP examples</strong></p>
<ul>
<li><p>Zoom / Google Meet</p>
</li>
<li><p>Online multiplayer games</p>
</li>
<li><p>Live sports streaming</p>
</li>
<li><p>DNS lookups (often)</p>
</li>
</ul>
<hr />
<h2 id="heading-what-is-http-and-where-it-fits">What is HTTP and where it fits</h2>
<p><strong>HTTP (Hypertext Transfer Protocol)</strong> is an <strong>application-level protocol</strong>.</p>
<p>It defines:</p>
<ul>
<li><p>how requests are structured</p>
</li>
<li><p>how responses are returned</p>
</li>
<li><p>things like URLs, headers, status codes</p>
</li>
</ul>
<p>Important point:<br />HTTP does <strong>not</strong> decide how data is delivered.<br />It only defines <strong>what the message looks like</strong>.</p>
<hr />
<h2 id="heading-relationship-between-tcp-and-http">Relationship between TCP and HTTP</h2>
<ul>
<li><p>HTTP creates the <strong>message</strong></p>
</li>
<li><p>TCP delivers that message <strong>reliably</strong></p>
</li>
</ul>
<p>So:</p>
<ul>
<li><p>HTTP sits <strong>on top of TCP</strong></p>
</li>
<li><p>TCP handles delivery</p>
</li>
<li><p>HTTP handles meaning</p>
</li>
</ul>
<p>Think:</p>
<ul>
<li><p>HTTP = letter content</p>
</li>
<li><p>TCP = postal system</p>
</li>
</ul>
<hr />
<h2 id="heading-why-http-does-not-replace-tcp">Why HTTP does not replace TCP</h2>
<p>HTTP assumes:</p>
<ul>
<li><p>data will arrive correctly</p>
</li>
<li><p>data will arrive in order</p>
</li>
</ul>
<p>It depends on TCP to guarantee this.</p>
<p>Without TCP:</p>
<ul>
<li><p>HTTP responses could be broken</p>
</li>
<li><p>webpages would load incorrectly</p>
</li>
<li><p>APIs would fail unpredictably</p>
</li>
</ul>
<p>That’s why <strong>HTTP needs TCP</strong>, not the other way around.</p>
<hr />
<h2 id="heading-common-beginner-confusion-is-http-the-same-as-tcp">Common beginner confusion: “Is HTTP the same as TCP?”</h2>
<p>No.</p>
<p>They work at <strong>different layers</strong>.</p>
<ul>
<li><p>TCP = how data is transported</p>
</li>
<li><p>HTTP = how web communication is defined</p>
</li>
</ul>
<p>They solve <strong>different problems</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Network Devices]]></title><description><![CDATA[How the Internet Reaches Your Home or Office
When you open a website or use an app, your data travels through multiple networking devices before reaching the internet.Each device has one clear job. Together, they make communication fast, reliable, an...]]></description><link>https://anants11-networking-basics.hashnode.dev/understanding-network-devices</link><guid isPermaLink="true">https://anants11-networking-basics.hashnode.dev/understanding-network-devices</guid><category><![CDATA[firewall]]></category><category><![CDATA[Firewalls]]></category><category><![CDATA[networking]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Anant Sethi]]></dc:creator><pubDate>Thu, 29 Jan 2026 17:21:33 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-how-the-internet-reaches-your-home-or-office">How the Internet Reaches Your Home or Office</h2>
<p>When you open a website or use an app, your data travels through multiple networking devices before reaching the internet.<br />Each device has <strong>one clear job</strong>. Together, they make communication fast, reliable, and secure.</p>
<p>Think of this setup like a <strong>city transportation system</strong>, where different roles keep traffic moving smoothly.</p>
<hr />
<h2 id="heading-what-is-a-modem-and-how-it-connects-your-network-to-the-internet">What is a Modem and how it connects your network to the internet?</h2>
<p>A <strong>modem</strong> is the device that connects your home or office to your <strong>Internet Service Provider (ISP)</strong>.</p>
<p>Its main job is <strong>translation</strong>.</p>
<ul>
<li><p>The ISP sends internet signals in a form your local network can’t understand directly.</p>
</li>
<li><p>The modem converts those signals into data your network devices can use.</p>
</li>
<li><p>It also converts your outgoing data back into a form the ISP understands.</p>
</li>
</ul>
<p>Real-world analogy:<br />A <strong>translator at an international border</strong> converting languages so both sides understand each other.</p>
<p>Important point:<br />A modem does <strong>not</strong> manage devices or traffic inside your network. It only connects you to the outside world.</p>
<hr />
<h2 id="heading-what-is-a-router-and-how-it-directs-traffic">What is a Router and how it directs traffic?</h2>
<p>A <strong>router</strong> decides <strong>where data should go</strong>.</p>
<p>Inside your network, multiple devices exist:</p>
<ul>
<li><p>phones</p>
</li>
<li><p>laptops</p>
</li>
<li><p>servers</p>
</li>
<li><p>printers</p>
</li>
</ul>
<p>The router:</p>
<ul>
<li><p>gives each device an internal address</p>
</li>
<li><p>sends incoming data to the correct device</p>
</li>
<li><p>sends outgoing data to the internet through the modem</p>
</li>
</ul>
<p>Analogy:<br />A <strong>traffic police officer</strong> at an intersection directing vehicles to the right roads.</p>
<p>Key difference from modem:</p>
<ul>
<li><p>Modem connects to the internet</p>
</li>
<li><p>Router manages traffic inside and outside your network</p>
</li>
</ul>
<hr />
<h2 id="heading-switch-vs-hub-how-local-networks-actually-work">Switch vs Hub: how local networks actually work</h2>
<p>Both hubs and switches connect devices within a local network, but they work very differently.</p>
<h3 id="heading-hub-old-and-inefficient">Hub (old and inefficient)</h3>
<p>A hub:</p>
<ul>
<li><p>sends incoming data to <strong>every device</strong></p>
</li>
<li><p>does not know who the data is for</p>
</li>
</ul>
<p>Analogy:<br />A person shouting a message in a room and everyone hears it.</p>
<p>Problems:</p>
<ul>
<li><p>slow</p>
</li>
<li><p>insecure</p>
</li>
<li><p>wastes bandwidth</p>
</li>
</ul>
<hr />
<h3 id="heading-switch-modern-and-efficient">Switch (modern and efficient)</h3>
<p>A switch:</p>
<ul>
<li><p>sends data <strong>only to the intended device</strong></p>
</li>
<li><p>learns which device is connected to which port</p>
</li>
</ul>
<p>Analogy:<br />A <strong>postal worker</strong> delivering letters to the correct house.</p>
<p>This is why modern networks use <strong>switches</strong>, not hubs.</p>
<hr />
<h2 id="heading-what-is-a-firewall-and-why-security-lives-here">What is a Firewall and why security lives here?</h2>
<p>A <strong>firewall</strong> controls <strong>what is allowed in and out</strong> of a network.</p>
<p>It:</p>
<ul>
<li><p>blocks malicious traffic</p>
</li>
<li><p>allows trusted traffic</p>
</li>
<li><p>enforces security rules</p>
</li>
</ul>
<p>A firewall can sit:</p>
<ul>
<li><p>in a router</p>
</li>
<li><p>as a dedicated device</p>
</li>
<li><p>in the cloud</p>
</li>
</ul>
<p>Analogy:<br />A <strong>security gate</strong> that checks IDs before letting people enter.</p>
<p>Without a firewall:</p>
<ul>
<li><p>networks are exposed</p>
</li>
<li><p>attacks are easy</p>
</li>
</ul>
<p>This is why security decisions often start here.</p>
<hr />
<h2 id="heading-what-is-a-load-balancer-and-why-scalable-systems-need-it">What is a Load Balancer and why scalable systems need it?</h2>
<p>A <strong>load balancer</strong> sits in front of multiple servers.</p>
<p>Its job:</p>
<ul>
<li><p>receive incoming requests</p>
</li>
<li><p>distribute them across servers</p>
</li>
<li><p>prevent overload on any single server</p>
</li>
</ul>
<p>Analogy:<br />A <strong>toll booth manager</strong> directing cars to the shortest queue.</p>
<p>Why this matters:</p>
<ul>
<li><p>higher performance</p>
</li>
<li><p>better reliability</p>
</li>
<li><p>systems can scale as traffic grows</p>
</li>
</ul>
<p>In production systems, load balancers are essential.</p>
<hr />
<h2 id="heading-how-all-these-devices-work-together-in-real-life">How all these devices work together in real life</h2>
<p>In a typical setup:</p>
<ul>
<li><p>Internet comes from the ISP</p>
</li>
<li><p>Modem connects your network to the ISP</p>
</li>
<li><p>Router directs traffic and assigns addresses</p>
</li>
<li><p>Firewall filters unsafe traffic</p>
</li>
<li><p>Switch connects multiple internal devices</p>
</li>
<li><p>Load balancer distributes traffic to servers</p>
</li>
</ul>
<p>Each device has <strong>one responsibility</strong>, but together they form a complete system.</p>
<hr />
<h2 id="heading-connecting-this-to-backend-systems-and-production-deployments">Connecting this to backend systems and production deployments</h2>
<p>For software engineers:</p>
<ul>
<li><p>APIs live behind load balancers</p>
</li>
<li><p>Firewalls protect backend services</p>
</li>
<li><p>Routers manage internal traffic between services</p>
</li>
<li><p>Switches connect servers inside data centers</p>
</li>
</ul>
<p>Understanding these devices helps you:</p>
<ul>
<li><p>design scalable systems</p>
</li>
<li><p>debug network issues</p>
</li>
<li><p>reason about production architectures</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Getting Started with cURL]]></title><description><![CDATA[What is cURL? (Explained Simply)
Before understanding cURL, let’s understand what a server is.

What is a server and why do we talk to it?
A server is just another computer on the internet that:

stores data

runs applications

sends responses when a...]]></description><link>https://anants11-networking-basics.hashnode.dev/getting-started-with-curl</link><guid isPermaLink="true">https://anants11-networking-basics.hashnode.dev/getting-started-with-curl</guid><category><![CDATA[networking]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[url]]></category><dc:creator><![CDATA[Anant Sethi]]></dc:creator><pubDate>Thu, 29 Jan 2026 17:19:25 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-what-is-curl-explained-simply">What is cURL? (Explained Simply)</h1>
<p>Before understanding <strong>cURL</strong>, let’s understand <strong>what a server is</strong>.</p>
<hr />
<h2 id="heading-what-is-a-server-and-why-do-we-talk-to-it">What is a server and why do we talk to it?</h2>
<p>A <strong>server</strong> is just another computer on the internet that:</p>
<ul>
<li><p>stores data</p>
</li>
<li><p>runs applications</p>
</li>
<li><p>sends responses when asked</p>
</li>
</ul>
<p>Whenever you:</p>
<ul>
<li><p>open a website</p>
</li>
<li><p>log in to an app</p>
</li>
<li><p>fetch data from an API</p>
</li>
</ul>
<p>Usually, the <strong>browser</strong> does this talking for you.<br />But programmers often need to talk to servers <strong>directly</strong>.</p>
<p>That’s where <strong>cURL</strong> comes in.</p>
<hr />
<h2 id="heading-what-is-curl-very-simple">What is cURL (very simple)?</h2>
<p><strong>cURL</strong> is a tool that lets you <strong>send messages to a server from the terminal</strong>.</p>
<p>Think of cURL as:</p>
<blockquote>
<p>“A browser without buttons or visuals”</p>
</blockquote>
<p>Instead of clicking links, you <strong>type commands</strong>.</p>
<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%2Fuploads%2Farticles%2Fm4061u6jlu03xspsnnmh.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%2Fuploads%2Farticles%2Fm4061u6jlu03xspsnnmh.png" /></p>
<p><img src="https://www.twilio.com/content/dam/twilio-com/global/en/blog/legacy/2022/http-methods-requests-curl/HTTP_Request_Flow_1.png" alt="https://www.twilio.com/content/dam/twilio-com/global/en/blog/legacy/2022/http-methods-requests-curl/HTTP_Request_Flow_1.png" /></p>
<hr />
<h2 id="heading-why-do-programmers-need-curl">Why do programmers need cURL?</h2>
<p>Programmers use cURL to:</p>
<ul>
<li><p>Test APIs</p>
</li>
<li><p>Check if a server is working</p>
</li>
<li><p>See raw responses from servers</p>
</li>
<li><p>Debug backend issues</p>
</li>
</ul>
<p>cURL is useful because:</p>
<ul>
<li><p>It’s fast</p>
</li>
<li><p>It works everywhere</p>
</li>
<li><p>It shows exactly what the server sends back</p>
</li>
</ul>
<hr />
<h2 id="heading-your-first-curl-command-simplest-possible">Your first cURL command (simplest possible)</h2>
<pre><code class="lang-plaintext">curl https://example.com
</code></pre>
<p>What this does:</p>
<ul>
<li><p>Sends a request to the server</p>
</li>
<li><p>Fetches the webpage content</p>
</li>
<li><p>Prints the response in the terminal</p>
</li>
</ul>
<p>This is similar to opening a website — just without the browser UI.</p>
<hr />
<h2 id="heading-understanding-request-and-response">Understanding request and response</h2>
<p>Every server communication has <strong>two parts</strong>:</p>
<h3 id="heading-request-what-you-ask">Request (what you ask)</h3>
<ul>
<li><p>“Give me this page”</p>
</li>
<li><p>“Send me this data”</p>
</li>
</ul>
<h3 id="heading-response-what-server-replies">Response (what server replies)</h3>
<ul>
<li><p>Status (success or error)</p>
</li>
<li><p>Data (HTML, JSON, text, etc.)</p>
</li>
</ul>
<p><img src="https://mdn.github.io/shared-assets/images/diagrams/http/messages/http-2-connection.png" alt="https://mdn.github.io/shared-assets/images/diagrams/http/messages/http-2-connection.png" /></p>
<hr />
<h2 id="heading-get-and-post-only-the-basics">GET and POST (only the basics)</h2>
<h3 id="heading-get-asking-for-data">GET – asking for data</h3>
<p>Used when you want to <strong>read</strong> something.</p>
<pre><code class="lang-plaintext">curl https://api.example.com/users
</code></pre>
<p>Meaning:</p>
<blockquote>
<p>“Server, give me the users”</p>
</blockquote>
<hr />
<h3 id="heading-post-sending-data">POST – sending data</h3>
<p>Used when you want to <strong>send</strong> something.</p>
<pre><code class="lang-plaintext">curl -X POST https://api.example.com/users
</code></pre>
<p>Meaning:</p>
<blockquote>
<p>“Server, I want to send data to you”</p>
</blockquote>
<p>(Details can come later — this is enough for now.)</p>
<hr />
<h2 id="heading-using-curl-to-talk-to-apis">Using cURL to talk to APIs</h2>
<p>APIs are servers that <strong>expect requests and return data</strong>, usually in JSON.</p>
<p>With cURL, you can:</p>
<ul>
<li><p>Call APIs</p>
</li>
<li><p>See exact responses</p>
</li>
<li><p>Test endpoints without writing code</p>
</li>
</ul>
<p>This makes cURL a <strong>backend developer’s best friend</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[How DNS Resolution Works]]></title><description><![CDATA[What is DNS and why name resolution exists
DNS (Domain Name System) is the internet’s phonebook.

Humans type names → google.com

Computers need numbers → IP addresses

Name resolution is the process of converting a name into an IP


Without DNS, you...]]></description><link>https://anants11-networking-basics.hashnode.dev/how-dns-resolution-works</link><guid isPermaLink="true">https://anants11-networking-basics.hashnode.dev/how-dns-resolution-works</guid><category><![CDATA[networking]]></category><category><![CDATA[dns]]></category><category><![CDATA[dig]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[Anant Sethi]]></dc:creator><pubDate>Thu, 29 Jan 2026 17:16:23 GMT</pubDate><content:encoded><![CDATA[<h3 id="heading-what-is-dns-and-why-name-resolution-exists">What is DNS and why name resolution exists</h3>
<p><strong>DNS (Domain Name System)</strong> is the <strong>internet’s phonebook</strong>.</p>
<ul>
<li><p>Humans type names → <a target="_blank" href="http://google.com"><code>google.com</code></a></p>
</li>
<li><p>Computers need numbers → IP addresses</p>
</li>
<li><p><strong>Name resolution</strong> is the process of converting a name into an IP</p>
</li>
</ul>
<p>Without DNS, you’d have to remember numeric IPs for every website — impossible at scale.</p>
<h2 id="heading-what-is-the-dig-command-and-when-it-is-used">What is the <code>dig</code> command and when it is used</h2>
<p><code>dig</code> (Domain Information Groper) is a <strong>DNS debugging and inspection tool</strong>.</p>
<p>You use it to:</p>
<ul>
<li><p>See <em>how</em> DNS answers are found</p>
</li>
<li><p>Check NS, A, MX, TXT records</p>
</li>
<li><p>Debug DNS issues (wrong IP, missing record)</p>
</li>
</ul>
<p>Think of <code>dig</code> as show me what dns is actually doing behind the scenes</p>
<h3 id="heading-dns-resolution-happens-in-layers">DNS resolution happens in layers</h3>
<p>DNS works <strong>top-down</strong>, not all at once:</p>
<p>Root servers → TLD servers (.com, .org) → Authoritative servers (<a target="_blank" href="http://google.com">google.com</a>)</p>
<h3 id="heading-understanding-dig-ns-root-name-servers">Understanding <code>dig . NS</code> — Root name servers</h3>
<p><code>dig . NS</code></p>
<p>It asks Who is responsible for DNS root</p>
<p>Ans: Root <strong>name servers</strong></p>
<p>Very simple words → Root is the top level directory of the internet</p>
<h3 id="heading-understanding-dig-com-ns-tld-name-servers">Understanding <code>dig com NS</code> — TLD name servers</h3>
<p>What it asks: Who manages all <code>.com</code> domains?”</p>
<p>Ans : <code>.com</code> <strong>TLD name servers</strong></p>
<p>Key idea:</p>
<ul>
<li><p>TLD servers know <strong>where each domain’s authoritative servers are</strong></p>
</li>
<li><p>They still don’t know the website’s IP</p>
</li>
</ul>
<h3 id="heading-understanding-dig-googlecomhttpgooglecom-ns-authoritative-name-servers">Understanding <code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> <code>NS</code> — Authoritative name servers</h3>
<p>as the command suggest google is authoritative name servers.</p>
<p>Key idea:</p>
<ul>
<li><p>These servers hold the <strong>real DNS records</strong></p>
</li>
<li><p>A, AAAA, MX, TXT live here</p>
</li>
</ul>
<h3 id="heading-understanding-dig-googlecomhttpgooglecom-full-dns-resolution">Understanding <code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> — Full DNS resolution</h3>
<p>What happens (simplified):</p>
<ol>
<li><p>Recursive resolver starts at <strong>root</strong></p>
</li>
<li><p>Root points to <strong>.com</strong></p>
</li>
<li><p><code>.com</code> points to <a target="_blank" href="http://google.com"><strong>google.com</strong></a> <strong>NS</strong></p>
</li>
<li><p>Authoritative server returns <strong>IP address</strong></p>
</li>
<li><p>Resolver gives IP to browser</p>
</li>
</ol>
<p>Your browser:</p>
<ul>
<li><p>Doesn’t talk to root/TLD directly</p>
</li>
<li><p>Uses a <strong>recursive resolver</strong> (ISP, Google DNS, Cloudflare)</p>
</li>
</ul>
<h2 id="heading-why-ns-records-matter">Why NS records matter</h2>
<p><strong>NS records define authority</strong>.</p>
<p>They tell DNS:</p>
<ul>
<li><p>Who is allowed to answer for a domain</p>
</li>
<li><p>Where the truth lives</p>
</li>
</ul>
<p>Without correct NS records:</p>
<ul>
<li><p>No website</p>
</li>
<li><p>No email</p>
</li>
<li><p>No verification</p>
</li>
</ul>
<h2 id="heading-how-this-connects-to-real-browser-requests">How this connects to real browser requests</h2>
<p>When you open a website:</p>
<ul>
<li><p>Browser → Recursive resolver</p>
</li>
<li><p>Resolver uses the <strong>same steps you saw with</strong> <code>dig</code></p>
</li>
<li><p><code>dig</code> just lets <em>you</em> see it manually</p>
</li>
</ul>
<p>So:</p>
]]></content:encoded></item><item><title><![CDATA[DNS Record Types Explained]]></title><description><![CDATA[When we search for a website name the browser don’t know where exactly this website is and also browser don’t understand these urls they need IP for this, this is where DNS comes into play.
DNS- Domain Name System
In very simple words DNS is the phon...]]></description><link>https://anants11-networking-basics.hashnode.dev/dns-record-types-explained</link><guid isPermaLink="true">https://anants11-networking-basics.hashnode.dev/dns-record-types-explained</guid><category><![CDATA[dns]]></category><category><![CDATA[dns resolver]]></category><category><![CDATA[dns-records]]></category><category><![CDATA[Cn]]></category><category><![CDATA[computer networking]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Anant Sethi]]></dc:creator><pubDate>Thu, 29 Jan 2026 16:22:41 GMT</pubDate><content:encoded><![CDATA[<p>When we search for a website name the browser don’t know where exactly this website is and also browser don’t understand these urls they need IP for this, this is where DNS comes into play.</p>
<h1 id="heading-dns-domain-name-system">DNS- Domain Name System</h1>
<p>In very simple words DNS is the phonebook/phone directory of the Internet.</p>
<h3 id="heading-why-are-dns-records-needed">Why are DNS records needed?</h3>
<p>One domains need answer to many questions like:</p>
<ul>
<li><p>Who manages it?</p>
</li>
<li><p>Where is the website?</p>
</li>
<li><p>Where should emails go?</p>
</li>
<li><p>Is this domain verified?</p>
</li>
</ul>
<p>Each <strong>DNS record solves one problem</strong>.</p>
<h1 id="heading-ns-name-system">NS - Name System</h1>
<p>NS controls the domains.</p>
<p>It tells which company is responsible for this domain’s DNS?</p>
<p>Eg. We have CloudFlare, GoDaddy, AWS\</p>
<p>They are the main authority office for the domain.</p>
<h3 id="heading-a-record-domain-ipv4-address">A Record – Domain → IPv4 address</h3>
<p><strong>A record</strong> maps a domain name to an <strong>IPv4 address</strong>.</p>
<p><a target="_blank" href="http://example.com">example.com</a> → 93.184.216.34</p>
<p>Like House name → Street address</p>
<h3 id="heading-aaaa-record-domain-ipv6-address">AAAA Record – Domain → IPv6 address</h3>
<p>Same as A record, but for <strong>IPv6</strong> (newer IP format).</p>
<ul>
<li><p>A = IPv4</p>
</li>
<li><p>AAAA = IPv6</p>
</li>
</ul>
<h3 id="heading-cname-record-one-name-pointing-to-another-name">CNAME Record – One name pointing to another name</h3>
<p><strong>CNAME</strong> points a domain to <strong>another domain name</strong>, not an IP.</p>
<p><a target="_blank" href="http://www.example.com">www.example.com</a> → <a target="_blank" href="http://example.com">example.com</a></p>
<p>Think of it as Nickname → Real name</p>
<h3 id="heading-mx-record-how-emails-reach-you">MX Record – How emails reach you</h3>
<p><strong>MX (Mail Exchange) record</strong> tells:</p>
<blockquote>
<p><em>Where emails for this domain should be delivered</em></p>
</blockquote>
<p><a target="_blank" href="http://example.com">example.com</a> → Google mail servers</p>
<p>Like you have post offices for your address that handles the your letters.</p>
<h3 id="heading-txt-record-extra-info-amp-verification">TXT Record – Extra info &amp; verification</h3>
<p><strong>TXT records</strong> store text for:</p>
<ul>
<li><p>Email security (SPF, DKIM)</p>
</li>
<li><p>Domain ownership verification</p>
</li>
</ul>
<p>It is a notice board message for the internet</p>
<blockquote>
<p>Together these make the website and email work properly.</p>
</blockquote>
]]></content:encoded></item></channel></rss>