<?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[Understanding Network Devices]]></title><description><![CDATA[Understanding Network Devices]]></description><link>https://blog.bipinbhatt.com.np</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 13:08:16 GMT</lastBuildDate><atom:link href="https://blog.bipinbhatt.com.np/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Introduction to Node.js]]></title><description><![CDATA[Node.js is widely known for its speed and non-blocking nature, but under the hood, it relies on a few powerful components that make all of this possible. The three most important ones are the V8 Engin]]></description><link>https://blog.bipinbhatt.com.np/introduction-to-node-js</link><guid isPermaLink="true">https://blog.bipinbhatt.com.np/introduction-to-node-js</guid><dc:creator><![CDATA[Bipin Bhatt]]></dc:creator><pubDate>Wed, 08 Apr 2026 04:18:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/696bb2f4eedaf078a34da0eb/51299728-99a9-4956-bb4f-9ec615e0a783.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Node.js is widely known for its speed and non-blocking nature, but under the hood, it relies on a few powerful components that make all of this possible. The three most important ones are the <strong>V8 Engine</strong>, <strong>libuv</strong>, and <strong>Node.js bindings</strong>.</p>
<p>Before diving into these components, it’s important to understand how JavaScript itself is executed.</p>
<h2>🧠 How JavaScript Executes Inside Node.js</h2>
<p>JavaScript execution is often misunderstood as simply being parsed and executed line by line. While parsing does happen first to check for syntax errors, modern engines like the V8 Engine go a step further.</p>
<p>After parsing the code and generating an internal structure (AST), V8 uses <strong>Just-In-Time (JIT) compilation</strong> to convert JavaScript into machine code. This allows the code to run much faster compared to traditional interpreted languages.</p>
<p>Execution then takes place using mechanisms like the <strong>call stack</strong> and <strong>memory heap</strong>, where functions are executed as they are invoked, rather than strictly following a simple top-to-bottom flow.</p>
<blockquote>
<p>In short, JavaScript is neither purely interpreted nor purely compiled—it uses JIT compilation, combining the best of both worlds.</p>
</blockquote>
<h2>1. 🔥 V8 Engine: Executing JavaScript at High Speed</h2>
<p>The V8 engine, developed by Google, is responsible for running JavaScript code in Node.js.</p>
<p>It uses <strong>Just-In-Time (JIT) compilation</strong>, which means it converts JavaScript directly into machine code at runtime instead of interpreting it line by line. This makes execution extremely fast.</p>
<blockquote>
<p>When you write JavaScript in Node.js, V8 is the component that actually runs it.</p>
</blockquote>
<p>V8 also manages:</p>
<ul>
<li><p><strong>Heap memory</strong> (for storing objects)</p>
</li>
<li><p><strong>Call stack</strong> (for tracking function execution)</p>
</li>
</ul>
<p>However, V8 has its limits. It does <strong>not</strong> handle:</p>
<ul>
<li><p>File system operations</p>
</li>
<li><p>Network requests</p>
</li>
<li><p>Timers</p>
</li>
</ul>
<p><strong>In short:</strong><br />👉 V8 executes JavaScript and manages memory, but knows nothing about async tasks.</p>
<h2>2. 🔄 libuv: The Backbone of Asynchronous Behavior</h2>
<p>While V8 executes code, it does not handle asynchronous operations like file reading, network requests, or timers. That responsibility is handled by <strong>libuv</strong>.</p>
<p>It is libuv is a C library that is responsible for</p>
<ul>
<li><p><strong>Event loop</strong> (core of async behavior)</p>
</li>
<li><p><strong>Thread pool</strong> (for handling heavy tasks)</p>
</li>
<li><p><strong>OS-level asynchronous I/O</strong> (files, network, etc.)</p>
</li>
<li><p><strong>DNS lookups</strong></p>
</li>
</ul>
<p>Node.js is single-threaded by design, but thanks to libuv, it can handle multiple operations at the same time without blocking the main thread.</p>
<p>For example, when you read a file or make an API call, libuv interacts with the operating system and processes the task without blocking the main thread.</p>
<p><strong>In short:</strong><br />👉 libuv handles everything V8 cannot—especially async operations.</p>
<h2>3. 🔗 Node.js Bindings: The Bridge to the System</h2>
<p>JavaScript alone cannot directly interact with low-level system operations like file systems or networking. This is where <strong>Node.js bindings</strong> come in.</p>
<p>Bindings are written in C/C++ and act as a bridge between JavaScript and the underlying system libraries (including libuv).</p>
<p>When you use built-in modules like <code>fs</code> or <code>http</code>, you are indirectly using these bindings. They pass your JavaScript requests to the system and bring the results back.</p>
<p><strong>In short:</strong><br />👉 Bindings = Connect JavaScript with system-level operations</p>
]]></content:encoded></item><item><title><![CDATA[Scopes and Hoisting in JavaScript]]></title><description><![CDATA[Hoisting is a behavior of JavaScript that moves the declaration of variable and function to the top of their respective scope.
As we know, let and const are block-scoped and variable is function-scope]]></description><link>https://blog.bipinbhatt.com.np/scopes-and-hoisting-in-javascript</link><guid isPermaLink="true">https://blog.bipinbhatt.com.np/scopes-and-hoisting-in-javascript</guid><dc:creator><![CDATA[Bipin Bhatt]]></dc:creator><pubDate>Mon, 06 Apr 2026 04:59:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/696bb2f4eedaf078a34da0eb/d8d2cfb9-ee2a-4c01-9894-0c986c0b0bcc.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hoisting is a behavior of JavaScript that moves the declaration of variable and function to the top of their respective scope.</p>
<p>As we know, let and const are block-scoped and variable is function-scoped. Let's talk about scope let, var, and const</p>
<ol>
<li><p>Let : <code>let</code> gives block scope. Variable declared with let have block scope, meaning they are only accessible within the block in which they are declared. <code>let</code> prevents redeclaration within the same scope, reducting errors.  </p>
</li>
<li><p>var : <code>var</code> is function-scoped, meaning a variable declared with var is accessible within the function it is declared in , or globally if declared outside any function. When declared outside any function, a <code>var</code> variable becomes a global variable.</p>
</li>
<li><p>const : Like <code>let</code>, const is block scoped. It does not allow ressaiging. While const prevents reassigning a value to a variable, it does not prevent modifying the contents of objects or arrrays. This is because const is applied to the binding( the reference) of the variable not the data stored in the object and array.</p>
</li>
</ol>
<h2>Hoisting</h2>
<p>We talked in the previous blog that all code is scanned, and every variable and function is loaded into memory during the memory phase.</p>
<p><code>var</code> declarations are hoisted to the top of their scope with values undefined. This means you can reference the variable before its declaration, but it will return <code>undefined</code> until it is assigned a value.</p>
<pre><code class="language-bash">console.log(x)//undefined
var x = 20
console.log(x)//20
</code></pre>
<h3><em><mark class="bg-yellow-200 dark:bg-yellow-500/30">NOTE: Only the declaration is hoisted, not the initialization.</mark></em></h3>
<p><code>let</code> and <code>const</code> are loaded to the memory phase, but they remain uninitialized and stay in the Temporal Dead Zone (TDZ) until their declaration is executed.</p>
<p>Temporal Dead Zone:<br />It is the period between when a variable is hoisted and when it is declared. During this time accessing the variable results reference error.</p>
<ul>
<li><p>This only occrus with the let and const.</p>
</li>
<li><p>Starts at the befinning of the block and ends when the variable is initialized.</p>
</li>
<li><p>Prevents the use of variable before declaration, avoiding unintended behavior.</p>
</li>
</ul>
<blockquote>
<p>let and const variable are hoisted but stay in the TDZ until the declaration is reached.</p>
</blockquote>
<pre><code class="language-bash">console.log(x)// throws reference errror(TDZ)
consoel.log(y) // says variable is not declared
let x// TDZ ends here

