<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Computer Networking on Noman Chowdhury Munna | Blog</title><link>http://hellonoman.dev/blog/categories/computer-networking/</link><description>Recent content in Computer Networking on Noman Chowdhury Munna | Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 20 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="http://hellonoman.dev/blog/categories/computer-networking/index.xml" rel="self" type="application/rss+xml"/><item><title>Web Systems Architecture Foundations: From Sockets to Application Servers</title><link>http://hellonoman.dev/blog/p/web-architecture-foundations/</link><pubDate>Thu, 20 Aug 2026 00:00:00 +0000</pubDate><guid>http://hellonoman.dev/blog/p/web-architecture-foundations/</guid><description>&lt;img src="http://hellonoman.dev/blog/p/web-architecture-foundations/cover.png" alt="Featured image of post Web Systems Architecture Foundations: From Sockets to Application Servers" /&gt;&lt;p&gt;Welcome back, everyone. Take your seats.&lt;/p&gt;&#10;&lt;p&gt;Today we are kicking off our deep-dive series on modern backend engineering and infrastructure architecture. Before we talk about Kubernetes, load balancers, or fancy service meshes, we must build an unshakeable understanding of fundamental web mechanics.&lt;/p&gt;&#10;&lt;p&gt;If you don&amp;rsquo;t understand what actually happens at the OS and network level when a user clicks a button on a web page, you will spend your entire career Cargo-culting configuration files and scratching your head during production outages.&lt;/p&gt;&#10;&lt;p&gt;So let me strip away the magic. Grab your notebook, and let me examine the foundations of web systems architecture.&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="1-the-client-server-model--life-of-a-request"&gt;1. The Client-Server Model &amp;amp; Life of a Request&#10;&lt;/h2&gt;&lt;p&gt;Let&amp;rsquo;s start with the baseline paradigm: &lt;strong&gt;Client-Server Architecture&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;In software engineering, client-server is a distributed application structure that partitions tasks or workloads between service providers (&lt;strong&gt;servers&lt;/strong&gt;) and service requesters (&lt;strong&gt;clients&lt;/strong&gt;).&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;span class="lnt"&gt;6&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; +------------------+ +-------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | | HTTP GET Request | |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | Client Browser | -------------------&amp;gt; | Web Server |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | (e.g., Chrome) | &amp;lt;------------------- | (e.g., Nginx) |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | | HTTP 200 Response | |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; +------------------+ +-------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;The Client&lt;/strong&gt;: Usually a web browser (Chrome, Firefox), a mobile application, or a CLI tool like &lt;code&gt;curl&lt;/code&gt;. It initiates communication by asking for a resource or sending data.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;The Server&lt;/strong&gt;: A machine (or software process) that waits passively for incoming network connections, processes requests, and returns responses.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="what-happens-when-you-type-httpsexamplecom-into-a-browser"&gt;What Happens When You Type &lt;code&gt;https://example.com&lt;/code&gt; into a Browser?&#10;&lt;/h3&gt;&lt;p&gt;This is a classic software engineering interview question, but more importantly, it tests your holistic understanding of networking. When a user hits &lt;code&gt;Enter&lt;/code&gt;, a precise chain of events triggers:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[User Types URL] -&amp;gt; [1. DNS Lookup] -&amp;gt; [2. TCP Handshake] -&amp;gt; [3. TLS Handshake] -&amp;gt; [4. HTTP Request] -&amp;gt; [5. Server Processing] -&amp;gt; [6. HTTP Response] -&amp;gt; [7. DOM Render]&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;URL Parsing &amp;amp; Protocol Identification&lt;/strong&gt;: The browser parses &lt;code&gt;https://example.com&lt;/code&gt;, recognizing the protocol (&lt;code&gt;https://&lt;/code&gt;), domain name (&lt;code&gt;example.com&lt;/code&gt;), and implicit default port (&lt;code&gt;443&lt;/code&gt;).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;DNS Resolution&lt;/strong&gt;: The computer needs an IP address (e.g., &lt;code&gt;93.184.216.34&lt;/code&gt;). The browser checks its local cache, OS cache, router cache, and finally queries a Recursive DNS Resolver.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;TCP Connection (3-Way Handshake)&lt;/strong&gt;: The browser opens a socket to port 443 at IP &lt;code&gt;93.184.216.34&lt;/code&gt;. The OS executes the TCP handshake: &lt;code&gt;SYN&lt;/code&gt; $\rightarrow$ &lt;code&gt;SYN-ACK&lt;/code&gt; $\rightarrow$ &lt;code&gt;ACK&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;TLS Handshake&lt;/strong&gt;: Because the protocol is &lt;code&gt;HTTPS&lt;/code&gt;, the client and server negotiate encryption keys, exchange cryptographic certificates, and verify host identities.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;HTTP Request Transmission&lt;/strong&gt;: The browser sends an HTTP request payload over the encrypted TCP connection (e.g., &lt;code&gt;GET / HTTP/1.1\r\nHost: example.com...&lt;/code&gt;).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Server Processing &amp;amp; Response&lt;/strong&gt;: The server receives the bytes via socket buffers, processes the request (executing business logic or fetching static files), and writes an HTTP response back (&lt;code&gt;HTTP/1.1 200 OK&lt;/code&gt;).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Client Rendering&lt;/strong&gt;: The browser receives HTML, parses the document tree (DOM), requests secondary assets (CSS, JS, images), executes JS, and renders the UI.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="2-dissecting-urls-hostnames-ips-ports-and-sockets"&gt;2. Dissecting URLs, Hostnames, IPs, Ports, and Sockets&#10;&lt;/h2&gt;&lt;p&gt;Students often mix up these terms. Let&amp;rsquo;s make the distinctions crystal clear.&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: left"&gt;Term&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: left"&gt;What it is&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: left"&gt;Real-world Physical Analogy&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;strong&gt;IP Address&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;The numerical network address of a machine on the internet (e.g., &lt;code&gt;192.168.1.1&lt;/code&gt; or &lt;code&gt;93.184.216.34&lt;/code&gt;).&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;The street address of an apartment building.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;strong&gt;Port&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;A 16-bit integer (0–65535) identifying a specific process on that machine.&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;The apartment number inside the building.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;strong&gt;Hostname&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;A human-readable name that maps to an IP address (e.g., &lt;code&gt;api.example.com&lt;/code&gt;).&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;The name of the building (&amp;ldquo;Empire State Building&amp;rdquo;).&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;strong&gt;URL&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;Uniform Resource Locator: host + port + path + query parameters + protocol (&lt;code&gt;https://example.com:8080/users?id=5&lt;/code&gt;).&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;The complete mailing instructions to deliver a letter to a specific person.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;&lt;strong&gt;Socket&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;An OS file descriptor representing an endpoint bound to an IP + Port pair (&lt;code&gt;192.168.1.1:443&lt;/code&gt;).&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: left"&gt;The actual telephone plug in the wall connected to a phone line.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;h3 id="what-does-it-mean-for-a-server-to-listen-on-a-port"&gt;What does it mean for a server to &amp;ldquo;listen&amp;rdquo; on a port?&#10;&lt;/h3&gt;&lt;p&gt;When you run a backend application (say, Python&amp;rsquo;s FastAPI or Node.js), the program makes system calls to the operating system kernel:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;code&gt;socket()&lt;/code&gt;: Requests a network socket file descriptor.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;bind(IP, Port)&lt;/code&gt;: Tells the kernel &amp;ldquo;associate this socket with IP &lt;code&gt;0.0.0.0&lt;/code&gt; and Port &lt;code&gt;8000&lt;/code&gt;&amp;rdquo;.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;listen()&lt;/code&gt;: Tells the kernel &amp;ldquo;accept incoming TCP connections on this socket and queue them up&amp;rdquo;.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;When a server is &amp;ldquo;listening,&amp;rdquo; the OS kernel handles the raw TCP packets in the background. When a client connects, the OS places the established socket in an accept queue for your application code to read.&lt;/p&gt;&#10;&lt;h3 id="exposing-a-port-to-the-internet"&gt;Exposing a Port to the Internet&#10;&lt;/h3&gt;&lt;p&gt;When you &lt;strong&gt;expose a port&lt;/strong&gt;, you configure your network interface and firewall (e.g., AWS Security Group, &lt;code&gt;ufw&lt;/code&gt;, or router port forwarding) to allow external IP addresses on the public internet to reach that listening socket port. If a port is bound to &lt;code&gt;127.0.0.1&lt;/code&gt; (localhost), it is strictly private to the machine. If it is bound to &lt;code&gt;0.0.0.0&lt;/code&gt; (all interfaces) and the firewall allows incoming traffic, it is publicly exposed.&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="3-protocols-http-vs-https--dns"&gt;3. Protocols: HTTP vs. HTTPS &amp;amp; DNS&#10;&lt;/h2&gt;&lt;h3 id="http-hypertext-transfer-protocol"&gt;HTTP (Hypertext Transfer Protocol)&#10;&lt;/h3&gt;&lt;p&gt;HTTP is an application-layer request-response protocol running over TCP. It is completely plaintext. Anyone eavesdropping on the network path (Wi-Fi router, ISP, transit provider) can inspect, alter, or inject data into your traffic.&lt;/p&gt;&#10;&lt;h3 id="https-http-secure"&gt;HTTPS (HTTP Secure)&#10;&lt;/h3&gt;&lt;p&gt;HTTPS is standard HTTP wrapped inside &lt;strong&gt;TLS (Transport Layer Security)&lt;/strong&gt; encryption.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;span class="lnt"&gt;6&#10;&lt;/span&gt;&lt;span class="lnt"&gt;7&#10;&lt;/span&gt;&lt;span class="lnt"&gt;8&#10;&lt;/span&gt;&lt;span class="lnt"&gt;9&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| Application Layer: HTTP |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| Security Layer: TLS (Encryption) |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| Transport Layer: TCP |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| Network Layer: IP |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;HTTPS guarantees three fundamental security principles:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;Confidentiality&lt;/strong&gt;: Payload is encrypted; eavesdroppers see only random bytes.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Integrity&lt;/strong&gt;: Data cannot be tampered with in transit without detection.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Authentication&lt;/strong&gt;: Digital certificates issued by Certificate Authorities (CAs) prove that the server actually owns the requested domain.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h3 id="dns-domain-name-system"&gt;DNS (Domain Name System)&#10;&lt;/h3&gt;&lt;p&gt;DNS is the internet&amp;rsquo;s phonebook. It translates human-friendly hostnames (&lt;code&gt;example.com&lt;/code&gt;) into machine-routable IP addresses (&lt;code&gt;93.184.216.34&lt;/code&gt;). It operates primarily over &lt;strong&gt;UDP port 53&lt;/strong&gt; for quick request-response lookups.&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="4-the-server-hierarchy-web-server-vs-application-server-vs-backend"&gt;4. The Server Hierarchy: Web Server vs. Application Server vs. Backend&#10;&lt;/h2&gt;&lt;p&gt;One of the biggest sources of confusion for junior engineers is distinguishing between &lt;strong&gt;Web Servers&lt;/strong&gt;, &lt;strong&gt;Application Servers&lt;/strong&gt;, and &lt;strong&gt;Backend Servers&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;span class="lnt"&gt;17&#10;&lt;/span&gt;&lt;span class="lnt"&gt;18&#10;&lt;/span&gt;&lt;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[ Public Internet ]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; v (Port 80/443 - Public)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+-------------------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| WEB SERVER (e.g., Nginx, Caddy, Apache) |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| - TLS Termination |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| - Serves static assets (HTML/CSS/Images) |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| - Rate limiting &amp;amp; request filtering |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+-------------------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; v (Port 8000 - Internal Socket / Loopback)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+-------------------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| APPLICATION SERVER (e.g., Gunicorn, Uvicorn) |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| - Runs dynamic code (Python, Node, Java, Go) |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| - Manages WSGI/ASGI worker process pools |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+-------------------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; v (Internal Database Protocol)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+-------------------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| BACKEND DATABASE (e.g., PostgreSQL, Redis) |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| - Data persistence &amp;amp; business state |&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+-------------------------------------------------+&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="1-web-server"&gt;1. Web Server&#10;&lt;/h3&gt;&lt;p&gt;A software application dedicated to handling HTTP protocols, serving static files directly from disk, managing TLS certificates, and forwarding dynamic requests.&#10;&lt;em&gt;Examples&lt;/em&gt;: Nginx, Apache HTTP Server, Caddy.&lt;/p&gt;&#10;&lt;h3 id="2-application-server"&gt;2. Application Server&#10;&lt;/h3&gt;&lt;p&gt;A runtime engine designed to execute dynamic programming code and business logic (Python, Java, Ruby, JS). It translates incoming raw HTTP payloads into programmatic objects (e.g., Python &lt;code&gt;dict&lt;/code&gt; or Express &lt;code&gt;req&lt;/code&gt;/&lt;code&gt;res&lt;/code&gt; objects).&#10;&lt;em&gt;Examples&lt;/em&gt;: Gunicorn / Uvicorn (Python), Puma (Ruby), Tomcat (Java), Node.js runtime.&lt;/p&gt;&#10;&lt;h3 id="3-backend-server"&gt;3. Backend Server&#10;&lt;/h3&gt;&lt;p&gt;A broader architectural term encompassing everything behind the user-facing tier—including application servers, background worker queues (Celery, BullMQ), microservices, and databases.&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="5-why-cant-you-expose-your-application-server-directly-to-the-internet"&gt;5. Why Can&amp;rsquo;t You Expose Your Application Server Directly to the Internet?&#10;&lt;/h2&gt;&lt;p&gt;Students frequently ask me: &lt;em&gt;&amp;ldquo;Professor, my FastAPI/Node.js app has a built-in server. Why can&amp;rsquo;t I just bind it to port 80/443 on my VPS and expose it directly?&amp;rdquo;&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Technically, you &lt;em&gt;can&lt;/em&gt;, but in production, &lt;strong&gt;this is an architectural sin&lt;/strong&gt;. Here is why:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;Slow Client Attacks (Slowloris)&lt;/strong&gt;: Application servers (like Gunicorn or Node.js event loops) are optimized for complex business logic, not holding open thousands of idle connection threads. An attacker sending 1 byte every 10 seconds can quickly exhaust all worker threads, taking your app offline.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Poor Static Asset Performance&lt;/strong&gt;: Application servers execute code to serve files. Reading a static &lt;code&gt;logo.png&lt;/code&gt; off disk via Python or JS is 10x to 100x slower and consumes vastly more CPU/RAM than Nginx serving it using OS zero-copy &lt;code&gt;sendfile()&lt;/code&gt; kernel calls.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Security &amp;amp; Privilege Escalation&lt;/strong&gt;: Binding to ports below 1024 (like port 80 or 443) requires root privileges on Linux. Running your application code (FastAPI/Node) as root means any Remote Code Execution (RCE) vulnerability gives the attacker full control of your server.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Lack of Robust TLS Management&lt;/strong&gt;: Application runtime TLS stacks are rarely as optimized, battle-tested, or easily automated (via Certbot) as dedicated web servers like Nginx.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;No Zero-Downtime Reloads&lt;/strong&gt;: Modern web servers can reload their configuration and worker processes without dropping a single active TCP connection. Application runtimes typically require restarting the whole process.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="classroom-recap--concept-check"&gt;Classroom Recap &amp;amp; Concept Check&#10;&lt;/h2&gt;&lt;p&gt;Let&amp;rsquo;s review what we learned today:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Client-Server&lt;/strong&gt;: Clients request, servers listen on TCP sockets.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Port vs IP&lt;/strong&gt;: IP is the machine&amp;rsquo;s address; Port is the process doorway.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;DNS &amp;amp; Sockets&lt;/strong&gt;: DNS translates hostnames to IPs; Sockets are the OS file handles for networking.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Web vs App Server&lt;/strong&gt;: Web servers (Nginx) handle HTTP/TLS/Static files blazingly fast; App servers (Uvicorn/Gunicorn) run business logic.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Exposure&lt;/strong&gt;: Never expose app servers directly; place a dedicated web server or reverse proxy in front.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;In our next lecture, we will take this foundation and explore &lt;strong&gt;Reverse Proxies &amp;amp; Nginx Implementation&lt;/strong&gt; in depth. Class dismissed!&lt;/p&gt;&#10;</description></item></channel></rss>