<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by SHYLESH S on Medium]]></title>
        <description><![CDATA[Stories by SHYLESH S on Medium]]></description>
        <link>https://medium.com/@shylesh1640?source=rss-3579f93424c1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3FCxSRkV-Uv8tuyQcq20-A.png</url>
            <title>Stories by SHYLESH S on Medium</title>
            <link>https://medium.com/@shylesh1640?source=rss-3579f93424c1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 10:51:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shylesh1640/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building CodeSage AI — An AI-Powered Code Review Platform During My Internship at Valentius Kryptix]]></title>
            <link>https://medium.com/@shylesh1640/building-codesage-ai-an-ai-powered-code-review-platform-during-my-internship-at-valentius-kryptix-809bd7abc9c8?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/809bd7abc9c8</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 13:22:54 GMT</pubDate>
            <atom:updated>2026-11-20T19:17:28.231Z</atom:updated>
            <content:encoded><![CDATA[<p>During my internship at <strong>Valentius Kryptix</strong>, I had the opportunity to develop <strong>CodeSage AI</strong>, an AI-powered code review platform designed to help developers improve code quality, identify potential bugs, detect security vulnerabilities, and optimize performance.</p><p>CodeSage AI allows users to submit source code, select a programming language, and choose from five review modes: Complete Review, Bug Detection, Security Audit, Performance Analysis, and Code Quality.</p><p>The platform supports 14+ programming languages and provides real-time AI-generated feedback through streaming responses.</p><p><strong>Technologies Used:</strong></p><ul><li>Next.js and React.js</li><li>TypeScript</li><li>Tailwind CSS</li><li>OpenAI AP</li><li>Vercel</li></ul><p>Working on this project gave me valuable hands-on experience in AI integration, modern web development, API security, and real-time streaming. It also helped me understand how artificial intelligence can make software development more efficient.</p><p>I would like to thank <strong>Valentius Kryptix</strong> for providing me with this opportunity to apply my knowledge and strengthen my technical skills through practical development experience.</p><h3>Explore CodeSage AI</h3><p>🚀 <strong>Live Project:</strong> <a href="https://codesage-ai-tau.vercel.app/">https://codesage-ai-tau.vercel.app/</a></p><p>📖 <strong>Read the Full Blog:</strong> <a href="https://valentiuskryptix.com/how-to-build-an-ai-powered-code-review-platform/">https://valentiuskryptix.com/how-to-build-an-ai-powered-code-review-platform/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=809bd7abc9c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From IP Addresses to Routers: Understanding the Network Layer]]></title>
            <link>https://medium.com/@shylesh1640/from-ip-addresses-to-routers-understanding-the-network-layer-57986763c1cd?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/57986763c1cd</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Mon, 10 Aug 2026 05:01:02 GMT</pubDate>
            <atom:updated>2026-08-10T05:01:02.917Z</atom:updated>
            <content:encoded><![CDATA[<p>After understanding Ethernet, switches, hubs, MAC addresses, ARP, broadcasts, and CRC at the Data Link Layer, I reached the next major part of networking:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fmLN7t4wWYvQhnFZsG6l3Q.png" /></figure><p><strong>The Network Layer (Layer 3).</strong></p><p>At first, IP addresses looked like just another numbering system. But as I went deeper, I realized that IP addressing exists to solve a much bigger problem:</p><blockquote><strong><em>How do we communicate with devices that are not on our local network?</em></strong></blockquote><p>A MAC address can help deliver a frame within a local network. But the Internet contains millions of different networks.</p><p>We need something that can identify <strong>which network a destination belongs to</strong> and decide <strong>where the packet should go next</strong>.</p><p>That is where the Network Layer comes in.</p><h3>Why Do We Need the Network Layer?</h3><p>Imagine a small network:</p><pre>PC1 ──┐<br>PC2 ──┤<br>PC3 ──┤── Switch<br>PC4 ──┘</pre><p>A switch can forward Ethernet frames between these devices using their MAC addresses.</p><p>But now imagine another network:</p><pre>Network A                 Network B</pre><pre>PC1 ── Switch             Switch ── PC5<br>          │                   │<br>          └────── ??? ────────┘</pre><p>PC1 and PC5 belong to different networks.</p><p>A mechanism is needed to move traffic between those networks.</p><p>That is the job of <strong>IP and routers</strong>.</p><h3>IPv4: Giving Devices a Logical Identity</h3><p>IPv4 uses a <strong>32-bit address</strong>.</p><p>For example:</p><pre>192.168.1.25</pre><p>It is divided into four octets:</p><pre>192 . 168 . 1 . 25</pre><p>But an IP address isn’t simply:</p><blockquote><em>“This number identifies this computer.”</em></blockquote><p>It contains information about the <strong>network</strong> and the <strong>host</strong>.</p><p>For example:</p><pre>192.168.1.25/24</pre><p>The /24 tells us how much of the address represents the network.</p><p>The network is:</p><pre>192.168.1.0/24</pre><p>while the device can have an address such as:</p><pre>192.168.1.25</pre><p>This distinction becomes extremely important when routers make forwarding decisions.</p><h3>CIDR and Subnet Masks</h3><p>One of the important concepts I learned was <strong>CIDR — Classless Inter-Domain Routing</strong>.</p><p>Instead of relying entirely on the old Class A, B, and C system, we can specify the network size using a prefix:</p><pre>192.168.1.0/24</pre><p>The /24 corresponds to the subnet mask:</p><pre>255.255.255.0</pre><p>This tells us:</p><pre>Network portion | Host portion<br>----------------|-------------<br>24 bits         | 8 bits</pre><p>So a router can understand:</p><blockquote><em>“This destination belongs to the </em><em>192.168.1.0/24 network.&quot;</em></blockquote><p>CIDR isn’t just an addressing trick. It becomes fundamental to <strong>routing</strong>.</p><h3>Public and Private IP Addresses</h3><p>I also learned that not every IPv4 address is globally reachable on the Internet.</p><p>Private address ranges are used inside local networks.</p><p>For example:</p><pre>192.168.1.25</pre><p>might be my laptop’s local address.</p><p>Another home somewhere else could also have:</p><pre>192.168.1.25</pre><p>And that’s perfectly fine.</p><p>Why?</p><p>Because these addresses are used within separate private networks.</p><p>The router/NAT system provides the connection between the private network and the public Internet.</p><h3>Special IPv4 Addresses</h3><p>Some IPv4 addresses have special purposes.</p><h3>127.0.0.1 — Loopback</h3><p>This means:</p><blockquote><em>“My own computer.”</em></blockquote><p>For example:</p><pre>ping 127.0.0.1</pre><p>The traffic stays inside the computer.</p><p>This is also why developers frequently use:</p><pre>localhost</pre><h3>169.254.x.x — APIPA</h3><p>If a device cannot obtain an address from DHCP, it may automatically assign itself an address in the:</p><pre>169.254.0.0/16</pre><p>range.</p><p>This allows limited local communication but normally doesn’t provide normal Internet connectivity.</p><p>Seeing a 169.254.x.x address is often a clue that something went wrong with DHCP or network connectivity.</p><h3>0.0.0.0</h3><p>This address has different meanings depending on context.</p><p>During DHCP, a device that doesn’t yet have an IP can use:</p><pre>Source: 0.0.0.0</pre><p>It essentially means:</p><blockquote><em>“I don’t have an address yet.”</em></blockquote><p>It can also appear in routing as the default route:</p><pre>0.0.0.0/0</pre><p>meaning:</p><blockquote><em>“If there isn’t a more specific route, use this route.”</em></blockquote><h3>Broadcast</h3><p>IPv4 also has broadcast addresses.</p><p>For example, for:</p><pre>192.168.1.0/24</pre><p>the subnet broadcast address is:</p><pre>192.168.1.255</pre><p>It means:</p><blockquote><em>“Send this to all hosts in this subnet.”</em></blockquote><p>There is also the limited broadcast:</p><pre>255.255.255.255</pre><p>which is used to reach all devices on the local network.</p><h3>Then I Asked: How Does a Device Get Its IP?</h3><p>This led to another important protocol:</p><h3>DHCP</h3><p>DHCP stands for:</p><p><strong>Dynamic Host Configuration Protocol.</strong></p><p>The problem it solves is simple.</p><p>Imagine an organization with 10,000 computers.</p><p>Would an administrator manually configure:</p><pre>IP address<br>Subnet mask<br>Gateway<br>DNS</pre><p>on every computer?</p><p>That would be extremely inefficient and error-prone.</p><p>DHCP automates this process.</p><h3>DHCP Is Like a Network Receptionist</h3><p>Think of a hotel.</p><p>A guest arrives and says:</p><blockquote><em>“I need a room.”</em></blockquote><p>The receptionist checks availability and assigns one.</p><p>DHCP does something similar.</p><p>A device joins the network and says:</p><blockquote><em>“I need network configuration.”</em></blockquote><p>The DHCP server provides:</p><pre>IP address<br>Subnet mask<br>Default gateway<br>DNS server<br>Lease time</pre><h3>The DORA Process</h3><p>The first time I heard “DORA”, it sounded like another completely new concept.</p><p>But the reason behind it makes sense.</p><p>A device initially doesn’t know:</p><ul><li>Its own IP address</li><li>The DHCP server’s IP address</li><li>The complete network configuration</li></ul><p>So DHCP uses four major messages:</p><pre>D → Discover<br>O → Offer<br>R → Request<br>A → Acknowledge</pre><h3>1. Discover</h3><p>The device broadcasts:</p><blockquote><em>“Is there a DHCP server here?”</em></blockquote><p>It can use:</p><pre>Source: 0.0.0.0<br>Destination: 255.255.255.255</pre><h3>2. Offer</h3><p>The DHCP server responds:</p><blockquote><em>“I can give you this IP.”</em></blockquote><p>For example:</p><pre>192.168.1.25</pre><h3>3. Request</h3><p>The client says:</p><blockquote><em>“Yes, I want that address.”</em></blockquote><p>This is particularly important if multiple DHCP servers made offers.</p><h3>4. Acknowledge</h3><p>The server confirms:</p><blockquote><em>“Okay. You can use it.”</em></blockquote><p>The device now has its network configuration.</p><h3>DHCP Leases</h3><p>One thing that initially confused me was the word <strong>lease</strong>.</p><p>It doesn’t mean the device is paying rent for the IP. 😄</p><p>A DHCP lease simply means:</p><blockquote><strong><em>The device is temporarily allowed to use an IP address for a specified period.</em></strong></blockquote><p>For example:</p><pre>192.168.1.25</pre><pre>Lease:<br>24 hours</pre><p>The address isn’t permanently assigned to that device.</p><p>When the device leaves and its lease eventually expires, the DHCP server can reuse the address.</p><p>This makes address allocation much more efficient.</p><h3>How Does DHCP Avoid Giving the Same IP to Two Devices?</h3><p>The DHCP server maintains a lease database.</p><p>Conceptually:</p><pre>MAC Address       IP Address       Lease<br>------------------------------------------------<br>AA:AA:AA          192.168.1.10     Active<br>BB:BB:BB          192.168.1.11     Active<br>CC:CC:CC          192.168.1.12     Active</pre><p>Before assigning an address, the DHCP server checks its records.</p><p>So:</p><pre>Device A<br>   ↓<br>192.168.1.10</pre><p>means another DHCP client shouldn’t simultaneously receive:</p><pre>192.168.1.10</pre><p>This is how DHCP manages a pool of addresses without constantly creating conflicts.</p><h3>DHCP Reservation</h3><p>Then I discovered something interesting.</p><p>What if I want a particular device to consistently receive the same IP?</p><p>For example, a network printer.</p><p>Instead of configuring a static IP directly on the printer, the DHCP server can have a reservation:</p><pre>Printer MAC<br>     ↓<br>192.168.1.50</pre><p>Whenever that printer requests an address, DHCP gives it the reserved address.</p><p>This is different from a manually configured static IP.</p><pre>Static IP:<br>Device remembers its own IP.</pre><pre>DHCP Reservation:<br>DHCP server remembers which IP to give the device.</pre><h3>DHCP Lease Renewal</h3><p>A device doesn’t normally perform DORA again every time its lease gets halfway through its lifetime.</p><p>Instead, it tries to renew its existing lease.</p><p>For example:</p><pre>Lease = 24 hours</pre><pre>0h -------------------------- 24h<br>       ↑                 ↑<br>       T1                Expiry<br>       12h</pre><p>At <strong>T1</strong>, normally 50% of the lease duration, the client tries to renew with the DHCP server.</p><p>If that doesn’t work, it eventually reaches <strong>T2</strong>, normally 87.5% of the lease duration, and tries to find another DHCP server that can renew the lease.</p><p>If renewal ultimately fails and the lease expires, the device can no longer continue using that address.</p><h3>DHCP Relay</h3><p>Then came another interesting problem.</p><p>What happens if the DHCP server is on another network?</p><p>Remember:</p><blockquote><em>Routers normally don’t forward Layer-2 broadcasts between networks.</em></blockquote><p>But DHCP Discover initially uses a broadcast.</p><p>So:</p><pre>Laptop<br>   │<br>   │ DHCP Broadcast<br>   ▼<br>Router<br>   ❌<br>   │<br>Network B<br>   │<br>DHCP Server</pre><p>The DHCP server would never receive the request.</p><p>The solution is a <strong>DHCP relay</strong>.</p><p>A relay acts like a messenger:</p><pre>Laptop<br>   ↓<br>DHCP Broadcast<br>   ↓<br>DHCP Relay<br>   ↓<br>DHCP Server</pre><p>The relay receives the request on one network and forwards it toward the DHCP server on another network.</p><p>This allows organizations to use centralized DHCP servers for many different networks.</p><h3>The Complete DHCP Journey</h3><p>Putting all of this together:</p><pre>New Laptop<br>    │<br>    ▼<br>No IP Address<br>    │<br>    ▼<br>DHCP Discover<br>    │<br>    ▼<br>DHCP Offer<br>    │<br>    ▼<br>DHCP Request<br>    │<br>    ▼<br>DHCP ACK<br>    │<br>    ▼<br>IP Configuration<br>    │<br>    ▼<br>ARP<br>    │<br>    ▼<br>Find Default Gateway&#39;s MAC<br>    │<br>    ▼<br>Ethernet Frame<br>    │<br>    ▼<br>Router<br>    │<br>    ▼<br>Internet</pre><p>This was one of the first moments where I could see multiple networking concepts working together instead of studying them as separate topics.</p><h3>And Now: Routers</h3><p>This naturally brought me to the next question:</p><blockquote><strong><em>If switches can forward frames, why do we even need routers?</em></strong></blockquote><p>Imagine:</p><pre>Network A                 Network B</pre><pre>PC1 ── Switch             Switch ── PC5<br>          │                   │<br>          └────── ??? ────────┘</pre><p>PC1 might have:</p><pre>192.168.1.10</pre><p>while PC5 has:</p><pre>192.168.2.10</pre><p>They belong to different IP networks.</p><p>We need something that can connect those networks and make a forwarding decision.</p><p>That device is a <strong>router</strong>.</p><h3>What Does a Router Actually Do?</h3><p>At the simplest level:</p><pre>Receive Packet<br>      ↓<br>Look at Destination IP<br>      ↓<br>Check Routing Table<br>      ↓<br>Find Best Route<br>      ↓<br>Choose Outgoing Interface<br>      ↓<br>Forward Packet</pre><p>For example, a router might know:</p><pre>192.168.1.0/24 → Interface 1</pre><pre>192.168.2.0/24 → Interface 2</pre><pre>10.0.0.0/8     → Interface 3</pre><pre>0.0.0.0/0      → Interface 4</pre><p>If a packet arrives with:</p><pre>Destination:<br>192.168.2.50</pre><p>the router finds:</p><pre>192.168.2.0/24</pre><p>and forwards the packet through the appropriate interface.</p><h3>Why Can’t We Just Build the Internet With Switches?</h3><p>This question helped me understand the purpose of routers much better.</p><p>If the entire world were one giant Layer-2 network, we’d have enormous problems.</p><h3>Broadcasts</h3><p>A broadcast could potentially affect an enormous number of devices.</p><h3>MAC tables</h3><p>A network trying to maintain Layer-2 information for an enormous global network would be impractical.</p><h3>Network boundaries</h3><p>Different organizations and networks need separation.</p><h3>Routing</h3><p>Most importantly, the Internet needs devices that can make decisions such as:</p><blockquote><em>“Which network should this packet move toward?</em></blockquote><p>That is routing.</p><h3>Switch vs Router</h3><p>The simplest mental model is:</p><pre>MAC address<br>     ↓<br>Frame<br>     ↓<br>Local network<br></pre><pre>ROUTER</pre><pre>IP address<br>     ↓<br>Packet<br>     ↓<br>Different networks</pre><p>A switch primarily makes forwarding decisions using Layer-2 information.</p><p>A router makes Layer-3 forwarding decisions using IP addressing and routing information.</p><p>Modern networking equipment can combine both functions, but the conceptual difference remains extremely important.</p><h3>Where I Am Now</h3><p>My Network Layer journey currently looks like this:</p><pre>Network Layer<br>│<br>├── Foundation                 ✅<br>│<br>├── IPv4                       ✅<br>│<br>├── CIDR                       ✅<br>│<br>├── Subnet Masks               ✅<br>│<br>├── Public / Private IP        ✅<br>│<br>├── Special IPv4 Addresses     ✅<br>│<br>├── DHCP                       ✅<br>│   ├── DORA<br>│   ├── Leases<br>│   ├── Renewal<br>│   ├── Reservations<br>│   └── Relay<br>│<br>└── Routers                    🚀 CURRENT</pre><p>The next question is now:</p><blockquote><strong><em>How does a router actually know where to send a packet?</em></strong></blockquote><p>That takes us into <strong>routing tables, next hops, default gateways, and longest-prefix matching</strong>.</p><p>And that is where the Network Layer starts getting really interesting.</p><h3>Final Thought</h3><p>The biggest change in my understanding so far is that networking isn’t really about memorizing definitions.</p><p>It’s about understanding <strong>why each mechanism exists</strong>.</p><ul><li>Ethernet solves local frame delivery.</li><li>Switches move frames inside Layer-2 networks.</li><li>ARP connects IP addresses to MAC addresses locally.</li><li>IP provides logical addressing between networks.</li><li>DHCP automatically gives devices their network configuration.</li><li>Routers connect different IP networks and decide where packets should go.</li></ul><p>Each technology exists because the previous one alone wasn’t enough.</p><p>And that chain of problems and solutions is what makes networking so interesting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57986763c1cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Computer Networks from First Principles: My Journey from Bits to Ethernet Switching]]></title>
            <link>https://medium.com/@shylesh1640/understanding-computer-networks-from-first-principles-my-journey-from-bits-to-ethernet-switching-2c82fe523a65?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c82fe523a65</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 05:01:02 GMT</pubDate>
            <atom:updated>2026-08-05T05:01:02.021Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started learning computer networks, I assumed it was mostly about connecting computers with cables and Wi-Fi. But as I dug deeper, I discovered something fascinating:</p><blockquote><em>Every networking technology exists because it solves a specific problem.</em></blockquote><p>Networking isn’t a collection of random protocols. It’s an engineering story of continuous evolution. Every new device, every protocol, and every layer was invented to overcome the limitations of the previous one.</p><p>This article summarizes my journey from understanding what a network is to mastering the core concepts of the Data Link Layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FvCtTDvRmQy4FvkbuHB5fw.png" /></figure><h3>Everything Begins with Communication</h3><p>At its heart, a computer network exists for one reason:</p><p><strong>To allow devices to communicate.</strong></p><p>Whether you’re:</p><ul><li>Browsing Google</li><li>Watching YouTube</li><li>Sending a WhatsApp message</li><li>Uploading files to the cloud</li><li>Playing an online game</li></ul><p>everything starts with one computer communicating with another.</p><p>That immediately raises an important question:</p><blockquote><em>How do two completely different computers understand each other?</em></blockquote><p>The answer is <strong>protocols</strong>.</p><h3>Protocols: The Rules of Communication</h3><p>Imagine two people trying to communicate.</p><p>One speaks English.</p><p>The other speaks Japanese.</p><p>Without a common language, communication is impossible.</p><p>Computers face the same challenge.</p><p>Protocols define:</p><ul><li>how communication begins</li><li>how messages are formatted</li><li>how errors are detected</li><li>how communication ends</li></ul><p>Instead of one giant protocol doing everything, networking uses many specialized protocols, each solving a different problem.</p><p>This design philosophy appears throughout networking.</p><h3>Different Networks for Different Scales</h3><p>Not every network covers the same geographical area.</p><p>Networks are generally divided into:</p><h3>LAN (Local Area Network)</h3><p>Small networks inside:</p><ul><li>Homes</li><li>Schools</li><li>Offices</li></ul><p>Communication is extremely fast because devices are nearby.</p><h3>MAN (Metropolitan Area Network)</h3><p>Connects multiple LANs across an entire city.</p><h3>WAN (Wide Area Network)</h3><p>Connects networks across countries and continents.</p><p>The Internet itself is the world’s largest WAN.</p><h3>Network Topologies</h3><p>I also learned that how devices are physically connected affects reliability, scalability, and cost.</p><p>Common topologies include:</p><ul><li>Bus</li><li>Ring</li><li>Star</li><li>Tree</li><li>Mesh</li></ul><p>Modern Ethernet primarily uses the <strong>Star Topology</strong>, but understanding older topologies helps explain why today’s networks are designed the way they are.</p><h3>The OSI Model Changed Everything</h3><p>One of the biggest breakthroughs in my learning was understanding the OSI Model.</p><p>Instead of building one enormous protocol that handles everything, networking divides communication into seven layers.</p><p>Each layer performs one specific responsibility before passing data to the next layer.</p><p>This separation makes networking:</p><ul><li>Modular</li><li>Easier to troubleshoot</li><li>Easier to improve</li><li>Highly scalable</li></ul><p>The deeper I studied, the more I appreciated why this layered architecture has survived for decades.</p><h3>Layer 1 — The Physical Layer</h3><p>The Physical Layer doesn’t understand websites.</p><p>It doesn’t understand IP addresses.</p><p>It doesn’t understand files.</p><p>It understands only one thing:</p><p><strong>Bits.</strong></p><p>Those bits travel as:</p><ul><li>Electrical signals</li><li>Optical signals</li><li>Radio waves</li></ul><p>through:</p><ul><li>Ethernet cables</li><li>Fiber optics</li><li>Wireless networks</li></ul><p>This layer is responsible for physically moving information from one device to another.</p><h3>Repeaters: Solving Weak Signals</h3><p>Electrical signals weaken over long distances.</p><p>To solve this problem, engineers invented the <strong>Repeater</strong>.</p><p>A repeater simply regenerates weak signals, allowing communication over longer distances.</p><h3>Hubs: Connecting Multiple Devices</h3><p>Engineers extended repeaters into devices called <strong>Hubs</strong>.</p><p>A hub is essentially a <strong>multi-port repeater</strong>.</p><p>Whenever one computer transmits data, the hub copies the signal to every connected port.</p><p>Initially this sounds useful.</p><p>Until you realize the biggest drawback.</p><h3>The Collision Problem</h3><p>Because every computer shares the same communication medium, two computers may transmit simultaneously.</p><p>Their electrical signals overlap.</p><p>The result is a <strong>collision</strong>.</p><p>Both frames become corrupted.</p><p>Both computers must transmit again.</p><p>As more devices were added, collisions became increasingly common.</p><h3>CSMA/CD: Reducing Collisions</h3><p>Early Ethernet introduced <strong>Carrier Sense Multiple Access with Collision Detection (CSMA/CD).</strong></p><p>The process was surprisingly clever:</p><ol><li>Listen before transmitting.</li><li>If the cable is busy, wait.</li><li>If it’s free, transmit.</li><li>Detect collisions while transmitting.</li><li>If a collision occurs, stop immediately.</li><li>Wait for a random amount of time.</li><li>Retry.</li></ol><p>CSMA/CD reduced collisions.</p><p>It didn’t eliminate them.</p><h3>Modern Ethernet Solved the Problem Completely</h3><p>Instead of allowing every computer to share one communication medium, engineers invented the <strong>Ethernet Switch</strong>.</p><p>Every computer now has its own dedicated connection.</p><p>Combined with <strong>Full-Duplex communication</strong>, collisions effectively disappeared from modern Ethernet.</p><p>This was one of the biggest improvements in networking history.</p><h3>Layer 2 — The Data Link Layer</h3><p>The Data Link Layer introduces another important concept:</p><p><strong>Frames.</strong></p><p>Instead of transmitting raw bits, Ethernet organizes information into structured frames.</p><p>An Ethernet frame contains:</p><ul><li>Destination MAC Address</li><li>Source MAC Address</li><li>EtherType</li><li>Payload</li><li>Frame Check Sequence (FCS)</li></ul><p>This allows reliable communication inside a Local Area Network.</p><h3>MAC Addresses</h3><p>Every Network Interface Card (NIC) has a unique <strong>MAC Address</strong>.</p><p>One insight that completely changed my understanding was the difference between MAC addresses and IP addresses.</p><p><strong>MAC Address</strong></p><ul><li>Identifies hardware</li><li>Used inside the local network</li></ul><p><strong>IP Address</strong></p><ul><li>Identifies logical network location</li><li>Used to reach devices across different networks</li></ul><p>Both are essential, but they solve different problems.</p><h3>Ethernet Frames</h3><p>An Ethernet frame isn’t just a container.</p><p>Every field has a purpose.</p><p>The destination MAC tells the switch where the frame should go.</p><p>The source MAC allows switches to learn where devices are connected.</p><p>The payload carries the entire IP packet.</p><p>The FCS allows the receiver to detect transmission errors.</p><p>Learning how each field contributes to communication made Ethernet much easier to understand.</p><h3>Error Detection with CRC</h3><p>Communication media are never perfect.</p><p>Electrical interference can change bits during transmission.</p><p>To detect these errors, Ethernet uses <strong>CRC (Cyclic Redundancy Check).</strong></p><p>Before sending a frame:</p><p>The sender performs a mathematical calculation on the data.</p><p>The resulting value becomes the <strong>Frame Check Sequence (FCS).</strong></p><p>The receiver performs the same calculation independently.</p><p>If both calculations agree, the frame is accepted.</p><p>Otherwise, it is discarded.</p><p>CRC doesn’t repair damaged frames.</p><p>It simply detects that something changed.</p><h3>How Ethernet Switches Actually Work</h3><p>This was probably the most satisfying concept I learned.</p><p>Whenever a frame reaches a switch:</p><ol><li>The switch reads the Source MAC Address.</li><li>It stores that MAC and the incoming port inside the CAM Table.</li><li>It reads the Destination MAC Address.</li><li>If the destination exists, the frame is forwarded only to that port.</li><li>If the destination is unknown, the switch temporarily floods the frame to every port except the one it arrived on.</li></ol><p>Over time, the switch automatically learns the entire network without any manual configuration.</p><h3>Broadcasts and Broadcast Domains</h3><p>Some messages aren’t intended for one computer.</p><p>They are intended for everyone.</p><p>These are called <strong>Broadcasts</strong>.</p><p>Ethernet represents them using the special destination MAC:</p><p><strong>FF:FF:FF:FF:FF:FF</strong></p><p>Switches forward broadcasts throughout the LAN.</p><p>Routers stop them.</p><p>This creates a <strong>Broadcast Domain</strong>.</p><p>Understanding broadcast domains helped me understand one of the hidden purposes of routers: limiting unnecessary traffic.</p><h3>ARP: Connecting IP Addresses to MAC Addresses</h3><p>One of the most fascinating concepts I learned was <strong>Address Resolution Protocol (ARP).</strong></p><p>Imagine my laptop wants to communicate with another device.</p><p>It knows the destination IP address.</p><p>But Ethernet cannot send data using IP addresses.</p><p>It requires a MAC address.</p><p>So the laptop broadcasts:</p><blockquote><em>“Who has this IP address?”</em></blockquote><p>The correct device replies with its MAC address.</p><p>The laptop stores this mapping inside its <strong>ARP Cache</strong>, making future communication much faster.</p><h3>ARP Cache</h3><p>Instead of asking the same question repeatedly, the operating system remembers recently learned IP-to-MAC mappings.</p><p>This dramatically reduces unnecessary broadcast traffic.</p><p>It’s essentially a phone contacts list for networking.</p><h3>Gratuitous ARP</h3><p>I also learned about <strong>Gratuitous ARP</strong>, where a device announces its own IP-to-MAC mapping without anyone asking.</p><p>This helps:</p><ul><li>Detect duplicate IP addresses</li><li>Update ARP caches</li><li>Support high-availability systems when routers fail over</li></ul><p>It’s a small protocol feature with surprisingly important real-world applications.</p><h3>The Security Weakness of ARP</h3><p>ARP was designed in a trusted networking environment.</p><p>It assumes devices tell the truth.</p><p>Unfortunately, attackers can exploit this.</p><p>By sending fake ARP replies, an attacker can convince another computer that:</p><blockquote><em>“I am the router.”</em></blockquote><p>The victim updates its ARP cache.</p><p>From that point onward, traffic flows through the attacker.</p><p>This attack is called <strong>ARP Spoofing</strong> or <strong>ARP Cache Poisoning</strong>.</p><p>Enterprise networks defend against this using technologies such as <strong>Dynamic ARP Inspection (DAI)</strong>, while encrypted protocols like HTTPS protect the actual application data even if traffic is intercepted.</p><h3>The Biggest Realization</h3><p>One lesson stood out above everything else.</p><p>An Ethernet frame and an IP packet have different destinations.</p><p>The Ethernet frame is delivered to the <strong>next hop</strong> (usually the router).</p><p>The IP packet inside continues carrying the <strong>final destination’s IP address</strong>, such as Google’s servers.</p><p>That single idea connected everything I had learned about Layers 2 and 3.</p><h3>My Biggest Takeaway</h3><p>Looking back, I realized networking isn’t about memorizing protocols.</p><p>It’s about understanding <strong>why each technology exists.</strong></p><p>Every new invention solved a real engineering problem:</p><ul><li>Repeaters solved weak signals.</li><li>Hubs connected multiple devices.</li><li>Switches solved collisions and unnecessary traffic.</li><li>CRC solved transmission error detection.</li><li>ARP connected IP addresses to MAC addresses.</li><li>Routers separated broadcast domains and connected different networks.</li></ul><p>When you understand the problem first, the solution becomes much easier to remember.</p><h3>What’s Next?</h3><p>At this point, I’ve completed:</p><ul><li>Networking Fundamentals</li><li>Network Architectures</li><li>Network Types</li><li>Network Topologies</li><li>OSI Model Overview</li><li>Physical Layer</li><li>Core Data Link Layer</li><li>Ethernet</li><li>Switching</li><li>Broadcast Domains</li><li>ARP</li><li>CRC</li><li>ARP Security</li></ul><p>The next stage of my journey is the <strong>Network Layer</strong>, where I’ll explore:</p><ul><li>IP Packets</li><li>Routers</li><li>Routing Tables</li><li>IPv4 vs IPv6</li><li>NAT</li><li>ICMP</li><li>TTL</li><li>DHCP</li><li>How packets travel across the Internet</li></ul><p>The deeper I go, the more I appreciate that the Internet isn’t magic.</p><p>It’s a beautifully engineered system where every layer solves a specific problem, allowing billions of devices to communicate reliably across the world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c82fe523a65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Zero to Understanding Ethernet: My Journey Learning Computer Networks (Part 1)]]></title>
            <link>https://medium.com/@shylesh1640/from-zero-to-understanding-ethernet-my-journey-learning-computer-networks-part-1-7f8b7e3d7582?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f8b7e3d7582</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 04:31:03 GMT</pubDate>
            <atom:updated>2026-08-01T04:31:03.639Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first started learning computer networks, I thought networking was simply about connecting computers with cables or Wi-Fi. Very quickly, I realized that every device, protocol, and layer exists because it solves a specific problem. Networking isn’t just a collection of technologies — it’s a story of continuous evolution.</p><p>This article summarizes everything I’ve learned so far, from the basics of networking to understanding how Ethernet switches make communication possible inside a Local Area Network (LAN).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLtIxRVKg9BSfvXXezS4Ow.png" /></figure><h3>Every Network Begins with Communication</h3><p>At its core, a computer network exists to allow devices to communicate and share resources.</p><p>Whether it’s:</p><ul><li>Opening a website</li><li>Sending an email</li><li>Watching a YouTube video</li><li>Uploading files to the cloud</li><li>Making a video call</li></ul><p>everything begins with one computer communicating with another.</p><p>That immediately raises an important question:</p><blockquote><em>How do two completely different computers understand each other?</em></blockquote><p>The answer is <strong>protocols</strong>.</p><h3>Protocols: The Common Language of Computers</h3><p>Imagine two people trying to talk.</p><p>One speaks English.</p><p>The other speaks Japanese.</p><p>Without a common language, communication becomes impossible.</p><p>Computers face the same challenge.</p><p>Protocols define:</p><ul><li>how communication starts</li><li>how messages are formatted</li><li>how errors are handled</li><li>when communication ends</li></ul><p>Every protocol solves a different communication problem.</p><p>Examples include:</p><ul><li>HTTP</li><li>HTTPS</li><li>DNS</li><li>SMTP</li><li>TCP</li><li>UDP</li><li>IP</li></ul><p>Instead of one giant protocol handling everything, networking divides responsibilities into multiple specialized protocols.</p><h3>Different Sizes of Networks</h3><p>Not every network covers the same geographical area.</p><p>I learned that networks are generally categorized into:</p><h3>LAN (Local Area Network)</h3><p>A small network inside:</p><ul><li>Homes</li><li>Offices</li><li>Schools</li><li>Colleges</li></ul><p>Communication is extremely fast because devices are physically close.</p><h3>MAN (Metropolitan Area Network)</h3><p>Connects multiple LANs across an entire city.</p><p>Example:</p><p>Several university campuses connected together.</p><h3>WAN (Wide Area Network)</h3><p>Connects networks across countries and continents.</p><p>The Internet itself is the world’s largest WAN.</p><h3>Network Topologies</h3><p>Another interesting concept was learning that the physical arrangement of devices also matters.</p><p>Common topologies include:</p><ul><li>Bus</li><li>Ring</li><li>Star</li><li>Tree</li><li>Mesh</li></ul><p>Although modern Ethernet primarily uses the <strong>Star topology</strong>, understanding the older designs helps explain why networking evolved the way it did.</p><h3>The OSI Model: Divide and Conquer</h3><p>One of the biggest breakthroughs in my understanding came from learning the <strong>OSI Model</strong>.</p><p>Instead of making one enormous protocol responsible for everything, networking divides communication into seven layers.</p><p>Each layer performs one specific responsibility before passing data to the next layer.</p><p>The idea is surprisingly elegant:</p><blockquote><em>Every layer solves one problem well.</em></blockquote><p>This makes networking modular, scalable, and much easier to design and troubleshoot.</p><h3>Layer 1 — Physical Layer</h3><p>The Physical Layer deals with one thing:</p><p><strong>Moving bits.</strong></p><p>Not packets.</p><p>Not IP addresses.</p><p>Not websites.</p><p>Just bits.</p><p>These bits travel as:</p><ul><li>Electrical signals</li><li>Optical signals</li><li>Radio waves</li></ul><p>through:</p><ul><li>Ethernet cables</li><li>Fiber optics</li><li>Wireless networks</li></ul><p>At this layer, computers don’t understand data.</p><p>They simply transmit and receive signals.</p><h3>Repeaters and Hubs</h3><p>Signals become weaker over long distances.</p><p>To solve this problem, engineers introduced <strong>Repeaters</strong>, whose only job is to regenerate weak signals.</p><p>To connect multiple computers, they extended this idea into a <strong>Hub</strong>.</p><p>A hub is essentially a <strong>multi-port repeater</strong>.</p><p>Whenever one computer transmits data, the hub repeats the signal to every connected device.</p><p>Initially this sounds useful.</p><p>Until you realize its biggest drawback.</p><h3>The Problem with Hubs</h3><p>Suppose one computer wants to send data to another.</p><p>Instead of forwarding data only to the intended device, the hub copies the signal to every computer.</p><p>Each computer must then inspect the frame.</p><p>If the destination MAC address doesn’t match its own, it discards the frame.</p><p>This wastes bandwidth.</p><p>Even worse…</p><p>If two computers transmit simultaneously, their electrical signals overlap.</p><p>This creates a <strong>collision</strong>.</p><p>The frame becomes corrupted and both devices must retransmit.</p><h3>CSMA/CD: Managing Collisions</h3><p>Early Ethernet solved this using <strong>CSMA/CD (Carrier Sense Multiple Access with Collision Detection).</strong></p><p>The process was surprisingly clever.</p><p>A computer would:</p><ol><li>Listen before transmitting.</li><li>Send only if the medium was free.</li><li>Detect collisions while transmitting.</li><li>Send a Jam Signal if a collision occurred.</li><li>Wait for a random period.</li><li>Retry transmission.</li></ol><p>CSMA/CD didn’t eliminate collisions.</p><p>It simply reduced them.</p><h3>Modern Ethernet: Eliminating Collisions</h3><p>Instead of making every computer share one communication medium, engineers introduced the <strong>Ethernet Switch</strong>.</p><p>Unlike a hub, every device receives its own dedicated connection.</p><p>This removes the shared medium.</p><p>Combined with <strong>Full-Duplex communication</strong>, collisions effectively disappear in modern Ethernet.</p><p>This was one of the biggest design improvements in networking history.</p><h3>Layer 2 — Data Link Layer</h3><p>The Data Link Layer introduced another major concept:</p><p><strong>Frames.</strong></p><p>Instead of sending raw bits, Ethernet organizes data into structured frames.</p><p>An Ethernet frame contains:</p><ul><li>Destination MAC Address</li><li>Source MAC Address</li><li>EtherType</li><li>Payload</li><li>Frame Check Sequence (FCS)</li></ul><p>This allows reliable communication between devices inside the same LAN.</p><h3>MAC Addresses</h3><p>Every network interface has a unique <strong>MAC Address</strong>.</p><p>Unlike IP addresses, MAC addresses identify network hardware.</p><p>One of the most interesting lessons for me was understanding the difference:</p><ul><li><strong>IP Address</strong> → Identifies <em>where</em> a device is in the network.</li><li><strong>MAC Address</strong> → Identifies the <em>hardware</em> itself on the local network.</li></ul><p>Both are important — but they solve completely different problems.</p><h3>How a Switch Actually Works</h3><p>Learning how switches work internally completely changed how I think about networking.</p><p>When a frame arrives:</p><ol><li>The switch reads the <strong>Source MAC Address</strong>.</li><li>It learns which port that device is connected to.</li><li>It stores this information inside the <strong>CAM (MAC) Table</strong>.</li><li>It then checks the <strong>Destination MAC Address</strong>.</li><li>If the destination exists in the CAM table, it forwards the frame only to that port.</li><li>If the destination is unknown, it temporarily floods the frame to every port except the incoming one.</li></ol><p>This process allows switches to automatically learn the network without manual configuration.</p><h3>Broadcasts and Broadcast Domains</h3><p>Not every message is intended for one computer.</p><p>Sometimes every device must receive it.</p><p>A <strong>Broadcast</strong> is sent using the destination MAC:</p><p><strong>FF:FF:FF:FF:FF:FF</strong></p><p>Switches forward broadcasts throughout the local network.</p><p>Routers, however, stop them.</p><p>This creates a <strong>Broadcast Domain</strong>.</p><p>Understanding broadcast domains helped me understand why routers exist — not just to connect networks, but also to limit unnecessary traffic.</p><h3>ARP: The Bridge Between IP and Ethernet</h3><p>One of the most fascinating concepts was <strong>ARP (Address Resolution Protocol).</strong></p><p>Imagine my laptop wants to send data to Google.</p><p>It already knows Google’s IP address.</p><p>But Ethernet doesn’t send packets using IP addresses.</p><p>It sends <strong>frames using MAC addresses</strong>.</p><p>So my computer first asks:</p><blockquote><em>“Who has the IP address of my router?”</em></blockquote><p>This question is broadcast across the local network.</p><p>The router responds with its MAC address.</p><p>Only then can my computer build the Ethernet frame.</p><p>The biggest realization was this:</p><ul><li>The <strong>Ethernet frame</strong> is addressed to the <strong>next hop</strong> (usually the router).</li><li>The <strong>IP packet inside the frame</strong> is still addressed to the <strong>final destination</strong> (for example, Google’s server).</li></ul><p>That single concept connected everything I had learned about Layers 2 and 3.</p><h3>My Biggest Takeaways</h3><p>Looking back, I realized networking isn’t about memorizing definitions.</p><p>It’s about understanding <strong>why each technology was invented</strong>.</p><p>Every new device solved a limitation of the previous one:</p><ul><li>Repeaters solved weak signals.</li><li>Hubs connected multiple computers.</li><li>Switches solved collisions and unnecessary traffic.</li><li>Routers connected different networks while limiting broadcasts.</li></ul><p>Understanding the <em>problem</em> first made the <em>solution</em> much easier to remember.</p><h3>What’s Next?</h3><p>So far, I’ve completed:</p><ul><li>Networking Fundamentals</li><li>Network Architectures</li><li>Network Types</li><li>Network Topologies</li><li>OSI Model Overview</li><li>Physical Layer</li><li>Most of the Data Link Layer</li><li>Ethernet</li><li>Switching</li><li>Broadcast Domains</li><li>ARP</li></ul><p>The next stage of my journey will cover the remaining Layer 2 concepts before diving into the <strong>Network Layer</strong>, where routers, IP forwarding, routing tables, NAT, TTL, ICMP, and Internet routing come together.</p><p>The deeper I go, the more I realize that networking is one of the most beautifully engineered systems in computer science — built layer by layer, with every component solving a real-world problem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f8b7e3d7582" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Networking Fundamentals for Developers — Part 3]]></title>
            <link>https://medium.com/@shylesh1640/networking-fundamentals-for-developers-part-3-4c01148e6100?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c01148e6100</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Fri, 24 Jul 2026 05:01:02 GMT</pubDate>
            <atom:updated>2026-07-24T05:01:02.271Z</atom:updated>
            <content:encoded><![CDATA[<h3>Client–Server vs Peer-to-Peer: Understanding How Modern Applications Communicate</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kywuI0AqYujwkYWgSNkQ1g.png" /></figure><blockquote>“Not every application on the Internet depends on a central server.”</blockquote><p>In <strong>Part 1</strong>, we explored how the Internet moves data using packets, routers, and IP addresses.</p><p>In <strong>Part 2</strong>, we learned how the <strong>Client–Server architecture</strong> powers websites and web applications like Google, Amazon, and Netflix.</p><p>At first glance, it may seem that every application on the Internet works this way.</p><p>But that’s not true.</p><p>Applications like BitTorrent, blockchain networks, and early versions of Skype follow a completely different approach.</p><p>Instead of communicating with a central server, devices communicate <strong>directly with one another</strong>.</p><p>This architecture is called <strong>Peer-to-Peer (P2P)</strong>.</p><p>In this article, we’ll learn:</p><ul><li>What Peer-to-Peer (P2P) is</li><li>How P2P works</li><li>Real-world examples</li><li>Advantages and disadvantages</li><li>Client–Server vs P2P comparison</li><li>Which architecture should you choose?</li></ul><h3>The Problem with Client–Server</h3><p>Let’s revisit the Client–Server model.</p><pre>Client<br>             │<br>             ▼<br>        Web Server<br>             │<br>             ▼<br>         Database</pre><p>Every client depends on the server.</p><p>Imagine 10 users opening a website.</p><pre>User 1 ─┐<br>User 2 ─┤<br>User 3 ─┤<br>User 4 ─┤<br>User 5 ─┤<br>User 6 ─┤<br>User 7 ─┤<br>User 8 ─┤<br>User 9 ─┤<br>User10 ─┘<br>         │<br>         ▼<br>      One Server</pre><p>This works well for many applications.</p><p>But what happens if:</p><ul><li>Millions of users connect at once?</li><li>The server crashes?</li><li>The server becomes overloaded?</li></ul><p>Everything depends on that one central machine.</p><p>This raises an interesting question:</p><blockquote><em>What if computers could help each other instead of relying on one server?</em></blockquote><p>That idea led to <strong>Peer-to-Peer networking</strong>.</p><h3>What Is Peer-to-Peer (P2P)?</h3><p>A <strong>Peer-to-Peer (P2P)</strong> network is a network where every participating computer (called a <strong>peer</strong>) can both <strong>request</strong> resources and <strong>provide</strong> resources.</p><p>Unlike the Client–Server model, there is no permanently central server responsible for all communication.</p><pre>Computer A ◄────► Computer B<br>      ▲               ▲<br>      │               │<br>      ▼               ▼<br>Computer C ◄────► Computer D</pre><p>Every computer can send and receive data.</p><p>A peer can act as both a client and a server depending on the situation.</p><h3>Why Is It Called a “Peer”?</h3><p>The word <strong>peer</strong> means <strong>equal</strong>.</p><p>In a P2P network, every computer has equal responsibility.</p><p>Instead of one powerful server and many clients, every participating device contributes to the network.</p><p>Think of a group study session.</p><p>Instead of one teacher explaining everything, every student shares notes and helps the others.</p><p>That’s exactly how a Peer-to-Peer network works.</p><h3>How Does P2P Work?</h3><p>Imagine four friends want the same file.</p><p>Instead of downloading everything from one computer:</p><pre>Friend A<br>    │<br>    ▼<br>Friend B</pre><p>they exchange pieces with one another.</p><pre>A<br>    ↗ ↑ ↖<br>   ↓  │  ↑<br>   B↔ C ↔D</pre><p>Each peer:</p><ul><li>Downloads missing piece</li><li>Uploads pieces it already has</li></ul><p>As more peers join, the network gains more upload capacity.</p><h3>A Real-World Example: BitTorrent</h3><p>One of the best-known P2P technologies is <strong>BitTorrent</strong>.</p><p>Suppose a Linux distribution releases a 4 GB installation image.</p><p>If everyone downloaded it from a single server:</p><pre>Thousands of Users<br>        │<br>        ▼<br>     One Server</pre><p>The server could quickly become overloaded.</p><p>BitTorrent solves this differently.</p><pre>User A<br>      ↗  ↑  ↖<br>     ↓   │   ↑<br>User B↔User C↔User D<br>     ↑   │   ↓<br>      ↖  ↓  ↙<br>       User E</pre><p>Each user shares the parts they’ve already downloaded.</p><p>As the number of users grows, the total upload capacity also grows.</p><p>This is why BitTorrent scales so well for large file distribution.</p><h3>What Is a Torrent Client?</h3><p>A torrent client is the software that participates in the P2P network.</p><p>Popular examples include:</p><ul><li>qBittorrent</li><li>Transmission</li><li>Deluge</li></ul><p>These applications:</p><ul><li>Discover peers</li><li>Download file pieces</li><li>Upload completed pieces</li><li>Verify data integrity</li><li>Reassemble the original file</li></ul><p>The software manages all of this automatically.</p><h3>P2P Is More Than File Sharing</h3><p>Many people think P2P is only for downloading files.</p><p>In reality, it powers many different systems.</p><p>Examples include:</p><h3>Blockchain Networks</h3><p>Cryptocurrencies like Bitcoin operate on decentralized peer-to-peer networks.</p><p>Instead of one central bank storing the ledger, thousands of computers maintain synchronized copies.</p><h3>Early Skype</h3><p>The original versions of Skype used P2P techniques to help route voice calls efficiently across the Internet.</p><h3>Distributed Storage</h3><p>Modern distributed storage systems often replicate data across multiple participating nodes instead of relying on a single storage server.</p><h3>Advantages of Peer-to-Peer</h3><h3>1. No Single Point of Failure</h3><p>In a Client–Server system:</p><pre>Clients<br>   │<br>   ▼<br> Server</pre><p>If the server fails, the service becomes unavailable.</p><p>In a P2P network:</p><pre>Peer A<br> │  ▲<br> ▼  │<br>Peer B ◄──► Peer C</pre><p>Communication can continue even if one peer leaves.</p><h3>2. Better Scalability</h3><p>As more users join, more resources become available.</p><p>Every new participant can contribute upload bandwidth.</p><p>This makes P2P highly scalable for certain workloads.</p><h3>3. Reduced Infrastructure Costs</h3><p>Since peers share resources, organizations often need fewer centralized servers for distributing large files.</p><h3>4. Efficient Large File Distribution</h3><p>Large downloads become faster because multiple peers can supply different parts of the same file simultaneously.</p><h3>Disadvantages of Peer-to-Peer</h3><p>Like any architecture, P2P also has trade-offs.</p><h3>Availability Depends on Peers</h3><p>If very few peers remain online, downloads may become slow or impossible.</p><h3>Less Centralized Control</h3><p>Managing permissions, updates, moderation, or security policies is often more difficult than in centralized systems.</p><h3>Security Challenges</h3><p>Since devices communicate directly, applications must carefully verify peers and data to reduce the risk of malicious behavior.</p><h3>Performance Can Vary</h3><p>The overall experience depends on:</p><ul><li>Number of peers</li><li>Network quality</li><li>Upload bandwidth</li><li>Peer availability</li></ul><h3>Client–Server vs Peer-to-Peer</h3><p>FeatureClient–ServerPeer-to-PeerCentral serverYesNo permanent central serverCommunicationClient ↔ ServerPeer ↔ PeerScalabilityLimited by server capacityOften improves as peers increaseSingle point of failureYesReducedManagementEasierMore distributedCommon examplesGoogle, Amazon, NetflixBitTorrent, blockchain networks</p><p>Neither architecture is universally better.</p><p>The right choice depends on the problem you’re trying to solve.</p><h3>Which Architecture Should You Use?</h3><p>Choose <strong>Client–Server</strong> when:</p><ul><li>You need centralized authentication</li><li>You require strict access control</li><li>Data consistency is critical</li><li>You operate a web application or API</li></ul><p>Choose <strong>Peer-to-Peer</strong> when:</p><ul><li>Users can share resources</li><li>Large files need efficient distribution</li><li>You want to reduce reliance on a central server</li><li>Decentralization is a design goal</li></ul><p>Many modern systems even combine both approaches.</p><p>For example, an application might use central servers for user accounts while using P2P for sharing large files.</p><h3>Key Takeaways</h3><ul><li>A <strong>Peer-to-Peer (P2P)</strong> network allows devices to communicate directly.</li><li>Every peer can both request and provide resources.</li><li>BitTorrent is one of the best-known examples of P2P.</li><li>P2P improves scalability by allowing peers to contribute bandwidth.</li><li>Client–Server provides centralized management and control.</li><li>Both architectures solve different problems and often coexist in modern applications.</li></ul><h3>Wrapping Up the Series</h3><p>Congratulations!</p><p>Across this series, you’ve built a solid foundation in computer networking.</p><p>You learned:</p><ul><li>How the Internet evolved</li><li>How packets travel across networks</li><li>MAC addresses and IP addresses</li><li>IPv4 and IPv6</li><li>Subnetting fundamentals</li><li>Client–Server architecture</li><li>HTTP, HTTPS, DNS, SMTP, and FTP</li><li>Website hosting</li><li>Peer-to-Peer networking</li></ul><p>These concepts form the backbone of modern networking and prepare you for deeper topics such as the <strong>OSI Model</strong>, <strong>TCP/IP layers</strong>, <strong>routing</strong>, <strong>switching</strong>, and <strong>network security</strong>.</p><p>In the next stage of your networking journey, we’ll begin exploring the <strong>OSI Model</strong> — the framework that explains exactly how data moves from an application on one computer to an application on another.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c01148e6100" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Networking Fundamentals for Developers — Part 2]]></title>
            <link>https://medium.com/@shylesh1640/networking-fundamentals-for-developers-part-2-97e04f5b96be?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/97e04f5b96be</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 05:01:02 GMT</pubDate>
            <atom:updated>2026-07-23T05:01:02.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wQWaB7SLwSxZkrreI-0RDA.png" /></figure><h3>How Your Browser Talks to a Server: Understanding Client–Server Architecture</h3><p>You open your laptop, type google.com, and press Enter.</p><p>Within milliseconds, millions of operations happen behind the scenes. Your browser finds Google’s server, sends a request across the Internet, receives multiple responses, downloads HTML, CSS, JavaScript, images, and fonts, and finally renders the webpage.</p><p>It feels instant.</p><p>But what actually happened?</p><p>In this article, we’ll trace every single step of that journey. In Part 1, we looked at how raw data travels across cables and routers. Now, we are moving up the stack. We are going to look at how <em>applications</em> talk to each other. Welcome to the heart of the modern web: the Client-Server Architecture.</p><h3>Section 1 — From Typing a URL to Loading a Website</h3><p>When you press Enter after typing a web address, you are kicking off one of the most complex, well-orchestrated digital conversations in human history. To understand this, we have to look at the primary actors.</p><p><strong>The Browser</strong> Your browser (Chrome, Firefox, Safari) is merely an application. It is a piece of software whose primary job is to act on your behalf, fetch resources from remote computers, and translate those resources (code) into a graphical interface you can interact with.</p><p><strong>The URL</strong> The Uniform Resource Locator (URL) is the address. Just like a postal worker needs a street, city, and zip code to deliver a letter, your browser needs a scheme (like https://), a domain name (like google.com), and a path (like /search) to know exactly who to talk to and what to ask for.</p><p><strong>The First Request</strong> Your browser doesn’t just “go” to a website. A website isn’t a place; it’s a collection of files. To get those files, your browser must formulate a specific, formatted message — a <strong>request</strong> — and send it out into the void of the Internet, hoping a specific machine is listening.</p><p>Here is the high-level communication flow of that initial interaction:</p><pre>User<br>        │ (Types URL)<br>        ▼<br>     Browser<br>        │ (Creates Request)<br>        ▼<br>     Internet<br>        │ (Routes Packets)<br>        ▼<br>   Google Server<br>        │ (Processes Request)<br>        ▼<br>     Response<br>        │ (Sends HTML/Data)<br>        ▼<br>     Browser<br>        │ (Renders Page)<br>        ▼<br>       User</pre><p>This simple flow is the bedrock of everything you build as a software developer. But to truly master it, we need to dissect the two ends of this conversation: the Client and the Server.</p><h3>Section 2 — Understanding Client and Server</h3><p>The terms “client” and “server” are thrown around constantly in tech. But what do they actually mean? At their core, they define a <em>relationship</em> between two programs, not necessarily the hardware they run on.</p><h4>What is a Client?</h4><p>A client is a piece of software (and by extension, the device it runs on) that <strong>requests</strong> resources or services. It is the initiator of the conversation.</p><ul><li>Your web browser is a client.</li><li>The Spotify app on your phone is a client.</li><li>A smart thermostat pinging a weather service is a client.</li></ul><h4>What is a Server?</h4><p>A server is a piece of software (and the device it runs on) that <strong>listens</strong> for requests, processes them, and <strong>provides</strong> resources or services. It is the responder.</p><ul><li>A machine hosting website files is a web server.</li><li>A machine managing a database is a database server.</li></ul><h4>Why Do We Need Servers?</h4><p>Why can’t computers just talk directly to each other without this hierarchy? We need servers for <strong>centralization of truth, security, and computing power</strong>. If Spotify stored its music library on every user’s phone, you would need petabytes of storage in your pocket. If your bank balance was stored locally on your laptop, anyone could edit the file and make themselves a billionaire. Servers hold the source of truth, execute complex logic safely away from user tampering, and distribute data efficiently.</p><h4>Client Responsibilities</h4><ul><li>Providing a user interface (UI).</li><li>Capturing user inputs (clicks, typing).</li><li>Formulating proper requests.</li><li>Parsing and displaying responses (rendering HTML, playing audio).</li><li>Managing local state (like cookies or local storage).</li></ul><h4>Server Responsibilities</h4><ul><li>Always being online and listening for incoming connections.</li><li>Validating and authenticating requests (Are you allowed to see this?).</li><li>Routing requests to the appropriate internal logic.</li><li>Interacting with databases or file systems.</li><li>Formatting and sending the response back to the client.</li></ul><h4>Analogies to Make it Stick</h4><p>To understand this dynamic, consider these real-world equivalents:</p><p><strong>The Restaurant Analogy</strong></p><ul><li><strong>You</strong> are the <strong>Client</strong>. You want food.</li><li>The <strong>Waiter/Kitchen</strong> is the <strong>Server</strong>. They have the food and the ability to cook it.</li><li>You look at the menu and give your order (the <strong>Request</strong>).</li><li>The kitchen cooks it (the <strong>Processing</strong>).</li><li>The waiter brings your meal (the <strong>Response</strong>). You don’t need to know <em>how</em> the chef cooked the steak, you just need to know how to ask for it.</li></ul><p><strong>The Library Analogy</strong></p><ul><li><strong>You (Client)</strong> want a specific book.</li><li>The <strong>Librarian (Server)</strong> manages the vast archives.</li><li>You ask for the book (Request). The librarian searches the catalog, retrieves the book from the back room, and hands it to you (Response).</li></ul><p><strong>The Bank Analogy</strong></p><ul><li><strong>You (Client)</strong> want to withdraw $100.</li><li>The <strong>Bank Teller (Server)</strong> checks your ID and account balance.</li><li>If you have the funds (Processing/Validation), they hand you the cash (Response). You are not allowed to walk into the vault and take it yourself.</li></ul><h4>Mythbuster: A Server ≠ An Expensive Computer</h4><p>A common misconception is that a “server” is a massive, glowing, expensive supercomputer sitting in a dark room.</p><p>While enterprise servers <em>are</em> powerful machines, <strong>any computer can become a server.</strong> If you write a simple Node.js or Python script on your 5-year-old laptop that listens on port 8080 and returns “Hello World,” your laptop is now acting as a server. “Server” is a role, not a hardware specification.</p><h4>The Server Lifecycle</h4><p>No matter how complex the server, its fundamental lifecycle is a simple, infinite loop:</p><pre>Start<br>    ↓<br>  Wait (Listen for connections)<br>    ↓<br>  Receive Request<br>    ↓<br>  Process (Run logic, check DB)<br>    ↓<br>  Respond (Send data back)<br>    ↓<br>  Wait (Listen for the next one)</pre><h3>Section 3 — Website Hosting &amp; Request–Response Model</h3><p>Now that we know what servers are, where do they live? And how do they handle the modern, media-heavy web?</p><h4>What is Website Hosting?</h4><p>Website hosting is the business of housing, serving, and maintaining files for one or more websites. When you “host” a website, you are renting space on a physical server that is connected to the Internet 24/7.</p><p><strong>Why Laptops Aren’t Used for Google</strong> If any computer can be a server, why doesn’t Google just run its search engine from a really nice MacBook Pro?</p><ol><li><strong>Uptime:</strong> Your laptop goes to sleep, runs out of battery, or restarts for updates. Servers need to be available 99.999% of the time.</li><li><strong>Bandwidth:</strong> Your home internet connection is not designed to handle 100,000 people trying to download files simultaneously.</li><li><strong>Power &amp; Cooling:</strong> Running processors at 100% capacity 24/7 generates massive heat.</li></ol><h4>Dedicated Servers and Data Centers</h4><p>To solve these problems, we use <strong>dedicated servers</strong> — hardware built specifically for reliability, stripped of unnecessary components like monitors and graphics cards.</p><p>These servers are stacked in racks inside <strong>Data Centers</strong>: massive, warehouse-sized facilities equipped with industrial cooling systems, backup diesel generators for power outages, and direct fiber-optic pipelines to the backbone of the Internet.</p><h4>The Request–Response Model</h4><p>When a client talks to a server in a data center, they use the Request-Response model. The client asks, the server answers.</p><pre>Browser                     Server<br>      │                           │<br>      │ ─────── GET / ──────────▶ │ (Request)<br>      │                           │<br>      │                      [Processing]<br>      │                           │<br>      │ ◀────── HTML ──────────── │ (Response)<br>      │                           │</pre><h4>Why Websites Send Many Requests</h4><p>If you open your browser’s Developer Tools (Network tab) and load a modern website, you won’t see just one request. You will see dozens, sometimes hundreds.</p><p>Why? Because the initial request (GET /) usually only returns the primary index.html document.</p><p>HTML is just the skeleton. As the browser reads the HTML from top to bottom, it finds links to other resources it needs to fully build the page. For every external resource, the browser must pause and send a brand new request to the server:</p><ol><li>Request 1: index.html (The skeleton)</li><li>Request 2: style.css (The styling and layout)</li><li>Request 3: script.js (The interactivity)</li><li>Request 4: logo.png (Images)</li><li>Request 5: fonts.woff2 (Custom typography)</li><li>Request 6: background.mp4 (Videos)</li></ol><p>The server processes each of these requests individually and sends back the corresponding files. The browser then pieces them all together in real-time to create the seamless visual experience you see on your screen.</p><h3>Section 4 — HTTP, HTTPS &amp; The Birth of the Web</h3><p>To understand how these requests are formatted, we need to travel back in time. This is where the true “language” of the web was born.</p><h4>Before HTTP: The Dark Ages of Networking</h4><p>In the 1970s and 80s, the foundation of the Internet was being laid.</p><ul><li><strong>ARPANET</strong> proved that computers across the country could link together.</li><li><strong>TCP/IP</strong> (Transmission Control Protocol/Internet Protocol) was invented, establishing a universal set of rules for how raw packets of data should travel from IP address A to IP address B.</li></ul><p>But there was a <strong>massive problem</strong>. TCP/IP allowed computers to connect, but it didn’t tell them <em>what to say</em> once they were connected. Imagine inventing the telephone network, but callers spoke a thousand different, incompatible languages.</p><p>Scientists sharing research papers had to use clunky command-line tools like FTP or Telnet. There was no concept of a “clickable link.” There was no rich text. There was no standard way for applications to format documents.</p><h4>Enter Tim Berners-Lee &amp; CERN</h4><p>In 1989, a British computer scientist named Tim Berners-Lee was working at CERN (the European Organization for Nuclear Research) in Switzerland. CERN had thousands of scientists, all using different computers, struggling to share information.</p><p>Berners-Lee proposed a system to link documents together. To make this work, he invented three fundamental technologies that would change human history:</p><ol><li><strong>HTML (HyperText Markup Language):</strong> A standardized language to format documents with text and, crucially, hyperlinks.</li><li><strong>URL (Uniform Resource Locator):</strong> A standardized naming convention so every document had a unique address.</li><li><strong>HTTP (Hypertext Transfer Protocol):</strong> The standardized language that clients and servers would use to request and deliver these HTML documents.</li></ol><p>Together, these three things created the <strong>World Wide Web</strong>.</p><h4>The Timeline</h4><pre>1969 — ARPANET (First connected nodes)<br>    ↓<br>  1983 — TCP/IP (Standardized data transmission)<br>    ↓<br>  1989 — The Problem: No standard application layer<br>    ↓<br>  1990 — The World Wide Web is born at CERN<br>         ├── HTML (The content)<br>         ├── URL  (The address)<br>         └── HTTP (The messenger)</pre><h4>Understanding HTTP Methods</h4><p>HTTP (Hypertext Transfer Protocol) is a text-based protocol. When your browser talks to a server, it sends a block of text. The very first word in that block of text is the <strong>HTTP Method</strong> (often called a “verb”).</p><p>The method tells the server exactly <em>what</em> the client wants to do.</p><p>Here are the primary HTTP Methods every developer must know:</p><ul><li><strong>GET</strong>: “Give me this resource.”</li><li><em>Example:</em> Loading a web page, fetching a list of tweets. It should only retrieve data and never alter the database.</li><li><strong>POST</strong>: “Create a brand new resource with this data.”</li><li><em>Example:</em> Submitting a signup form, publishing a new blog post.</li><li><strong>PUT</strong>: “Replace an existing resource entirely.”</li><li><em>Example:</em> Updating your user profile. If you omit your bio in a PUT request, the server might delete your bio. It replaces the whole object.</li><li><strong>PATCH</strong>: “Partially update an existing resource.”</li><li><em>Example:</em> Only changing your password or just updating your avatar, leaving the rest of the profile alone.</li><li><strong>DELETE</strong>: “Remove this resource.”</li><li><em>Example:</em> Deleting a comment or closing an account.</li><li><strong>HEAD</strong>: “Give me the headers for this resource, but not the actual data.”</li><li><em>Example:</em> Checking if a file exists or if it has been modified recently before committing to downloading a massive 5GB file.</li><li><strong>OPTIONS</strong>: “What methods are allowed here?”</li><li><em>Example:</em> Used heavily in CORS (Cross-Origin Resource Sharing) to see if a web app is allowed to talk to a specific API.</li></ul><h4>The Problem with HTTP and the Rise of HTTPS</h4><p>HTTP was revolutionary, but it had a fatal flaw as the web grew into an ecosystem of commerce and banking: <strong>It was sent in plain text.</strong></p><p>If you sent a POST request with your credit card number over HTTP, anyone sitting on the same Wi-Fi network, or any router between you and the server, could easily read the text and steal your card.</p><h4>HTTPS, Encryption, and TLS</h4><p>Enter <strong>HTTPS</strong> (Hypertext Transfer Protocol <strong>Secure</strong>).</p><p>HTTPS is not a completely new protocol; it is simply HTTP layered on top of a cryptographic protocol called <strong>TLS</strong> (Transport Layer Security, the successor to SSL).</p><p>Before the client and server send any HTTP data, they perform a complex “TLS Handshake.” They use asymmetric cryptography (public and private keys) to securely agree on a shared secret key. Once agreed upon, they use that shared key to scramble (encrypt) all further communication.</p><p><strong>The Analogy: Postcard vs. Locked Envelope</strong></p><ul><li><strong>HTTP is a Postcard:</strong> You write your message on the back. The mail carrier, the sorting facility, and anyone who glances at it in transit can read your message.</li><li><strong>HTTPS is a Locked Envelope:</strong> You write your message, put it in an indestructible steel box, and lock it. Only you and the recipient have the key. The mail carrier can see <em>where</em> the box is going (the IP address), but they have absolutely no idea what is inside.</li></ul><p>Today, HTTPS is the absolute standard. Browsers actively warn users if a site is still using unencrypted HTTP.</p><h3>Section 5 — Beyond HTTP</h3><p>While HTTP powers the World Wide Web, it is not the only protocol sitting at the Application Layer of the Internet. Different types of applications require different rules of communication.</p><pre>Application Layer<br>               │<br>    ┌────┬─────┼─────┬────┐<br>    │    │     │     │    │<br>  HTTP HTTPS SMTP   FTP  DNS</pre><p>Here is a look at the other major protocols that run alongside HTTP:</p><ul><li><strong>DNS (Domain Name System):</strong> The phonebook of the Internet. Computers don’t understand google.com; they only understand IP addresses like 142.250.190.46. Before your browser can send an HTTP request, it makes a DNS request to translate the human-readable domain name into a machine-readable IP address.</li><li><strong>SMTP (Simple Mail Transfer Protocol):</strong> The protocol for sending emails. When you hit “send” in your email client, the app uses SMTP to push the email to your mail server, which then uses SMTP to push it to the recipient’s mail server. (Retrieving mail uses different protocols like IMAP or POP3).</li><li><strong>FTP (File Transfer Protocol):</strong> A much older protocol designed specifically for uploading and downloading files between a client and a server. While largely replaced by HTTP/HTTPS for modern web usage, it is still used in legacy systems and bulk server administration.</li></ul><h3>Section 6 — Types of Servers</h3><p>We’ve established that “server” is a role. Because modern web applications are immensely complex, dividing different tasks into specialized server roles is crucial for performance and security. This is often referred to as Multi-Tier or N-Tier architecture.</p><p>Here are the primary types of servers you will encounter:</p><ol><li><strong>Web Server:</strong> Handles HTTP/HTTPS requests. Its main job is to serve static files (HTML, CSS, JS, images). Examples: Nginx, Apache.</li><li><strong>Application Server:</strong> Runs the backend business logic. This is where your Python, Node.js, Java, or Ruby code lives. It processes data, handles user authentication, and makes decisions.</li><li><strong>Database Server:</strong> Optimized purely for data storage and retrieval. Runs software like PostgreSQL, MySQL, or MongoDB.</li><li><strong>DNS Server:</strong> Specializes in translating domain names to IP addresses.</li><li><strong>File Server:</strong> A massive digital storage drive for holding raw files (videos, massive image directories).</li><li><strong>Mail Server:</strong> Handles the sending, receiving, and routing of emails.</li><li><strong>Proxy Server (and Reverse Proxy):</strong> Sits between the client and the actual servers. Used for security, hiding internal IP addresses, and distributing incoming traffic (Load Balancing).</li></ol><h4>The Complete Picture: A Real-World Example</h4><p>Let’s look at how these servers work together. Imagine you are logging into Amazon, viewing your shopping cart, and looking at product images.</p><pre>Browser<br>         │ (1. Sends HTTPS Request)<br>         ▼<br>     Web Server (Nginx)<br>         │ (2. Serves static HTML/UI, routes dynamic requests)<br>         ▼<br>  Application Server (Node.js/Java)<br>         │ (3. Processes login logic, checks cart)<br>         ├──────────────────────────────┐<br>         ▼                              ▼<br>     Database                      File Server<br> (Stores user data,              (Stores product<br>  passwords, cart items)           images, videos)</pre><p><strong>Step-by-Step:</strong></p><ol><li><strong>Web Server:</strong> Your browser connects to Amazon’s Web Server. The web server immediately sends back the basic HTML framework, the CSS styling, and the JavaScript.</li><li><strong>File Server (CDN):</strong> For the high-resolution images of products, the web server doesn’t waste its time. It points your browser to a File Server (often a Content Delivery Network like AWS S3/CloudFront) optimized purely for delivering heavy media files fast.</li><li><strong>Application Server:</strong> When you type your password and hit “Login”, that POST request is passed from the Web Server to the Application Server. The Application Server runs the complex hashing algorithms to securely process your password.</li><li><strong>Database Server:</strong> The Application Server queries the Database Server to verify if your password hash matches what is on file, and queries it again to retrieve the items currently sitting in your shopping cart.</li></ol><p>By splitting these roles, if the database gets overloaded, it doesn’t crash the web server. The architecture is resilient, secure, and scalable.</p><h3>Section 7 — Can a Server Become a Client?</h3><p>This is one of my favorite topics, and an excellent concept to understand for system design interviews.</p><p>We often think of the Client-Server relationship as fixed: the browser is the client, the backend is the server. <strong>But these roles are fluid.</strong> A server can, and frequently does, become a client to another server.</p><p>Let’s look at three common examples:</p><h4>Example 1: Instagram Login (OAuth)</h4><p>Imagine you are building a new web app, and you want users to “Log in with Instagram.”</p><pre>Browser (Client)<br>         │<br>         ▼<br>  Your Web Server (Server)<br>         │<br>         ▼ (Becomes Client!)<br>  Instagram&#39;s API Server (Server)</pre><p>Your server receives the request from the browser. But your server doesn’t know the user’s Instagram details. So, your server must format an HTTP request and send it out across the internet to Instagram’s servers. In this interaction, <strong>your server is acting as the client</strong>, and Instagram is the server.</p><h4>Example 2: The Weather API</h4><p>You are building a travel dashboard. A user requests the itinerary for their trip to Tokyo. Your Application Server gets the request. It queries its own database for the flight details. But your database doesn’t know the weather in Tokyo. So, your Application Server pauses, becomes an HTTP client, and sends a GET request to the OpenWeatherMap API. Once OpenWeatherMap (the server) responds, your Application Server compiles all the data and sends it back to the user&#39;s browser.</p><h4>Example 3: Microservices</h4><p>In modern enterprise applications, the monolithic “Application Server” is broken down into dozens or hundreds of tiny, specialized servers called <strong>Microservices</strong>.</p><p>You might have one server dedicated to User Accounts, one for Billing, and one for Notifications.</p><p>When a user buys an item, the main server acts as a client to contact the Billing server. Once successful, the Billing server acts as a client to contact the Notification server to send a receipt email. The entire backend is a massive web of servers constantly acting as clients to one another!</p><h3>Conclusion</h3><p>Let’s tie everything together and look at the complete picture of what happens when you press Enter:</p><pre>User (You)<br>         │<br>         ▼<br>      Browser (Formats the URL)<br>         │<br>         ▼<br>       DNS Server (Translates URL to IP address)<br>         │<br>         ▼<br>      Internet (TCP/IP routes the packets)<br>         │<br>         ▼<br>      Web Server (Handles HTTP/HTTPS &amp; serves static files)<br>         │<br>         ▼<br>   Application Server (Executes business logic)<br>         │<br>         ▼<br>      Database (Retrieves data)<br>         │<br>         ▼<br>      Response (Sent back up the chain)<br>         │<br>         ▼<br>      Browser (Parses HTML/CSS/JS and renders)</pre><p>The seemingly instant loading of a webpage is actually a synchronized dance of protocols, hardware, and specialized software roles.</p><p>In Part 1, we learned how devices communicate across networks. In Part 2, we learned how applications communicate over those networks using the Client-Server architecture and protocols like HTTP.</p><p>But Client-Server is not the only way to build a network.</p><p>In Part 3, we’ll explore Peer-to-Peer (P2P) Architecture, discover how BitTorrent works, why blockchain networks don’t rely on a central server, and compare P2P with Client–Server to understand where each architecture shines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97e04f5b96be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Networking Fundamentals for Developers — Part 1: How the Internet Actually Works]]></title>
            <link>https://medium.com/@shylesh1640/networking-fundamentals-for-developers-part-1-how-the-internet-actually-works-aa231516aa29?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa231516aa29</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 05:01:03 GMT</pubDate>
            <atom:updated>2026-07-22T05:01:03.432Z</atom:updated>
            <content:encoded><![CDATA[<p>“The Internet wasn’t created overnight. It wasn’t invented by one person, nor was it built for social media, online shopping, or streaming videos. It started as a simple idea: What if computers could talk to each other?”</p><p>Every day, billions of people open their laptops, unlock their phones, and connect to the Internet without giving it a second thought. We search on Google, watch YouTube, scroll through Instagram, send messages on WhatsApp, and join Zoom meetings as if it’s all effortless.</p><p>But have you ever paused to ask:</p><ul><li>How does my computer actually communicate with another computer that’s thousands of kilometers away?</li><li>How does a message sent from Chennai reach a server in California in just a fraction of a second?</li><li>How does typing google.com magically open one of the world&#39;s largest websites?</li></ul><p>These questions lead us into one of the most fascinating fields in computer science: <strong>Computer Networking</strong>.</p><p>Whether you’re a software developer, a DevOps engineer, a cybersecurity enthusiast, or simply curious about how the Internet works, understanding networking fundamentals will change the way you think about modern technology.</p><p>In this series, we’ll start from absolute basics and gradually build up to topics like Client–Server Architecture, DNS, HTTP, IP Addressing, and eventually the OSI and TCP/IP models.</p><p>Let’s begin where it all started.</p><h3>Section 1: How the Internet Was Born — From Isolated Computers to a Connected World</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dsmbaslDOScvQ_HXWJNRpQ.png" /></figure><h3>Before Networks: When Computers Were Lonely</h3><p>Imagine buying a brand-new computer in the 1970s. It was powerful for its time. It could perform calculations, store files, and run programs. But there was one major limitation: <strong>it couldn’t communicate with another computer.</strong> Each computer was like an island.</p><pre>+-----------+      +-----------+      +-----------+<br>| Computer A|      | Computer B|      | Computer C|<br>+-----------+      +-----------+      +-----------+<br>(No Connection)    (No Connection)    (No Connection)</pre><p>If Computer A wanted to share a file with Computer B, there was no “Send” button. There was no email. No cloud storage. No WhatsApp. The only option was to physically move the data.</p><p>This process was slow, inconvenient, and error-prone. As organizations started using more computers, this approach quickly became impractical. People began asking a simple question: <em>What if computers could communicate directly instead of physically moving data?</em></p><p>That single question changed the history of computing forever.</p><h3>The Birth of Computer Networking</h3><p>A computer network is simply a group of devices connected together so they can communicate and share resources (files, printers, databases, applications). At its core, networking solves one fundamental problem: <strong>How can two computers exchange information reliably?</strong></p><p>Think of networking like building roads between cities. Before roads existed, travel was difficult. After roads were built, people and goods could move freely. Computer networks work the same way. Instead of transporting people, they transport data.</p><h3>ARPANET: The Grandfather of the Internet</h3><p>The story of the Internet begins in the late 1960s. During the Cold War, the United States wanted a communication system that could continue working even if part of the network was damaged. Traditional communication systems relied on centralized structures; if the central point failed, the entire network stopped functioning.</p><p>Researchers wanted something different: a decentralized network where every connected computer could help forward information. If one route failed, another route could be used.</p><p>This idea led to the creation of <strong>ARPANET</strong> in 1969, the first large-scale packet-switched computer network. The network was tiny compared to today’s Internet, connecting only a handful of universities (UCLA, Stanford, UC Santa Barbara, and the University of Utah). But this small experiment proved something extraordinary: computers located in different places could communicate over a network.</p><h3>TCP/IP: A Universal Language for Computers</h3><p>As networking became more popular, different organizations started building their own networks. The problem? Each network used different communication methods. Imagine four people speaking different languages; without a common language, communication becomes difficult. Computers had the same problem.</p><p>To solve this, researchers developed <strong>TCP/IP</strong> (Transmission Control Protocol / Internet Protocol). TCP/IP became the common language that allowed different networks to communicate with each other. Instead of creating one gigantic network, many independent networks could now work together.</p><p>This idea became known as the <strong>Internet</strong> (Interconnected Networks). It is not one enormous network, but a <em>network of networks</em>. Millions of private, public, educational, government, and business networks cooperate using the TCP/IP protocol suite.</p><h3>Internet vs World Wide Web</h3><p>One of the biggest misconceptions in technology is treating the Internet and the World Wide Web (WWW) as the same thing. They are not.</p><p>Think of a modern city. The city has roads, bridges, and highways. Those roads allow people to reach buildings.</p><ul><li><strong>Roads = Internet</strong> (The infrastructure)</li><li><strong>Buildings = Websites</strong> (The services on top)</li></ul><p>Without the Internet, you cannot access websites. However, not everything on the Internet is part of the Web. For example, email and WhatsApp use the Internet, but they are not part of the Web.</p><h3>Why Networking Matters Today</h3><p>Every modern application depends on networking. When you send a message, deploy to the cloud, or push code to GitHub, you’re relying on computer networks. Understanding networking isn’t just for network engineers anymore — it’s a foundational skill for every software developer. Concepts like APIs, cloud computing, Docker, Kubernetes, and microservices become much easier to learn once you grasp the basics.</p><h3>Section 2: From Data to Packets — How Information Travels Across the Internet</h3><p>Imagine you’re sending a 2 GB movie to your friend. Does your computer send the entire 2 GB file in one giant transmission? No.</p><p>If you were moving houses, you wouldn’t pack all your furniture into one enormous box. It would be too heavy and impossible to replace if lost. You use smaller boxes. Networking works exactly the same way.</p><h3>Why Networks Use Packets</h3><p>Instead of sending one huge block of data, computers divide data into many small <strong>packets</strong>. A packet is the smallest unit of data commonly sent across a network. Think of it as a digital envelope containing two major parts:</p><ol><li><strong>The Header (The Identity Card):</strong> Contains the source IP, destination IP, packet number, and error-checking information. Think of it like a shipping label on a courier box.</li><li><strong>The Payload (The Actual Information):</strong> The useful data (a tiny fragment of an image, movie, or email).</li></ol><p>By using packets, networks gain several advantages:</p><ul><li><strong>Reliability:</strong> If a transmission fails halfway, only the missing packets are retransmitted, not the entire file.</li><li><strong>Better Sharing:</strong> Many users can share the same connection. Like cars on a highway, packets from different users travel together.</li><li><strong>Faster Communication:</strong> Different packets can travel through completely different routes to reach the same destination.</li></ul><h3>Meet the Router</h3><p>Now imagine thousands of packets travelling around the world. Who decides where each packet should go? The answer is the <strong>router</strong>.</p><p>A router is a networking device that forwards packets between different networks. It acts as a traffic officer, examining the destination address in each packet’s header and deciding the best next path. It doesn’t read your payload; it only reads the destination.</p><p>Your request to example.com might travel from your laptop to a Wi-Fi router, through an ISP, across national backbones, and finally to a destination data center. All of this usually happens in less than a second.</p><h3>Section 3: How Computers Find Each Other — MAC Addresses vs. IP Addresses</h3><p>If you order a laptop online, the courier company relies on your address to deliver the package. Computer networks work exactly the same way. Every device connected to a network needs an identity.</p><h3>MAC Address — A Device’s Permanent Identity</h3><p>Every network-enabled device has a unique identifier called a <strong>MAC (Media Access Control) Address</strong>. It is permanently assigned to the network interface card (NIC) when manufactured (e.g., 00:1A:2B:3C:4D:5E).</p><p>Think of a MAC address like a human fingerprint. It uniquely identifies the physical hardware. However, a MAC address is primarily used <em>inside</em> a local network (LAN). When your home router sends data to your phone, it delivers it to your phone’s specific MAC address.</p><h3>IP Address — The Network Location</h3><p>Your MAC address means nothing to a router halfway across the world. To travel across the Internet, your device needs an <strong>IP Address</strong>. Think of this as your postal address. It tells the global network exactly where you are currently located.</p><p>Feature</p><p>MAC Address</p><p>IP Address</p><p><strong>Purpose</strong></p><p>Identifies the physical hardware (Identity)</p><p>Identifies the location on a network (Location)</p><p><strong>Scope</strong></p><p>Local network only</p><p>Global network (Internet)</p><p><strong>Persistence</strong></p><p>Permanent (usually)</p><p>Changes when you switch networks</p><h3>Public IP vs Private IP</h3><p>If every phone, smart TV, and laptop in your house had its own global IP address, we would have run out of addresses decades ago.</p><p>Instead, your Internet Service Provider (ISP) gives your router one <strong>Public IP Address</strong> (e.g., 103.48.200.25). This identifies your network on the Internet.</p><p>Inside your house, your router hands out <strong>Private IP Addresses</strong> (like 192.168.1.10) to your devices. These addresses are not directly reachable from the public Internet. When you open a website, your router translates the traffic from your private devices and sends it out using the single public IP (a process called NAT).</p><h3>Section 4: Understanding IPv4, IPv6, and Subnetting</h3><h3>IPv4 vs IPv6</h3><p>When people say “IP Address”, they usually mean <strong>IPv4</strong>. It is a 32-bit numerical address divided into four sections (octets), like 192.168.1.10.</p><p>When IPv4 was designed, its 4.3 billion address limit seemed like plenty. Today, with billions of connected devices, we are running out of space.</p><p>To solve this, <strong>IPv6</strong> was introduced. It uses 128 bits (e.g., 2404:6800:4009:080b::200e), providing an astronomically larger address space.</p><h3>An IP Address Has Two Parts</h3><p>Every IP address contains two pieces of information:</p><ol><li><strong>Network ID:</strong> Identifies the network (e.g., the city/street).</li><li><strong>Host ID:</strong> Identifies the individual device inside that network (e.g., the house number).</li></ol><p>A computer uses a <strong>Subnet Mask</strong> (like 255.255.255.0) to figure out where the Network ID ends and the Host ID begins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mhvB_fMDRf_QGEZB_IHNMQ.png" /></figure><h3>Why Do We Need Subnetting?</h3><p>Imagine a university with 8,000 computers on one huge network. This would cause massive traffic, be hard to manage, and be difficult to secure.</p><p>Instead, administrators use <strong>Subnetting</strong> to divide the large network into smaller subnetworks (e.g., one for Computer Science, one for the Library). This provides better performance, tighter security, and easier management.</p><h3>Wrapping Up Part 1</h3><p>Congratulations! You’ve now built a strong foundation in networking. You understand:</p><ul><li>How the Internet evolved from isolated computers.</li><li>How data is broken into packets.</li><li>The role of routers, MAC Addresses, and IP Addresses.</li><li>The difference between Public/Private IPs and IPv4/IPv6.</li><li>The purpose of Subnetting.</li></ul><p>These concepts are the building blocks for everything that comes next.</p><p>In <strong>Part 2</strong>, we’ll move from the network itself to what happens when you open a website. We’ll explore Client-Server Architecture, DNS, HTTP, and exactly what happens when you type a URL into your browser!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa231516aa29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My First Steps into Computer Networking]]></title>
            <link>https://medium.com/@shylesh1640/my-first-steps-into-computer-networking-31c2be67c522?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/31c2be67c522</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 02:38:45 GMT</pubDate>
            <atom:updated>2026-07-19T02:38:45.882Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started learning computer networking, I thought it was all about Wi-Fi and the Internet. I quickly realized that networking is much more than that — it’s about how devices communicate, share information, and stay connected across the world.</p><p>Here’s a summary of the key concepts I’ve learned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDoDszhrPwCyCBv7SY3GzA.png" /></figure><h3>What is a Computer Network?</h3><p>A computer network is a group of interconnected devices that communicate with each other and share resources using communication protocols.</p><p>These devices can include laptops, smartphones, printers, servers, routers, and many other network-enabled devices.</p><h3>Why Was Computer Networking Created?</h3><p>Initially, computers worked independently. Sharing data meant physically moving storage devices like tapes or disks from one computer to another, which was slow and inconvenient.</p><p>Networking was introduced to:</p><ul><li>Enable communication between computers.</li><li>Share files and resources.</li><li>Reduce costs by sharing expensive hardware.</li><li>Improve collaboration.</li><li>Transfer data more efficiently.</li></ul><h3>A Brief History of Networking</h3><p>One of the biggest milestones in networking was <strong>ARPANET</strong>, launched in <strong>1969</strong>. It connected four computers and became the foundation for today’s Internet.</p><p>Some major milestones include:</p><ul><li><strong>1969:</strong> ARPANET was created.</li><li><strong>1971:</strong> The first email was sent.</li><li><strong>1974:</strong> TCP/IP was introduced.</li><li><strong>1983:</strong> TCP/IP became the standard for Internet communication.</li><li><strong>1989–1991:</strong> The World Wide Web made the Internet accessible to everyone.</li></ul><h3>How Does a Network Work?</h3><p>Whenever we send data — whether it’s a message, photo, or video — the data is broken into smaller pieces called <strong>packets</strong>.</p><p>These packets travel through routers and other networking devices to reach their destination, where they are reassembled into the original data.</p><p>This process happens in milliseconds, allowing us to browse websites, stream videos, and send messages almost instantly.</p><h3>Understanding TCP</h3><p>One concept that stood out to me was <strong>TCP (Transmission Control Protocol)</strong>.</p><p>TCP ensures reliable communication by:</p><ul><li>Breaking data into smaller pieces.</li><li>Sending them in order.</li><li>Detecting missing pieces.</li><li>Requesting retransmission if something is lost.</li><li>Reassembling everything correctly at the destination.</li></ul><p>It’s like sending a valuable package through a courier service that tracks every box until it safely arrives.</p><h3>MAC Address vs IP Address</h3><p>This was one of the most interesting topics.</p><p>Every network device has a <strong>MAC Address</strong>. It is a hardware identifier assigned by the manufacturer and is usually permanent.</p><p>An <strong>IP Address</strong>, on the other hand, identifies where a device is on a network. Unlike a MAC address, an IP address can change depending on the network you’re connected to.</p><p>A simple way to remember it is:</p><ul><li><strong>MAC Address = Device identity</strong></li><li><strong>IP Address = Device location on the network</strong></li></ul><h3>What Happens at Home?</h3><p>Suppose seven devices are connected to the same home router.</p><p>Each device receives its own <strong>private IP address</strong>, such as:</p><ul><li>192.168.1.2</li><li>192.168.1.3</li><li>192.168.1.4</li></ul><p>Although every device has a different private IP, they usually share a single <strong>public IP address</strong> provided by the Internet Service Provider (ISP) when accessing the Internet.</p><p>This means websites see one public IP while the router keeps track of which response belongs to which device.</p><h3>Internet, Web, and Wi-Fi Are Different</h3><p>One important lesson was understanding that these terms are not interchangeable.</p><ul><li><strong>Internet</strong> is the global network connecting millions of devices.</li><li><strong>World Wide Web (WWW)</strong> is a service that runs on the Internet and contains websites.</li><li><strong>Wi-Fi</strong> is simply a wireless technology that connects your device to a router.</li></ul><p>Wi-Fi provides access to a network — it is not the Internet itself.</p><h3>What Comes Next?</h3><p>This journey has helped me build a strong foundation before diving into advanced topics.</p><p>Next, I’ll explore:</p><ul><li>Client–Server Architecture</li><li>Network Protocols</li><li>IP Addressing in depth</li><li>Port Numbers</li><li>DNS</li><li>TCP vs UDP</li><li>OSI Model</li><li>TCP/IP Model</li></ul><h3>Final Thoughts</h3><p>Learning networking isn’t about memorizing definitions — it’s about understanding how billions of devices communicate every second.</p><p>So far, I’ve learned that every device has its own identity (MAC address), its own location on a network (IP address), and that reliable communication is made possible by protocols like TCP. Even something as simple as opening a website involves packets, routers, servers, and many networking concepts working together behind the scenes.</p><p>This is just the beginning, but it’s already changing the way I think about the Internet I use every day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31c2be67c522" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From an LLM Demo to a Production-Ready Personal AI Assistant]]></title>
            <link>https://medium.com/@shylesh1640/from-an-llm-demo-to-a-production-ready-personal-ai-assistant-ceb1f077c4b1?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ceb1f077c4b1</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 04:31:06 GMT</pubDate>
            <atom:updated>2026-07-07T04:31:06.432Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building an AI Assistant with LangGraph, FastAPI, Streamlit, Docker, and Render</h3><p>Artificial Intelligence has reached a point where building a chatbot is no longer the interesting part. With just a few lines of code, anyone can connect an LLM and receive intelligent responses.</p><p>The real engineering challenge begins after the first successful response.</p><p>How do you give your assistant memory?</p><p>How does it call external tools?</p><p>How do you stream responses like ChatGPT?</p><p>How do you protect against prompt injection?</p><p>How do you package everything into a deployable application?</p><p>These are the questions that separate an AI demo from an AI product.</p><p>In this article, I’ll walk through building a full-stack Personal AI Assistant using <strong>LangGraph</strong>, <strong>FastAPI</strong>, <strong>Streamlit</strong>, <strong>Docker</strong>, and <strong>Render</strong>, along with production features like persistent memory, guardrails, observability, streaming, and cloud deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOV6-VtpEmGDT6EULnb6Mw.png" /></figure><h3>Why Another AI Assistant?</h3><p>Most tutorials stop here:</p><pre>User<br>   │<br>   ▼<br>Large Language Model<br>   │<br>   ▼<br>Response</pre><p>That works for demonstrations, but real assistants require much more.</p><p>A production-ready assistant should be able to:</p><ul><li>Remember previous conversations</li><li>Use external tools</li><li>Validate user input</li><li>Protect sensitive information</li><li>Stream responses</li><li>Provide debugging and tracing</li><li>Deploy reliably in the cloud</li></ul><p>Instead of building another chatbot, the goal was to build an AI application that behaves like modern production systems.</p><h3>Technology Stack</h3><p>The project uses a focused Python ecosystem where every component has a clear responsibility.</p><p>ComponentPurposeLangGraphAgent orchestration and workflow managementLangChainTool integration and LLM abstractionsFastAPIBackend REST API and streamingStreamlitInteractive chat interfaceLangSmithTracing and debuggingPydanticInput and output validationDockerContainerizationDocker ComposeMulti-service orchestrationRenderCloud deployment</p><h3>Overall Architecture</h3><p>The application consists of two services.</p><pre>User<br>                   │<br>                   ▼<br>          Streamlit Frontend<br>                   │<br>                   ▼<br>             FastAPI Backend<br>                   │<br>                   ▼<br>          Input Validation Layer<br>                   │<br>                   ▼<br>            LangGraph Agent<br>          ┌────────┴────────┐<br>          │                 │<br>          ▼                 ▼<br>      External Tools     Memory<br>          │                 │<br>          └────────┬────────┘<br>                   ▼<br>         Output Validation Layer<br>                   │<br>                   ▼<br>             Streamlit UI</pre><p>Every request passes through validation before reaching the language model and is checked again before being returned to the user.</p><h3>Step 1 — Building the LangGraph Agent</h3><p>The assistant’s intelligence comes from LangGraph.</p><p>Unlike traditional one-shot prompting, LangGraph manages state across multiple execution steps.</p><p>A typical workflow looks like this:</p><pre>User Query</pre><pre>↓</pre><pre>Graph State</pre><pre>↓</pre><pre>Planner</pre><pre>↓</pre><pre>Need a Tool?</pre><pre>↓</pre><pre>Yes ─────────► Execute Tool</pre><pre>↓</pre><pre>Update Memory</pre><pre>↓</pre><pre>Generate Response</pre><pre>↓</pre><pre>Return Answer</pre><p>This graph-based execution makes it easy to extend the assistant with new tools and workflows.</p><h3>Step 2 — Giving the Assistant Memory</h3><p>Without memory, every conversation starts from scratch.</p><p>Persistent conversation history transforms the experience from a chatbot into a personal assistant.</p><p>The memory pipeline is straightforward:</p><pre>Conversation</pre><pre>↓</pre><pre>Messages</pre><pre>↓</pre><pre>Checkpoint</pre><pre>↓</pre><pre>Stored State</pre><pre>↓</pre><pre>Next User Message</pre><pre>↓</pre><pre>Context Restoration</pre><p>This allows the assistant to understand follow-up questions naturally.</p><h3>Step 3 — Adding Tool Calling</h3><p>Many user requests require more than text generation.</p><p>Instead of guessing, the assistant can execute specialized tools.</p><p>Example tools include:</p><ul><li>Calculator</li><li>Weather lookup</li><li>Document search</li><li>Knowledge retrieval</li></ul><p>Execution flow:</p><pre>User</pre><pre>↓</pre><pre>LLM Decision</pre><pre>↓</pre><pre>Tool Selection</pre><pre>↓</pre><pre>Tool Execution</pre><pre>↓</pre><pre>Tool Result</pre><pre>↓</pre><pre>Final Response</pre><p>Tool calling significantly reduces hallucinations by replacing guesses with deterministic operations.</p><h3>Step 4 — Observability with LangSmith</h3><p>As agents become more sophisticated, debugging becomes increasingly difficult.</p><p>LangSmith provides visibility into every execution step.</p><p>It records:</p><ul><li>Prompt execution</li><li>Tool calls</li><li>Memory updates</li><li>Agent state transitions</li><li>Latency</li><li>Errors</li></ul><p>Instead of wondering <em>why</em> the assistant behaved a certain way, you can inspect every step.</p><h3>Step 5 — Building Guardrails</h3><p>Safety shouldn’t rely entirely on prompting.</p><p>The application introduces validation both before and after model execution.</p><h3>Input Validation</h3><p>Incoming prompts are checked for:</p><ul><li>Prompt injection attempts</li><li>Unsafe requests</li><li>Invalid input</li><li>Malicious instruction</li></ul><p>Output Validation</p><p>Responses are validated before reaching the user.</p><p>The assistant:</p><ul><li>Detects email addresses</li><li>Detects phone numbers</li><li>Redacts sensitive information</li><li>Validates structured output using Pydantic</li></ul><p>The complete safety pipeline becomes:</p><pre>User Prompt</pre><pre>↓</pre><pre>Input Filters</pre><pre>↓</pre><pre>Prompt Injection Detection</pre><pre>↓</pre><pre>LangGraph Agent</pre><pre>↓</pre><pre>Response Validation</pre><pre>↓</pre><pre>PII Redaction</pre><pre>↓</pre><pre>User</pre><h3>Step 6 — Streaming Responses</h3><p>Waiting for a complete response feels slow.</p><p>Instead, the backend streams text incrementally using FastAPI’s StreamingResponse.</p><pre>LLM</pre><pre>↓</pre><pre>Generated Tokens</pre><pre>↓</pre><pre>StreamingResponse</pre><pre>↓</pre><pre>HTTP Chunks</pre><pre>↓</pre><pre>Streamlit write_stream()</pre><pre>↓</pre><pre>Live Response</pre><p>Streaming creates a far more natural conversational experience.</p><h3>Step 7 — Building the User Interface</h3><p>Rather than creating a custom frontend, Streamlit provides an elegant chat interface using only Python.</p><p>Key features include:</p><ul><li>st.chat_input</li><li>st.chat_message</li><li>st.session_state</li><li>st.write_stream</li></ul><p>This allowed the interface to be built rapidly while keeping the entire stack in a single language.</p><h3>Step 8 — Containerization with Docker</h3><p>The application is split into two containers.</p><pre>+----------------------+<br>|   Streamlit UI       |<br>+----------------------+<br>           │<br>           ▼<br>+----------------------+<br>|    FastAPI Backend   |<br>+----------------------+<br>           │<br>           ▼<br>+----------------------+<br>| LangGraph + Tools    |<br>+----------------------+</pre><p>Docker Compose coordinates both services and ensures the backend is healthy before the frontend starts.</p><h3>Step 9 — Deploying with Render</h3><p>Deployment is managed using a single render.yaml Blueprint.</p><pre>Internet</pre><pre>↓</pre><pre>Render</pre><pre>├── FastAPI Service</pre><pre>└── Streamlit Service</pre><pre>↓</pre><pre>Users</pre><p>This approach keeps deployment reproducible and easy to maintain.</p><h3>Challenges Encountered</h3><p>Every engineering project has its share of obstacles.</p><p>Some of the key challenges included:</p><h3>Streaming Responses</h3><p>The initial implementation blocked until generation completed.</p><p>Using FastAPI’s StreamingResponse enabled incremental output.</p><h3>Docker Networking</h3><p>Containers cannot communicate using localhost.</p><p>Docker service names solved inter-container communication.</p><h3>Memory Persistence</h3><p>Conversation state was initially lost between requests.</p><p>Checkpoint-based persistence preserved context across sessions.</p><h3>Prompt Injection</h3><p>Users can intentionally manipulate system prompts.</p><p>Input validation and layered guardrails significantly reduced this risk.</p><h3>Debugging Agent Behavior</h3><p>Multiple tools and memory layers made debugging difficult.</p><p>LangSmith traces made execution transparent.</p><h3>Key Takeaways</h3><p>Several architectural decisions proved especially valuable:</p><ul><li>Build one useful workflow before expanding features.</li><li>Add observability early.</li><li>Treat guardrails as part of the architecture.</li><li>Prefer modular services over monolithic designs.</li><li>Use streaming to improve perceived responsiveness.</li><li>Containerize from the beginning to simplify deployment.</li></ul><h3>Future Improvements</h3><p>The current assistant provides a strong foundation, but several enhancements are planned:</p><ul><li>Retrieval-Augmented Generation (RAG)</li><li>Voice interaction</li><li>Multi-agent collaboration</li><li>MCP server integration</li><li>Calendar and email tools</li><li>Authentication</li><li>Long-term semantic memory</li><li>Image understanding</li><li>Background task execution</li></ul><h3>Final Thoughts</h3><p>Building an AI assistant today is no longer about connecting an API to an LLM.</p><p>The real engineering lies in everything surrounding the model — memory, tools, safety, observability, streaming, deployment, and maintainability.</p><p>By combining LangGraph, FastAPI, Streamlit, Docker, and Render, it’s possible to transform a simple chatbot into a production-ready AI application that users can genuinely rely on.</p><p>As language models continue to improve, the competitive advantage will increasingly come from the systems built around them — not the model call itself.</p><p>If you’re building your own AI assistant, focus on the architecture as much as the model. That’s where the most interesting engineering happens.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ceb1f077c4b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 5: Deploying Your AI App — From Terminal to Real Product]]></title>
            <link>https://medium.com/@shylesh1640/part-5-deploying-your-ai-app-from-terminal-to-real-product-d471d3dbd0b6?source=rss-3579f93424c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d471d3dbd0b6</guid>
            <dc:creator><![CDATA[SHYLESH S]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 04:31:03 GMT</pubDate>
            <atom:updated>2026-06-22T04:31:03.371Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Subtitle:</strong> <em>How I wrapped a RAG pipeline in a FastAPI backend and Streamlit chat interface</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BMXqER5tT1TyD_37G4kmVw.png" /></figure><h3>Introduction</h3><p>Everything in the previous four posts ran in a terminal. Real users cannot run Python scripts. This final post walks through turning the RAG pipeline into a deployable chat application.</p><h3>The Architecture</h3><pre>Browser (Streamlit UI)<br>        ↓<br>FastAPI backend (api.py)<br>        ↓<br>RAG pipeline (rag.py)<br>        ↓<br>Vector DB + LLM</pre><p>Separating the backend from the UI means you can later swap Streamlit for a React frontend, or add mobile support, without changing the core logic.</p><h3>Layer 1: FastAPI Backend</h3><pre>from fastapi import FastAPI<br>from pydantic import BaseModel<br>from rag import ask_question</pre><pre>app = FastAPI()</pre><pre>class QueryRequest(BaseModel):<br>    question: str</pre><pre>@app.post(&quot;/ask&quot;)<br>def ask(request: QueryRequest):<br>    answer = ask_question(request.question)<br>    return {&quot;answer&quot;: answer}</pre><p>Run with:</p><pre>uvicorn api:app --reload</pre><p>Your RAG pipeline is now a REST API. Any client — browser, mobile app, Postman — can call it.</p><h3>Layer 2: Streamlit Chat UI</h3><pre>python</pre><pre>import streamlit as st<br>import requests</pre><pre>st.title(&quot;🌊 OceanLedger GitHub Assistant&quot;)</pre><pre>if &quot;messages&quot; not in st.session_state:<br>    st.session_state.messages = []</pre><pre>for msg in st.session_state.messages:<br>    with st.chat_message(msg[&quot;role&quot;]):<br>        st.markdown(msg[&quot;content&quot;])</pre><pre>if prompt := st.chat_input(&quot;Ask a question...&quot;):<br>    response = requests.post(<br>        &quot;http://localhost:8000/ask&quot;,<br>        json={&quot;question&quot;: prompt}<br>    )<br>    answer = response.json()[&quot;answer&quot;]<br>    st.session_state.messages.append({&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: prompt})<br>    st.session_state.messages.append({&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: answer})<br>    st.rerun()</pre><p>Run with:</p><pre>streamlit run app.py</pre><h3>What You Get</h3><p>A working chat application with:</p><ul><li>A real browser interface at <a href="http://localhost:8501/">http://localhost:8501</a></li><li>A clean REST API at <a href="http://localhost:8000/">http://localhost:8000</a></li><li>Full conversation history in the UI</li><li>Your RAG pipeline answering questions in real time</li></ul><h3>What to Build Next</h3><p>With this foundation you can:</p><ul><li>Add authentication with API keys or OAuth</li><li>Deploy to Hugging Face Spaces, Railway, or Render for public access</li><li>Add streaming responses so answers appear word by word</li><li>Connect multiple agents — one for GitHub docs, one for live web search</li><li>Build domain-specific apps like OceanLedger’s blue carbon assistant</li></ul><h3>Final Reflection</h3><p>This five-part journey covered the full stack of modern AI development:</p><p>StepWhat you learnedLLMs + PromptingHow AI generates textEmbeddings + Vector DBHow AI searches meaningRAGHow AI uses your dataAgents + MemoryHow AI takes actionsFine-tuningHow AI learns your styleEvaluationHow AI is measuredDeploymentHow AI reaches users</p><p>If you started this series knowing nothing about GenAI and you followed along, you are now capable of building and shipping real AI applications. That is not a small thing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d471d3dbd0b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>