console.log(x)// throws undefined

x = 5 

console.log(x) // print 5
</code></pre>
<p>So if someone ask you if <code>let</code> and <code>const</code> are hoisted in JavaScript?<br />Say :<br />Yes they are hoisted , but unlike var they remains in the TDZ until their declaration. This means you can not access them before the declaration or you will get a reference error.</p>
<p>In case of functions, tfunctions are fully hoisted. Maybe clarify:</p>
<ul>
<li><p><code>function foo() {}</code> → fully hoisted (callable before definition)</p>
</li>
<li><p><code>var foo = function() {}</code> → behaves like <code>var</code>, only the variable is hoisted, not the function body.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Understanding Execution Context  in JS]]></title><description><![CDATA[You are here means you must have written some code in JavaScript and have seen your code do magic-like things. But have you ever wondered what happens behind the scenes when your code runs?Let's try t]]></description><link>https://blog.bipinbhatt.com.np/understanding-execution-context-in-js</link><guid isPermaLink="true">https://blog.bipinbhatt.com.np/understanding-execution-context-in-js</guid><dc:creator><![CDATA[Bipin Bhatt]]></dc:creator><pubDate>Wed, 01 Apr 2026 07:25:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/696bb2f4eedaf078a34da0eb/73ab0561-4676-433e-8bd3-7b2b3e7d388b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You are here means you must have written some code in JavaScript and have seen your code do magic-like things. But have you ever wondered what happens behind the scenes when your code runs?<br />Let's try to get it.</p>
<h2>What is the Execution Context?</h2>
<p>JavaScript first prepares the workspace/container/environment that holds all the information needed for JavaScript to run the piece of code. That environment is called the execution context.</p>
<ul>
<li><p>Global context: It is the default context when code runs outside any functions. Or we can say the global code runs in this execution context.</p>
</li>
<li><p>Local Execution Context: Every time a function is called, a new execution context (local execution context) is created and pushed onto the call stack. It has its own memory location for the variable and the functions declared inside the function. This context is removed after the execution of the function</p>
</li>
</ul>
<h2>Execution Context Phases</h2>
<img src="https://cdn.hashnode.com/uploads/covers/696bb2f4eedaf078a34da0eb/d64c02c0-9c20-473b-8b6f-1dbebbe624e4.png" alt="" style="display:block;margin:0 auto" />

<p><img src="align=%22center%22" alt="" /></p>
<h3>1. Memory Phase</h3>
<blockquote>
<p>setting up your tools on a desk</p>
</blockquote>
<p>This is the first phase where JavaScript sets up the environment for your code before actually running it. The memory phase is also known as the creation phase.</p>
<p>JavaScript scans all code before executing it. All variables are loaded into memory with the value "undefined," and functions are stored with their full definitions(<em><mark class="bg-yellow-200 dark:bg-yellow-500/30">fully hoisted)</mark></em>.</p>
<p>In the above example, the name variable is loaded in the memory with the value "undefined". And the greet function is loaded with the full definition. This is why we can access the function before its declaration. This concept is called <a href="https://blog.bipinbhatt.com.np/scopes-and-hoisting-in-javascript">hoisting</a> in JavaScript.</p>
<h3>2. Code Execution Phase</h3>
<blockquote>
<p>actually using the tools to do the work</p>
</blockquote>
<p>Now JavaScript starts running your code line by line. This is where values are assigned, expressions are evaluated, and functions are called.</p>
<p>What happens here:</p>
<ul>
<li><p>Variables get their assigned values.</p>
</li>
<li><p>Function calls create new local execution contexts, which are pushed onto the call stack.</p>
</li>
<li><p>Code executes in order.</p>
</li>
</ul>
<p>Let's see the table for how the code in the above figure works.</p>
<img src="https://cdn.hashnode.com/uploads/covers/696bb2f4eedaf078a34da0eb/9b80b0d0-ded8-4006-920c-d2b6e5d6af71.png" alt="" style="display:block;margin:0 auto" />

<p>JavaScript first prepares memory and then executes code. Understanding these two phases makes it easier to follow how your code runs.</p>
<p>Now that you know this, you’re ready to dive deeper into JavaScript!</p>
<p>Read more about hoisting in this blog : <a href="https://blog.bipinbhatt.com.np/scopes-and-hoisting-in-javascript">scope and hoisting in js</a></p>
]]></content:encoded></item><item><title><![CDATA[Before you write the code in JS]]></title><description><![CDATA[Here’s a simple fact:
Programming is all about:

What we should do with what?
a. Data (numbers, text, true/false…)
b. Processing (loops, functions, etc.)



Let's talk about terminologies:

Data type:]]></description><link>https://blog.bipinbhatt.com.np/before-you-write-the-code-in-js</link><guid isPermaLink="true">https://blog.bipinbhatt.com.np/before-you-write-the-code-in-js</guid><dc:creator><![CDATA[Bipin Bhatt]]></dc:creator><pubDate>Tue, 31 Mar 2026 04:22:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/696bb2f4eedaf078a34da0eb/ec2ae1e9-266f-403f-b3ff-d1262a4a3f57.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Here’s a simple fact:</p>
<p>Programming is all about:</p>
<blockquote>
<p><strong>What we should do with what?</strong></p>
<p>a. Data (numbers, text, true/false…)</p>
<p>b. Processing (loops, functions, etc.)</p>
</blockquote>
<img src="https://cdn.hashnode.com/uploads/covers/696bb2f4eedaf078a34da0eb/228aa0fe-a065-4377-b51b-bf1ee09ee24e.png" alt="" style="display:block;margin:0 auto" />

<p>Let's talk about terminologies:</p>
<ol>
<li><p><strong>Data type:</strong> Data types are like labels that tell the computer what kind of value a variable holds. They define<br />a. What kind of data can be stored (numbers, text, true/false, etc.)<br />b. What operations can be done on that data</p>
</li>
<li><p><strong>Context:</strong> It is the environment in which a piece of code runs. It consist of :<br />a. execution thread and<br />b. memory</p>
</li>
<li><p><strong>Global Context:</strong> This is the default context when code runs outside any function. In browsers, this in global context refers to the window object. Variables and functions declared globally belong to this context.</p>
</li>
<li><p><strong>Local Context:</strong> When code runs inside a function, it has a local context.</p>
</li>
<li><p><strong>Execution Thread :</strong> An execution thread is the part of the JavaScript engine that runs your code line by line. It is like the “worker” that executes instructions in your program.<br />Main thread and local exectuion thread are it's type.. based on the context.</p>
</li>
<li><p><strong>Call stack:</strong> It is a structure in js that keeps track of funcitons. When function is encountered by exectuion thread(main thread), it pushes the function in to the stack. This call stack works in LIFO manner. After the execution function is popped out.</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Git for Beginners: Basics and Essential Commands]]></title><description><![CDATA[Introduction: What is git?
Git is a version control system. It helps developers to track changes in files. It tracks all the information like: who changes the code, what changes are done, when the changes are done. It also lets you revert any changes...]]></description><link>https://blog.bipinbhatt.com.np/git-for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://blog.bipinbhatt.com.np/git-for-beginners-basics-and-essential-commands</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[version control]]></category><category><![CDATA[Git Commands]]></category><category><![CDATA[github-actions]]></category><category><![CDATA[Gitcommands]]></category><category><![CDATA[git-init]]></category><category><![CDATA[git rebase]]></category><dc:creator><![CDATA[Bipin Bhatt]]></dc:creator><pubDate>Fri, 30 Jan 2026 08:22:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769761215826/8a3e3fb6-e6ae-4b2b-9dfb-f707d8ed559c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction-what-is-git">Introduction: What is git?</h2>
<p>Git is a version control system. It helps developers to track changes in files. It tracks all the information like: who changes the code, what changes are done, when the changes are done. It also lets you revert any changes if needed. Git uses diffing algorithm to track changes. Git enables developers to work on same project independently without breaking others code. Git allows every user to have the local copy of the repository(so that we call it distriubuted)</p>
<p>we use platform like github, gitlab,bitbucket, aws code commit, azure, git tea etc to store our local repository on the internet and enable collaboration with other developers.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769402333626/5ea9f70d-a4e2-4044-8998-b44df3642a85.png" alt /></p>
<h2 id="heading-why-git-is-used">Why git is used?</h2>
<p>Git is used because it solves the real problems of developers:</p>
<ul>
<li><p>Keep track of every change in code(when it is made, who made it)</p>
</li>
<li><p>Provide better collaborative environment</p>
</li>
<li><p>Prevents code loss</p>
</li>
<li><p>Helps to roll back if you realised the change was a mistake.</p>
</li>
</ul>
<h2 id="heading-how-to-install-git">How to install git?</h2>
<p>To get started with git, we need to install git in our machine first</p>
<p><strong>For windows:</strong><br />visit the officail git website: <a target="_blank" href="https://git-scm.com/install/windows">https://git-scm.com/install/windows</a></p>
<p>Download the latest installer (64-bits is recommended) and run it.</p>
<p><strong>For MacOs:</strong> install home brew if not already and then run following command</p>
<p><code>brew install git</code></p>
<p>After installing git successfully, you need to set your email address and username. This is important because git commit willl use this information and permanently save in the commits you create.</p>
<p><code>git config --global</code> <a target="_blank" href="http://user.name"><code>user.name</code></a> <code>"Your Name"</code><br /><code>git config --global</code> <a target="_blank" href="http://user.email"><code>user.email</code></a> <code>"</code><a target="_blank" href="mailto:youremail@example.com"><code>youremail@example.com</code></a><code>"</code></p>
<p>In this , —global means your information will be used by all the repository in your machine.</p>
<p>Make sure by running command below:</p>
<p><code>git config --list</code></p>
<p>this will show something like this:</p>
<p><a target="_blank" href="http://user.name"><code>user.name</code></a><code>="Your Name"</code> <a target="_blank" href="mailto:user.email=bipinbhatt280@gmail.com"><code>user.email=</code></a><code>"your email address”</code></p>
<p>Now every commit you create will contain your your name and email address as author.</p>
<h2 id="heading-git-core-terminologies">Git core terminologies</h2>
<ol>
<li><p><strong>Repository</strong></p>
<p> Any project maintained by git is called repository. A repository is the main project folder that git tracks. Every changes in the files inside this folder. This folder contains project files, git history and the branch information. Once we run <code>git init</code> command, git starts tracking changes on our files and the folder becomes repository.</p>
</li>
<li><p><strong>Commit</strong></p>
<p> Commit is the snapshot of your code at a point of time. It has a unique id(hash) and message. Or we can say any version of your project is a commit. If you permanenlty save your changes to your project with git, it is a commit. You basically move changes in your staging area to the repository area, that’s a commit. To move you use <code>git commit -m “message to explain the change”.</code></p>
</li>
<li><p><strong>Branch</strong></p>
<p> When many developer works on the same project or even when you are working on new feature by yourself, you do not want to break your code, then you use soemthing called branch. Branch is a independent and separate line of development in your repository. It allows developers to work on new feature , bug fix etc without affecting the main version or stable version. Once your work is done you have to merge it into the default branch i.e. master or main.</p>
</li>
<li><p><strong>Head</strong></p>
<p> Head is a pointer that points to the current branch you are working on and the latest commit on that branch. When you make new commit, head updates HEAD to point to the new commit. You can move HEAD to a different branch or commit using <code>git checkout</code> or <code>git switch</code>.</p>
</li>
<li><p><strong>Remote</strong></p>
<p> Remote refers to the online-hosted version of your repository. It allows many developers to collab and share changes. Default remote name is usually ‘origin’.</p>
<p> You can run:</p>
<p> <code>git remote -v</code> shows the remote repository linked to your local repository.</p>
<p> <code>git remote add &lt;any_name_(origin is default)&gt; &lt;url&gt;</code> to add new remote repository to your local repository</p>
<p> Similary you can remove and rename too.</p>
<p> After adding remote repo to your local repository , you push your commits over there.<br /> <code>git push -u origin main</code></p>
<p> <code>-u</code> sets <code>origin</code> as the default so future <code>git push</code> commands can be run without specifying it.(<code>-u</code> sets the default remote and branch for your local branch, so you don’t have to type the remote and branch every time you push or pull.)</p>
</li>
<li><p><strong>Clone</strong></p>
<p> Clone is used to copy the remote repository to your local machine.</p>
<p> <code>git clone &lt;repo_url&gt;</code></p>
<p> This creates local repository with all the commits, files, and branches for the remote repository and allow you to work on the project locally.</p>
</li>
<li><p><strong>Merge</strong></p>
<p> Merge is the process of combining changes from one branch into another, usually merging a feature or bug-fix branch into the main branch. Git automatically integrates the changes, but if the same lines were edited in both branches, you may need to resolve conflicts manually. After merging, the target branch contains all commits from both branches, preserving their history.</p>
<p> <code>git checkout main</code> // swich to main branch(where you wanna merge other branch)</p>
<p> <code>git merge &lt;brancName&gt;</code> // this will merge</p>
</li>
<li><p><strong>Push</strong></p>
<p> Push refers to sending commits you did on the local repository to the remote repository so that other can see and access the change.</p>
</li>
<li><p><strong>Pull</strong></p>
<p> Let's say some collaborator to your project added some code on the remote repository and you want sync your local repository with the new changes, for doing this we need to download the repository changes. We can do it using the <code>git pull origin main</code> command.</p>
</li>
</ol>
<h2 id="heading-three-areas-in-git">Three areas in Git</h2>
<p>To maintains our files git uses three areas:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769407179161/a599b683-34a4-4394-82a5-82ff562406d3.png" alt /></p>
<h3 id="heading-1-working-area">1. Working Area</h3>
<p>Wokring area or working directory is the actual folder that we are writing code on. This is where we write code, make changes or delte files. Once we run <code>git init</code> command on this folder, git starts tracking changes on our files. Git just notices the changes does not save them in its history yet.</p>
<h3 id="heading-2-staging-area">2. Staging Area</h3>
<p>Working area is where we write, edit code. Once git notices these all changes if we decided to save the change, git put those changes in the staging area. Git does not do it automatically we have to run <code>git add &lt;filename&gt;</code> or if you want all the changes <code>git add .</code> . Any changes if file/files present in this area are those which wil be part of next version/commit*(in the world of git version is also referred as commit).*</p>
<h3 id="heading-2-repository-area">2. Repository Area</h3>
<p>Repository area or local repository where we hve those changes which are already part of some earlier vesion. When the files in the staging area are committed using the <code>git commit</code> command, Git stores those changes in the repository along with a commit message, date, and unique commit ID.</p>
<p>Read about git command <a target="_blank" href="https://blog.bipinbhatt.com.np/git-commands">here</a></p>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists: The Pendrive Problem]]></title><description><![CDATA[Why version control exists?
let’s suppose you have a song lyrics file. Now you want to change one verse. You keep changing a lot of times. But after some time, you realise that the older one was better. So what will you do? nothing but regret. Cause ...]]></description><link>https://blog.bipinbhatt.com.np/why-version-control-exists-the-pendrive-problem</link><guid isPermaLink="true">https://blog.bipinbhatt.com.np/why-version-control-exists-the-pendrive-problem</guid><category><![CDATA[Why Version Control Exists: The Pendrive Problem]]></category><category><![CDATA[versioncontrol]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[Bipin Bhatt]]></dc:creator><pubDate>Fri, 30 Jan 2026 08:14:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769760837723/c819995e-7259-4781-9024-401387bf597f.avif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-why-version-control-exists">Why version control exists?</h2>
<p>let’s suppose you have a song lyrics file. Now you want to change one verse. You keep changing a lot of times. But after some time, you realise that the older one was better. So what will you do? nothing but regret. Cause you don’t have backup and history of the change.</p>
<p>Now one of your friends says, <em>“ let’s do this song together.”</em> And ask you for lyrics file to write his lyrics on. How would you give that to him ?I believe, you will either send it via email / whatsApp or you copy file in a pendrive and give him pendrive. Imagine,</p>
<ul>
<li><p>One good line got triggered on your mind and you want to add that right now on the file. You can not do it because file is with him.</p>
</li>
<li><p>He does not write his lyrics but modified yours too.</p>
</li>
<li><p>He records the song himself that it’s his own song. You will lose the ownership**.**</p>
</li>
</ul>
<p>This is problematic, right?</p>
<p>So, this is where version control comes into the picture. Version control is a system that</p>
<ul>
<li><p>keeps track of all the changes in your files(l<em>ike: when changes are made, who made the changes</em>)</p>
</li>
<li><p>allows Multiple people collaborate independently.</p>
</li>
<li><p>allows you to rollback to the previous version if needed</p>
</li>
</ul>
<h2 id="heading-the-pendrive-analogy-in-software-development">The Pendrive Analogy in Software Development</h2>
<p>Before version control came into the picture, developers used to write code back then too. They used to use pendrive. Pendrive used to be shared among all the developer in the team. So typical workflow used to be like this:</p>
<ul>
<li><p>Developer A writes code</p>
</li>
<li><p>Copies it to a pendrive</p>
</li>
<li><p>Gives it to developer B</p>
</li>
<li><p>B edits the same file</p>
</li>
<li><p>Copies it back to the pendrive</p>
</li>
<li><p>gives it to developer</p>
</li>
</ul>
<p>It’s look simple but if B can overwirte the codes and there will be no history for that. They don’t wanna take risk they used to make copies. B will make a new version instead updating it so that they can track changes later. That led to name project like final, final, final_real, final_actual_real. This can cause a lot of confusions to get which is the final.</p>
<p>To solve all these kind of issues, version control is used.</p>
]]></content:encoded></item><item><title><![CDATA[How DNS Resolution Works?]]></title><description><![CDATA[Problem without DNS
Before I start, I expect you to have basic understanding of IP addresses. You know, they are just numerical label that is given to each devices in a computer network to uniquely identify them, right?
So, let suppose I wanna talk t...]]></description><link>https://blog.bipinbhatt.com.np/how-dns-resolution-works</link><guid isPermaLink="true">https://blog.bipinbhatt.com.np/how-dns-resolution-works</guid><category><![CDATA[tiktok-banned-in-nepal]]></category><category><![CDATA[dns]]></category><category><![CDATA[dns resolver]]></category><category><![CDATA[#DNS Resolution]]></category><category><![CDATA[dns-records]]></category><category><![CDATA[dns server]]></category><category><![CDATA[Domain Name System]]></category><dc:creator><![CDATA[Bipin Bhatt]]></dc:creator><pubDate>Fri, 30 Jan 2026 08:06:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769760348076/ec63bf1b-0ee3-4702-8cec-60fea4652758.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-problem-without-dns">Problem without DNS</h2>
<p>Before I start, I expect you to have basic understanding of IP addresses. You know, they are just numerical label that is given to each devices in a computer network to uniquely identify them, right?</p>
<p>So, let suppose I wanna talk to a web server. I must have the IP address of that server right? So basically if I wanna access anything in the internet(network of computer network) I must need to know the IP addresses. Wait, wouldn’t this gonna give you a headache? Internet is suppose to make your life easier now it is making you remember lots of things.</p>
<h2 id="heading-solution-before-dns">Solution before DNS</h2>
<p>To solve this, computers started using a hosts.txt file to map hostname to IP address. It was manual text file stored in each computer(you can still finds that file : etc/hosts).</p>
<p>It looks sth like:</p>
<pre><code class="lang-bash">192.168.1.10        server1
192.168.03.12       server2
</code></pre>
<p>This file was manually maintained/ updated by system administrators. Even today, every computer still has a hosts file. It’s mainly used for testing or blocking websites.</p>
<h2 id="heading-dns">DNS</h2>
<p>As you know more manual work quickly become problem. And we know every problem has a solution(either it’s already found or we will have to… haha). Don’t worry somebody has already found the solution.<br />Do you remember every contact numbers that you have in your phone? Hell No. Then what you do? you just open phonebook and type name and you can get number and make a phone call.</p>
<p>So there is something named DNS that is like the phonebook of the internet.</p>
<p>DNS is distributed(<em>no single server controls DNS, it’s spread across many servers worldwide</em>), robust(<em>keeps working even some servers fail</em>) and scalable(<em>can handle billions of request</em> ) system of the interne. It translates human-readable domain names like(<code>www.google.com</code>) into IP address that computers use to communicate. Without DNS we would have to remember IP address for every website.</p>
<p><strong>DNS does note exist to serve browsers. Browers are just one of its users. Email, security, cloud, verification all use DNS</strong></p>
<p><strong><mark>DNS tells you who should you talk to next.</mark></strong></p>
<p>But DNS does not only translate the human readable domain names to an IP address. It does much more than that:</p>
<ul>
<li><p>translates domain names into IP addresses.</p>
</li>
<li><p>Guides your request to the correct server across the internet.</p>
<p>  ex. Your browser asks DNS for <code>cs.harvard.edu</code> → DNS tells which authoritative server to contact.</p>
</li>
<li><p>Directs emails to the right mail servers (MX records)</p>
<p>  ex. Sending email to example@mail.com → DNS points to Gmail’s mail servers</p>
</li>
<li><p>Handles subdomains and organizes services</p>
<p>  ex. cs.harvar.edu .. cs is subdomain</p>
</li>
<li><p>Supports load balancing and faster content delivery (CDNs)</p>
<p>  ex. www.netflix.com DNS may give IP of the nearest server to your location.</p>
</li>
<li><p>Caches results to make internet access faster</p>
<p>  ex: Visiting www.youtube.com again → your local DNS cache returns IP instantly</p>
</li>
</ul>
<h2 id="heading-dns-hierarchy">DNS Hierarchy</h2>
<p>DNS hierarchy is the structured organization of domain servers. It is tree like structure starting from root server branching down to subdomain. This structure makes DNS distributed, robust and scalable.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769755682860/9e791fdf-86a1-49c0-8d6f-d36269848075.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769754352216/9c5a1208-e769-4e30-a870-e7bc64dc7ea3.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-1-root-server">1. Root Server</h3>
<p>This is the top most level in the DNS system. This is the first POC(point of contact). Root servers know the location of all TLD(top-level domains) servers. There are 13 root server groups globally(with many copies). So in reality, there are <strong>hundreds of physical root server instances worldwide</strong>, but <strong>only 13 logical root servers</strong> from the DNS perspective.</p>
<p>This is the top most level in the DNS system. There are the first POC(point of contact). Root serves know the location of all TLD(top level domains) servers. There are 13 root server groups globally(with many copies). So in reality, there are <strong>hundreds of physical root server instances worldwide</strong>, but <strong>only 13 logical root servers</strong> from the DNS perspective.</p>
<h3 id="heading-2-top-level-domain">2. Top Level Domain</h3>
<p>TLD is the last part of the domain name that comes after the last dot(.). TLD servers manages domains under specific TLD like .com, .edu, .org etc.</p>
<p>Example: .edu TLD server knows where the <code>cs.harvard.edu</code>’s authoritative server is.</p>
<p>.edu is Top level deomain</p>
<p>.edu’s <strong>TLD server</strong> doesn’t know the exact IP of <code>cs.harvard.edu</code> itself.<br />But it <strong>knows which server is authoritative for</strong> <code>harvard.edu</code> (the second-level domain).</p>
<h3 id="heading-3-second-level-domain">3. Second level Domain</h3>
<p>The second-level domain is the part of a domain name that comes directly before the top-level domain (TLD). It is usually the name of organization, company etc.</p>
<p>Second level domain’s authoritative server stores the actual DNS record for this domain.</p>
<p><code>harvard.edu</code> → <code>harvard</code> is second level domain and <strong>.</strong><code>edu</code> is the TLD</p>
<p>Authoritative server for second level domain is where DNS records live.</p>
<h3 id="heading-4-sub-domain">4. Sub Domain</h3>
<p>A subdomain is a part of a domain that comes before the second-level domain.<br />It is used to organize different sections or services of a website and can have its own DNS records.<br />If needed, it can also have its own authoritative server, separate from the main domain.</p>
<p><code>cs.harvard.edu</code> → <code>cs</code> is the <strong>subdomain</strong> of <code>harvard.edu</code> (second-level domain) with <code>.edu</code> as the TLD.</p>
<p>Subdomains let you divide or manage a domain without buying a new domain.</p>
<h2 id="heading-dns-resolution">DNS Resolution</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769758618989/c9943ed4-e5ea-469e-a6a1-96af7f1020e0.png" alt class="image--center mx-auto" /></p>
<p>when you type <code>google.com</code> in browser, what happens actually? let’s discuess</p>
<h3 id="heading-1-check-hosttxt-file">1. Check host.txt file</h3>
<p>Your computer first checks the <strong>hosts file</strong> (already discussed above) If it finds an entry here (for <code>google.com</code> <strong>→ ip address</strong>), it skips all other steps and uses this IP.</p>
<h3 id="heading-2-query-initiation">2. Query Initiation</h3>
<p>Now, your computer or device verifies its local DNS cache to see if it already has the IP address corresponding to <strong><mark>google.com</mark></strong> . If it doesn't have the IP address, the DNS resolution process begins.</p>
<h3 id="heading-3-recursive-dns-server">3. Recursive DNS Server</h3>
<p>Next, your computer sends a query to a recursive DNS server, often provided by your internet service provider or a public DNS resolver like Google Public DNS. These servers are responsible for carrying out DNS resolution on behalf of the client. This is the point of contact. Recursive DNS server <mark>first check its local cache</mark> .</p>
<p><em><mark>If you are from Nepal, do you remember Nepal once banned tiktok. The authorities did not block TikTok’s IP addresses directll but they blocked access only at the DNS level. This means that the ISPs’ DNS servers refused to translate TikTok’s domain name (like www.tiktok.com) into its corresponding IP address, making it impossible for users to reach the site using default settings. However, users who switched to public DNS servers such as Cloudflare’s </mark></em> <code>1.1.1.1</code> <em><mark>or Google’s </mark></em> <code>8.8.8.8</code> <em><mark>were still able to access TikTok, because these DNS servers could resolve the domain normally. In other words, the ban affected only the domain resolution at the ISP DNS level and did not block the actual TikTok servers or their IP addresses.</mark></em></p>
<h3 id="heading-4-dns-hierarchy">4. DNS Hierarchy</h3>
<p>If the recursive DNS server doesn't have the IP address for the <code>google.com</code> either, it initiates the DNS resolution process by sending a request to the root DNS servers. These servers are critical to the DNS infrastructure and store a list of the top-level domain (TLD) servers for each domain extension like .com, .org, .net, etc. g1 TLD servers: The root DNS servers respond to the recursive DNS server with the IP address (i.e. <code>.com</code> ) of the TLD server that manages the specific domain extension requested like .com, .org, etc. The recursive DNS server then sends a query to the <code>.com</code> TLD server.</p>
<h3 id="heading-5-authoritative-dns-servers">5. Authoritative DNS Servers</h3>
<p>The TLD server responds to the recursive DNS server with the IP address of the authoritative DNS server for <code>google.com</code>. The authoritative DNS servers store the DNS records (such as A records, CNAME records, MX records, etc.) for specific domain names. The recursive server fetches the IP from here and sends it back to your device. Usually, the IP is also cached locally to speed up future requests.</p>
]]></content:encoded></item><item><title><![CDATA[Git Commands]]></title><description><![CDATA[Git commands are instructions that we give to git to perform action such as tracking changes, switching branch, creating commits etc (Rebase ko barem pani yesmia lekha).
Following are some usefull git commands
git init
This initializes a new git repo...]]></description><link>https://blog.bipinbhatt.com.np/git-commands</link><guid isPermaLink="true">https://blog.bipinbhatt.com.np/git-commands</guid><category><![CDATA[Git]]></category><category><![CDATA[Git Commands]]></category><category><![CDATA[git-init]]></category><category><![CDATA[git rebase]]></category><category><![CDATA[git remote]]></category><dc:creator><![CDATA[Bipin Bhatt]]></dc:creator><pubDate>Thu, 29 Jan 2026 05:52:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769761502116/601a4de2-9585-4c01-92d8-d562555a12ef.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Git commands are instructions that we give to git to perform action such as tracking changes, switching branch, creating commits etc (Rebase ko barem pani yesmia lekha).</p>
<p>Following are some usefull git commands</p>
<h2 id="heading-git-init">git init</h2>
<p>This initializes a new git repository in an existing project. This command creates a new hidden folder (.git). It contains all the necessary repository files and subdirectories to manage version control for your project.</p>
<p>To initialize the git in your project, go to root folder and run following command</p>
<pre><code class="lang-plaintext">git init
</code></pre>
<h2 id="heading-git-status">git status</h2>
<p>This command is used to check and display the current status of your project. This command tells the informaiton like which files are modified, which files are staged for the next commit, and which files are untracked. This is very helpful command to know the state of your project.</p>
<pre><code class="lang-bash">git status
</code></pre>
<h2 id="heading-git-add">git add</h2>
<p>The git add command is used in order to begin tracking a new file or stage changes in the working directory so that the changes can be included in the next commit. Staging is an essential step in the Git workflow because it allows you to choose which changes should be included in the commit and which ones should be excluded.</p>
<pre><code class="lang-bash"><span class="hljs-comment">#1 to add all the changes and new files</span>
git add . 
<span class="hljs-comment">#2 to add single file</span>
git add filename
<span class="hljs-comment">#3 to add multiple file </span>
git add filename filename
</code></pre>
<h2 id="heading-git-commit">git commit</h2>
<p>Commit is a snapshot of the project at any specific point in time. Each commit has a unique identifier (a hash) and includes a message that describes the changes made in that commit. The git commit command is used <mark>to save staged changes in your Git repository as a new commit.</mark></p>
<pre><code class="lang-bash">git commit -m <span class="hljs-string">"message that describes the change made"</span>
</code></pre>
<h2 id="heading-git-log">git log</h2>
<p>This command is used to list the commit history of a repository. It shows information about past commits, including hashes, authors, dates, and commit messages.</p>
<pre><code class="lang-bash"><span class="hljs-comment">#1 displays history commits</span>
git <span class="hljs-built_in">log</span>

<span class="hljs-comment">#2 Displays commits history in short</span>
git <span class="hljs-built_in">log</span> -oneline

<span class="hljs-comment">#3 Displays details of a commit</span>
git <span class="hljs-built_in">log</span> -p &lt;commit_has&gt;

<span class="hljs-comment">#4 Display last n number of commits</span>
git <span class="hljs-built_in">log</span> -n &lt;number_of_commit&gt;

<span class="hljs-comment">#5 display for specific branch</span>
git <span class="hljs-built_in">log</span> &lt;branch_name&gt;

<span class="hljs-comment">#6 display commits by auther</span>
git <span class="hljs-built_in">log</span> --author &lt;author_name&gt;
</code></pre>
<h2 id="heading-git-diff">git diff</h2>
<p>This command is used to compare various parts of your git repository</p>
<pre><code class="lang-bash"><span class="hljs-comment">#1 Compares working direcotry to last commit </span>
git diff

<span class="hljs-comment">#2 compares two commits</span>
git diff &lt;commit_has&gt; &lt;commit_hash&gt;

<span class="hljs-comment">#3 compare staged changes to last commit</span>
git diff --staged
</code></pre>
<h2 id="heading-git-pull">git pull</h2>
<p>The git pull command is used to fetch changes from a remote repository (usually the origin) and merge them into your current branch. It essentially combines two operations git fetch and git merge.</p>
<p><strong>Fetching changes (git fetch)</strong> -  Git fetches new changes from the remote repository (usually named "origin" by default) into your local repository without immediately merging them into your current branch. <strong>Merging Changes (git merge)</strong> - After fetching changes, Git automatically tries to merge them into your current branch.</p>
<pre><code class="lang-bash"><span class="hljs-comment">#1 fetch form remote main branch and merge to current branch</span>
git pull
<span class="hljs-comment">#2 fetch from another remote branch to current brach </span>
git pull origin branchname
</code></pre>
<h2 id="heading-git-clone">git clone</h2>
<p>The git clone command is used to make a copy of a remote Git repository on a local machine. It allows us to start working on a project that is hosted on a remote server by downloading all the project’s files, commit history, and branches</p>
<pre><code class="lang-bash">git <span class="hljs-built_in">clone</span> &lt;url&gt;
</code></pre>
<h2 id="heading-git-push">git push</h2>
<p>This command is used to upload local commits to a remote repository, allowing developers to share their work and synchronize changes across multiple machines.</p>
<pre><code class="lang-bash">git push -u origin main <span class="hljs-comment"># for first time then  git push</span>
</code></pre>
<h2 id="heading-git-stash">git stash</h2>
<p>The git stash is a useful Git command used to temporarily save the changes in your working directory and index without committing them. This is particularly handy when you need to switch to a different branch or perform some other operation that requires a clean working directory.</p>
<p>The main purpose of git stash is to save changes that are not ready to be committed yet but need to be temporarily stored. This allows you to switch branches or perform other operations without committing to halffinished work.</p>
<pre><code class="lang-bash"><span class="hljs-comment">#to save changes without commit</span>
git stash

<span class="hljs-comment"># retrieve stashed change</span>
git stash apply

<span class="hljs-comment">#list all the stashed changes</span>
git stash  list
</code></pre>
<h2 id="heading-git-checkout">git checkout</h2>
<p>This is versatile command with the multiple uses.</p>
<pre><code class="lang-bash"><span class="hljs-comment">#1 to switch to existing branch</span>
git checkout branch_name

<span class="hljs-comment">#2 create and switch to a new branch</span>
git checkout -b branch_name
</code></pre>
<h2 id="heading-git-branch">git branch</h2>
<p>The git branch command in Git is used to list, create delete, and manage branches with a Git repository. Branches are used to isolate development work and manage different lines of code.</p>
<pre><code class="lang-bash"><span class="hljs-comment">#1 list all branchs</span>
git branch

<span class="hljs-comment">#2 create a new barnch</span>
git branch &lt;branchName&gt;

<span class="hljs-comment">#3 delete </span>
git branch -D &lt;branchname&gt;

<span class="hljs-comment">#4 rename</span>
git branch -m newname
</code></pre>
<h2 id="heading-git-reset">git reset</h2>
<p>The git reset is a powerful Git command that allows you to reset the current branch to a specified state. It’s used to undo changes, unstaged files, or move the branch to a pointer to a different commit.</p>
<p>It is a Git command used to move the HEAD (and the current branch pointer) to a specified commit and optionally update the staging area and working directory.</p>
<p><mark>HEAD points to the current branch, while the branch pointer points to a commit; when a branch moves, HEAD follows it</mark>.</p>
<p>There are three primary options for git resets<br />1. Soft reset: This moves HEAD and the current branch pointer to the specified commit <mark>without changing the staging area or working directory</mark>. All changes remain staged for the next commit.</p>
<ol start="2">
<li><p>Mixed reset: Moves HEAD and the branch pointer to the specified commit, <mark>unstages all changes, but keeps them in the working directory</mark>. Useful when you accidentally staged files.</p>
</li>
<li><p>Hard reset : Moves HEAD and the branch pointer to the specified commit, removes all staged and unstaged changes from the working directory, effectively discarding all changes. Use with caution.</p>
</li>
</ol>
<p>Use cases are give below</p>
<pre><code class="lang-bash"><span class="hljs-comment">#1 Undo the last commit(When you commit to early or with the wrong message</span>
git reset -- soft HEAD^
(Keeps changes staged)

<span class="hljs-comment">#2 Unstage files accidentally added ( you did git add. and wanna unstage some )</span>
git reset &lt;file_name&gt;

<span class="hljs-comment">#3 Discard all local changes.....( you tried some changes but want to start fresh)</span>
git reset --hard HEAD 
(Removes all staged and unstaged changes <span class="hljs-keyword">in</span> the current branch.)

<span class="hljs-comment">#4 Move the branch to a specific commit</span>
git reset --&lt;commit_hash&gt;

etc,..
</code></pre>
<h2 id="heading-git-merge">git merge</h2>
<p>The git merge is a Git command that is used to integrate changes from one branch to another branch. This is typically used to combine the changes made in a features branch back into the main branch.</p>
<pre><code class="lang-bash">git merge &lt;branch_name&gt;
</code></pre>
<h2 id="heading-git-squash">git squash</h2>
<p>The git squash is not a standalone Git command, but it refers to a technique used to combine multiple Git commits into a single, more meaningful commit. This is typically done to maintain a cleaner and more organized Git history.</p>
<pre><code class="lang-bash">git merge --squash &lt;branch_name&gt;

//Squash combines changes ... you need a single commit to save them.
</code></pre>
<h2 id="heading-git-rebase">git rebase</h2>
<p>Git rebase is a Git command used to move or reapply commits from one branch onto another, creating a linear commit history. It rewrites commit hashes for the rebased commits. After rebasing, you won’t see a merge commit, but all the changes from your branch will appear as if they were applied on top of the target branch from the beginning. In other words, it acts as if the branch was created from the latest state of the main branch, even though it originally started earlier. Rebase is used instead of merging to avoid unnecessary merge commits and keep the history clean.</p>
<pre><code class="lang-bash"><span class="hljs-comment">#suppose you have a branch feature  and you want to rebase on top of the main branch</span>

<span class="hljs-comment">#1. make sure you are on the main branch</span>
git checkout main
git pull origin main

<span class="hljs-comment">#2. switch to the feature brahcn</span>
 git checkout feature

<span class="hljs-comment">#3 rebase the feature branch on the main branch</span>
git rebase main
</code></pre>
<h2 id="heading-git-revert">git revert</h2>
<p>The git revert command is used to create a new commit that undoes the changes made by a previous commit or a range of commits.  It effectively applies the inverse of the specified commit(s) to the current branch, allowing you to ‘revert the changes without altering the commit history</p>
<pre><code class="lang-bash"><span class="hljs-comment">#single commit  revert</span>
git rever &lt;commit_hash&gt;

<span class="hljs-comment">#range of commit </span>
git revert &lt;commit_hash&gt; .. &lt;commit_hash&gt;
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Network And Network Devices]]></title><description><![CDATA[Introduction to Network
If any two or more than two entities are connected to communicate with each other, then that connection is called as network. Example of network can be social network (connection between two or more people), network or highway...]]></description><link>https://blog.bipinbhatt.com.np/network-and-network-devices</link><guid isPermaLink="true">https://blog.bipinbhatt.com.np/network-and-network-devices</guid><category><![CDATA[networking]]></category><category><![CDATA[#NetworkDevices]]></category><category><![CDATA[router]]></category><category><![CDATA[modem]]></category><dc:creator><![CDATA[Bipin Bhatt]]></dc:creator><pubDate>Sun, 25 Jan 2026 00:15:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769761537710/1626383a-8971-445b-a709-3e74fbe08f98.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction-to-network">Introduction to Network</h2>
<p>If any two or more than two entities are connected to communicate with each other, then that connection is called as network. Example of network can be social network (connection between two or more people), network or highways etc.</p>
<p>Similary, when the two or more computers are connected, it is called computer network. Computer network make communication possible for computers. The network of multiple computer networks is internet. We need certain physical appliances to establish a network for computers , these physical appliances are know as network devices. Some of network devices are : Router, Modem, Switch, firewall etc. these devices help you to access the internet.</p>
<h2 id="heading-function-of-network-devices">Function of Network Devices</h2>
<ol>
<li><p>Enabling communication between computers</p>
</li>
<li><p>Managing and controlling data traffic to avoid congestion</p>
</li>
<li><p>Amplifies weak signal to boost speed and extend network coverage</p>
</li>
<li><p>Provice secure connection</p>
</li>
</ol>
<h2 id="heading-network-devices">Network Devices</h2>
<p>When you open a website, your data travels through multiple devies before reaching its destination.</p>
<ul>
<li><p>your device genereates data(like http request)</p>
</li>
<li><p>NIC converts data into signal to travel over local network</p>
</li>
<li><p>Hub or switch or access point directs data within your local network</p>
</li>
<li><p>router choose the best path for data to leave your network</p>
</li>
<li><p>modem converts your LAN signal into analog signal suitable for transimsiion over the ISP medium then you get connected to the internet</p>
</li>
</ul>
<p>Finally your request reach to the server and it gerenates the response and it come back to you same way it went.</p>
<h3 id="heading-1-nic">1. NIC</h3>
<p>NIC stands for network interface card. This is the chip(used to be an external card) inside your device that makes your device able to connect to network physically or wirelessly. NIC is present in every network-connected device. NIC has mac address assigned to which is required for the communication inside local aread network. NIC converts data to the electrical signal(if you are connecting with ethernete cable) or radio waves(if using wi-fi) so it can travel over the medium. The receiving device’s NIC converts the signal back into digital form tha computer can understand</p>
<h3 id="heading-2-hub">2. HUB</h3>
<p>HUB Is used to connect multiple computers in a local area network. When hub receives data from any devices connectd to it’s port, it broadcast the data to all other ports. It does not know MAC address, IP address. It is dumb. So every device connected to its port wil get the data but only the intended device will receive it, others just ignore. The transmission mode in hub is dubplex, meaning sending and receiving of data can not be done simultaneouly.</p>
<h3 id="heading-3-repeater">3. Repeater</h3>
<p>When signal travels through the medium like wire, air they might lose weight with the distance. In order to make the signal sharp as the original we need some extra work to do. This is where repeater are used. Repeater does not understand data but they just signals. Let’s suppose you max length for a ethernet cable is 100m, if you need 200m you have to put a repeater in between.</p>
<h3 id="heading-4-modem">4. Modem</h3>
<p>Word modem came from the work it does; modulation and demodulation. Modem converts signal(generated by NIC) from your network to the form requried by your ISP’s physical medium and vice verca. It acts as a translator between your network and your internert. It is placed between your router and ISP connection. Modem provides internet to the network that is connected through a hub or switch.</p>
<h3 id="heading-5-switch">5. Switch</h3>
<p>Switch is the better version of HUB that is used to connect all the fevices is a local area network. It is much smarter. It forwards data only tot the device that needs it using mac address. It stores mac of all the connected devices and upon receiving a message from sender it checks mac address of the message and then sends the message to the receiver that mathces the mac address.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769298078924/e169db85-47b3-451c-9cae-bc0038c8f931.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-6-bridge">6. Bridge</h3>
<p>Bridge is a network device that connects two LAN segments and manage traffic between them. You can think it as a small overpass connecting two neighborhood allowing only relevant traffic to pass. Bridge uses MAC address to decide whether to send data between LAN segments. Suppose you have LAN1 and LAN2. Device A in LAN1 wants to send data to device B in LAN2. Bridge check MAC address table: if the destination MAC is in the other LAN , it forwards the data, and if same it blocks the data.</p>
<h3 id="heading-7-access-point-ap">7. Access Point (AP)</h3>
<p>AP is a networking device that allows wireless devices to conne t to a wired network (LAN). AP is connected to a switch or router using ethernet cable. Wireless devices connet to the AP via wi-fi. AP forwards wireless traffic to the wired network, and vice-versa.</p>
<h3 id="heading-8-router">8. Router</h3>
<p>Router is a device that connects two or more networks and forwads data between these based on IP address. It connets a LAN to the WAN or Internet. It maintains MAC address of local devices using an ARP(address resolution protocol) table. When a router receives a packet it checks the destination IP address. If destination IP belongs to the local network the router forward the packet by creating frame with the destination device’s MAC address and sends it to the switch. If the destination IP is outside the local network , the router forwards to ISP gateway by encapsulatin it in a new frame with the ISP gateway’s MAC address.</p>
<h3 id="heading-9-firewall">9. Firewall</h3>
<p>Firewall is network device that sits between. your local network and the outside world to control and filter the traffic. It monitors and filters incomming and outgoing traffic according to predefined rules. This is the best place to control the traffic because it is right in between the router and outside world. All of the traffic or packets have to pass through this. Imagine you wanna put a security guard at your home to block all of the unknown person to enter, where would you let him stand? at the main gate from where the any unknown person can come right? So firewall is also a gatekeeper for you LAN.</p>
<h3 id="heading-10-load-balancer">10. Load Balancer</h3>
<p>It is a networking device that distributes network traffic across multiple servers to make sore no single server get overloaded. Load balancers are used in the server side. Server use it to share the load. Suppose you have 3 servers. If any user requuest come load balancer will direct it to the server that has less requests, to make sure user get response faster and no server become overloaded.</p>
]]></content:encoded></item></channel></rss>