<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet href="/static/feed.xsl" type="text/xsl" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:quartz="https://quartz.jzhao.xyz/ns">
  <script xmlns="http://www.w3.org/1999/xhtml" src="/static/scripts/xslt-polyfill-214fd525.js"></script>
  <title>/wiki / https</title>
  <subtitle>Recent notes in /wiki / https on Animesh Mishra</subtitle>
  <link href="https://animishraa05.github.io/wiki/https" />
  <link rel="alternate" type="text/html" href="https://animishraa05.github.io/wiki/https" />
  <category term="wiki/https" />
  <id>https://animishraa05.github.io/wiki/https</id>
  <updated>2026-09-02T00:00:00.000Z</updated>
  <contributor>
    <name>Animesh Mishra</name>
    <email>animesh.mishra818@gmail.com</email>
  </contributor>
  <logo>https://animishraa05.github.io/icon.png</logo>
  <icon>https://animishraa05.github.io/icon.png</icon>
  <generator>Quartz v4.6.0 -- quartz.jzhao.xyz</generator>
  <rights type="html">&amp;amp;copy; 2026 Animesh Mishra</rights>
  
  <entry>
    <title>Https — Map of Content</title>
    <link href="https://animishraa05.github.io/wiki/https/https-moc" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/https-moc.md" />
    <summary> Map of Content for Https — 30 concepts. Start here to navigate https.</summary>
    <published>2026-09-02T00:00:00.000Z</published>
    <updated>2026-09-02T00:00:00.000Z</updated>
    <publishedTime>Sep 02, 2026</publishedTime>
    <updatedTime>Sep 02, 2026</updatedTime>
    <category term="meta" label="meta" />
<category term="https" label="https" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;blockquote&gt;
&lt;p dir=&quot;auto&quot;&gt;Map of Content for &lt;strong&gt;Https&lt;/strong&gt; — 30 concepts. Start here to navigate https.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;core-concepts&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Concepts&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-concepts&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;a href=&quot;../../arp-protocol&quot; class=&quot;internal alias&quot; data-slug=&quot;arp-protocol&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ARP Protocol&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../browser-autocomplete&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-autocomplete&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Autocomplete&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../compositing&quot; class=&quot;internal alias&quot; data-slug=&quot;compositing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Compositing&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../cssom&quot; class=&quot;internal alias&quot; data-slug=&quot;cssom&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSSOM&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../css-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;css-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSS Parsing&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../dns-authoritative-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-authoritative-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Authoritative Server&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../dns-cache&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-cache&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Cache&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../dns-hierarchy&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-hierarchy&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Hierarchy&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../dns-root-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-root-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Root Server&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../dns-tld-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-tld-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS TLD Server&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../dom-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;dom-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DOM Tree&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../gpu-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;gpu-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;GPU Rendering&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../hsts&quot; class=&quot;internal alias&quot; data-slug=&quot;hsts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HSTS&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../html-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;html-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTML Parsing&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../http-headers&quot; class=&quot;internal alias&quot; data-slug=&quot;http-headers&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Headers&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../http-request&quot; class=&quot;internal alias&quot; data-slug=&quot;http-request&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Request&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../http-response&quot; class=&quot;internal alias&quot; data-slug=&quot;http-response&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Response&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../https&quot; class=&quot;internal alias&quot; data-slug=&quot;https&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTPS&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../keyboard-interrupt&quot; class=&quot;internal alias&quot; data-slug=&quot;keyboard-interrupt&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Keyboard Interrupt&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../layout&quot; class=&quot;internal alias&quot; data-slug=&quot;layout&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Layout&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../mac-address&quot; class=&quot;internal alias&quot; data-slug=&quot;mac-address&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;MAC Address&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../os-interrupt-handler&quot; class=&quot;internal alias&quot; data-slug=&quot;os-interrupt-handler&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;OS Interrupt Handler&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../painting&quot; class=&quot;internal alias&quot; data-slug=&quot;painting&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Painting&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../recursive-dns&quot; class=&quot;internal alias&quot; data-slug=&quot;recursive-dns&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Recursive DNS&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../render-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;render-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Render Tree&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../tcp-packet-drop&quot; class=&quot;internal alias&quot; data-slug=&quot;tcp-packet-drop&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TCP Packet Drop&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../url-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;url-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;URL Parsing&lt;/a&gt; — concept&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;../../url-to-rendering-flow&quot; class=&quot;internal&quot; data-slug=&quot;url-to-rendering-flow&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;url-to-rendering-flow&lt;/a&gt; — concept&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;mechanisms--how-things-work&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Mechanisms &amp;#x26; How Things Work&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#mechanisms--how-things-work&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;em&gt;Auto-generated — edit to curate. Pages that explain processes/flows.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;comparisons--tradeoffs&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Comparisons &amp;#x26; Tradeoffs&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#comparisons--tradeoffs&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;em&gt;(No synthesis yet — create via ingest or query —save)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;suggested-reading-order&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Suggested Reading Order&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#suggested-reading-order&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;Browse Core Concepts above — start with most-linked page&lt;/li&gt;
&lt;li&gt;Follow Connections sections for dense graph traversal&lt;/li&gt;
&lt;/ol&gt;</content>
  </entry><entry>
    <title>arp-protocol</title>
    <link href="https://animishraa05.github.io/wiki/https/arp-protocol" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/arp-protocol.md" />
    <summary>The Problem You have an IP address (142.250.183.46) but need to send a packet on the local network (Ethernet).</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="arp" label="arp" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;You have an IP address (142.250.183.46) but need to send a packet on the local network (Ethernet). Local networks use MAC addresses, not IP addresses. Without ARP, you can’t figure out which MAC address corresponds to an IP.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;ARP (Address Resolution Protocol) translates IP addresses to MAC addresses on local networks. It broadcasts “Who has this IP?” and the owner replies with its MAC address.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Need MAC&lt;/strong&gt;: System wants to send packet to IP 192.168.1.1&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check ARP Cache&lt;/strong&gt;: Is this IP already mapped? If yes, use cached MAC&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Broadcast Query&lt;/strong&gt;: “Who has IP 192.168.1.1? Tell 192.168.1.100”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reply&lt;/strong&gt;: The owner replies (unicast): “I have 192.168.1.1, my MAC is aa:bb:cc:dd:ee:ff”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cache&lt;/strong&gt;: Store in ARP cache for future use&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;ARP operates at Layer 2 (Data Link) and is essential for IPv4 over Ethernet.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;558pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 558.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 554.22,-94 554.22,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Sender --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Sender&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M84.5,-46C84.5,-46 12,-46 12,-46 6,-46 0,-40 0,-34 0,-34 0,-16.4 0,-16.4 0,-10.4 6,-4.4 12,-4.4 12,-4.4 84.5,-4.4 84.5,-4.4 90.5,-4.4 96.5,-10.4 96.5,-16.4 96.5,-16.4 96.5,-34 96.5,-34 96.5,-40 90.5,-46 84.5,-46&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;48.25&quot; y=&quot;-29.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Sender&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;48.25&quot; y=&quot;-12.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;192.168.1.100&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Broadcast --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Broadcast&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M268.13,-90C268.13,-90 145.5,-90 145.5,-90 139.5,-90 133.5,-84 133.5,-78 133.5,-78 133.5,-60.4 133.5,-60.4 133.5,-54.4 139.5,-48.4 145.5,-48.4 145.5,-48.4 268.13,-48.4 268.13,-48.4 274.13,-48.4 280.13,-54.4 280.13,-60.4 280.13,-60.4 280.13,-78 280.13,-78 280.13,-84 274.13,-90 268.13,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;206.82&quot; y=&quot;-73.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Broadcast&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;206.82&quot; y=&quot;-56.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;&#039;Who has 192.168.1.1?&#039;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Sender&amp;#45;&amp;gt;Broadcast --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Sender-&gt;Broadcast&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M96.65,-38.52C104.75,-40.8 113.38,-43.22 122.09,-45.67&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;121.12,-49.03 131.69,-48.37 123.01,-42.29 121.12,-49.03&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Router --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Router&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M538.22,-58.4C538.22,-58.4 412.88,-58.4 412.88,-58.4 406.88,-58.4 400.88,-52.4 400.88,-46.4 400.88,-46.4 400.88,-12 400.88,-12 400.88,-6 406.88,0 412.88,0 412.88,0 538.22,0 538.22,0 544.22,0 550.22,-6 550.22,-12 550.22,-12 550.22,-46.4 550.22,-46.4 550.22,-52.4 544.22,-58.4 538.22,-58.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;475.55&quot; y=&quot;-41.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Router&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;475.55&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;192.168.1.1&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;475.55&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;MAC: aa:bb:cc:dd:ee:ff&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Broadcast&amp;#45;&amp;gt;Router --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Broadcast-&gt;Router&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M280.35,-58.32C314.04,-53.27 354.32,-47.23 389.43,-41.96&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;389.77,-45.45 399.14,-40.51 388.73,-38.53 389.77,-45.45&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;340.51&quot; y=&quot;-59.32&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;All devices see&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Router&amp;#45;&amp;gt;Sender --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Router-&gt;Sender&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M400.71,-26.01C364.4,-24.6 319.98,-23.1 280.13,-22.4 214.97,-21.26 198.66,-21.32 133.5,-22.4 125.35,-22.54 116.76,-22.74 108.31,-22.99&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;108.32,-19.49 98.43,-23.29 108.53,-26.48 108.32,-19.49&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;206.82&quot; y=&quot;-26.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Unicast: &#039;My MAC is ...&#039;&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Only needed for IPv4 (IPv6 uses Neighbor Discovery)&lt;/li&gt;
&lt;li&gt;ARP cache has TTL (typically 2-20 minutes)&lt;/li&gt;
&lt;li&gt;Broadcast query, unicast response&lt;/li&gt;
&lt;li&gt;Operates below IP layer (Layer 2)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../ip-address&quot; class=&quot;internal alias&quot; data-slug=&quot;ip-address&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;IP Address&lt;/a&gt; — ARP translates IP to MAC&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../socket&quot; class=&quot;internal alias&quot; data-slug=&quot;socket&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Socket&lt;/a&gt; — sockets use MAC for local delivery&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../mac-address&quot; class=&quot;internal alias&quot; data-slug=&quot;mac-address&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;MAC Address&lt;/a&gt; — what ARP resolves to&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../ethernet&quot; class=&quot;internal alias&quot; data-slug=&quot;ethernet&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Ethernet&lt;/a&gt; — ARP is used on Ethernet networks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt; — DNS is IP↔domain; ARP is MAC↔IP&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;ARP spoofing attacks can redirect traffic (man-in-the-middle)&lt;/li&gt;
&lt;li&gt;ARP cache poisoning is a common attack vector&lt;/li&gt;
&lt;li&gt;Large networks can have many ARP entries (router burden)&lt;/li&gt;
&lt;li&gt;No authentication—anyone can reply to ARP queries&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>browser-autocomplete</title>
    <link href="https://animishraa05.github.io/wiki/https/browser-autocomplete" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/browser-autocomplete.md" />
    <summary>The Problem When users type in the address bar, they want suggestions to speed up navigation.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When users type in the address bar, they want suggestions to speed up navigation. Without autocomplete, users would have to type full URLs manually every time.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Browser autocomplete suggests URLs as you type, using history, bookmarks, cookies, and popular queries. It runs locally (no network needed at this stage) and updates in real-time.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Input detected&lt;/strong&gt;: User types character in address bar&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Local search&lt;/strong&gt;: Check against:
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Browsing history&lt;/li&gt;
&lt;li&gt;Bookmarks&lt;/li&gt;
&lt;li&gt;Cookies (visited sites)&lt;/li&gt;
&lt;li&gt;Popular/common URLs&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Display&lt;/strong&gt;: Show dropdown with matching suggestions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No network&lt;/strong&gt;: This happens before any DNS/HTTP&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Modern browsers also use AI/ML for smarter suggestions.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;453pt&quot; height=&quot;66pt&quot; viewBox=&quot;0.00 0.00 453.00 66.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 62.4)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-62.4 448.68,-62.4 448.68,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Input --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Input&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M93.03,-47.2C93.03,-47.2 12,-47.2 12,-47.2 6,-47.2 0,-41.2 0,-35.2 0,-35.2 0,-23.2 0,-23.2 0,-17.2 6,-11.2 12,-11.2 12,-11.2 93.03,-11.2 93.03,-11.2 99.03,-11.2 105.03,-17.2 105.03,-23.2 105.03,-23.2 105.03,-35.2 105.03,-35.2 105.03,-41.2 99.03,-47.2 93.03,-47.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;52.52&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;User types &#039;goo&#039;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Sources --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Sources&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M311.47,-50C311.47,-50 153.03,-50 153.03,-50 147.03,-50 141.03,-44 141.03,-38 141.03,-38 141.03,-20.4 141.03,-20.4 141.03,-14.4 147.03,-8.4 153.03,-8.4 153.03,-8.4 311.47,-8.4 311.47,-8.4 317.47,-8.4 323.47,-14.4 323.47,-20.4 323.47,-20.4 323.47,-38 323.47,-38 323.47,-44 317.47,-50 311.47,-50&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;232.25&quot; y=&quot;-33.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Local Sources&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;232.25&quot; y=&quot;-16.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;History, Bookmarks, Cookies&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Input&amp;#45;&amp;gt;Sources --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Input-&gt;Sources&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M105.4,-29.2C113.08,-29.2 121.21,-29.2 129.49,-29.2&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;129.33,-32.7 139.33,-29.2 129.33,-25.7 129.33,-32.7&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Suggestions --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Suggestions&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M432.68,-58.4C432.68,-58.4 371.47,-58.4 371.47,-58.4 365.47,-58.4 359.47,-52.4 359.47,-46.4 359.47,-46.4 359.47,-12 359.47,-12 359.47,-6 365.47,0 371.47,0 371.47,0 432.68,0 432.68,0 438.68,0 444.68,-6 444.68,-12 444.68,-12 444.68,-46.4 444.68,-46.4 444.68,-52.4 438.68,-58.4 432.68,-58.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;402.08&quot; y=&quot;-41.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Suggestions&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;402.08&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;google.com&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;402.08&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;google.co.in&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Sources&amp;#45;&amp;gt;Suggestions --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Sources-&gt;Suggestions&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M323.55,-29.2C331.79,-29.2 339.95,-29.2 347.71,-29.2&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;347.62,-32.7 357.62,-29.2 347.62,-25.7 347.62,-32.7&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Runs locally—no network requests yet&lt;/li&gt;
&lt;li&gt;Uses history, bookmarks, cookies, popular queries&lt;/li&gt;
&lt;li&gt;Updates in real-time as user types&lt;/li&gt;
&lt;li&gt;Can be disabled in browser settings&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../url-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;url-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;URL Parsing&lt;/a&gt; — autocomplete works on URL input&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — happens before rendering&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../history&quot; class=&quot;internal alias&quot; data-slug=&quot;history&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser History&lt;/a&gt; — source for suggestions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt; — autocomplete is local, DNS is network&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Private/incognito mode limits autocomplete data&lt;/li&gt;
&lt;li&gt;Corrupt history database can break autocomplete&lt;/li&gt;
&lt;li&gt;Some browsers share data across devices (synced)&lt;/li&gt;
&lt;li&gt;Autocomplete can leak visited sites (privacy concern)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>browser-rendering</title>
    <link href="https://animishraa05.github.io/wiki/https/browser-rendering" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/browser-rendering.md" />
    <summary>The Problem The browser has received an HTML response from the server. Now it needs to turn that raw text into pixels on the screen.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The browser has received an HTML response from the server. Now it needs to turn that raw text into pixels on the screen. Without a rendering pipeline, the user would just see a blank page or raw HTML source.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Browser rendering is the multi-step pipeline that converts HTML, CSS, and JavaScript into visible pixels: parsing → style calculation → layout → paint → composite. Each step transforms the content into a more rendered form.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;HTML Parsing&lt;/strong&gt;: Build DOM tree from HTML&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS Parsing&lt;/strong&gt;: Build CSSOM (CSS Object Model) from stylesheets&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Render Tree&lt;/strong&gt;: Combine DOM + CSSOM (only visible elements)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Layout&lt;/strong&gt;: Calculate position and size of each element&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paint&lt;/strong&gt;: Fill in pixels for each element&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Composite&lt;/strong&gt;: Combine layers and send to GPU for display&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Modern browsers use GPU acceleration for steps 5-6.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;571pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 571.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 566.79,-94 566.79,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- HTML --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;HTML&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M43.66,-90C43.66,-90 12,-90 12,-90 6,-90 0,-84 0,-78 0,-78 0,-66 0,-66 0,-60 6,-54 12,-54 12,-54 43.66,-54 43.66,-54 49.66,-54 55.66,-60 55.66,-66 55.66,-66 55.66,-78 55.66,-78 55.66,-84 49.66,-90 43.66,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;27.83&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HTML&lt;/text&gt;
&lt;/g&gt;
&lt;!-- DOM --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;DOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M157.47,-90C157.47,-90 103.66,-90 103.66,-90 97.66,-90 91.66,-84 91.66,-78 91.66,-78 91.66,-66 91.66,-66 91.66,-60 97.66,-54 103.66,-54 103.66,-54 157.47,-54 157.47,-54 163.47,-54 169.47,-60 169.47,-66 169.47,-66 169.47,-78 169.47,-78 169.47,-84 163.47,-90 157.47,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;130.57&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;DOM Tree&lt;/text&gt;
&lt;/g&gt;
&lt;!-- HTML&amp;#45;&amp;gt;DOM --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;HTML-&gt;DOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M56.09,-72C63.46,-72 71.67,-72 79.85,-72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;79.8,-75.5 89.8,-72 79.8,-68.5 79.8,-75.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- RenderTree --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;RenderTree&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M279.04,-63C279.04,-63 217.47,-63 217.47,-63 211.47,-63 205.47,-57 205.47,-51 205.47,-51 205.47,-39 205.47,-39 205.47,-33 211.47,-27 217.47,-27 217.47,-27 279.04,-27 279.04,-27 285.04,-27 291.04,-33 291.04,-39 291.04,-39 291.04,-51 291.04,-51 291.04,-57 285.04,-63 279.04,-63&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;248.26&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Render Tree&lt;/text&gt;
&lt;/g&gt;
&lt;!-- DOM&amp;#45;&amp;gt;RenderTree --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;DOM-&gt;RenderTree&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M169.77,-63.08C177.55,-61.27 185.87,-59.33 194.07,-57.41&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;194.69,-60.86 203.63,-55.18 193.1,-54.05 194.69,-60.86&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- CSS --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CSS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M42.83,-36C42.83,-36 12.83,-36 12.83,-36 6.83,-36 0.83,-30 0.83,-24 0.83,-24 0.83,-12 0.83,-12 0.83,-6 6.83,0 12.83,0 12.83,0 42.83,0 42.83,0 48.83,0 54.83,-6 54.83,-12 54.83,-12 54.83,-24 54.83,-24 54.83,-30 48.83,-36 42.83,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;27.83&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CSS&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CSSOM --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CSSOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M150.3,-36C150.3,-36 110.83,-36 110.83,-36 104.83,-36 98.83,-30 98.83,-24 98.83,-24 98.83,-12 98.83,-12 98.83,-6 104.83,0 110.83,0 110.83,0 150.3,0 150.3,0 156.3,0 162.3,-6 162.3,-12 162.3,-12 162.3,-24 162.3,-24 162.3,-30 156.3,-36 150.3,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;130.57&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CSSOM&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CSS&amp;#45;&amp;gt;CSSOM --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CSS-&gt;CSSOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M55.3,-18C65.06,-18 76.38,-18 87.19,-18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;87.12,-21.5 97.12,-18 87.12,-14.5 87.12,-21.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- CSSOM&amp;#45;&amp;gt;RenderTree --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CSSOM-&gt;RenderTree&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M162.57,-25.24C172.31,-27.51 183.35,-30.08 194.16,-32.61&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;193.28,-36 203.82,-34.86 194.87,-29.18 193.28,-36&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Layout --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Layout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M370.7,-63C370.7,-63 339.04,-63 339.04,-63 333.04,-63 327.04,-57 327.04,-51 327.04,-51 327.04,-39 327.04,-39 327.04,-33 333.04,-27 339.04,-27 339.04,-27 370.7,-27 370.7,-27 376.7,-27 382.7,-33 382.7,-39 382.7,-39 382.7,-51 382.7,-51 382.7,-57 376.7,-63 370.7,-63&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;354.87&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Layout&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RenderTree&amp;#45;&amp;gt;Layout --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;RenderTree-&gt;Layout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M291.51,-45C299.41,-45 307.64,-45 315.43,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;315.29,-48.5 325.29,-45 315.29,-41.5 315.29,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Paint --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Paint&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M460.7,-63C460.7,-63 430.7,-63 430.7,-63 424.7,-63 418.7,-57 418.7,-51 418.7,-51 418.7,-39 418.7,-39 418.7,-33 424.7,-27 430.7,-27 430.7,-27 460.7,-27 460.7,-27 466.7,-27 472.7,-33 472.7,-39 472.7,-39 472.7,-51 472.7,-51 472.7,-57 466.7,-63 460.7,-63&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;445.7&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Paint&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Layout&amp;#45;&amp;gt;Paint --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Layout-&gt;Paint&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M383,-45C390.55,-45 398.87,-45 406.91,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;406.83,-48.5 416.83,-45 406.83,-41.5 406.83,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Screen --&gt;
&lt;g id=&quot;node8&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Screen&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M550.79,-63C550.79,-63 520.7,-63 520.7,-63 514.7,-63 508.7,-57 508.7,-51 508.7,-51 508.7,-39 508.7,-39 508.7,-33 514.7,-27 520.7,-27 520.7,-27 550.79,-27 550.79,-27 556.79,-27 562.79,-33 562.79,-39 562.79,-39 562.79,-51 562.79,-51 562.79,-57 556.79,-63 550.79,-63&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;535.74&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Screen&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Paint&amp;#45;&amp;gt;Screen --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Paint-&gt;Screen&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M473.11,-45C480.6,-45 488.9,-45 496.92,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;496.83,-48.5 506.83,-45 496.83,-41.5 496.83,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Render-blocking: CSS blocks rendering (no paint without styles)&lt;/li&gt;
&lt;li&gt;JavaScript can block HTML parsing (unless &lt;code class=&quot;notranslate&quot;&gt;async&lt;/code&gt;/&lt;code class=&quot;notranslate&quot;&gt;defer&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Layers enable GPU-accelerated compositing&lt;/li&gt;
&lt;li&gt;Reflow (layout recalculation) is expensive—avoid in loops&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../http-response&quot; class=&quot;internal alias&quot; data-slug=&quot;http-response&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Response&lt;/a&gt; — HTML response triggers rendering&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../dom-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;dom-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DOM Tree&lt;/a&gt; — first step of rendering&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../css-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;css-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSS Parsing&lt;/a&gt; — builds CSSOM&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../gpu-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;gpu-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;GPU Rendering&lt;/a&gt; — accelerates painting/compositing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../layout&quot; class=&quot;internal alias&quot; data-slug=&quot;layout&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Layout&lt;/a&gt; — calculates element positions&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;FOUC (Flash of Unstyled Content) if CSS loads slowly&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;display: none&lt;/code&gt; removes element from render tree&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;visibility: hidden&lt;/code&gt; keeps element in render tree (takes space)&lt;/li&gt;
&lt;li&gt;Forced synchronous layout (reading layout properties in JS) is slow&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>compositing</title>
    <link href="https://animishraa05.github.io/wiki/https/compositing" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/compositing.md" />
    <summary>The Problem The browser has multiple painted layers (bitmaps), but the screen shows only one image.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The browser has multiple painted layers (bitmaps), but the screen shows only one image. Without compositing, layers would overlap incorrectly or the GPU couldn’t accelerate the final display.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Compositing combines multiple painted layers into a single image for display. It’s handled by the GPU for smooth scrolling, animations, and transforms.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Layers ready&lt;/strong&gt;: Painting has created bitmap layers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GPU composites&lt;/strong&gt;: GPU takes layers and combines them in order
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Respect z-index and stacking context&lt;/li&gt;
&lt;li&gt;Apply transforms, opacity, clips&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Final output&lt;/strong&gt;: Single frame sent to display&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Modern browsers promote elements to layers for:&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;transform&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;opacity&lt;/code&gt; animations&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;position: fixed&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Video, canvas, iframe elements&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;341pt&quot; height=&quot;170pt&quot; viewBox=&quot;0.00 0.00 341.00 170.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 165.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-165.6 337.08,-165.6 337.08,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Layer1 --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Layer1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M52.58,-161.6C52.58,-161.6 13.95,-161.6 13.95,-161.6 7.95,-161.6 1.95,-155.6 1.95,-149.6 1.95,-149.6 1.95,-132 1.95,-132 1.95,-126 7.95,-120 13.95,-120 13.95,-120 52.58,-120 52.58,-120 58.58,-120 64.58,-126 64.58,-132 64.58,-132 64.58,-149.6 64.58,-149.6 64.58,-155.6 58.58,-161.6 52.58,-161.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;33.27&quot; y=&quot;-145&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Layer 1&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;33.27&quot; y=&quot;-128.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(header)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- GPU --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;GPU&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M204.16,-98.8C204.16,-98.8 114.53,-98.8 114.53,-98.8 108.53,-98.8 102.53,-92.8 102.53,-86.8 102.53,-86.8 102.53,-74.8 102.53,-74.8 102.53,-68.8 108.53,-62.8 114.53,-62.8 114.53,-62.8 204.16,-62.8 204.16,-62.8 210.16,-62.8 216.16,-68.8 216.16,-74.8 216.16,-74.8 216.16,-86.8 216.16,-86.8 216.16,-92.8 210.16,-98.8 204.16,-98.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;159.34&quot; y=&quot;-76.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;GPU Compositor&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Layer1&amp;#45;&amp;gt;GPU --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Layer1-&gt;GPU&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M64.94,-125.97C78.58,-119.37 94.97,-111.44 110.19,-104.09&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;111.64,-107.27 119.12,-99.77 108.6,-100.97 111.64,-107.27&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Layer2 --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Layer2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M54.53,-101.6C54.53,-101.6 12,-101.6 12,-101.6 6,-101.6 0,-95.6 0,-89.6 0,-89.6 0,-72 0,-72 0,-66 6,-60 12,-60 12,-60 54.53,-60 54.53,-60 60.53,-60 66.53,-66 66.53,-72 66.53,-72 66.53,-89.6 66.53,-89.6 66.53,-95.6 60.53,-101.6 54.53,-101.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;33.27&quot; y=&quot;-85&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Layer 2&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;33.27&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(content)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Layer2&amp;#45;&amp;gt;GPU --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Layer2-&gt;GPU&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M66.87,-80.8C74.37,-80.8 82.62,-80.8 91,-80.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;90.94,-84.3 100.94,-80.8 90.94,-77.3 90.94,-84.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Layer3 --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Layer3&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M54.14,-41.6C54.14,-41.6 12.39,-41.6 12.39,-41.6 6.39,-41.6 0.39,-35.6 0.39,-29.6 0.39,-29.6 0.39,-12 0.39,-12 0.39,-6 6.39,0 12.39,0 12.39,0 54.14,0 54.14,0 60.14,0 66.14,-6 66.14,-12 66.14,-12 66.14,-29.6 66.14,-29.6 66.14,-35.6 60.14,-41.6 54.14,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;33.27&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Layer 3&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;33.27&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(sidebar)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Layer3&amp;#45;&amp;gt;GPU --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Layer3-&gt;GPU&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M66.54,-36.41C79.96,-42.9 95.81,-50.56 110.54,-57.68&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;108.61,-60.64 119.14,-61.84 111.66,-54.34 108.61,-60.64&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Screen --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Screen&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M321.08,-101.6C321.08,-101.6 264.16,-101.6 264.16,-101.6 258.16,-101.6 252.16,-95.6 252.16,-89.6 252.16,-89.6 252.16,-72 252.16,-72 252.16,-66 258.16,-60 264.16,-60 264.16,-60 321.08,-60 321.08,-60 327.08,-60 333.08,-66 333.08,-72 333.08,-72 333.08,-89.6 333.08,-89.6 333.08,-95.6 327.08,-101.6 321.08,-101.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;292.62&quot; y=&quot;-85&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Screen&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;292.62&quot; y=&quot;-68.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Final frame&lt;/text&gt;
&lt;/g&gt;
&lt;!-- GPU&amp;#45;&amp;gt;Screen --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;GPU-&gt;Screen&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M216.4,-80.8C224.45,-80.8 232.7,-80.8 240.65,-80.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;240.5,-84.3 250.5,-80.8 240.5,-77.3 240.5,-84.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;GPU-accelerated (fast, off-main-thread)&lt;/li&gt;
&lt;li&gt;Layers created for specific CSS properties&lt;/li&gt;
&lt;li&gt;Order matters: z-index, stacking context&lt;/li&gt;
&lt;li&gt;Enables smooth scrolling/animations without repainting&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../painting&quot; class=&quot;internal alias&quot; data-slug=&quot;painting&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Painting&lt;/a&gt; — painted layers are composited&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../gpu-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;gpu-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;GPU Rendering&lt;/a&gt; — compositing uses GPU&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — compositing is step 7&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../css-layers&quot; class=&quot;internal alias&quot; data-slug=&quot;css-layers&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSS Layers&lt;/a&gt; — promote elements to layers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Too many layers = memory overhead&lt;/li&gt;
&lt;li&gt;Layer promotion with &lt;code class=&quot;notranslate&quot;&gt;will-change&lt;/code&gt; can backfire&lt;/li&gt;
&lt;li&gt;Compositing doesn’t fix slow JavaScript&lt;/li&gt;
&lt;li&gt;Not all CSS properties trigger compositing&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>css-parsing</title>
    <link href="https://animishraa05.github.io/wiki/https/css-parsing" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/css-parsing.md" />
    <summary>The Problem The browser receives CSS as text (from stylesheets, &amp;lt;style&amp;gt; tags, inline styles).</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The browser receives CSS as text (from stylesheets, &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;style&gt;&lt;/code&gt; tags, inline styles). To apply styles, the browser needs a structured representation of all CSS rules. Raw text isn’t programmable.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;CSS parsing converts CSS text into the CSSOM (CSS Object Model)—a tree of style rules. This is used later to compute styles for each DOM element during render tree construction.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Tokenization&lt;/strong&gt;: Break CSS text into tokens (&lt;code class=&quot;notranslate&quot;&gt;selector&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;{&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;property&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;value&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;}&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parse rules&lt;/strong&gt;: Build CSSOM tree with selectors and declarations
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;body { color: red; }
↓
CSSOM: selector=body, declarations=[color: red]
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Style calculation&lt;/strong&gt;: Later, match CSSOM rules to DOM elements&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;CSS parsing can block rendering—browser won’t paint until CSSOM is ready.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;187pt&quot; height=&quot;199pt&quot; viewBox=&quot;0.00 0.00 187.00 199.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 195.2)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-195.2 183.06,-195.2 183.06,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- CSS --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CSS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M112.56,-191.2C112.56,-191.2 66.5,-191.2 66.5,-191.2 60.5,-191.2 54.5,-185.2 54.5,-179.2 54.5,-179.2 54.5,-167.2 54.5,-167.2 54.5,-161.2 60.5,-155.2 66.5,-155.2 66.5,-155.2 112.56,-155.2 112.56,-155.2 118.56,-155.2 124.56,-161.2 124.56,-167.2 124.56,-167.2 124.56,-179.2 124.56,-179.2 124.56,-185.2 118.56,-191.2 112.56,-191.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;89.53&quot; y=&quot;-169&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CSS Text&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CSSOM --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CSSOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M133.01,-119.2C133.01,-119.2 46.05,-119.2 46.05,-119.2 40.05,-119.2 34.05,-113.2 34.05,-107.2 34.05,-107.2 34.05,-89.6 34.05,-89.6 34.05,-83.6 40.05,-77.6 46.05,-77.6 46.05,-77.6 133.01,-77.6 133.01,-77.6 139.01,-77.6 145.01,-83.6 145.01,-89.6 145.01,-89.6 145.01,-107.2 145.01,-107.2 145.01,-113.2 139.01,-119.2 133.01,-119.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;89.53&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CSSOM Tree&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;89.53&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(selector + rules)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CSS&amp;#45;&amp;gt;CSSOM --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CSS-&gt;CSSOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M89.53,-154.95C89.53,-147.75 89.53,-139.15 89.53,-130.89&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;93.03,-131.14 89.53,-121.14 86.03,-131.14 93.03,-131.14&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- RenderTree --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;RenderTree&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M167.06,-41.6C167.06,-41.6 12,-41.6 12,-41.6 6,-41.6 0,-35.6 0,-29.6 0,-29.6 0,-12 0,-12 0,-6 6,0 12,0 12,0 167.06,0 167.06,0 173.06,0 179.06,-6 179.06,-12 179.06,-12 179.06,-29.6 179.06,-29.6 179.06,-35.6 173.06,-41.6 167.06,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;89.53&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Render Tree&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;89.53&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(DOM + CSSOM combined)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CSSOM&amp;#45;&amp;gt;RenderTree --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CSSOM-&gt;RenderTree&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M89.53,-77.14C89.53,-69.79 89.53,-61.31 89.53,-53.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;93.03,-53.37 89.53,-43.37 86.03,-53.37 93.03,-53.37&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;CSSOM is separate from DOM (different trees)&lt;/li&gt;
&lt;li&gt;CSS parsing blocks rendering (need styles before paint)&lt;/li&gt;
&lt;li&gt;Media queries are evaluated during CSSOM construction&lt;/li&gt;
&lt;li&gt;Errors in CSS are silently ignored (lenient parsing)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../render-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;render-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Render Tree&lt;/a&gt; — CSSOM combines with DOM&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dom-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;dom-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DOM Tree&lt;/a&gt; — CSSOM is the CSS counterpart&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — CSS parsing is step 2&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../cssom&quot; class=&quot;internal alias&quot; data-slug=&quot;cssom&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSSOM&lt;/a&gt; — the output of CSS parsing&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;CSS at top of page (best practice)—blocks rendering until parsed&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;@import&lt;/code&gt; causes additional network requests (slow)&lt;/li&gt;
&lt;li&gt;Invalid CSS silently fails (no error thrown)&lt;/li&gt;
&lt;li&gt;Large stylesheets = slow CSSOM construction&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>cssom</title>
    <link href="https://animishraa05.github.io/wiki/https/cssom" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/cssom.md" />
    <summary>The Problem CSS is received as text, but the browser needs a structured representation to compute styles for each DOM element.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;CSS is received as text, but the browser needs a structured representation to compute styles for each DOM element. Raw CSS text can’t be queried programmatically.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;CSSOM (CSS Object Model) is the tree structure created by parsing CSS. It contains all style rules and is used to compute styles for each DOM element during render tree construction.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;CSS Received&lt;/strong&gt;: From stylesheets, &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;style&gt;&lt;/code&gt; tags, inline styles&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parse&lt;/strong&gt;: Convert to CSSOM tree
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;body { color: red; }
↓
CSSOM: selector=body, declarations=[color: red]
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Style computation&lt;/strong&gt;: For each DOM element, find matching CSSOM rules&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cascading&lt;/strong&gt;: Apply specificity, inheritance, &lt;code class=&quot;notranslate&quot;&gt;!important&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;126pt&quot; height=&quot;199pt&quot; viewBox=&quot;0.00 0.00 126.00 199.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 195.2)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-195.2 121.86,-195.2 121.86,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- CSS --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CSS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M81.96,-191.2C81.96,-191.2 35.9,-191.2 35.9,-191.2 29.9,-191.2 23.9,-185.2 23.9,-179.2 23.9,-179.2 23.9,-167.2 23.9,-167.2 23.9,-161.2 29.9,-155.2 35.9,-155.2 35.9,-155.2 81.96,-155.2 81.96,-155.2 87.96,-155.2 93.96,-161.2 93.96,-167.2 93.96,-167.2 93.96,-179.2 93.96,-179.2 93.96,-185.2 87.96,-191.2 81.96,-191.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;58.93&quot; y=&quot;-169&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CSS Text&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CSSOM --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CSSOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M102.41,-119.2C102.41,-119.2 15.45,-119.2 15.45,-119.2 9.45,-119.2 3.45,-113.2 3.45,-107.2 3.45,-107.2 3.45,-89.6 3.45,-89.6 3.45,-83.6 9.45,-77.6 15.45,-77.6 15.45,-77.6 102.41,-77.6 102.41,-77.6 108.41,-77.6 114.41,-83.6 114.41,-89.6 114.41,-89.6 114.41,-107.2 114.41,-107.2 114.41,-113.2 108.41,-119.2 102.41,-119.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;58.93&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CSSOM Tree&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;58.93&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(selector + rules)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CSS&amp;#45;&amp;gt;CSSOM --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CSS-&gt;CSSOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M58.93,-154.95C58.93,-147.75 58.93,-139.15 58.93,-130.89&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;62.43,-131.14 58.93,-121.14 55.43,-131.14 62.43,-131.14&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Computed --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Computed&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M105.86,-41.6C105.86,-41.6 12,-41.6 12,-41.6 6,-41.6 0,-35.6 0,-29.6 0,-29.6 0,-12 0,-12 0,-6 6,0 12,0 12,0 105.86,0 105.86,0 111.86,0 117.86,-6 117.86,-12 117.86,-12 117.86,-29.6 117.86,-29.6 117.86,-35.6 111.86,-41.6 105.86,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;58.93&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Computed Styles&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;58.93&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;per DOM element&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CSSOM&amp;#45;&amp;gt;Computed --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CSSOM-&gt;Computed&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M58.93,-77.14C58.93,-69.79 58.93,-61.31 58.93,-53.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;62.43,-53.37 58.93,-43.37 55.43,-53.37 62.43,-53.37&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;CSSOM is separate from DOM (different trees)&lt;/li&gt;
&lt;li&gt;JavaScript can manipulate CSSOM via &lt;code class=&quot;notranslate&quot;&gt;document.styleSheets&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;CSS parsing blocks rendering (need styles before paint)&lt;/li&gt;
&lt;li&gt;Media queries evaluated during CSSOM construction&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../css-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;css-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSS Parsing&lt;/a&gt; — CSSOM is the output&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../render-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;render-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Render Tree&lt;/a&gt; — CSSOM + DOM = render tree&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dom-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;dom-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DOM Tree&lt;/a&gt; — CSSOM styles are applied to DOM&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — CSSOM is step 2&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;document.write()&lt;/code&gt; in old browsers could break CSSOM&lt;/li&gt;
&lt;li&gt;Large stylesheets = slow CSSOM construction&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;@import&lt;/code&gt; causes additional network requests&lt;/li&gt;
&lt;li&gt;CSSOM errors are silently ignored&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>dns-authoritative-server</title>
    <link href="https://animishraa05.github.io/wiki/https/dns-authoritative-server" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/dns-authoritative-server.md" />
    <summary>The Problem After navigating root and TLD servers, you still don’t have the IP address.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="dns" label="dns" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;After navigating root and TLD servers, you still don’t have the IP address. Someone needs to hold the actual DNS records (A, AAAA, CNAME, etc.) for each domain—that’s the authoritative server.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The authoritative server is the final authority for a domain—it holds the actual DNS records (A, AAAA, MX, etc.) and returns the real IP address. This is the server operated by the domain owner or their DNS provider.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Query from Resolver&lt;/strong&gt;: “What is the IP for google.com?”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lookup&lt;/strong&gt;: Authoritative server checks its zone file&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Response&lt;/strong&gt;: Returns the A record (IPv4) or AAAA record (IPv6)
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Example: “google.com = 142.250.183.46”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Done&lt;/strong&gt;: Resolver caches and returns IP to client&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;The domain owner configures records on their authoritative server (or via DNS provider like Cloudflare, AWS Route53).&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;697pt&quot; height=&quot;66pt&quot; viewBox=&quot;0.00 0.00 697.00 66.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 62.4)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-62.4 693.22,-62.4 693.22,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Resolver --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M113.25,-47.2C113.25,-47.2 12,-47.2 12,-47.2 6,-47.2 0,-41.2 0,-35.2 0,-35.2 0,-23.2 0,-23.2 0,-17.2 6,-11.2 12,-11.2 12,-11.2 113.25,-11.2 113.25,-11.2 119.25,-11.2 125.25,-17.2 125.25,-23.2 125.25,-23.2 125.25,-35.2 125.25,-35.2 125.25,-41.2 119.25,-47.2 113.25,-47.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;62.62&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Recursive Resolver&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Auth --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Auth&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M387.62,-50C387.62,-50 280.94,-50 280.94,-50 274.94,-50 268.94,-44 268.94,-38 268.94,-38 268.94,-20.4 268.94,-20.4 268.94,-14.4 274.94,-8.4 280.94,-8.4 280.94,-8.4 387.62,-8.4 387.62,-8.4 393.62,-8.4 399.62,-14.4 399.62,-20.4 399.62,-20.4 399.62,-38 399.62,-38 399.62,-44 393.62,-50 387.62,-50&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;334.28&quot; y=&quot;-33.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Authoritative Server&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;334.28&quot; y=&quot;-16.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(google.com)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver&amp;#45;&amp;gt;Auth --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Resolver-&gt;Auth&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M125.49,-29.2C164.72,-29.2 215.74,-29.2 257.4,-29.2&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;257.38,-32.7 267.38,-29.2 257.38,-25.7 257.38,-32.7&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;197.09&quot; y=&quot;-33.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;IP for google.com?&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Auth&amp;#45;&amp;gt;Resolver --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Auth-&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M268.84,-11.32C262.83,-10.14 256.79,-9.13 250.94,-8.4 203.44,-2.49 190.72,-2.3 143.25,-8.4 141.07,-8.68 138.86,-9 136.64,-9.36&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;136.17,-5.89 126.97,-11.14 137.43,-12.77 136.17,-5.89&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;197.09&quot; y=&quot;-12.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;142.250.183.46&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Records --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Records&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M677.22,-58.4C677.22,-58.4 486.51,-58.4 486.51,-58.4 480.51,-58.4 474.51,-52.4 474.51,-46.4 474.51,-46.4 474.51,-12 474.51,-12 474.51,-6 480.51,0 486.51,0 486.51,0 677.22,0 677.22,0 683.22,0 689.22,-6 689.22,-12 689.22,-12 689.22,-46.4 689.22,-46.4 689.22,-52.4 683.22,-58.4 677.22,-58.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;581.87&quot; y=&quot;-41.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Zone File&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;581.87&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;A: 142.250.183.46&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;581.87&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;AAAA: 2404:6800:4007:80e::200e&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Auth&amp;#45;&amp;gt;Records --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Auth-&gt;Records&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M399.81,-29.2C419.17,-29.2 441.05,-29.2 462.74,-29.2&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;462.53,-32.7 472.53,-29.2 462.53,-25.7 462.53,-32.7&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;437.07&quot; y=&quot;-33.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;lookup&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Records&amp;#45;&amp;gt;Auth --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Records-&gt;Auth&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M474.19,-7.88C455.35,-6.32 435.91,-6.13 417.62,-8.4 415.43,-8.67 413.21,-8.99 410.97,-9.33&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;410.45,-5.87 401.21,-11.06 411.67,-12.76 410.45,-5.87&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;437.07&quot; y=&quot;-12.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;found&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Holds actual DNS records (A, AAAA, CNAME, MX, TXT, etc.)&lt;/li&gt;
&lt;li&gt;Domain owners configure records via their DNS provider&lt;/li&gt;
&lt;li&gt;Responds authoritatively—no further lookup needed&lt;/li&gt;
&lt;li&gt;Can be primary (master) or secondary (slave) for redundancy&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../dns-tld-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-tld-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS TLD Server&lt;/a&gt; — TLD points to authoritative server&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt; — authoritative gives the final answer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-records&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-records&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Records&lt;/a&gt; — authoritative servers store these&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-zone&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-zone&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Zone&lt;/a&gt; — the configuration file holding records&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Misconfigured records cause site outages&lt;/li&gt;
&lt;li&gt;TTL affects how long resolvers cache the answer&lt;/li&gt;
&lt;li&gt;Secondary servers sync from primary (zone transfer)&lt;/li&gt;
&lt;li&gt;Anycast used by large providers for global coverage&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>dns-cache</title>
    <link href="https://animishraa05.github.io/wiki/https/dns-cache" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/dns-cache.md" />
    <summary>The Problem DNS lookups are slow when they have to traverse the full hierarchy (root → TLD → authoritative).</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="dns" label="dns" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;DNS lookups are slow when they have to traverse the full hierarchy (root → TLD → authoritative). Without caching, every page visit would require this full lookup, adding significant latency to every connection.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;DNS caching stores resolved domain-to-IP mappings at multiple levels (browser, OS, router, ISP) so that subsequent requests for the same domain don’t need to repeat the full lookup process.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Each level maintains a cache with TTL-based expiry:&lt;/p&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Browser Cache&lt;/strong&gt;: Chrome/Firefox cache DNS for minutes to hours&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OS Cache&lt;/strong&gt;: Windows/Linux/macOS cache via DNS client service&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Router Cache&lt;/strong&gt;: Home/office routers cache for the local network&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ISP Cache&lt;/strong&gt;: ISP recursive resolvers cache for many users&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;When a request comes in:&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Check each cache in order&lt;/li&gt;
&lt;li&gt;If found (cache hit), return the IP immediately&lt;/li&gt;
&lt;li&gt;If not found (cache miss), continue to next level&lt;/li&gt;
&lt;li&gt;TTL (Time To Live) determines how long entries remain valid&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;910pt&quot; height=&quot;112pt&quot; viewBox=&quot;0.00 0.00 910.00 112.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 107.8)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-107.8 906.27,-107.8 906.27,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Query --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Query&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M112.08,-44C112.08,-44 12,-44 12,-44 6,-44 0,-38 0,-32 0,-32 0,-20 0,-20 0,-14 6,-8 12,-8 12,-8 112.08,-8 112.08,-8 118.08,-8 124.08,-14 124.08,-20 124.08,-20 124.08,-32 124.08,-32 124.08,-38 118.08,-44 112.08,-44&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;62.04&quot; y=&quot;-21.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Query: google.com&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Browser --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M251,-46.8C251,-46.8 173.08,-46.8 173.08,-46.8 167.08,-46.8 161.08,-40.8 161.08,-34.8 161.08,-34.8 161.08,-17.2 161.08,-17.2 161.08,-11.2 167.08,-5.2 173.08,-5.2 173.08,-5.2 251,-5.2 251,-5.2 257,-5.2 263,-11.2 263,-17.2 263,-17.2 263,-34.8 263,-34.8 263,-40.8 257,-46.8 251,-46.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;212.04&quot; y=&quot;-30.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Browser Cache&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;212.04&quot; y=&quot;-13.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TTL: 5 min&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Query&amp;#45;&amp;gt;Browser --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Query-&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M124.52,-26C132.73,-26 141.14,-26 149.35,-26&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;149.26,-29.5 159.26,-26 149.26,-22.5 149.26,-29.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- OS --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;OS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M397.88,-86.8C397.88,-86.8 336.67,-86.8 336.67,-86.8 330.67,-86.8 324.67,-80.8 324.67,-74.8 324.67,-74.8 324.67,-57.2 324.67,-57.2 324.67,-51.2 330.67,-45.2 336.67,-45.2 336.67,-45.2 397.88,-45.2 397.88,-45.2 403.88,-45.2 409.88,-51.2 409.88,-57.2 409.88,-57.2 409.88,-74.8 409.88,-74.8 409.88,-80.8 403.88,-86.8 397.88,-86.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;367.28&quot; y=&quot;-70.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;OS Cache&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;367.28&quot; y=&quot;-53.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TTL: 1 hour&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Browser&amp;#45;&amp;gt;OS --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Browser-&gt;OS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M263.22,-39.1C279.24,-43.28 297.03,-47.92 313.25,-52.16&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;312.17,-55.49 322.73,-54.63 313.94,-48.72 312.17,-55.49&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;293.83&quot; y=&quot;-53.78&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;miss&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Result --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Result&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M532.85,-36C532.85,-36 502.85,-36 502.85,-36 496.85,-36 490.85,-30 490.85,-24 490.85,-24 490.85,-12 490.85,-12 490.85,-6 496.85,0 502.85,0 502.85,0 532.85,0 532.85,0 538.85,0 544.85,-6 544.85,-12 544.85,-12 544.85,-24 544.85,-24 544.85,-30 538.85,-36 532.85,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;517.85&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Result&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Browser&amp;#45;&amp;gt;Result --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Browser-&gt;Result&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M263.3,-22.35C282.5,-21.11 304.59,-19.87 324.67,-19.2 378.2,-17.4 440.15,-17.39 478.92,-17.63&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;478.88,-21.13 488.9,-17.7 478.93,-14.13 478.88,-21.13&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;367.28&quot; y=&quot;-23.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;hit&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Router --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Router&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M552.14,-103.8C552.14,-103.8 483.56,-103.8 483.56,-103.8 477.56,-103.8 471.56,-97.8 471.56,-91.8 471.56,-91.8 471.56,-74.2 471.56,-74.2 471.56,-68.2 477.56,-62.2 483.56,-62.2 483.56,-62.2 552.14,-62.2 552.14,-62.2 558.14,-62.2 564.14,-68.2 564.14,-74.2 564.14,-74.2 564.14,-91.8 564.14,-91.8 564.14,-97.8 558.14,-103.8 552.14,-103.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;517.85&quot; y=&quot;-87.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Router Cache&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;517.85&quot; y=&quot;-70.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TTL: 1 hour&lt;/text&gt;
&lt;/g&gt;
&lt;!-- OS&amp;#45;&amp;gt;Router --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;OS-&gt;Router&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M410.06,-70.78C425.54,-72.55 443.37,-74.59 459.96,-76.49&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;459.38,-79.95 469.71,-77.61 460.17,-72.99 459.38,-79.95&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;440.72&quot; y=&quot;-79.72&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;miss&lt;/text&gt;
&lt;/g&gt;
&lt;!-- OS&amp;#45;&amp;gt;Result --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;OS-&gt;Result&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M410.06,-52.5C432.03,-45.4 458.72,-36.78 479.93,-29.93&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;480.89,-33.3 489.33,-26.89 478.74,-26.63 480.89,-33.3&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;440.72&quot; y=&quot;-50.5&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;hit&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ISP --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ISP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M711.47,-103.8C711.47,-103.8 637.81,-103.8 637.81,-103.8 631.81,-103.8 625.81,-97.8 625.81,-91.8 625.81,-91.8 625.81,-74.2 625.81,-74.2 625.81,-68.2 631.81,-62.2 637.81,-62.2 637.81,-62.2 711.47,-62.2 711.47,-62.2 717.47,-62.2 723.47,-68.2 723.47,-74.2 723.47,-74.2 723.47,-91.8 723.47,-91.8 723.47,-97.8 717.47,-103.8 711.47,-103.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;674.64&quot; y=&quot;-87.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ISP Cache&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;674.64&quot; y=&quot;-70.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TTL: 24 hours&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Router&amp;#45;&amp;gt;ISP --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Router-&gt;ISP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M564.45,-83C580.03,-83 597.69,-83 614.2,-83&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;613.89,-86.5 623.89,-83 613.89,-79.5 613.89,-86.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;594.98&quot; y=&quot;-87.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;miss&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Miss --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Miss&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M890.27,-101C890.27,-101 797.15,-101 797.15,-101 791.15,-101 785.15,-95 785.15,-89 785.15,-89 785.15,-77 785.15,-77 785.15,-71 791.15,-65 797.15,-65 797.15,-65 890.27,-65 890.27,-65 896.27,-65 902.27,-71 902.27,-77 902.27,-77 902.27,-89 902.27,-89 902.27,-95 896.27,-101 890.27,-101&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;843.71&quot; y=&quot;-78.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Full DNS Lookup&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ISP&amp;#45;&amp;gt;Miss --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;ISP-&gt;Miss&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M723.96,-83C739.39,-83 756.78,-83 773.39,-83&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;773.22,-86.5 783.22,-83 773.22,-79.5 773.22,-86.5&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;754.31&quot; y=&quot;-87.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;miss&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;TTL (Time To Live) controls cache duration in seconds&lt;/li&gt;
&lt;li&gt;Each level can serve the cached result to speed up lookup&lt;/li&gt;
&lt;li&gt;Clearing cache forces a fresh lookup (useful for debugging)&lt;/li&gt;
&lt;li&gt;Cache poisoning is a security risk—false entries redirect traffic&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt; — caching is part of the lookup process&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../recursive-dns&quot; class=&quot;internal alias&quot; data-slug=&quot;recursive-dns&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Recursive DNS&lt;/a&gt; — fallback when caches miss&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-hierarchy&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-hierarchy&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Hierarchy&lt;/a&gt; — caches store results from hierarchical queries&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt; — lookup is the full process; cache is just one optimization&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Stale cache entries point to old/incorrect IPs after server changes&lt;/li&gt;
&lt;li&gt;TTL too long = slow propagation of DNS changes&lt;/li&gt;
&lt;li&gt;TTL too short = unnecessary load on DNS servers&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;ipconfig /flushdns&lt;/code&gt; clears Windows DNS cache&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>dns-hierarchy</title>
    <link href="https://animishraa05.github.io/wiki/https/dns-hierarchy" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/dns-hierarchy.md" />
    <summary>The Problem With millions of domains, a single DNS server cannot store all domain-to-IP mappings.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="dns" label="dns" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;With millions of domains, a single DNS server cannot store all domain-to-IP mappings. Without a hierarchical structure, DNS would be a bottleneck and single point of failure for the entire internet.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;DNS uses a hierarchical distributed database structured like a tree: Root servers → TLD servers → Authoritative servers. Each level is responsible for a portion of the namespace, making the system scalable and fault-tolerant.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The DNS hierarchy has four levels:&lt;/p&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Root Servers&lt;/strong&gt; (13 logical servers globally): Know locations of TLD servers&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Answer: “Where is .com server?”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;TLD Servers&lt;/strong&gt; (Top-Level Domain): Manage domains under a TLD (.com, .org, .net)&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Answer: “Where is google.com server?”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Authoritative Servers&lt;/strong&gt;: Know the actual IP for a specific domain&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Answer: “google.com = 142.250.xx.xx”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Recursive Resolvers&lt;/strong&gt; (ISP): Do the work of querying down the hierarchy&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;210pt&quot; height=&quot;205pt&quot; viewBox=&quot;0.00 0.00 210.00 205.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 200.8)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-200.8 206.01,-200.8 206.01,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Root --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Root&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M144.7,-196.8C144.7,-196.8 53.95,-196.8 53.95,-196.8 47.95,-196.8 41.95,-190.8 41.95,-184.8 41.95,-184.8 41.95,-167.2 41.95,-167.2 41.95,-161.2 47.95,-155.2 53.95,-155.2 53.95,-155.2 144.7,-155.2 144.7,-155.2 150.7,-155.2 156.7,-161.2 156.7,-167.2 156.7,-167.2 156.7,-184.8 156.7,-184.8 156.7,-190.8 150.7,-196.8 144.7,-196.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;99.32&quot; y=&quot;-180.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Root Servers&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;99.32&quot; y=&quot;-163.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;13 logical servers&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLD_Com --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TLD_Com&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M76.95,-119.2C76.95,-119.2 17.7,-119.2 17.7,-119.2 11.7,-119.2 5.7,-113.2 5.7,-107.2 5.7,-107.2 5.7,-89.6 5.7,-89.6 5.7,-83.6 11.7,-77.6 17.7,-77.6 17.7,-77.6 76.95,-77.6 76.95,-77.6 82.95,-77.6 88.95,-83.6 88.95,-89.6 88.95,-89.6 88.95,-107.2 88.95,-107.2 88.95,-113.2 82.95,-119.2 76.95,-119.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;47.32&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TLD Server&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;47.32&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;.com&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Root&amp;#45;&amp;gt;TLD_Com --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Root-&gt;TLD_Com&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M85.39,-154.74C79.92,-146.8 73.55,-137.52 67.59,-128.86&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;70.53,-126.96 61.98,-120.7 64.76,-130.92 70.53,-126.96&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- TLD_Org --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TLD_Org&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M181.95,-119.2C181.95,-119.2 122.7,-119.2 122.7,-119.2 116.7,-119.2 110.7,-113.2 110.7,-107.2 110.7,-107.2 110.7,-89.6 110.7,-89.6 110.7,-83.6 116.7,-77.6 122.7,-77.6 122.7,-77.6 181.95,-77.6 181.95,-77.6 187.95,-77.6 193.95,-83.6 193.95,-89.6 193.95,-89.6 193.95,-107.2 193.95,-107.2 193.95,-113.2 187.95,-119.2 181.95,-119.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;152.32&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TLD Server&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;152.32&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;.org&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Root&amp;#45;&amp;gt;TLD_Org --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Root-&gt;TLD_Org&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M113.53,-154.74C119.1,-146.8 125.6,-137.52 131.67,-128.86&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;134.52,-130.89 137.4,-120.69 128.79,-126.87 134.52,-130.89&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Auth_Google --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Auth_Google&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M78.65,-41.6C78.65,-41.6 12,-41.6 12,-41.6 6,-41.6 0,-35.6 0,-29.6 0,-29.6 0,-12 0,-12 0,-6 6,0 12,0 12,0 78.65,0 78.65,0 84.65,0 90.65,-6 90.65,-12 90.65,-12 90.65,-29.6 90.65,-29.6 90.65,-35.6 84.65,-41.6 78.65,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;45.32&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Authoritative&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;45.32&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;google.com&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLD_Com&amp;#45;&amp;gt;Auth_Google --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TLD_Com-&gt;Auth_Google&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M46.79,-77.14C46.59,-69.79 46.37,-61.31 46.16,-53.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;49.66,-53.27 45.89,-43.37 42.66,-53.46 49.66,-53.27&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Auth_Wiki --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Auth_Wiki&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M190.01,-41.6C190.01,-41.6 120.64,-41.6 120.64,-41.6 114.64,-41.6 108.64,-35.6 108.64,-29.6 108.64,-29.6 108.64,-12 108.64,-12 108.64,-6 114.64,0 120.64,0 120.64,0 190.01,0 190.01,0 196.01,0 202.01,-6 202.01,-12 202.01,-12 202.01,-29.6 202.01,-29.6 202.01,-35.6 196.01,-41.6 190.01,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;155.32&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Authoritative&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;155.32&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;wikipedia.org&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLD_Org&amp;#45;&amp;gt;Auth_Wiki --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TLD_Org-&gt;Auth_Wiki&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M153.13,-77.14C153.42,-69.79 153.76,-61.31 154.08,-53.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;157.57,-53.5 154.47,-43.37 150.57,-53.22 157.57,-53.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Root servers are anycast (same IP, multiple physical locations)&lt;/li&gt;
&lt;li&gt;TLD servers handle specific top-level domains&lt;/li&gt;
&lt;li&gt;Authoritative servers are authoritative for specific domains&lt;/li&gt;
&lt;li&gt;Distributed design prevents single point of failure&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../recursive-dns&quot; class=&quot;internal alias&quot; data-slug=&quot;recursive-dns&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Recursive DNS&lt;/a&gt; — recursive resolvers navigate the hierarchy&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-root-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-root-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Root Server&lt;/a&gt; — the top level of the hierarchy&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-tld-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-tld-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS TLD Server&lt;/a&gt; — intermediate level for each TLD&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-authoritative-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-authoritative-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Authoritative Server&lt;/a&gt; — bottom level with actual records&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt; — hierarchy is queried during DNS resolution&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Root server compromise would be catastrophic (but heavily protected)&lt;/li&gt;
&lt;li&gt;Some countries operate their own root servers (not part of ICANN)&lt;/li&gt;
&lt;li&gt;DNS hijacking can redirect at any hierarchy level&lt;/li&gt;
&lt;li&gt;Anycast allows multiple servers to share the same IP address&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>dns-lookup</title>
    <link href="https://animishraa05.github.io/wiki/https/dns-lookup" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/dns-lookup.md" />
    <summary>The Problem Humans remember domain names like google.com, but computers need IP addresses like 142.250.183.46 to route packets.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="dns" label="dns" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Humans remember domain names like &lt;code class=&quot;notranslate&quot;&gt;google.com&lt;/code&gt;, but computers need IP addresses like &lt;code class=&quot;notranslate&quot;&gt;142.250.183.46&lt;/code&gt; to route packets. Without DNS lookup, every website visit would require knowing its numeric IP address.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;DNS lookup is the process of translating a human-readable domain name into a machine-readable IP address. It checks multiple caches and queries a hierarchical chain of DNS servers to find the IP.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The lookup follows this priority order:&lt;/p&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Browser Cache&lt;/strong&gt;: Recently visited domains are cached by the browser&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OS Cache&lt;/strong&gt;: Operating system maintains its own DNS cache&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hosts File&lt;/strong&gt;: Manual mappings (e.g., &lt;code class=&quot;notranslate&quot;&gt;127.0.0.1 localhost&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Router Cache&lt;/strong&gt;: Home/office router may cache DNS responses&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ISP DNS Server&lt;/strong&gt;: Internet provider’s recursive resolver&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Recursive Resolution&lt;/strong&gt; (if not cached):
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Root server: “Where is .com server?”&lt;/li&gt;
&lt;li&gt;TLD server: “Where is google.com server?”&lt;/li&gt;
&lt;li&gt;Authoritative server: “Here is the IP”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;262pt&quot; height=&quot;780pt&quot; viewBox=&quot;0.00 0.00 262.00 780.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 776)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-776 258.42,-776 258.42,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Start --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Start&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M242.42,-772C242.42,-772 102.27,-772 102.27,-772 96.27,-772 90.27,-766 90.27,-760 90.27,-760 90.27,-748 90.27,-748 90.27,-742 96.27,-736 102.27,-736 102.27,-736 242.42,-736 242.42,-736 248.42,-736 254.42,-742 254.42,-748 254.42,-748 254.42,-760 254.42,-760 254.42,-766 248.42,-772 242.42,-772&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;172.34&quot; y=&quot;-749.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;DNS Lookup: google.com&lt;/text&gt;
&lt;/g&gt;
&lt;!-- BrowserCache --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;BrowserCache&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M211.3,-699C211.3,-699 133.39,-699 133.39,-699 127.39,-699 121.39,-693 121.39,-687 121.39,-687 121.39,-675 121.39,-675 121.39,-669 127.39,-663 133.39,-663 133.39,-663 211.3,-663 211.3,-663 217.3,-663 223.3,-669 223.3,-675 223.3,-675 223.3,-687 223.3,-687 223.3,-693 217.3,-699 211.3,-699&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;172.34&quot; y=&quot;-676.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Browser Cache&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Start&amp;#45;&amp;gt;BrowserCache --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Start-&gt;BrowserCache&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M172.34,-735.81C172.34,-728.23 172.34,-719.1 172.34,-710.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;175.84,-710.54 172.34,-700.54 168.84,-710.54 175.84,-710.54&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- OSCache --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;OSCache&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M164.53,-610.2C164.53,-610.2 116.16,-610.2 116.16,-610.2 110.16,-610.2 104.16,-604.2 104.16,-598.2 104.16,-598.2 104.16,-586.2 104.16,-586.2 104.16,-580.2 110.16,-574.2 116.16,-574.2 116.16,-574.2 164.53,-574.2 164.53,-574.2 170.53,-574.2 176.53,-580.2 176.53,-586.2 176.53,-586.2 176.53,-598.2 176.53,-598.2 176.53,-604.2 170.53,-610.2 164.53,-610.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;140.34&quot; y=&quot;-588&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;OS Cache&lt;/text&gt;
&lt;/g&gt;
&lt;!-- BrowserCache&amp;#45;&amp;gt;OSCache --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;BrowserCache-&gt;OSCache&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M166.02,-662.85C161.67,-651.04 155.78,-635.07 150.74,-621.41&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;154.03,-620.2 147.29,-612.03 147.46,-622.62 154.03,-620.2&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;172.05&quot; y=&quot;-632.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;miss&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Result --&gt;
&lt;g id=&quot;node10&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Result&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M204.51,-36C204.51,-36 112.17,-36 112.17,-36 106.17,-36 100.17,-30 100.17,-24 100.17,-24 100.17,-12 100.17,-12 100.17,-6 106.17,0 112.17,0 112.17,0 204.51,0 204.51,0 210.51,0 216.51,-6 216.51,-12 216.51,-12 216.51,-24 216.51,-24 216.51,-30 210.51,-36 204.51,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;158.34&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;IP: 142.250.xx.xx&lt;/text&gt;
&lt;/g&gt;
&lt;!-- BrowserCache&amp;#45;&amp;gt;Result --&gt;
&lt;g id=&quot;edge10&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;BrowserCache-&gt;Result&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M182.82,-662.73C192.15,-645.69 204.34,-618.58 204.34,-593.2 204.34,-593.2 204.34,-593.2 204.34,-90 204.34,-73.22 195.18,-57.27 185.03,-44.76&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;187.82,-42.63 178.58,-37.43 182.56,-47.25 187.82,-42.63&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;211.73&quot; y=&quot;-321.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;hit&lt;/text&gt;
&lt;/g&gt;
&lt;!-- HostsFile --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;HostsFile&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M115.93,-521.4C115.93,-521.4 66.76,-521.4 66.76,-521.4 60.76,-521.4 54.76,-515.4 54.76,-509.4 54.76,-509.4 54.76,-497.4 54.76,-497.4 54.76,-491.4 60.76,-485.4 66.76,-485.4 66.76,-485.4 115.93,-485.4 115.93,-485.4 121.93,-485.4 127.93,-491.4 127.93,-497.4 127.93,-497.4 127.93,-509.4 127.93,-509.4 127.93,-515.4 121.93,-521.4 115.93,-521.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;91.34&quot; y=&quot;-499.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Hosts File&lt;/text&gt;
&lt;/g&gt;
&lt;!-- OSCache&amp;#45;&amp;gt;HostsFile --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;OSCache-&gt;HostsFile&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M129.3,-573.9C125.81,-568.3 122.01,-562.03 118.67,-556.2 114.22,-548.44 109.6,-539.89 105.46,-532.01&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;108.58,-530.43 100.85,-523.17 102.37,-533.66 108.58,-530.43&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;131.51&quot; y=&quot;-543.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;miss&lt;/text&gt;
&lt;/g&gt;
&lt;!-- OSCache&amp;#45;&amp;gt;Result --&gt;
&lt;g id=&quot;edge11&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;OSCache-&gt;Result&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-dasharray=&quot;5 2&quot; d=&quot;M146.14,-573.8C151.4,-556.43 158.34,-528.87 158.34,-504.4 158.34,-504.4 158.34,-504.4 158.34,-90 158.34,-76.08 158.34,-60.63 158.34,-47.7&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;161.84,-47.73 158.34,-37.73 154.84,-47.73 161.84,-47.73&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;165.73&quot; y=&quot;-277.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;hit&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RouterCache --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;RouterCache&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M116.63,-432.6C116.63,-432.6 48.05,-432.6 48.05,-432.6 42.05,-432.6 36.05,-426.6 36.05,-420.6 36.05,-420.6 36.05,-408.6 36.05,-408.6 36.05,-402.6 42.05,-396.6 48.05,-396.6 48.05,-396.6 116.63,-396.6 116.63,-396.6 122.63,-396.6 128.63,-402.6 128.63,-408.6 128.63,-408.6 128.63,-420.6 128.63,-420.6 128.63,-426.6 122.63,-432.6 116.63,-432.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;82.34&quot; y=&quot;-410.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Router Cache&lt;/text&gt;
&lt;/g&gt;
&lt;!-- HostsFile&amp;#45;&amp;gt;RouterCache --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;HostsFile-&gt;RouterCache&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M89.57,-485.25C88.35,-473.56 86.72,-457.79 85.31,-444.22&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;88.82,-444.1 84.3,-434.52 81.85,-444.82 88.82,-444.1&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;100.49&quot; y=&quot;-454.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;miss&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ISP --&gt;
&lt;g id=&quot;node6&quot; class=&quot;node&quot;&gt;
&lt;title&gt;ISP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M118.23,-343.8C118.23,-343.8 34.45,-343.8 34.45,-343.8 28.45,-343.8 22.45,-337.8 22.45,-331.8 22.45,-331.8 22.45,-319.8 22.45,-319.8 22.45,-313.8 28.45,-307.8 34.45,-307.8 34.45,-307.8 118.23,-307.8 118.23,-307.8 124.23,-307.8 130.23,-313.8 130.23,-319.8 130.23,-319.8 130.23,-331.8 130.23,-331.8 130.23,-337.8 124.23,-343.8 118.23,-343.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;76.34&quot; y=&quot;-321.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;ISP DNS Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RouterCache&amp;#45;&amp;gt;ISP --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;RouterCache-&gt;ISP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M81.16,-396.45C80.35,-384.76 79.26,-368.99 78.32,-355.42&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;81.83,-355.46 77.65,-345.72 74.85,-355.94 81.83,-355.46&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;92.72&quot; y=&quot;-366&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;miss&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Root --&gt;
&lt;g id=&quot;node7&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Root&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M102.98,-255C102.98,-255 43.71,-255 43.71,-255 37.71,-255 31.71,-249 31.71,-243 31.71,-243 31.71,-231 31.71,-231 31.71,-225 37.71,-219 43.71,-219 43.71,-219 102.98,-219 102.98,-219 108.98,-219 114.98,-225 114.98,-231 114.98,-231 114.98,-243 114.98,-243 114.98,-249 108.98,-255 102.98,-255&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;73.34&quot; y=&quot;-232.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Root Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- ISP&amp;#45;&amp;gt;Root --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;ISP-&gt;Root&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M75.75,-307.65C75.35,-295.96 74.8,-280.19 74.33,-266.62&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;77.84,-266.8 74,-256.92 70.84,-267.04 77.84,-266.8&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;87.95&quot; y=&quot;-277.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;miss&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLD --&gt;
&lt;g id=&quot;node8&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TLD&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M117.18,-182C117.18,-182 17.5,-182 17.5,-182 11.5,-182 5.5,-176 5.5,-170 5.5,-170 5.5,-158 5.5,-158 5.5,-152 11.5,-146 17.5,-146 17.5,-146 117.18,-146 117.18,-146 123.18,-146 129.18,-152 129.18,-158 129.18,-158 129.18,-170 129.18,-170 129.18,-176 123.18,-182 117.18,-182&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;67.34&quot; y=&quot;-159.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TLD Server (.com)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Root&amp;#45;&amp;gt;TLD --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Root-&gt;TLD&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M71.89,-218.81C71.24,-211.14 70.46,-201.89 69.73,-193.24&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;73.24,-193.21 68.91,-183.54 66.26,-193.8 73.24,-193.21&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Auth --&gt;
&lt;g id=&quot;node9&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Auth&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M118.69,-109C118.69,-109 12,-109 12,-109 6,-109 0,-103 0,-97 0,-97 0,-85 0,-85 0,-79 6,-73 12,-73 12,-73 118.69,-73 118.69,-73 124.69,-73 130.69,-79 130.69,-85 130.69,-85 130.69,-97 130.69,-97 130.69,-103 124.69,-109 118.69,-109&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;65.34&quot; y=&quot;-86.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Authoritative Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLD&amp;#45;&amp;gt;Auth --&gt;
&lt;g id=&quot;edge8&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TLD-&gt;Auth&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M66.86,-145.81C66.64,-138.14 66.38,-128.89 66.14,-120.24&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;69.65,-120.44 65.87,-110.54 62.65,-120.64 69.65,-120.44&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Auth&amp;#45;&amp;gt;Result --&gt;
&lt;g id=&quot;edge9&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Auth-&gt;Result&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M87.86,-72.81C99.54,-63.9 114,-52.86 126.77,-43.1&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;128.69,-46.04 134.51,-37.19 124.44,-40.48 128.69,-46.04&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Caching at every level speeds up repeated lookups&lt;/li&gt;
&lt;li&gt;TTL (Time To Live) controls how long entries are cached&lt;/li&gt;
&lt;li&gt;Recursive resolvers do the work so clients don’t need to query multiple servers&lt;/li&gt;
&lt;li&gt;UDP port 53 is used for standard queries (TCP for large responses)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../dns-cache&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-cache&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Cache&lt;/a&gt; — caching is core to DNS lookup efficiency&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../tcp-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tcp-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TCP Handshake&lt;/a&gt; — IP from DNS used to establish TCP connection&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-hierarchy&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-hierarchy&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Hierarchy&lt;/a&gt; — the chain of servers queried&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../arp-protocol&quot; class=&quot;internal alias&quot; data-slug=&quot;arp-protocol&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ARP Protocol&lt;/a&gt; — after DNS gives IP, ARP finds MAC address&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../recursive-dns&quot; class=&quot;internal alias&quot; data-slug=&quot;recursive-dns&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Recursive DNS&lt;/a&gt; — DNS lookup includes caching, recursive is the fallback mechanism&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;DNS poisoning can redirect users to malicious sites&lt;/li&gt;
&lt;li&gt;Cache poisoning attacks exploit trust in DNS responses&lt;/li&gt;
&lt;li&gt;Some ISPs hijack failed DNS lookups to show ads&lt;/li&gt;
&lt;li&gt;DNS over HTTPS (DoH) encrypts DNS queries for privacy&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>dns-root-server</title>
    <link href="https://animishraa05.github.io/wiki/https/dns-root-server" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/dns-root-server.md" />
    <summary>The Problem When a DNS resolver doesn’t know where to find a domain, it needs a starting point.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="dns" label="dns" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When a DNS resolver doesn’t know where to find a domain, it needs a starting point. Without root servers, there would be no way to begin the DNS resolution process for unknown domains.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;DNS root servers are the top of the DNS hierarchy—13 logical servers (labeled A through M) that know the locations of all TLD servers. They are the starting point for all recursive DNS lookups.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Query Received&lt;/strong&gt;: Recursive resolver has a new domain to resolve&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contact Root&lt;/strong&gt;: Resolver sends query to a root server&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Response&lt;/strong&gt;: Root server returns the TLD server for the domain’s extension
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;For &lt;code class=&quot;notranslate&quot;&gt;google.com&lt;/code&gt;, root returns &lt;code class=&quot;notranslate&quot;&gt;.com&lt;/code&gt; TLD server address&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Next Step&lt;/strong&gt;: Resolver now queries the TLD server&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Root servers don’t know the final IP—they only know which TLD server to ask next.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;384pt&quot; height=&quot;131pt&quot; viewBox=&quot;0.00 0.00 384.00 131.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 127)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-127 379.9,-127 379.9,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Resolver --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M113.25,-69C113.25,-69 12,-69 12,-69 6,-69 0,-63 0,-57 0,-57 0,-45 0,-45 0,-39 6,-33 12,-33 12,-33 113.25,-33 113.25,-33 119.25,-33 125.25,-39 125.25,-45 125.25,-45 125.25,-57 125.25,-57 125.25,-63 119.25,-69 113.25,-69&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;62.62&quot; y=&quot;-46.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Recursive Resolver&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RootA --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;RootA&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M350.5,-99C350.5,-99 277.62,-99 277.62,-99 271.62,-99 265.62,-93 265.62,-87 265.62,-87 265.62,-75 265.62,-75 265.62,-69 271.62,-63 277.62,-63 277.62,-63 350.5,-63 350.5,-63 356.5,-63 362.5,-69 362.5,-75 362.5,-75 362.5,-87 362.5,-87 362.5,-93 356.5,-99 350.5,-99&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;314.06&quot; y=&quot;-76.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Root Server A&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver&amp;#45;&amp;gt;RootA --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Resolver-&gt;RootA&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M125.61,-65.97C131.55,-67.11 137.5,-68.15 143.25,-69 179.86,-74.4 221.29,-77.39 254.06,-79.03&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;253.6,-82.52 263.76,-79.49 253.93,-75.52 253.6,-82.52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;188.73&quot; y=&quot;-81.92&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Where is .com?&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLD --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TLD&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M363.9,-36C363.9,-36 264.22,-36 264.22,-36 258.22,-36 252.22,-30 252.22,-24 252.22,-24 252.22,-12 252.22,-12 252.22,-6 258.22,0 264.22,0 264.22,0 363.9,0 363.9,0 369.9,0 375.9,-6 375.9,-12 375.9,-12 375.9,-24 375.9,-24 375.9,-30 369.9,-36 363.9,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;314.06&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TLD Server (.com)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver&amp;#45;&amp;gt;TLD --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Resolver-&gt;TLD&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M125.74,-40.58C131.65,-39.68 137.56,-38.8 143.25,-38 175.18,-33.52 210.58,-29.24 240.77,-25.79&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;241.01,-29.29 250.56,-24.69 240.23,-22.33 241.01,-29.29&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- RootA&amp;#45;&amp;gt;Resolver --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;RootA-&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M277.1,-62.54C263.97,-56.74 248.76,-51.1 234.22,-48.2 202.67,-41.9 167.18,-41.45 136.77,-43.02&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;136.66,-39.52 126.9,-43.62 137.09,-46.51 136.66,-39.52&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;188.73&quot; y=&quot;-52.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Ask TLD server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RootB --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;RootB&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M98.67,-123C98.67,-123 26.57,-123 26.57,-123 20.57,-123 14.57,-117 14.57,-111 14.57,-111 14.57,-99 14.57,-99 14.57,-93 20.57,-87 26.57,-87 26.57,-87 98.67,-87 98.67,-87 104.67,-87 110.67,-93 110.67,-99 110.67,-99 110.67,-111 110.67,-111 110.67,-117 104.67,-123 98.67,-123&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;62.62&quot; y=&quot;-100.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Root Server B&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;13 logical servers (A-M), hundreds of physical servers via anycast&lt;/li&gt;
&lt;li&gt;Managed by different organizations (ICANN, Verisign, etc.)&lt;/li&gt;
&lt;li&gt;Only return TLD server addresses, never final IPs&lt;/li&gt;
&lt;li&gt;Root zone file contains all TLD server addresses&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../recursive-dns&quot; class=&quot;internal alias&quot; data-slug=&quot;recursive-dns&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Recursive DNS&lt;/a&gt; — resolvers query root servers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../dns-tld-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-tld-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS TLD Server&lt;/a&gt; — root points to TLD servers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-hierarchy&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-hierarchy&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Hierarchy&lt;/a&gt; — root is the top level&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../anycast&quot; class=&quot;internal alias&quot; data-slug=&quot;anycast&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Anycast&lt;/a&gt; — root servers use anycast for redundancy&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Root server compromise would break the entire internet&lt;/li&gt;
&lt;li&gt;Root servers are heavily DDoS protected&lt;/li&gt;
&lt;li&gt;Some countries operate alternative root systems (not ICANN-recognized)&lt;/li&gt;
&lt;li&gt;Anycast allows multiple physical servers to share one IP&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>dns-tld-server</title>
    <link href="https://animishraa05.github.io/wiki/https/dns-tld-server" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/dns-tld-server.md" />
    <summary>The Problem After the root server tells you where .com is, you need to find the specific server for google.com.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="dns" label="dns" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;After the root server tells you where &lt;code class=&quot;notranslate&quot;&gt;.com&lt;/code&gt; is, you need to find the specific server for &lt;code class=&quot;notranslate&quot;&gt;google.com&lt;/code&gt;. TLD servers bridge the gap between root servers and authoritative servers for each domain extension.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;TLD (Top-Level Domain) servers manage all domains under a specific extension (.com, .org, .net, etc.). They know the addresses of authoritative servers for each domain registered under that TLD.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Query from Resolver&lt;/strong&gt;: “Where is google.com?”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TLD Lookup&lt;/strong&gt;: TLD server checks its zone file for &lt;code class=&quot;notranslate&quot;&gt;google.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Response&lt;/strong&gt;: Returns the authoritative name server for that domain
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Example: “google.com is served by ns1.google.com”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Next Step&lt;/strong&gt;: Resolver queries the authoritative server&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;TLDs are managed by organizations like Verisign (.com, .net), PIR (.org), etc.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;425pt&quot; height=&quot;116pt&quot; viewBox=&quot;0.00 0.00 425.00 116.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 111.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-111.6 421.49,-111.6 421.49,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Resolver --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M113.25,-71.8C113.25,-71.8 12,-71.8 12,-71.8 6,-71.8 0,-65.8 0,-59.8 0,-59.8 0,-47.8 0,-47.8 0,-41.8 6,-35.8 12,-35.8 12,-35.8 113.25,-35.8 113.25,-35.8 119.25,-35.8 125.25,-41.8 125.25,-47.8 125.25,-47.8 125.25,-59.8 125.25,-59.8 125.25,-65.8 119.25,-71.8 113.25,-71.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;62.62&quot; y=&quot;-49.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Recursive Resolver&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLD_Com --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TLD_Com&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M381.78,-107.6C381.78,-107.6 322.52,-107.6 322.52,-107.6 316.52,-107.6 310.52,-101.6 310.52,-95.6 310.52,-95.6 310.52,-78 310.52,-78 310.52,-72 316.52,-66 322.52,-66 322.52,-66 381.78,-66 381.78,-66 387.78,-66 393.78,-72 393.78,-78 393.78,-78 393.78,-95.6 393.78,-95.6 393.78,-101.6 387.78,-107.6 381.78,-107.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;352.15&quot; y=&quot;-91&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TLD Server&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;352.15&quot; y=&quot;-74.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(.com)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver&amp;#45;&amp;gt;TLD_Com --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Resolver-&gt;TLD_Com&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M125.61,-68.76C131.55,-69.91 137.5,-70.95 143.25,-71.8 195.93,-79.61 256.74,-83.4 298.93,-85.21&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;298.67,-88.7 308.81,-85.6 298.96,-81.7 298.67,-88.7&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;206.03&quot; y=&quot;-87.78&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Where is google.com?&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Auth --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Auth&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M405.49,-41.6C405.49,-41.6 298.81,-41.6 298.81,-41.6 292.81,-41.6 286.81,-35.6 286.81,-29.6 286.81,-29.6 286.81,-12 286.81,-12 286.81,-6 292.81,0 298.81,0 298.81,0 405.49,0 405.49,0 411.49,0 417.49,-6 417.49,-12 417.49,-12 417.49,-29.6 417.49,-29.6 417.49,-35.6 411.49,-41.6 405.49,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;352.15&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Authoritative Server&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;352.15&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(google.com)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver&amp;#45;&amp;gt;Auth --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Resolver-&gt;Auth&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M125.7,-42.37C131.62,-41.44 137.54,-40.56 143.25,-39.8 186.74,-34 235.58,-29.44 275,-26.24&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;275.18,-29.73 284.87,-25.45 274.62,-22.76 275.18,-29.73&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- TLD_Com&amp;#45;&amp;gt;Resolver --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TLD_Com-&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M311.2,-65.52C298.07,-59.6 283.15,-53.98 268.81,-51 225.63,-42.02 176.24,-42.38 136.74,-45.15&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;136.55,-41.65 126.85,-45.91 137.09,-48.63 136.55,-41.65&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;206.03&quot; y=&quot;-55.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Ask ns1.google.com&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;One TLD server handles all domains under that extension&lt;/li&gt;
&lt;li&gt;Zone files contain authoritative server mappings&lt;/li&gt;
&lt;li&gt;Managed by registries (Verisign for .com, etc.)&lt;/li&gt;
&lt;li&gt;Respond with NS (Name Server) records, not IP addresses&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../dns-root-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-root-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Root Server&lt;/a&gt; — root server points to TLD server&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../dns-authoritative-server&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-authoritative-server&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Authoritative Server&lt;/a&gt; — TLD points to authoritative&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-hierarchy&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-hierarchy&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Hierarchy&lt;/a&gt; — TLD is the middle layer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../domain-registration&quot; class=&quot;internal alias&quot; data-slug=&quot;domain-registration&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Domain Registration&lt;/a&gt; — TLD servers updated via registrars&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;TLD server downtime affects all domains under that TLD&lt;/li&gt;
&lt;li&gt;Some TLDs have more stringent policies (.gov, .edu)&lt;/li&gt;
&lt;li&gt;Country-code TLDs (.uk, .jp) have local governance&lt;/li&gt;
&lt;li&gt;New gTLDs (.app, .dev) added regularly&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>dom-tree</title>
    <link href="https://animishraa05.github.io/wiki/https/dom-tree" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/dom-tree.md" />
    <summary>The Problem The browser receives HTML as a text string.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The browser receives HTML as a text string. To render the page and allow JavaScript to manipulate it, the browser needs a structured representation of the document. Raw HTML text isn’t programmable.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The DOM (Document Object Model) tree is a tree structure built by parsing HTML, where each HTML element becomes a node. It’s the programmatic interface that JavaScript uses to read and modify the page.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;HTML Received&lt;/strong&gt;: Browser starts receiving HTML from server&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tokenization&lt;/strong&gt;: HTML is broken into tokens (&lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;div&gt;&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;class=&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tree Construction&lt;/strong&gt;: Tokens are assembled into a tree
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;html
├── head
│   └── title
└── body
    ├── h1
    └── p
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scripts may modify&lt;/strong&gt;: JavaScript can add/remove nodes&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;The DOM is live—changes via JavaScript immediately affect the structure.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;177pt&quot; height=&quot;188pt&quot; viewBox=&quot;0.00 0.00 177.00 188.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 184)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-184 173.11,-184 173.11,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- HTML --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;HTML&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M83.84,-180C83.84,-180 50.38,-180 50.38,-180 44.38,-180 38.38,-174 38.38,-168 38.38,-168 38.38,-156 38.38,-156 38.38,-150 44.38,-144 50.38,-144 50.38,-144 83.84,-144 83.84,-144 89.84,-144 95.84,-150 95.84,-156 95.84,-156 95.84,-168 95.84,-168 95.84,-174 89.84,-180 83.84,-180&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;67.11&quot; y=&quot;-157.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;&amp;#x3C;html&gt;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Head --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Head&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M46.22,-108C46.22,-108 12,-108 12,-108 6,-108 0,-102 0,-96 0,-96 0,-84 0,-84 0,-78 6,-72 12,-72 12,-72 46.22,-72 46.22,-72 52.22,-72 58.22,-78 58.22,-84 58.22,-84 58.22,-96 58.22,-96 58.22,-102 52.22,-108 46.22,-108&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;29.11&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;&amp;#x3C;head&gt;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- HTML&amp;#45;&amp;gt;Head --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;HTML-&gt;Head&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M57.72,-143.7C53.53,-135.98 48.5,-126.71 43.83,-118.11&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;46.96,-116.55 39.12,-109.43 40.81,-119.89 46.96,-116.55&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Body --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Body&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M124,-108C124,-108 88.21,-108 88.21,-108 82.21,-108 76.21,-102 76.21,-96 76.21,-96 76.21,-84 76.21,-84 76.21,-78 82.21,-72 88.21,-72 88.21,-72 124,-72 124,-72 130,-72 136,-78 136,-84 136,-84 136,-96 136,-96 136,-102 130,-108 124,-108&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;106.11&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;&amp;#x3C;body&gt;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- HTML&amp;#45;&amp;gt;Body --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;HTML-&gt;Body&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M76.75,-143.7C81.05,-135.98 86.21,-126.71 91,-118.11&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;94.03,-119.87 95.84,-109.43 87.92,-116.46 94.03,-119.87&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- H1 --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;H1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M85.11,-36C85.11,-36 55.11,-36 55.11,-36 49.11,-36 43.11,-30 43.11,-24 43.11,-24 43.11,-12 43.11,-12 43.11,-6 49.11,0 55.11,0 55.11,0 85.11,0 85.11,0 91.11,0 97.11,-6 97.11,-12 97.11,-12 97.11,-24 97.11,-24 97.11,-30 91.11,-36 85.11,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;70.11&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;&amp;#x3C;h1&gt;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Body&amp;#45;&amp;gt;H1 --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Body-&gt;H1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M97.21,-71.7C93.24,-63.98 88.48,-54.71 84.05,-46.11&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;87.28,-44.74 79.6,-37.45 81.06,-47.94 87.28,-44.74&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- P --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;P&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M157.11,-36C157.11,-36 127.11,-36 127.11,-36 121.11,-36 115.11,-30 115.11,-24 115.11,-24 115.11,-12 115.11,-12 115.11,-6 121.11,0 127.11,0 127.11,0 157.11,0 157.11,0 163.11,0 169.11,-6 169.11,-12 169.11,-12 169.11,-24 169.11,-24 169.11,-30 163.11,-36 157.11,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;142.11&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;&amp;#x3C;p&gt;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Body&amp;#45;&amp;gt;P --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Body-&gt;P&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M115.01,-71.7C118.98,-63.98 123.74,-54.71 128.17,-46.11&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;131.16,-47.94 132.62,-37.45 124.93,-44.74 131.16,-47.94&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Tree structure mirrors HTML nesting&lt;/li&gt;
&lt;li&gt;JavaScript can traverse and modify the DOM&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;document.getElementById()&lt;/code&gt; etc. query the DOM&lt;/li&gt;
&lt;li&gt;DOM changes trigger re-rendering (reflow/repaint)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — DOM is step 1&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../render-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;render-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Render Tree&lt;/a&gt; — DOM + CSSOM combine&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../html-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;html-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTML Parsing&lt;/a&gt; — the process that builds the DOM&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../cssom&quot; class=&quot;internal alias&quot; data-slug=&quot;cssom&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSSOM&lt;/a&gt; — CSS counterpart to DOM&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../javascript&quot; class=&quot;internal alias&quot; data-slug=&quot;javascript&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;JavaScript&lt;/a&gt; — manipulates the DOM&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Malformed HTML gets corrected by parser (auto-close tags)&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;document.write()&lt;/code&gt; during parsing can break things&lt;/li&gt;
&lt;li&gt;Large DOM = slow rendering and JS operations&lt;/li&gt;
&lt;li&gt;DOM is not the same as HTML source (parser fixes errors)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>gpu-rendering</title>
    <link href="https://animishraa05.github.io/wiki/https/gpu-rendering" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/gpu-rendering.md" />
    <summary>The Problem The CPU can draw pixels, but it’s slow for animations, scrolling, and complex visual effects.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The CPU can draw pixels, but it’s slow for animations, scrolling, and complex visual effects. Without GPU acceleration, web pages would feel sluggish and janky.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;GPU rendering uses the Graphics Processing Unit (GPU) to accelerate painting and compositing. GPUs are designed for parallel pixel operations, making scrolling and animations smooth (60+ FPS).&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;CPU paints&lt;/strong&gt;: Initial painting may happen on CPU&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Layers to GPU&lt;/strong&gt;: Painted layers uploaded to GPU memory&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GPU composites&lt;/strong&gt;: GPU combines layers, applies transforms/opacity&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Result&lt;/strong&gt;: Smooth animations without CPU involvement&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;GPU excels at:&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Transforming layers (translate, scale, rotate)&lt;/li&gt;
&lt;li&gt;Adjusting opacity&lt;/li&gt;
&lt;li&gt;Compositing multiple layers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;365pt&quot; height=&quot;50pt&quot; viewBox=&quot;0.00 0.00 365.00 50.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 45.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-45.6 360.85,-45.6 360.85,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- CPU --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CPU&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M50.67,-41.6C50.67,-41.6 12,-41.6 12,-41.6 6,-41.6 0,-35.6 0,-29.6 0,-29.6 0,-12 0,-12 0,-6 6,0 12,0 12,0 50.67,0 50.67,0 56.67,0 62.67,-6 62.67,-12 62.67,-12 62.67,-29.6 62.67,-29.6 62.67,-35.6 56.67,-41.6 50.67,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;31.33&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CPU&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;31.33&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Painting&lt;/text&gt;
&lt;/g&gt;
&lt;!-- GPU --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;GPU&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M251.99,-41.6C251.99,-41.6 110.67,-41.6 110.67,-41.6 104.67,-41.6 98.67,-35.6 98.67,-29.6 98.67,-29.6 98.67,-12 98.67,-12 98.67,-6 104.67,0 110.67,0 110.67,0 251.99,0 251.99,0 257.99,0 263.99,-6 263.99,-12 263.99,-12 263.99,-29.6 263.99,-29.6 263.99,-35.6 257.99,-41.6 251.99,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;181.33&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;GPU&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;181.33&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Compositing &amp;#x26; Transform&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CPU&amp;#45;&amp;gt;GPU --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CPU-&gt;GPU&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M63,-20.8C70.3,-20.8 78.47,-20.8 87.01,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;86.89,-24.3 96.89,-20.8 86.89,-17.3 86.89,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Screen --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Screen&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M344.85,-41.6C344.85,-41.6 311.99,-41.6 311.99,-41.6 305.99,-41.6 299.99,-35.6 299.99,-29.6 299.99,-29.6 299.99,-12 299.99,-12 299.99,-6 305.99,0 311.99,0 311.99,0 344.85,0 344.85,0 350.85,0 356.85,-6 356.85,-12 356.85,-12 356.85,-29.6 356.85,-29.6 356.85,-35.6 350.85,-41.6 344.85,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;328.42&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Screen&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;328.42&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;60 FPS&lt;/text&gt;
&lt;/g&gt;
&lt;!-- GPU&amp;#45;&amp;gt;Screen --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;GPU-&gt;Screen&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M264.21,-20.8C272.56,-20.8 280.74,-20.8 288.31,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;288.1,-24.3 298.1,-20.8 288.1,-17.3 288.1,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Parallel processing: GPU has thousands of small cores&lt;/li&gt;
&lt;li&gt;Off-main-thread: doesn’t block JavaScript&lt;/li&gt;
&lt;li&gt;Used for: transforms, opacity, scrolling, video&lt;/li&gt;
&lt;li&gt;Layers must be uploaded to GPU memory (costly first time)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../compositing&quot; class=&quot;internal alias&quot; data-slug=&quot;compositing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Compositing&lt;/a&gt; — GPU does the compositing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../painting&quot; class=&quot;internal alias&quot; data-slug=&quot;painting&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Painting&lt;/a&gt; — CPU may do initial paint&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — GPU rendering is step 6&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../cpu-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;cpu-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CPU Rendering&lt;/a&gt; — GPU is faster for graphics&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Uploading layers to GPU has initial cost&lt;/li&gt;
&lt;li&gt;GPU memory is limited—too many layers cause issues&lt;/li&gt;
&lt;li&gt;Not all CSS properties are GPU-accelerated&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;transform&lt;/code&gt; and &lt;code class=&quot;notranslate&quot;&gt;opacity&lt;/code&gt; are the best for animations&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>hsts</title>
    <link href="https://animishraa05.github.io/wiki/https/hsts" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/hsts.md" />
    <summary>The Problem Users might accidentally visit the HTTP version of a site instead of HTTPS, exposing them to downgrade attacks.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="security" label="security" />
<category term="https" label="https" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Users might accidentally visit the HTTP version of a site instead of HTTPS, exposing them to downgrade attacks. Without HSTS, a man-in-the-middle could strip TLS and force a connection to use insecure HTTP.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;HTTP Strict Transport Security (HSTS) is a security policy that tells browsers to always use HTTPS for a domain, never allowing HTTP fallback. It prevents protocol downgrade attacks and cookie hijacking.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;First Visit&lt;/strong&gt;: Server sends &lt;code class=&quot;notranslate&quot;&gt;Strict-Transport-Security&lt;/code&gt; header with &lt;code class=&quot;notranslate&quot;&gt;max-age&lt;/code&gt; value&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Browser Records&lt;/strong&gt;: Browser stores the HSTS policy for the specified duration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Subsequent Visits&lt;/strong&gt;: Browser automatically upgrades HTTP requests to HTTPS&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Preload List&lt;/strong&gt;: Popular sites are hardcoded into browser HSTS preload lists&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;When a site is in the HSTS list, the browser:&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Never attempts HTTP for that domain&lt;/li&gt;
&lt;li&gt;Refuses to connect if certificate errors occur (no “proceed anyway” option)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;735pt&quot; height=&quot;98pt&quot; viewBox=&quot;0.00 0.00 735.00 98.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 94)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-94 731.1,-94 731.1,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- User --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;User&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M132.69,-63C132.69,-63 12,-63 12,-63 6,-63 0,-57 0,-51 0,-51 0,-39 0,-39 0,-33 6,-27 12,-27 12,-27 132.69,-27 132.69,-27 138.69,-27 144.69,-33 144.69,-39 144.69,-39 144.69,-51 144.69,-51 144.69,-57 138.69,-63 132.69,-63&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;72.35&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;User types google.com&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CheckHSTS --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CheckHSTS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M284.47,-63C284.47,-63 193.69,-63 193.69,-63 187.69,-63 181.69,-57 181.69,-51 181.69,-51 181.69,-39 181.69,-39 181.69,-33 187.69,-27 193.69,-27 193.69,-27 284.47,-27 284.47,-27 290.47,-27 296.47,-33 296.47,-39 296.47,-39 296.47,-51 296.47,-51 296.47,-57 290.47,-63 284.47,-63&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;239.08&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Check HSTS List&lt;/text&gt;
&lt;/g&gt;
&lt;!-- User&amp;#45;&amp;gt;CheckHSTS --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;User-&gt;CheckHSTS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M145.12,-45C153.37,-45 161.77,-45 169.97,-45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;169.88,-48.5 179.88,-45 169.88,-41.5 169.88,-48.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- UseHTTPS --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;UseHTTPS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M502.93,-90C502.93,-90 414.49,-90 414.49,-90 408.49,-90 402.49,-84 402.49,-78 402.49,-78 402.49,-66 402.49,-66 402.49,-60 408.49,-54 414.49,-54 414.49,-54 502.93,-54 502.93,-54 508.93,-54 514.93,-60 514.93,-66 514.93,-66 514.93,-78 514.93,-78 514.93,-84 508.93,-90 502.93,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;458.71&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Use HTTPS only&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CheckHSTS&amp;#45;&amp;gt;UseHTTPS --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CheckHSTS-&gt;UseHTTPS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M296.69,-52.02C325.51,-55.6 360.72,-59.97 390.86,-63.71&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;390.28,-67.16 400.63,-64.92 391.14,-60.21 390.28,-67.16&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;349.48&quot; y=&quot;-66.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;In HSTS list&lt;/text&gt;
&lt;/g&gt;
&lt;!-- UseHTTP --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;UseHTTP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M497.09,-36C497.09,-36 420.33,-36 420.33,-36 414.33,-36 408.33,-30 408.33,-24 408.33,-24 408.33,-12 408.33,-12 408.33,-6 414.33,0 420.33,0 420.33,0 497.09,0 497.09,0 503.09,0 509.09,-6 509.09,-12 509.09,-12 509.09,-24 509.09,-24 509.09,-30 503.09,-36 497.09,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;458.71&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Try HTTP first&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CheckHSTS&amp;#45;&amp;gt;UseHTTP --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CheckHSTS-&gt;UseHTTP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M296.92,-36.56C302.84,-35.74 308.78,-34.94 314.47,-34.2 341.38,-30.73 371.18,-27.29 396.6,-24.48&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;396.88,-27.97 406.44,-23.4 396.12,-21.01 396.88,-27.97&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;349.48&quot; y=&quot;-38.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Not in list&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Secure --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Secure&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M715.1,-63C715.1,-63 616.97,-63 616.97,-63 610.97,-63 604.97,-57 604.97,-51 604.97,-51 604.97,-39 604.97,-39 604.97,-33 610.97,-27 616.97,-27 616.97,-27 715.1,-27 715.1,-27 721.1,-27 727.1,-33 727.1,-39 727.1,-39 727.1,-51 727.1,-51 727.1,-57 721.1,-63 715.1,-63&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;666.03&quot; y=&quot;-40.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Secure Connection&lt;/text&gt;
&lt;/g&gt;
&lt;!-- UseHTTPS&amp;#45;&amp;gt;Secure --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;UseHTTPS-&gt;Secure&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M515.27,-64.69C539.38,-61.52 567.91,-57.77 593.56,-54.4&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;593.78,-57.9 603.24,-53.13 592.87,-50.96 593.78,-57.9&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- UseHTTP&amp;#45;&amp;gt;Secure --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;UseHTTP-&gt;Secure&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M509.59,-24.22C533.07,-27.18 561.47,-30.81 586.97,-34.2 589.01,-34.47 591.09,-34.75 593.19,-35.03&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;592.64,-38.49 603.02,-36.36 593.58,-31.55 592.64,-38.49&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;559.95&quot; y=&quot;-38.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;after TLS&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Header: &lt;code class=&quot;notranslate&quot;&gt;Strict-Transport-Security: max-age=31536000; includeSubDomains&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Prevents SSL stripping man-in-the-middle attacks&lt;/li&gt;
&lt;li&gt;Browsers refuse to bypass certificate errors for HSTS sites&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;includeSubDomains&lt;/code&gt; extends policy to all subdomains&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../https&quot; class=&quot;internal alias&quot; data-slug=&quot;https&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTPS&lt;/a&gt; — HSTS enforces HTTPS usage&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../http&quot; class=&quot;internal alias&quot; data-slug=&quot;http&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP&lt;/a&gt; — HSTS explicitly prevents HTTP fallback&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../tls-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tls-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TLS Handshake&lt;/a&gt; — HSTS ensures TLS is always used&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../url-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;url-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;URL Parsing&lt;/a&gt; — HSTS check happens after URL is parsed&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;First visit before HSTS is set is still vulnerable (use preload list)&lt;/li&gt;
&lt;li&gt;Max-age expiry requires re-visit to refresh policy&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;includeSubDomains&lt;/code&gt; can break subdomains not ready for HTTPS&lt;/li&gt;
&lt;li&gt;Cannot be disabled by user even if site has issues (must wait for expiry)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>html-parsing</title>
    <link href="https://animishraa05.github.io/wiki/https/html-parsing" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/html-parsing.md" />
    <summary>The Problem The browser receives HTML as a text string from the server.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The browser receives HTML as a text string from the server. To build the DOM and render the page, the browser needs to convert this text into a structured tree. Raw HTML isn’t programmable.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;HTML parsing tokenizes HTML text and constructs the DOM tree. The parser is lenient—it corrects malformed HTML automatically (missing closing tags, mismatched tags, etc.).&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Tokenization&lt;/strong&gt;: Break HTML into tokens (&lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;div&gt;&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;class=&lt;/code&gt;, text content, &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;/div&gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tree construction&lt;/strong&gt;: Assemble tokens into DOM tree
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;html&gt;
  &amp;#x3C;body&gt;
    &amp;#x3C;h1&gt;Hello&amp;#x3C;/h1&gt;
&lt;/code&gt;&lt;/pre&gt;
↓
DOM: html → body → h1 → “Hello”
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error recovery&lt;/strong&gt;: Fix common HTML errors automatically&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;The HTML parser can be paused by &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;script&gt;&lt;/code&gt; tags (unless &lt;code class=&quot;notranslate&quot;&gt;async&lt;/code&gt;/&lt;code class=&quot;notranslate&quot;&gt;defer&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;232pt&quot; height=&quot;205pt&quot; viewBox=&quot;0.00 0.00 232.00 205.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 200.8)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-200.8 227.83,-200.8 227.83,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- HTML --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;HTML&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M197.83,-196.8C197.83,-196.8 26,-196.8 26,-196.8 20,-196.8 14,-190.8 14,-184.8 14,-184.8 14,-167.2 14,-167.2 14,-161.2 20,-155.2 26,-155.2 26,-155.2 197.83,-155.2 197.83,-155.2 203.83,-155.2 209.83,-161.2 209.83,-167.2 209.83,-167.2 209.83,-184.8 209.83,-184.8 209.83,-190.8 203.83,-196.8 197.83,-196.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;111.91&quot; y=&quot;-180.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HTML Text&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;111.91&quot; y=&quot;-163.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;&amp;#x3C;html&gt;&amp;#x3C;body&gt;&amp;#x3C;h1&gt;Hello&amp;#x3C;/h1&gt;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Tokens --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Tokens&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M211.83,-119.2C211.83,-119.2 12,-119.2 12,-119.2 6,-119.2 0,-113.2 0,-107.2 0,-107.2 0,-89.6 0,-89.6 0,-83.6 6,-77.6 12,-77.6 12,-77.6 211.83,-77.6 211.83,-77.6 217.83,-77.6 223.83,-83.6 223.83,-89.6 223.83,-89.6 223.83,-107.2 223.83,-107.2 223.83,-113.2 217.83,-119.2 211.83,-119.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;111.91&quot; y=&quot;-102.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Tokens&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;111.91&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;&amp;#x3C;html&gt;, &amp;#x3C;body&gt;, &amp;#x3C;h1&gt;, Hello, &amp;#x3C;/h1&gt;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- HTML&amp;#45;&amp;gt;Tokens --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;HTML-&gt;Tokens&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M111.91,-154.74C111.91,-147.39 111.91,-138.91 111.91,-130.83&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;115.41,-130.97 111.91,-120.97 108.41,-130.97 115.41,-130.97&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- DOM --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;DOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M190.73,-41.6C190.73,-41.6 33.09,-41.6 33.09,-41.6 27.09,-41.6 21.09,-35.6 21.09,-29.6 21.09,-29.6 21.09,-12 21.09,-12 21.09,-6 27.09,0 33.09,0 33.09,0 190.73,0 190.73,0 196.73,0 202.73,-6 202.73,-12 202.73,-12 202.73,-29.6 202.73,-29.6 202.73,-35.6 196.73,-41.6 190.73,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;111.91&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;DOM Tree&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;111.91&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(html → body → h1 → &#039;Hello&#039;)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Tokens&amp;#45;&amp;gt;DOM --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Tokens-&gt;DOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M111.91,-77.14C111.91,-69.79 111.91,-61.31 111.91,-53.23&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;115.41,-53.37 111.91,-43.37 108.41,-53.37 115.41,-53.37&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Lenient parsing: fixes errors automatically&lt;/li&gt;
&lt;li&gt;Scripts block parsing (unless async/defer)&lt;/li&gt;
&lt;li&gt;Incremental parsing: starts before full HTML arrives&lt;/li&gt;
&lt;li&gt;Output is the DOM tree&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../dom-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;dom-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DOM Tree&lt;/a&gt; — HTML parsing creates the DOM&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — HTML parsing is step 1&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../css-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;css-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSS Parsing&lt;/a&gt; — parallel but separate process&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../xml-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;xml-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;XML Parsing&lt;/a&gt; — HTML is lenient, XML is strict&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;script&gt;&lt;/code&gt; without &lt;code class=&quot;notranslate&quot;&gt;async&lt;/code&gt;/&lt;code class=&quot;notranslate&quot;&gt;defer&lt;/code&gt; blocks parsing&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;document.write()&lt;/code&gt; during parsing can break things&lt;/li&gt;
&lt;li&gt;Malformed HTML gets “fixed” (may not match intent)&lt;/li&gt;
&lt;li&gt;Table parsing is especially complex&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>http-headers</title>
    <link href="https://animishraa05.github.io/wiki/https/http-headers" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/http-headers.md" />
    <summary>The Problem HTTP requests and responses need metadata—who is making the request? What type of content is being sent? How should the response be cached? Without headers, HTTP would only be able to send raw data with no context.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="http" label="http" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;HTTP requests and responses need metadata—who is making the request? What type of content is being sent? How should the response be cached? Without headers, HTTP would only be able to send raw data with no context.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;HTTP headers are key-value pairs sent with requests and responses that provide metadata: content type, authentication, caching instructions, cookies, and more. They’re the extension mechanism that lets HTTP evolve without changing the protocol.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Headers appear after the request/status line, one per line:&lt;/p&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Request Headers:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;Host: google.com
User-Agent: Mozilla/5.0
Cookie: session=abc123
Authorization: Bearer token123
&lt;/code&gt;&lt;/pre&gt;
&lt;p dir=&quot;auto&quot;&gt;&lt;strong&gt;Response Headers:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;Content-Type: text/html
Cache-Control: max-age=3600
Set-Cookie: session=abc123
&lt;/code&gt;&lt;/pre&gt;
&lt;p dir=&quot;auto&quot;&gt;Headers are case-insensitive and can appear in any order.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;444pt&quot; height=&quot;188pt&quot; viewBox=&quot;0.00 0.00 444.00 188.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 184)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-184 439.57,-184 439.57,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Request --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Request&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M276.35,-180C276.35,-180 143.19,-180 143.19,-180 137.19,-180 131.19,-174 131.19,-168 131.19,-168 131.19,-156 131.19,-156 131.19,-150 137.19,-144 143.19,-144 143.19,-144 276.35,-144 276.35,-144 282.35,-144 288.35,-150 288.35,-156 288.35,-156 288.35,-168 288.35,-168 288.35,-174 282.35,-180 276.35,-180&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;209.77&quot; y=&quot;-157.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HTTP Request/Response&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Headers --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Headers&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M278.07,-108C278.07,-108 141.48,-108 141.48,-108 135.48,-108 129.48,-102 129.48,-96 129.48,-96 129.48,-84 129.48,-84 129.48,-78 135.48,-72 141.48,-72 141.48,-72 278.07,-72 278.07,-72 284.07,-72 290.07,-78 290.07,-84 290.07,-84 290.07,-96 290.07,-96 290.07,-102 284.07,-108 278.07,-108&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;209.77&quot; y=&quot;-85.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Headers (key-value pairs)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Request&amp;#45;&amp;gt;Headers --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Request-&gt;Headers&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M209.77,-143.7C209.77,-136.41 209.77,-127.73 209.77,-119.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;213.27,-119.62 209.77,-109.62 206.27,-119.62 213.27,-119.62&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- H1 --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;H1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M103.54,-36C103.54,-36 12,-36 12,-36 6,-36 0,-30 0,-24 0,-24 0,-12 0,-12 0,-6 6,0 12,0 12,0 103.54,0 103.54,0 109.54,0 115.54,-6 115.54,-12 115.54,-12 115.54,-24 115.54,-24 115.54,-30 109.54,-36 103.54,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;57.77&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Host: google.com&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Headers&amp;#45;&amp;gt;H1 --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Headers-&gt;H1&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M171.81,-71.52C151.87,-62.34 127.24,-50.99 105.97,-41.2&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;107.44,-38.02 96.89,-37.01 104.51,-44.38 107.44,-38.02&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- H2 --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;H2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M273.62,-36C273.62,-36 145.92,-36 145.92,-36 139.92,-36 133.92,-30 133.92,-24 133.92,-24 133.92,-12 133.92,-12 133.92,-6 139.92,0 145.92,0 145.92,0 273.62,0 273.62,0 279.62,0 285.62,-6 285.62,-12 285.62,-12 285.62,-24 285.62,-24 285.62,-30 279.62,-36 273.62,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;209.77&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Content-Type: text/html&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Headers&amp;#45;&amp;gt;H2 --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Headers-&gt;H2&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M209.77,-71.7C209.77,-64.41 209.77,-55.73 209.77,-47.54&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;213.27,-47.62 209.77,-37.62 206.27,-47.62 213.27,-47.62&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- H3 --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;H3&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M423.57,-36C423.57,-36 315.97,-36 315.97,-36 309.97,-36 303.97,-30 303.97,-24 303.97,-24 303.97,-12 303.97,-12 303.97,-6 309.97,0 315.97,0 315.97,0 423.57,0 423.57,0 429.57,0 435.57,-6 435.57,-12 435.57,-12 435.57,-24 435.57,-24 435.57,-30 429.57,-36 423.57,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;369.77&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Cookie: session=abc&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Headers&amp;#45;&amp;gt;H3 --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Headers-&gt;H3&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M249.73,-71.52C270.91,-62.25 297.13,-50.78 319.65,-40.93&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;320.9,-44.2 328.66,-36.99 318.09,-37.79 320.9,-44.2&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Case-insensitive names (Host = host = HOST)&lt;/li&gt;
&lt;li&gt;Multiple values possible (e.g., multiple Accept headers)&lt;/li&gt;
&lt;li&gt;Standard headers vs custom &lt;code class=&quot;notranslate&quot;&gt;X-&lt;/code&gt; headers (deprecated but still seen)&lt;/li&gt;
&lt;li&gt;Headers affect caching, auth, content negotiation, CORS&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../http-request&quot; class=&quot;internal alias&quot; data-slug=&quot;http-request&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Request&lt;/a&gt; — headers are part of requests&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../http-response&quot; class=&quot;internal alias&quot; data-slug=&quot;http-response&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Response&lt;/a&gt; — headers are part of responses&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../cookies&quot; class=&quot;internal alias&quot; data-slug=&quot;cookies&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Cookies&lt;/a&gt; — sent via Cookie/Set-Cookie headers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../cors&quot; class=&quot;internal alias&quot; data-slug=&quot;cors&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CORS&lt;/a&gt; — controlled by special headers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../cache-control&quot; class=&quot;internal alias&quot; data-slug=&quot;cache-control&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Cache Control&lt;/a&gt; — caching headers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Large headers can cause issues (proxy limits, 431 error)&lt;/li&gt;
&lt;li&gt;Header injection attacks possible with untrusted input&lt;/li&gt;
&lt;li&gt;Some headers are hop-by-hop (not forwarded by proxies)&lt;/li&gt;
&lt;li&gt;Duplicate headers may be merged or cause errors&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>http-request</title>
    <link href="https://animishraa05.github.io/wiki/https/http-request" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/http-request.md" />
    <summary>The Problem After establishing a TCP (and possibly TLS) connection, the browser needs to ask the server for a specific resource.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="http" label="http" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;After establishing a TCP (and possibly TLS) connection, the browser needs to ask the server for a specific resource. Without a structured request format, servers wouldn’t understand what the client wants.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;An HTTP request is a structured message from client to server containing: method (GET, POST, etc.), target URL path, headers (cookies, user-agent), and optional body (for POST/PUT).&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A typical HTTP request looks like:&lt;/p&gt;
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;GET / HTTP/1.1
Host: google.com
User-Agent: Mozilla/5.0
Cookie: session=abc123
&lt;/code&gt;&lt;/pre&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Request Line&lt;/strong&gt;: Method + path + HTTP version&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Headers&lt;/strong&gt;: Key-value pairs (Host, User-Agent, Cookie, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Body&lt;/strong&gt;: Optional data (for POST requests with form data/JSON)&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;The server reads this and determines what to return.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;427pt&quot; height=&quot;66pt&quot; viewBox=&quot;0.00 0.00 427.00 66.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 62.4)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-62.4 422.92,-62.4 422.92,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Browser --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M51.43,-47.2C51.43,-47.2 12,-47.2 12,-47.2 6,-47.2 0,-41.2 0,-35.2 0,-35.2 0,-23.2 0,-23.2 0,-17.2 6,-11.2 12,-11.2 12,-11.2 51.43,-11.2 51.43,-11.2 57.43,-11.2 63.43,-17.2 63.43,-23.2 63.43,-23.2 63.43,-35.2 63.43,-35.2 63.43,-41.2 57.43,-47.2 51.43,-47.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;31.72&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Browser&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Request --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Request&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M234.09,-58.4C234.09,-58.4 142.54,-58.4 142.54,-58.4 136.54,-58.4 130.54,-52.4 130.54,-46.4 130.54,-46.4 130.54,-12 130.54,-12 130.54,-6 136.54,0 142.54,0 142.54,0 234.09,0 234.09,0 240.09,0 246.09,-6 246.09,-12 246.09,-12 246.09,-46.4 246.09,-46.4 246.09,-52.4 240.09,-58.4 234.09,-58.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;188.32&quot; y=&quot;-41.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;GET / HTTP/1.1&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;188.32&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Host: google.com&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;188.32&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;User-Agent: ...&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Browser&amp;#45;&amp;gt;Request --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Browser-&gt;Request&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M63.63,-29.2C79.54,-29.2 99.61,-29.2 118.93,-29.2&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;118.67,-32.7 128.67,-29.2 118.67,-25.7 118.67,-32.7&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;96.99&quot; y=&quot;-33.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;sends&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Server --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M406.92,-47.2C406.92,-47.2 376.92,-47.2 376.92,-47.2 370.92,-47.2 364.92,-41.2 364.92,-35.2 364.92,-35.2 364.92,-23.2 364.92,-23.2 364.92,-17.2 370.92,-11.2 376.92,-11.2 376.92,-11.2 406.92,-11.2 406.92,-11.2 412.92,-11.2 418.92,-17.2 418.92,-23.2 418.92,-23.2 418.92,-35.2 418.92,-35.2 418.92,-41.2 412.92,-47.2 406.92,-47.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;391.92&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Request&amp;#45;&amp;gt;Server --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Request-&gt;Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M246.55,-29.2C280.77,-29.2 323.29,-29.2 353.3,-29.2&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;353.02,-32.7 363.02,-29.2 353.02,-25.7 353.02,-32.7&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;305.51&quot; y=&quot;-33.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;over TCP/TLS&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Methods: GET (fetch), POST (submit), PUT (update), DELETE, etc.&lt;/li&gt;
&lt;li&gt;Headers provide metadata (cookies, auth, content-type)&lt;/li&gt;
&lt;li&gt;Body present only for methods that send data (POST, PUT)&lt;/li&gt;
&lt;li&gt;HTTP/1.1 requires Host header (virtual hosting)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../tcp-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tcp-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TCP Handshake&lt;/a&gt; — TCP connection must exist first&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../tls-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tls-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TLS Handshake&lt;/a&gt; — for HTTPS, TLS wraps HTTP&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../http-response&quot; class=&quot;internal alias&quot; data-slug=&quot;http-response&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Response&lt;/a&gt; — server replies to request&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../http-headers&quot; class=&quot;internal alias&quot; data-slug=&quot;http-headers&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Headers&lt;/a&gt; — headers are part of the request&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../http-methods&quot; class=&quot;internal alias&quot; data-slug=&quot;http-methods&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Methods&lt;/a&gt; — GET, POST, PUT, DELETE&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;GET requests shouldn’t have a body (though some servers accept it)&lt;/li&gt;
&lt;li&gt;Large headers can cause issues (proxy limits)&lt;/li&gt;
&lt;li&gt;Missing Host header fails in HTTP/1.1&lt;/li&gt;
&lt;li&gt;Request smuggling possible with malformed headers&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>http-response</title>
    <link href="https://animishraa05.github.io/wiki/https/http-response" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/http-response.md" />
    <summary>The Problem The server has processed the request—now it needs to send back the result.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="http" label="http" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The server has processed the request—now it needs to send back the result. Without a structured response format, the client wouldn’t know if the request succeeded, what data was returned, or how to interpret it.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;An HTTP response is the server’s reply containing: status code (200, 404, etc.), headers (content-type, cache-control), and body (HTML, JSON, etc.).&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A typical HTTP response looks like:&lt;/p&gt;
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1234

&amp;#x3C;html&gt;...&amp;#x3C;/html&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Status Line&lt;/strong&gt;: HTTP version + status code + reason phrase&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Headers&lt;/strong&gt;: Metadata (content-type, cache settings, cookies)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Body&lt;/strong&gt;: The actual data (HTML page, JSON, image, etc.)&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;The browser processes the response based on headers and status code.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;463pt&quot; height=&quot;82pt&quot; viewBox=&quot;0.00 0.00 463.00 82.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 78.4)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-78.4 459.08,-78.4 459.08,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Server --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Server&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M42,-55.2C42,-55.2 12,-55.2 12,-55.2 6,-55.2 0,-49.2 0,-43.2 0,-43.2 0,-31.2 0,-31.2 0,-25.2 6,-19.2 12,-19.2 12,-19.2 42,-19.2 42,-19.2 48,-19.2 54,-25.2 54,-31.2 54,-31.2 54,-43.2 54,-43.2 54,-49.2 48,-55.2 42,-55.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;27&quot; y=&quot;-33&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Response --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Response&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M260.81,-74.4C260.81,-74.4 133.11,-74.4 133.11,-74.4 127.11,-74.4 121.11,-68.4 121.11,-62.4 121.11,-62.4 121.11,-12 121.11,-12 121.11,-6 127.11,0 133.11,0 133.11,0 260.81,0 260.81,0 266.81,0 272.81,-6 272.81,-12 272.81,-12 272.81,-62.4 272.81,-62.4 272.81,-68.4 266.81,-74.4 260.81,-74.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;196.96&quot; y=&quot;-57.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;HTTP/1.1 200 OK&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;196.96&quot; y=&quot;-41&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Content-Type: text/html&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;196.96&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;&amp;#x3C;html&gt;...&amp;#x3C;/html&gt;&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Server&amp;#45;&amp;gt;Response --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Server-&gt;Response&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M54.24,-37.2C69.35,-37.2 89.3,-37.2 109.44,-37.2&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;109.43,-40.7 119.43,-37.2 109.43,-33.7 109.43,-40.7&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;87.56&quot; y=&quot;-41.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;sends&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Browser --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M443.08,-55.2C443.08,-55.2 403.64,-55.2 403.64,-55.2 397.64,-55.2 391.64,-49.2 391.64,-43.2 391.64,-43.2 391.64,-31.2 391.64,-31.2 391.64,-25.2 397.64,-19.2 403.64,-19.2 403.64,-19.2 443.08,-19.2 443.08,-19.2 449.08,-19.2 455.08,-25.2 455.08,-31.2 455.08,-31.2 455.08,-43.2 455.08,-43.2 455.08,-49.2 449.08,-55.2 443.08,-55.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;423.36&quot; y=&quot;-33&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Browser&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Response&amp;#45;&amp;gt;Browser --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Response-&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M273.31,-37.2C308.83,-37.2 349.89,-37.2 379.91,-37.2&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;379.73,-40.7 389.73,-37.2 379.73,-33.7 379.73,-40.7&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;332.23&quot; y=&quot;-41.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;over TCP/TLS&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Status codes: 2xx (success), 3xx (redirect), 4xx (client error), 5xx (server error)&lt;/li&gt;
&lt;li&gt;Headers tell browser how to handle the response (content-type, caching)&lt;/li&gt;
&lt;li&gt;Body contains the actual resource (HTML, CSS, JS, images)&lt;/li&gt;
&lt;li&gt;Responses can be cached based on cache headers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../http-request&quot; class=&quot;internal alias&quot; data-slug=&quot;http-request&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Request&lt;/a&gt; — response is the reply to a request&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — HTML response gets rendered&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../http-status-codes&quot; class=&quot;internal alias&quot; data-slug=&quot;http-status-codes&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Status Codes&lt;/a&gt; — 200, 404, 500, etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../http-headers&quot; class=&quot;internal alias&quot; data-slug=&quot;http-headers&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Headers&lt;/a&gt; — headers control response behavior&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;204 No Content has no body (valid response)&lt;/li&gt;
&lt;li&gt;301/302 redirects cause browser to make a new request&lt;/li&gt;
&lt;li&gt;304 Not Modified uses cached version (saves bandwidth)&lt;/li&gt;
&lt;li&gt;Chunked transfer encoding streams large responses&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>https</title>
    <link href="https://animishraa05.github.io/wiki/https/https" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/https.md" />
    <summary>The Problem HTTP sends data in plain text—anyone between client and server can read passwords, cookies, and private data.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="security" label="security" />
<category term="https" label="https" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;HTTP sends data in plain text—anyone between client and server can read passwords, cookies, and private data. Without encryption, the web would be unsafe for banking, shopping, or any private communication.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;HTTPS is HTTP over TLS/SSL encryption. It wraps HTTP inside an encrypted tunnel, protecting data from eavesdropping, tampering, and man-in-the-middle attacks.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;TCP Handshake&lt;/strong&gt;: Establish TCP connection (3-way handshake)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TLS Handshake&lt;/strong&gt;: Negotiate encryption, verify certificate, establish shared key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encrypted HTTP&lt;/strong&gt;: All HTTP requests/responses are encrypted with the shared key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Decrypt&lt;/strong&gt;: Server decrypts request, sends encrypted response&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;The browser shows a lock icon  for HTTPS sites.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;625pt&quot; height=&quot;50pt&quot; viewBox=&quot;0.00 0.00 625.00 50.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 45.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-45.6 620.81,-45.6 620.81,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Client --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M42,-38.8C42,-38.8 12,-38.8 12,-38.8 6,-38.8 0,-32.8 0,-26.8 0,-26.8 0,-14.8 0,-14.8 0,-8.8 6,-2.8 12,-2.8 12,-2.8 42,-2.8 42,-2.8 48,-2.8 54,-8.8 54,-14.8 54,-14.8 54,-26.8 54,-26.8 54,-32.8 48,-38.8 42,-38.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;27&quot; y=&quot;-16.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TCP --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TCP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M248.79,-41.6C248.79,-41.6 102,-41.6 102,-41.6 96,-41.6 90,-35.6 90,-29.6 90,-29.6 90,-12 90,-12 90,-6 96,0 102,0 102,0 248.79,0 248.79,0 254.79,0 260.79,-6 260.79,-12 260.79,-12 260.79,-29.6 260.79,-29.6 260.79,-35.6 254.79,-41.6 248.79,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;175.4&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TCP Handshake&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;175.4&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;SYN → SYN-ACK → ACK&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;TCP --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;TCP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M54.17,-20.8C61.4,-20.8 69.69,-20.8 78.46,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;78.28,-24.3 88.28,-20.8 78.28,-17.3 78.28,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- TLS --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TLS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M456.78,-41.6C456.78,-41.6 308.79,-41.6 308.79,-41.6 302.79,-41.6 296.79,-35.6 296.79,-29.6 296.79,-29.6 296.79,-12 296.79,-12 296.79,-6 302.79,0 308.79,0 308.79,0 456.78,0 456.78,0 462.78,0 468.78,-6 468.78,-12 468.78,-12 468.78,-29.6 468.78,-29.6 468.78,-35.6 462.78,-41.6 456.78,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;382.79&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TLS Handshake&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;382.79&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Certificate + Key Exchange&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TCP&amp;#45;&amp;gt;TLS --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TCP-&gt;TLS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M261.12,-20.8C269.08,-20.8 277.19,-20.8 285.25,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;285.08,-24.3 295.08,-20.8 285.08,-17.3 285.08,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- HTTP --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;HTTP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M604.81,-41.6C604.81,-41.6 516.78,-41.6 516.78,-41.6 510.78,-41.6 504.78,-35.6 504.78,-29.6 504.78,-29.6 504.78,-12 504.78,-12 504.78,-6 510.78,0 516.78,0 516.78,0 604.81,0 604.81,0 610.81,0 616.81,-6 616.81,-12 616.81,-12 616.81,-29.6 616.81,-29.6 616.81,-35.6 610.81,-41.6 604.81,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;560.8&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Encrypted HTTP&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;560.8&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;GET /, 200 OK&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLS&amp;#45;&amp;gt;HTTP --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TLS-&gt;HTTP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M469.21,-20.8C477.34,-20.8 485.49,-20.8 493.39,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;493.24,-24.3 503.24,-20.8 493.24,-17.3 493.24,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;HTTP + TLS encryption (default port 443)&lt;/li&gt;
&lt;li&gt;Protects against eavesdropping, tampering, MITM&lt;/li&gt;
&lt;li&gt;Requires SSL/TLS certificate from trusted CA&lt;/li&gt;
&lt;li&gt;Slower than HTTP (TLS handshake overhead)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../http&quot; class=&quot;internal alias&quot; data-slug=&quot;http&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP&lt;/a&gt; — HTTPS is HTTP over TLS&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../tls-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tls-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TLS Handshake&lt;/a&gt; — HTTPS requires TLS&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../tcp-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tcp-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TCP Handshake&lt;/a&gt; — TCP comes first&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../hsts&quot; class=&quot;internal alias&quot; data-slug=&quot;hsts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HSTS&lt;/a&gt; — enforces HTTPS usage&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../http&quot; class=&quot;internal alias&quot; data-slug=&quot;http&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP&lt;/a&gt; — HTTP is plain text, HTTPS is encrypted&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Mixed content warnings (HTTPS page loading HTTP resources)&lt;/li&gt;
&lt;li&gt;Certificate expiration breaks HTTPS (browser warning)&lt;/li&gt;
&lt;li&gt;TLS 1.3 is faster (1-RTT handshake)&lt;/li&gt;
&lt;li&gt;Some networks block HTTPS (deep packet inspection)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>keyboard-interrupt</title>
    <link href="https://animishraa05.github.io/wiki/https/keyboard-interrupt" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/keyboard-interrupt.md" />
    <summary>The Problem When you press a key, the computer needs to know about it immediately.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="systems" label="systems" />
<category term="hardware" label="hardware" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When you press a key, the computer needs to know about it immediately. Without interrupts, the CPU would have to constantly poll (check) the keyboard, wasting cycles.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A keyboard interrupt is a hardware signal sent to the CPU when a key is pressed (or released). The keyboard controller converts the physical keypress into a scan code and triggers an interrupt for the OS to handle.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Key press&lt;/strong&gt;: Physical switch closes in keyboard matrix&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scan code&lt;/strong&gt;: Keyboard controller generates scan code (e.g., &lt;code class=&quot;notranslate&quot;&gt;g&lt;/code&gt; = code 0x22)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interrupt&lt;/strong&gt;: Keyboard raises hardware interrupt (IRQ 1 on x86)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OS handler&lt;/strong&gt;: CPU jumps to interrupt handler, reads scan code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;To application&lt;/strong&gt;: OS delivers key event to active app (browser)&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;USB keyboards poll at ~10ms instead of generating interrupts.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;686pt&quot; height=&quot;50pt&quot; viewBox=&quot;0.00 0.00 686.00 50.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 45.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-45.6 682.45,-45.6 682.45,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Key --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Key&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M80.21,-38.8C80.21,-38.8 12,-38.8 12,-38.8 6,-38.8 0,-32.8 0,-26.8 0,-26.8 0,-14.8 0,-14.8 0,-8.8 6,-2.8 12,-2.8 12,-2.8 80.21,-2.8 80.21,-2.8 86.21,-2.8 92.21,-8.8 92.21,-14.8 92.21,-14.8 92.21,-26.8 92.21,-26.8 92.21,-32.8 86.21,-38.8 80.21,-38.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;46.1&quot; y=&quot;-16.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Key Press (g)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Controller --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Controller&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M248.45,-41.6C248.45,-41.6 140.21,-41.6 140.21,-41.6 134.21,-41.6 128.21,-35.6 128.21,-29.6 128.21,-29.6 128.21,-12 128.21,-12 128.21,-6 134.21,0 140.21,0 140.21,0 248.45,0 248.45,0 254.45,0 260.45,-6 260.45,-12 260.45,-12 260.45,-29.6 260.45,-29.6 260.45,-35.6 254.45,-41.6 248.45,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;194.33&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Keyboard Controller&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;194.33&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;generate scan code&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Key&amp;#45;&amp;gt;Controller --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Key-&gt;Controller&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M92.57,-20.8C100.15,-20.8 108.19,-20.8 116.3,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;116.25,-24.3 126.25,-20.8 116.25,-17.3 116.25,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Interrupt --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Interrupt&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M408.12,-41.6C408.12,-41.6 308.45,-41.6 308.45,-41.6 302.45,-41.6 296.45,-35.6 296.45,-29.6 296.45,-29.6 296.45,-12 296.45,-12 296.45,-6 302.45,0 308.45,0 308.45,0 408.12,0 408.12,0 414.12,0 420.12,-6 420.12,-12 420.12,-12 420.12,-29.6 420.12,-29.6 420.12,-35.6 414.12,-41.6 408.12,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;358.29&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Hardware Interrupt&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;358.29&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(IRQ 1)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Controller&amp;#45;&amp;gt;Interrupt --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Controller-&gt;Interrupt&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M260.74,-20.8C268.67,-20.8 276.82,-20.8 284.85,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;284.58,-24.3 294.58,-20.8 284.58,-17.3 284.58,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- OS --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;OS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M542.51,-41.6C542.51,-41.6 468.12,-41.6 468.12,-41.6 462.12,-41.6 456.12,-35.6 456.12,-29.6 456.12,-29.6 456.12,-12 456.12,-12 456.12,-6 462.12,0 468.12,0 468.12,0 542.51,0 542.51,0 548.51,0 554.51,-6 554.51,-12 554.51,-12 554.51,-29.6 554.51,-29.6 554.51,-35.6 548.51,-41.6 542.51,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;505.31&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;OS Handler&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;505.31&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;read scan code&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Interrupt&amp;#45;&amp;gt;OS --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Interrupt-&gt;OS&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M420.37,-20.8C428.28,-20.8 436.37,-20.8 444.26,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;444.11,-24.3 454.11,-20.8 444.11,-17.3 444.11,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- App --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;App&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M666.45,-41.6C666.45,-41.6 602.51,-41.6 602.51,-41.6 596.51,-41.6 590.51,-35.6 590.51,-29.6 590.51,-29.6 590.51,-12 590.51,-12 590.51,-6 596.51,0 602.51,0 602.51,0 666.45,0 666.45,0 672.45,0 678.45,-6 678.45,-12 678.45,-12 678.45,-29.6 678.45,-29.6 678.45,-35.6 672.45,-41.6 666.45,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;634.48&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Browser&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;634.48&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;KeyDown: g&lt;/text&gt;
&lt;/g&gt;
&lt;!-- OS&amp;#45;&amp;gt;App --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;OS-&gt;App&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M554.75,-20.8C562.58,-20.8 570.73,-20.8 578.7,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;578.66,-24.3 588.66,-20.8 578.66,-17.3 578.66,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Scan codes are hardware-specific (not ASCII)&lt;/li&gt;
&lt;li&gt;USB polls at ~10ms (not true interrupts)&lt;/li&gt;
&lt;li&gt;OS converts scan codes to characters&lt;/li&gt;
&lt;li&gt;Interrupt Vector Table maps IRQ to handler&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../os-interrupt-handler&quot; class=&quot;internal alias&quot; data-slug=&quot;os-interrupt-handler&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;OS Interrupt Handler&lt;/a&gt; — OS handles the interrupt&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../keyboard-matrix&quot; class=&quot;internal alias&quot; data-slug=&quot;keyboard-matrix&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Keyboard Matrix&lt;/a&gt; — physical circuit for keys&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../scan-code&quot; class=&quot;internal alias&quot; data-slug=&quot;scan-code&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Scan Code&lt;/a&gt; — what keyboard controller generates&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../polling&quot; class=&quot;internal alias&quot; data-slug=&quot;polling&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Polling&lt;/a&gt; — interrupts vs continuous checking&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Key repeat triggers multiple interrupts (hold key down)&lt;/li&gt;
&lt;li&gt;USB keyboards don’t use hardware interrupts (polling)&lt;/li&gt;
&lt;li&gt;Some keys have two-byte scan codes (extended keys)&lt;/li&gt;
&lt;li&gt;Interrupt storms can overwhelm CPU (too many fast keypresses)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>layout</title>
    <link href="https://animishraa05.github.io/wiki/https/layout" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/layout.md" />
    <summary>The Problem The render tree has elements with styles, but the browser doesn’t yet know where to put them on the screen.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The render tree has elements with styles, but the browser doesn’t yet know where to put them on the screen. Without layout calculation, everything would overlap at position (0,0).&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Layout (also called reflow) calculates the exact position (x,y) and size (width, height) of each element in the render tree. It runs the CSS box model algorithm to determine where pixels go.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Start at root&lt;/strong&gt;: Begin with &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;html&gt;&lt;/code&gt; element&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Box model&lt;/strong&gt;: Calculate width, height, padding, border, margin per element&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flow&lt;/strong&gt;: Block elements stack vertically, inline elements flow horizontally&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Positioning&lt;/strong&gt;: Apply &lt;code class=&quot;notranslate&quot;&gt;position&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;float&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;flexbox&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;grid&lt;/code&gt; rules&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Output&lt;/strong&gt;: Each element gets (x, y, width, height)&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;Element: &amp;#x3C;div&gt;
- x: 100px, y: 50px
- width: 500px, height: 200px
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;169pt&quot; height=&quot;194pt&quot; viewBox=&quot;0.00 0.00 169.00 194.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 189.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-189.6 164.61,-189.6 164.61,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- RenderTree --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;RenderTree&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M111.09,-185.6C111.09,-185.6 49.52,-185.6 49.52,-185.6 43.52,-185.6 37.52,-179.6 37.52,-173.6 37.52,-173.6 37.52,-161.6 37.52,-161.6 37.52,-155.6 43.52,-149.6 49.52,-149.6 49.52,-149.6 111.09,-149.6 111.09,-149.6 117.09,-149.6 123.09,-155.6 123.09,-161.6 123.09,-161.6 123.09,-173.6 123.09,-173.6 123.09,-179.6 117.09,-185.6 111.09,-185.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;80.31&quot; y=&quot;-163.4&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Render Tree&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Layout --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Layout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M145.32,-113.6C145.32,-113.6 15.29,-113.6 15.29,-113.6 9.29,-113.6 3.29,-107.6 3.29,-101.6 3.29,-101.6 3.29,-84 3.29,-84 3.29,-78 9.29,-72 15.29,-72 15.29,-72 145.32,-72 145.32,-72 151.32,-72 157.32,-78 157.32,-84 157.32,-84 157.32,-101.6 157.32,-101.6 157.32,-107.6 151.32,-113.6 145.32,-113.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;80.31&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Layout Phase&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;80.31&quot; y=&quot;-80.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Calculate positions/sizes&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RenderTree&amp;#45;&amp;gt;Layout --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;RenderTree-&gt;Layout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M80.31,-149.35C80.31,-142.15 80.31,-133.55 80.31,-125.29&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;83.81,-125.54 80.31,-115.54 76.81,-125.54 83.81,-125.54&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Output --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Output&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M148.61,-36C148.61,-36 12,-36 12,-36 6,-36 0,-30 0,-24 0,-24 0,-12 0,-12 0,-6 6,0 12,0 12,0 148.61,0 148.61,0 154.61,0 160.61,-6 160.61,-12 160.61,-12 160.61,-24 160.61,-24 160.61,-30 154.61,-36 148.61,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;80.31&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Each element: (x, y, w, h)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Layout&amp;#45;&amp;gt;Output --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Layout-&gt;Output&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M80.31,-71.52C80.31,-64.15 80.31,-55.66 80.31,-47.7&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;83.81,-47.73 80.31,-37.73 76.81,-47.73 83.81,-47.73&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Also called “reflow” when triggered again after initial layout&lt;/li&gt;
&lt;li&gt;Runs the CSS box model algorithm&lt;/li&gt;
&lt;li&gt;Parent elements affect children (containing blocks)&lt;/li&gt;
&lt;li&gt;Expensive operation—avoid forced synchronous layout&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../render-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;render-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Render Tree&lt;/a&gt; — layout takes render tree as input&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../painting&quot; class=&quot;internal alias&quot; data-slug=&quot;painting&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Painting&lt;/a&gt; — layout output used for painting&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../css-box-model&quot; class=&quot;internal alias&quot; data-slug=&quot;css-box-model&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSS Box Model&lt;/a&gt; — defines width/height calculation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — layout is step 4&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Reading offsetWidth/Height triggers synchronous layout (slow!)&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;display: none&lt;/code&gt; → &lt;code class=&quot;notranslate&quot;&gt;display: block&lt;/code&gt; triggers full reflow&lt;/li&gt;
&lt;li&gt;Animations with &lt;code class=&quot;notranslate&quot;&gt;top&lt;/code&gt;/&lt;code class=&quot;notranslate&quot;&gt;left&lt;/code&gt; cause continuous reflow (use &lt;code class=&quot;notranslate&quot;&gt;transform&lt;/code&gt; instead)&lt;/li&gt;
&lt;li&gt;Table layout is especially expensive&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>mac-address</title>
    <link href="https://animishraa05.github.io/wiki/https/mac-address" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/mac-address.md" />
    <summary>The Problem On a local network (Ethernet, Wi-Fi), devices need unique identifiers to deliver packets to the correct machine.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="ethernet" label="ethernet" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;On a local network (Ethernet, Wi-Fi), devices need unique identifiers to deliver packets to the correct machine. IP addresses can change, but hardware needs a permanent identifier for Layer 2 communication.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A MAC address is a 48-bit hardware identifier (e.g., &lt;code class=&quot;notranslate&quot;&gt;aa:bb:cc:dd:ee:ff&lt;/code&gt;) burned into a network interface card (NIC). It’s used by Ethernet and Wi-Fi to deliver frames to the correct device on the local network.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Structure&lt;/strong&gt;: 6 bytes = 48 bits, typically written as hex pairs (aa:bb:cc:dd:ee:ff)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Uniqueness&lt;/strong&gt;: First 3 bytes = OUI (Organizationally Unique Identifier, assigned to vendor)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Delivery&lt;/strong&gt;: Network switches read destination MAC to forward frames&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resolution&lt;/strong&gt;: &lt;a href=&quot;../../arp-protocol&quot; class=&quot;internal alias&quot; data-slug=&quot;arp-protocol&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ARP&lt;/a&gt; maps IP addresses to MAC addresses&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;MAC addresses operate at Layer 2 (Data Link), while IP addresses operate at Layer 3 (Network).&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;328pt&quot; height=&quot;152pt&quot; viewBox=&quot;0.00 0.00 328.00 152.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 148)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-148 323.58,-148 323.58,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Packet --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Packet&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M90.69,-90C90.69,-90 12,-90 12,-90 6,-90 0,-84 0,-78 0,-78 0,-66 0,-66 0,-60 6,-54 12,-54 12,-54 90.69,-54 90.69,-54 96.69,-54 102.69,-60 102.69,-66 102.69,-66 102.69,-78 102.69,-78 102.69,-84 96.69,-90 90.69,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;51.34&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Ethernet Frame&lt;/text&gt;
&lt;/g&gt;
&lt;!-- DestMAC --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;DestMAC&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M306.39,-144C306.39,-144 151.88,-144 151.88,-144 145.88,-144 139.88,-138 139.88,-132 139.88,-132 139.88,-120 139.88,-120 139.88,-114 145.88,-108 151.88,-108 151.88,-108 306.39,-108 306.39,-108 312.39,-108 318.39,-114 318.39,-120 318.39,-120 318.39,-132 318.39,-132 318.39,-138 312.39,-144 306.39,-144&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;229.13&quot; y=&quot;-121.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Dest MAC: aa:bb:cc:dd:ee:ff&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Packet&amp;#45;&amp;gt;DestMAC --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Packet-&gt;DestMAC&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M103,-87.93C114.71,-91.59 127.13,-95.45 138.69,-99 144.4,-100.76 150.33,-102.57 156.29,-104.38&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;154.97,-107.64 165.55,-107.2 157,-100.94 154.97,-107.64&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- SrcMAC --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;SrcMAC&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M307.58,-90C307.58,-90 150.69,-90 150.69,-90 144.69,-90 138.69,-84 138.69,-78 138.69,-78 138.69,-66 138.69,-66 138.69,-60 144.69,-54 150.69,-54 150.69,-54 307.58,-54 307.58,-54 313.58,-54 319.58,-60 319.58,-66 319.58,-66 319.58,-78 319.58,-78 319.58,-84 313.58,-90 307.58,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;229.13&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Src MAC: 11:22:33:44:55:66&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Packet&amp;#45;&amp;gt;SrcMAC --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Packet-&gt;SrcMAC&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M102.72,-72C110.39,-72 118.53,-72 126.84,-72&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;126.72,-75.5 136.72,-72 126.72,-68.5 126.72,-75.5&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- IP --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;IP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M270.62,-36C270.62,-36 187.65,-36 187.65,-36 181.65,-36 175.65,-30 175.65,-24 175.65,-24 175.65,-12 175.65,-12 175.65,-6 181.65,0 187.65,0 187.65,0 270.62,0 270.62,0 276.62,0 282.62,-6 282.62,-12 282.62,-12 282.62,-24 282.62,-24 282.62,-30 276.62,-36 270.62,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;229.13&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;IP Packet Inside&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Packet&amp;#45;&amp;gt;IP --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Packet-&gt;IP&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M103,-56.07C114.71,-52.41 127.13,-48.55 138.69,-45 147.08,-42.42 155.93,-39.72 164.66,-37.08&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;165.6,-40.45 174.16,-34.2 163.57,-33.75 165.6,-40.45&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;48 bits = 2^48 ≈ 281 trillion possible addresses&lt;/li&gt;
&lt;li&gt;Burned into hardware (but can be software-overridden)&lt;/li&gt;
&lt;li&gt;Used by switches to learn port-to-MAC mappings&lt;/li&gt;
&lt;li&gt;First 3 bytes indicate manufacturer (OUI)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../ethernet&quot; class=&quot;internal alias&quot; data-slug=&quot;ethernet&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Ethernet&lt;/a&gt; — MAC addresses are used by Ethernet&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../arp-protocol&quot; class=&quot;internal alias&quot; data-slug=&quot;arp-protocol&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ARP Protocol&lt;/a&gt; — ARP resolves IP to MAC&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../ip-address&quot; class=&quot;internal alias&quot; data-slug=&quot;ip-address&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;IP Address&lt;/a&gt; — IP is Layer 3; MAC is Layer 2&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../network-switch&quot; class=&quot;internal alias&quot; data-slug=&quot;network-switch&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Network Switch&lt;/a&gt; — switches forward based on MAC&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;MAC addresses can be spoofed (changed in software)&lt;/li&gt;
&lt;li&gt;VPNs hide your real MAC address&lt;/li&gt;
&lt;li&gt;Wi-Fi uses MAC filtering for access control (easily bypassed)&lt;/li&gt;
&lt;li&gt;Random MAC addresses used by some devices for privacy&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>os-interrupt-handler</title>
    <link href="https://animishraa05.github.io/wiki/https/os-interrupt-handler" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/os-interrupt-handler.md" />
    <summary>The Problem When hardware interrupts arrive (keyboard, mouse, network), the CPU needs to know what to do.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="systems" label="systems" />
<category term="os" label="os" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When hardware interrupts arrive (keyboard, mouse, network), the CPU needs to know what to do. Without an interrupt handler, the interrupt would be ignored or crash the system.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The OS interrupt handler is a function that runs when a hardware interrupt fires. It reads the scan code (for keyboard) or data (for other devices) and dispatches it to the appropriate driver or application.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Interrupt fires&lt;/strong&gt;: Hardware raises IRQ (e.g., IRQ 1 for keyboard)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CPU jumps&lt;/strong&gt;: Looks up handler in Interrupt Vector Table&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Handler runs&lt;/strong&gt;:
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Read data from device (scan code from keyboard)&lt;/li&gt;
&lt;li&gt;Convert to character (&lt;code class=&quot;notranslate&quot;&gt;g&lt;/code&gt; = scan code 0x22)&lt;/li&gt;
&lt;li&gt;Determine target application (active window = browser)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deliver event&lt;/strong&gt;: Send key event to application&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;599pt&quot; height=&quot;50pt&quot; viewBox=&quot;0.00 0.00 599.00 50.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 45.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-45.6 595.47,-45.6 595.47,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- IRQ --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;IRQ&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M106.63,-38.8C106.63,-38.8 12,-38.8 12,-38.8 6,-38.8 0,-32.8 0,-26.8 0,-26.8 0,-14.8 0,-14.8 0,-8.8 6,-2.8 12,-2.8 12,-2.8 106.63,-2.8 106.63,-2.8 112.63,-2.8 118.63,-8.8 118.63,-14.8 118.63,-14.8 118.63,-26.8 118.63,-26.8 118.63,-32.8 112.63,-38.8 106.63,-38.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;59.32&quot; y=&quot;-16.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;IRQ 1 (Keyboard)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- IVT --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;IVT&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M284.57,-41.6C284.57,-41.6 166.63,-41.6 166.63,-41.6 160.63,-41.6 154.63,-35.6 154.63,-29.6 154.63,-29.6 154.63,-12 154.63,-12 154.63,-6 160.63,0 166.63,0 166.63,0 284.57,0 284.57,0 290.57,0 296.57,-6 296.57,-12 296.57,-12 296.57,-29.6 296.57,-29.6 296.57,-35.6 290.57,-41.6 284.57,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;225.6&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Interrupt Vector Table&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;225.6&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;IRQ 1 → Handler&lt;/text&gt;
&lt;/g&gt;
&lt;!-- IRQ&amp;#45;&amp;gt;IVT --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;IRQ-&gt;IVT&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M118.7,-20.8C126.54,-20.8 134.69,-20.8 142.83,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;142.8,-24.3 152.8,-20.8 142.8,-17.3 142.8,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Handler --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Handler&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M455.54,-38.8C455.54,-38.8 344.57,-38.8 344.57,-38.8 338.57,-38.8 332.57,-32.8 332.57,-26.8 332.57,-26.8 332.57,-14.8 332.57,-14.8 332.57,-8.8 338.57,-2.8 344.57,-2.8 344.57,-2.8 455.54,-2.8 455.54,-2.8 461.54,-2.8 467.54,-8.8 467.54,-14.8 467.54,-14.8 467.54,-26.8 467.54,-26.8 467.54,-32.8 461.54,-38.8 455.54,-38.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;400.06&quot; y=&quot;-16.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;OS Interrupt Handler&lt;/text&gt;
&lt;/g&gt;
&lt;!-- IVT&amp;#45;&amp;gt;Handler --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;IVT-&gt;Handler&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M296.75,-20.8C304.73,-20.8 312.91,-20.8 320.99,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;320.81,-24.3 330.81,-20.8 320.81,-17.3 320.81,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Browser --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M579.47,-41.6C579.47,-41.6 515.54,-41.6 515.54,-41.6 509.54,-41.6 503.54,-35.6 503.54,-29.6 503.54,-29.6 503.54,-12 503.54,-12 503.54,-6 509.54,0 515.54,0 515.54,0 579.47,0 579.47,0 585.47,0 591.47,-6 591.47,-12 591.47,-12 591.47,-29.6 591.47,-29.6 591.47,-35.6 585.47,-41.6 579.47,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;547.51&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Browser&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;547.51&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;KeyDown: g&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Handler&amp;#45;&amp;gt;Browser --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Handler-&gt;Browser&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M467.82,-20.8C475.95,-20.8 484.18,-20.8 492.1,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;491.92,-24.3 501.92,-20.8 491.92,-17.3 491.92,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Interrupt Vector Table maps IRQ numbers to handler functions&lt;/li&gt;
&lt;li&gt;Handlers run in kernel mode (privileged)&lt;/li&gt;
&lt;li&gt;Must be fast—blocking handler blocks entire system&lt;/li&gt;
&lt;li&gt;After handler, CPU resumes previous task&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../keyboard-interrupt&quot; class=&quot;internal alias&quot; data-slug=&quot;keyboard-interrupt&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Keyboard Interrupt&lt;/a&gt; — handler processes keyboard IRQs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../browser-autocomplete&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-autocomplete&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Autocomplete&lt;/a&gt; — key events go to browser&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../interrupt-vector-table&quot; class=&quot;internal alias&quot; data-slug=&quot;interrupt-vector-table&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Interrupt Vector Table&lt;/a&gt; — lookup table for handlers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../kernel-mode&quot; class=&quot;internal alias&quot; data-slug=&quot;kernel-mode&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Kernel Mode&lt;/a&gt; — handlers run with full privileges&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Slow handlers cause system lag (handler blocks everything)&lt;/li&gt;
&lt;li&gt;Nested interrupts require careful handling&lt;/li&gt;
&lt;li&gt;Missing handler = interrupt ignored (or panic)&lt;/li&gt;
&lt;li&gt;Shared IRQs (multiple devices on one IRQ) need demultiplexing&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>painting</title>
    <link href="https://animishraa05.github.io/wiki/https/painting" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/painting.md" />
    <summary>The Problem The browser knows where each element goes (layout), but the screen is still blank. The pixels haven’t been drawn yet.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The browser knows where each element goes (layout), but the screen is still blank. The pixels haven’t been drawn yet. Without painting, the user would see nothing.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Painting (rasterization) converts the layout output into actual pixels. Each element is drawn into layers (bitmaps) that will later be composited together.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Input&lt;/strong&gt;: Layout gives (x, y, width, height) for each element&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fill pixels&lt;/strong&gt;: Draw text, backgrounds, borders, shadows&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create layers&lt;/strong&gt;: Elements may be promoted to separate layers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Output&lt;/strong&gt;: Bitmap layers ready for compositing&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Painting is done by the browser’s rendering engine (Blink, Gecko, WebKit).&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;416pt&quot; height=&quot;50pt&quot; viewBox=&quot;0.00 0.00 416.00 50.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 45.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-45.6 412.46,-45.6 412.46,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Layout --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Layout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M124.12,-41.6C124.12,-41.6 12,-41.6 12,-41.6 6,-41.6 0,-35.6 0,-29.6 0,-29.6 0,-12 0,-12 0,-6 6,0 12,0 12,0 124.12,0 124.12,0 130.12,0 136.12,-6 136.12,-12 136.12,-12 136.12,-29.6 136.12,-29.6 136.12,-35.6 130.12,-41.6 124.12,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;68.06&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Layout&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;68.06&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(x,y,w,h) per element&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Paint --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Paint&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M244.16,-41.6C244.16,-41.6 184.12,-41.6 184.12,-41.6 178.12,-41.6 172.12,-35.6 172.12,-29.6 172.12,-29.6 172.12,-12 172.12,-12 172.12,-6 178.12,0 184.12,0 184.12,0 244.16,0 244.16,0 250.16,0 256.16,-6 256.16,-12 256.16,-12 256.16,-29.6 256.16,-29.6 256.16,-35.6 250.16,-41.6 244.16,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;214.14&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Paint Phase&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;214.14&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Draw pixels&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Layout&amp;#45;&amp;gt;Paint --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Layout-&gt;Paint&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M136.46,-20.8C144.44,-20.8 152.49,-20.8 160.22,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;160.16,-24.3 170.16,-20.8 160.16,-17.3 160.16,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Layers --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Layers&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M396.46,-41.6C396.46,-41.6 304.16,-41.6 304.16,-41.6 298.16,-41.6 292.16,-35.6 292.16,-29.6 292.16,-29.6 292.16,-12 292.16,-12 292.16,-6 298.16,0 304.16,0 304.16,0 396.46,0 396.46,0 402.46,0 408.46,-6 408.46,-12 408.46,-12 408.46,-29.6 408.46,-29.6 408.46,-35.6 402.46,-41.6 396.46,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;350.31&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Bitmap Layers&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;350.31&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(text, bg, borders)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Paint&amp;#45;&amp;gt;Layers --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Paint-&gt;Layers&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M256.49,-20.8C264.22,-20.8 272.48,-20.8 280.78,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;280.55,-24.3 290.55,-20.8 280.55,-17.3 280.55,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Converts vectors (layout) to rasters (pixels)&lt;/li&gt;
&lt;li&gt;Each element can be in a different layer&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;will-change&lt;/code&gt; hints browser to create a layer&lt;/li&gt;
&lt;li&gt;CPU-intensive for complex styles (shadows, gradients)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../layout&quot; class=&quot;internal alias&quot; data-slug=&quot;layout&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Layout&lt;/a&gt; — painting uses layout output&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../compositing&quot; class=&quot;internal alias&quot; data-slug=&quot;compositing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Compositing&lt;/a&gt; — layers get combined&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../gpu-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;gpu-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;GPU Rendering&lt;/a&gt; — can accelerate painting&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — painting is step 5&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Large repaints are expensive (full-screen redraw)&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;box-shadow&lt;/code&gt; and &lt;code class=&quot;notranslate&quot;&gt;border-radius&lt;/code&gt; slow down painting&lt;/li&gt;
&lt;li&gt;Layers help—only repaint changed elements&lt;/li&gt;
&lt;li&gt;Forced repaint (reading &lt;code class=&quot;notranslate&quot;&gt;getComputedStyle&lt;/code&gt;) is slow&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>recursive-dns</title>
    <link href="https://animishraa05.github.io/wiki/https/recursive-dns" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/recursive-dns.md" />
    <summary>The Problem Clients (browsers) don’t want to query root, TLD, and authoritative servers themselves—that’s too complex and slow.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="dns" label="dns" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Clients (browsers) don’t want to query root, TLD, and authoritative servers themselves—that’s too complex and slow. Recursive DNS resolvers do all the work so clients just get the final answer.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;A recursive DNS resolver is a server (usually your ISP’s or a public one like 8.8.8.8) that performs the full DNS lookup on behalf of clients. It queries root → TLD → authoritative servers and returns only the final IP.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Client Query&lt;/strong&gt;: “What is google.com’s IP?”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cache Check&lt;/strong&gt;: Resolver checks its cache first&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Recursive Lookup&lt;/strong&gt; (if not cached):
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Query root server → get TLD server&lt;/li&gt;
&lt;li&gt;Query TLD server → get authoritative server&lt;/li&gt;
&lt;li&gt;Query authoritative server → get IP&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cache &amp;#x26; Return&lt;/strong&gt;: Store in cache (per TTL), return IP to client&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Public recursive resolvers: Google (8.8.8.8), Cloudflare (1.1.1.1), Quad9 (9.9.9.9).&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;543pt&quot; height=&quot;227pt&quot; viewBox=&quot;0.00 0.00 543.00 227.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 223.2)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-223.2 538.8,-223.2 538.8,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Client --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M307.71,-219.2C307.71,-219.2 230.56,-219.2 230.56,-219.2 224.56,-219.2 218.56,-213.2 218.56,-207.2 218.56,-207.2 218.56,-195.2 218.56,-195.2 218.56,-189.2 224.56,-183.2 230.56,-183.2 230.56,-183.2 307.71,-183.2 307.71,-183.2 313.71,-183.2 319.71,-189.2 319.71,-195.2 319.71,-195.2 319.71,-207.2 319.71,-207.2 319.71,-213.2 313.71,-219.2 307.71,-219.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;269.14&quot; y=&quot;-197&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Client Browser&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M319.76,-130.4C319.76,-130.4 218.51,-130.4 218.51,-130.4 212.51,-130.4 206.51,-124.4 206.51,-118.4 206.51,-118.4 206.51,-100.8 206.51,-100.8 206.51,-94.8 212.51,-88.8 218.51,-88.8 218.51,-88.8 319.76,-88.8 319.76,-88.8 325.76,-88.8 331.76,-94.8 331.76,-100.8 331.76,-100.8 331.76,-118.4 331.76,-118.4 331.76,-124.4 325.76,-130.4 319.76,-130.4&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;269.14&quot; y=&quot;-113.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Recursive Resolver&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;269.14&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(ISP or 8.8.8.8)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Client&amp;#45;&amp;gt;Resolver --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Client-&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M237.97,-182.75C232.02,-177.89 226.6,-172.03 223.22,-165.2 218.56,-155.81 222,-146.66 228.69,-138.62&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;230.97,-141.3 235.57,-131.75 226.02,-136.34 230.97,-141.3&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;259.18&quot; y=&quot;-152.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;google.com?&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver&amp;#45;&amp;gt;Client --&gt;
&lt;g id=&quot;edge8&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Resolver-&gt;Client&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M287.05,-130.84C293.81,-140.92 299.03,-153.44 295.14,-165.2 294.22,-167.97 292.99,-170.69 291.57,-173.33&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;288.66,-171.37 286.15,-181.67 294.53,-175.18 288.66,-171.37&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;336.71&quot; y=&quot;-152.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;142.250.xx.xx&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Root --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Root&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M110.77,-36C110.77,-36 51.5,-36 51.5,-36 45.5,-36 39.5,-30 39.5,-24 39.5,-24 39.5,-12 39.5,-12 39.5,-6 45.5,0 51.5,0 51.5,0 110.77,0 110.77,0 116.77,0 122.77,-6 122.77,-12 122.77,-12 122.77,-24 122.77,-24 122.77,-30 116.77,-36 110.77,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;81.14&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Root Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver&amp;#45;&amp;gt;Root --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Resolver-&gt;Root&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M206.19,-108.72C136.35,-107.35 30.09,-100.29 4.52,-70.8 -8.09,-56.27 7.87,-44 28.43,-35.05&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;29.71,-38.31 37.72,-31.37 27.13,-31.8 29.71,-38.31&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;48.83&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;1. Where .com?&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLD --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;TLD&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M256.76,-36C256.76,-36 197.51,-36 197.51,-36 191.51,-36 185.51,-30 185.51,-24 185.51,-24 185.51,-12 185.51,-12 185.51,-6 191.51,0 197.51,0 197.51,0 256.76,0 256.76,0 262.76,0 268.76,-6 268.76,-12 268.76,-12 268.76,-24 268.76,-24 268.76,-30 262.76,-36 256.76,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;227.14&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TLD Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver&amp;#45;&amp;gt;TLD --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Resolver-&gt;TLD&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M212.86,-88.52C205.92,-83.75 199.76,-77.92 195.41,-70.8 190.3,-62.43 193.09,-53.31 198.71,-45.08&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;201.36,-47.37 205.03,-37.43 195.96,-42.91 201.36,-47.37&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;258.77&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;2. Where google.com?&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Auth --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Auth&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M504.48,-36C504.48,-36 397.79,-36 397.79,-36 391.79,-36 385.79,-30 385.79,-24 385.79,-24 385.79,-12 385.79,-12 385.79,-6 391.79,0 397.79,0 397.79,0 504.48,0 504.48,0 510.48,0 516.48,-6 516.48,-12 516.48,-12 516.48,-24 516.48,-24 516.48,-30 510.48,-36 504.48,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;451.14&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Authoritative Server&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Resolver&amp;#45;&amp;gt;Auth --&gt;
&lt;g id=&quot;edge6&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Resolver-&gt;Auth&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M332.18,-92.8C350.16,-87.09 369.4,-79.79 386.14,-70.8 399.78,-63.48 413.41,-53.19 424.63,-43.71&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;426.69,-46.56 431.94,-37.35 422.1,-41.28 426.69,-46.56&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;427.27&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;3. IP?&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Root&amp;#45;&amp;gt;Resolver --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Root-&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M94.54,-36.22C104.24,-47.58 118.28,-61.94 133.55,-70.8 152.27,-81.66 174.27,-89.53 195.04,-95.18&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;194.07,-98.55 204.62,-97.64 195.81,-91.77 194.07,-98.55&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;161.34&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;TLD addr&lt;/text&gt;
&lt;/g&gt;
&lt;!-- TLD&amp;#45;&amp;gt;Resolver --&gt;
&lt;g id=&quot;edge5&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;TLD-&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M268.87,-23.49C288.44,-27.93 310.07,-36.7 322.14,-54 328.79,-63.54 324.6,-72.98 316.23,-81.25&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;314.16,-78.43 308.73,-87.53 318.65,-83.8 314.16,-78.43&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;353.61&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Auth addr&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Auth&amp;#45;&amp;gt;Resolver --&gt;
&lt;g id=&quot;edge7&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Auth-&gt;Resolver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M454.65,-36.39C455.84,-47.53 455.22,-61.57 447.14,-70.8 433.28,-86.62 385.72,-96.2 343.24,-101.77&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;342.99,-98.27 333.5,-102.97 343.86,-105.22 342.99,-98.27&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;494.55&quot; y=&quot;-58.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;142.250.xx.xx&lt;/text&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Does the heavy lifting so clients don’t have to&lt;/li&gt;
&lt;li&gt;Caches results for many clients (improves performance)&lt;/li&gt;
&lt;li&gt;Can be ISP-provided or public (Google, Cloudflare)&lt;/li&gt;
&lt;li&gt;Recursive = will query until it gets the final answer&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../dns-hierarchy&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-hierarchy&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Hierarchy&lt;/a&gt; — navigates the full hierarchy&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt; — recursive is the fallback when caches miss&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../dns-cache&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-cache&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Cache&lt;/a&gt; — resolvers cache aggressively&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../public-dns&quot; class=&quot;internal alias&quot; data-slug=&quot;public-dns&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Public DNS&lt;/a&gt; — Google DNS, Cloudflare, Quad9&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;ISP resolvers may hijack failed lookups to show ads&lt;/li&gt;
&lt;li&gt;DNS over HTTPS (DoH) encrypts queries to recursive resolver&lt;/li&gt;
&lt;li&gt;Some resolvers filter malicious domains (Quad9)&lt;/li&gt;
&lt;li&gt;Recursion can be disabled (authoritative-only servers)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>render-tree</title>
    <link href="https://animishraa05.github.io/wiki/https/render-tree" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/render-tree.md" />
    <summary>The Problem The DOM tree has all HTML elements, but not all are visible (e.g., &amp;lt;head&amp;gt;, display: none).</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="dev" label="dev" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The DOM tree has all HTML elements, but not all are visible (e.g., &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;head&gt;&lt;/code&gt;, &lt;code class=&quot;notranslate&quot;&gt;display: none&lt;/code&gt;). The CSSOM has all styles, but not all apply to every element. We need a combined tree of only visible elements with their styles attached.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;The render tree combines the DOM tree and CSSOM, keeping only visible elements and attaching their computed styles. This is the tree used for layout and painting—invisible elements are excluded.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Start with DOM&lt;/strong&gt;: Traverse the DOM tree&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check visibility&lt;/strong&gt;: Skip elements that are &lt;code class=&quot;notranslate&quot;&gt;display: none&lt;/code&gt; or in &lt;code class=&quot;notranslate&quot;&gt;&amp;#x3C;head&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Attach styles&lt;/strong&gt;: For each visible element, compute its styles from CSSOM&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Build render tree&lt;/strong&gt;: New tree with visible elements + computed styles&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;DOM: &amp;#x3C;div style=&quot;display:none&quot;&gt; (skipped)
DOM: &amp;#x3C;h1&gt; (included, with styles attached)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;194pt&quot; height=&quot;199pt&quot; viewBox=&quot;0.00 0.00 194.00 199.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 195.2)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-195.2 189.64,-195.2 189.64,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- DOM --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;DOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M80.58,-191.2C80.58,-191.2 12,-191.2 12,-191.2 6,-191.2 0,-185.2 0,-179.2 0,-179.2 0,-161.6 0,-161.6 0,-155.6 6,-149.6 12,-149.6 12,-149.6 80.58,-149.6 80.58,-149.6 86.58,-149.6 92.58,-155.6 92.58,-161.6 92.58,-161.6 92.58,-179.2 92.58,-179.2 92.58,-185.2 86.58,-191.2 80.58,-191.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;46.29&quot; y=&quot;-174.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;DOM Tree&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;46.29&quot; y=&quot;-157.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(all elements)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RenderTree --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;RenderTree&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M166.64,-113.6C166.64,-113.6 27.94,-113.6 27.94,-113.6 21.94,-113.6 15.94,-107.6 15.94,-101.6 15.94,-101.6 15.94,-84 15.94,-84 15.94,-78 21.94,-72 27.94,-72 27.94,-72 166.64,-72 166.64,-72 172.64,-72 178.64,-78 178.64,-84 178.64,-84 178.64,-101.6 178.64,-101.6 178.64,-107.6 172.64,-113.6 166.64,-113.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;97.29&quot; y=&quot;-97&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Render Tree&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;97.29&quot; y=&quot;-80.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(visible elements + styles)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- DOM&amp;#45;&amp;gt;RenderTree --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;DOM-&gt;RenderTree&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M59.96,-149.14C65.31,-141.2 71.57,-131.92 77.41,-123.26&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;80.22,-125.36 82.91,-115.11 74.42,-121.44 80.22,-125.36&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- CSSOM --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;CSSOM&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M173.64,-191.2C173.64,-191.2 122.93,-191.2 122.93,-191.2 116.93,-191.2 110.93,-185.2 110.93,-179.2 110.93,-179.2 110.93,-161.6 110.93,-161.6 110.93,-155.6 116.93,-149.6 122.93,-149.6 122.93,-149.6 173.64,-149.6 173.64,-149.6 179.64,-149.6 185.64,-155.6 185.64,-161.6 185.64,-161.6 185.64,-179.2 185.64,-179.2 185.64,-185.2 179.64,-191.2 173.64,-191.2&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;148.29&quot; y=&quot;-174.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;CSSOM&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;148.29&quot; y=&quot;-157.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(all styles)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- CSSOM&amp;#45;&amp;gt;RenderTree --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;CSSOM-&gt;RenderTree&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M134.62,-149.14C129.26,-141.2 123.01,-131.92 117.17,-123.26&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;120.16,-121.44 111.66,-115.11 114.35,-125.36 120.16,-121.44&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Layout --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Layout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M131.2,-36C131.2,-36 63.38,-36 63.38,-36 57.38,-36 51.38,-30 51.38,-24 51.38,-24 51.38,-12 51.38,-12 51.38,-6 57.38,0 63.38,0 63.38,0 131.2,0 131.2,0 137.2,0 143.2,-6 143.2,-12 143.2,-12 143.2,-24 143.2,-24 143.2,-30 137.2,-36 131.2,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;97.29&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Layout Phase&lt;/text&gt;
&lt;/g&gt;
&lt;!-- RenderTree&amp;#45;&amp;gt;Layout --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;RenderTree-&gt;Layout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M97.29,-71.52C97.29,-64.15 97.29,-55.66 97.29,-47.7&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;100.79,-47.73 97.29,-37.73 93.79,-47.73 100.79,-47.73&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Only visible elements included (&lt;code class=&quot;notranslate&quot;&gt;display: none&lt;/code&gt; excluded)&lt;/li&gt;
&lt;li&gt;Each node has computed styles (inherited + specified + default)&lt;/li&gt;
&lt;li&gt;Render tree nodes are called “render objects” or “frames”&lt;/li&gt;
&lt;li&gt;Changes to DOM or CSS can trigger render tree reconstruction&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../dom-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;dom-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DOM Tree&lt;/a&gt; — provides the structure&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../cssom&quot; class=&quot;internal alias&quot; data-slug=&quot;cssom&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSSOM&lt;/a&gt; — provides the styles&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../layout&quot; class=&quot;internal alias&quot; data-slug=&quot;layout&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Layout&lt;/a&gt; — render tree is input to layout&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Rendering&lt;/a&gt; — render tree is step 3&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../dom-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;dom-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DOM Tree&lt;/a&gt; — DOM has everything; render tree has only visible&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;visibility: hidden&lt;/code&gt; elements ARE in render tree (take space, just invisible)&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;display: none&lt;/code&gt; elements are NOT in render tree&lt;/li&gt;
&lt;li&gt;Pseudo-elements (&lt;code class=&quot;notranslate&quot;&gt;::before&lt;/code&gt;) are in render tree but not DOM&lt;/li&gt;
&lt;li&gt;Rebuilding render tree is expensive (triggers layout + paint)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>tcp-packet-drop</title>
    <link href="https://animishraa05.github.io/wiki/https/tcp-packet-drop" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/tcp-packet-drop.md" />
    <summary>The Problem Packets can get lost in the network (router congestion, cable issues, buffer overflow).</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="tcp" label="tcp" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;Packets can get lost in the network (router congestion, cable issues, buffer overflow). Without handling packet loss, data transfers would fail randomly and unpredictably.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When a TCP packet is dropped (lost in network), TCP detects the loss (via timeout or duplicate ACKs) and retransmits the packet. This ensures reliable delivery despite unreliable underlying networks.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Packet sent&lt;/strong&gt;: TCP sends packet with sequence number&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Packet lost&lt;/strong&gt;: Router drops packet (congestion, error)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeout&lt;/strong&gt;: Sender doesn’t receive ACK within timeout&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Retransmit&lt;/strong&gt;: Sender resends the packet&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Congestion control&lt;/strong&gt;: TCP reduces sending rate (slow start, congestion avoidance)&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;TCP treats packet drops as a signal of network congestion.&lt;/p&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;563pt&quot; height=&quot;50pt&quot; viewBox=&quot;0.00 0.00 563.00 50.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 45.6)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-45.6 558.53,-45.6 558.53,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- Sender --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Sender&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M42.88,-38.8C42.88,-38.8 12,-38.8 12,-38.8 6,-38.8 0,-32.8 0,-26.8 0,-26.8 0,-14.8 0,-14.8 0,-8.8 6,-2.8 12,-2.8 12,-2.8 42.88,-2.8 42.88,-2.8 48.88,-2.8 54.88,-8.8 54.88,-14.8 54.88,-14.8 54.88,-26.8 54.88,-26.8 54.88,-32.8 48.88,-38.8 42.88,-38.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;27.44&quot; y=&quot;-16.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Sender&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Packet --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Packet&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M189.36,-41.6C189.36,-41.6 128.54,-41.6 128.54,-41.6 122.54,-41.6 116.54,-35.6 116.54,-29.6 116.54,-29.6 116.54,-12 116.54,-12 116.54,-6 122.54,0 128.54,0 128.54,0 189.36,0 189.36,0 195.36,0 201.36,-6 201.36,-12 201.36,-12 201.36,-29.6 201.36,-29.6 201.36,-35.6 195.36,-41.6 189.36,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;158.95&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Packet #100&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;158.95&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;LOST&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Sender&amp;#45;&amp;gt;Packet --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Sender-&gt;Packet&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M55.27,-20.8C69.68,-20.8 87.95,-20.8 105.07,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;104.59,-24.3 114.59,-20.8 104.59,-17.3 104.59,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;85.71&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;send&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Timeout --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Timeout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M317.97,-41.6C317.97,-41.6 269.58,-41.6 269.58,-41.6 263.58,-41.6 257.58,-35.6 257.58,-29.6 257.58,-29.6 257.58,-12 257.58,-12 257.58,-6 263.58,0 269.58,0 269.58,0 317.97,0 317.97,0 323.97,0 329.97,-6 329.97,-12 329.97,-12 329.97,-29.6 329.97,-29.6 329.97,-35.6 323.97,-41.6 317.97,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;293.77&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Timeout&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;293.77&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;(no ACK)&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Packet&amp;#45;&amp;gt;Timeout --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Packet-&gt;Timeout&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M201.61,-20.8C215.78,-20.8 231.7,-20.8 246.22,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;246,-24.3 256,-20.8 246,-17.3 246,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;229.47&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;lost&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Retry --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Retry&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M439.78,-41.6C439.78,-41.6 378.97,-41.6 378.97,-41.6 372.97,-41.6 366.97,-35.6 366.97,-29.6 366.97,-29.6 366.97,-12 366.97,-12 366.97,-6 372.97,0 378.97,0 378.97,0 439.78,0 439.78,0 445.78,0 451.78,-6 451.78,-12 451.78,-12 451.78,-29.6 451.78,-29.6 451.78,-35.6 445.78,-41.6 439.78,-41.6&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;409.37&quot; y=&quot;-25&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Retransmit&lt;/text&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;409.37&quot; y=&quot;-8.2&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Packet #100&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Timeout&amp;#45;&amp;gt;Retry --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Timeout-&gt;Retry&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M330.41,-20.8C338.28,-20.8 346.79,-20.8 355.19,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;354.99,-24.3 364.99,-20.8 354.99,-17.3 354.99,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Receiver --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Receiver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M542.53,-38.8C542.53,-38.8 500.78,-38.8 500.78,-38.8 494.78,-38.8 488.78,-32.8 488.78,-26.8 488.78,-26.8 488.78,-14.8 488.78,-14.8 488.78,-8.8 494.78,-2.8 500.78,-2.8 500.78,-2.8 542.53,-2.8 542.53,-2.8 548.53,-2.8 554.53,-8.8 554.53,-14.8 554.53,-14.8 554.53,-26.8 554.53,-26.8 554.53,-32.8 548.53,-38.8 542.53,-38.8&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;521.66&quot; y=&quot;-16.6&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Receiver&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Retry&amp;#45;&amp;gt;Receiver --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;Retry-&gt;Receiver&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M452.07,-20.8C460.28,-20.8 468.91,-20.8 477.17,-20.8&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;477.02,-24.3 487.02,-20.8 477.02,-17.3 477.02,-24.3&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Detected via timeout or 3 duplicate ACKs&lt;/li&gt;
&lt;li&gt;Triggers retransmission automatically&lt;/li&gt;
&lt;li&gt;Reduces congestion window (slows down sending)&lt;/li&gt;
&lt;li&gt;Part of TCP’s reliability guarantees&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../tcp-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tcp-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TCP Handshake&lt;/a&gt; — TCP connection must exist&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../congestion-control&quot; class=&quot;internal alias&quot; data-slug=&quot;congestion-control&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Congestion Control&lt;/a&gt; — packet drop triggers slowdown&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../timeout&quot; class=&quot;internal alias&quot; data-slug=&quot;timeout&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Timeout&lt;/a&gt; — mechanism to detect lost packets&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Contrasts with:&lt;/strong&gt; &lt;a href=&quot;../../udp&quot; class=&quot;internal alias&quot; data-slug=&quot;udp&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;UDP&lt;/a&gt; — UDP doesn’t handle packet loss&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Too-short timeout = unnecessary retransmissions&lt;/li&gt;
&lt;li&gt;Too-long timeout = slow recovery&lt;/li&gt;
&lt;li&gt;Congestion collapse if many TCP flows don’t back off&lt;/li&gt;
&lt;li&gt;Some networks drop packets intentionally (policing)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>url-parsing</title>
    <link href="https://animishraa05.github.io/wiki/https/url-parsing" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/url-parsing.md" />
    <summary>The Problem When you type a URL into a browser, the browser needs to understand what resource you’re requesting and how to reach it.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="url" label="url" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;the-problem&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Problem&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-problem&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;When you type a URL into a browser, the browser needs to understand what resource you’re requesting and how to reach it. Without parsing, the browser wouldn’t know which protocol to use, which server to contact, or which resource to fetch.&lt;/p&gt;
&lt;h2 id=&quot;core-idea&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Core Idea&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#core-idea&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;URL parsing is the process of breaking a URL string into its component parts: protocol, domain, path, query parameters, and fragments. This allows the browser to understand the request and route it correctly.&lt;/p&gt;
&lt;h2 id=&quot;how-it-works&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;How It Works&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#how-it-works&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Extract Protocol&lt;/strong&gt;: Browser identifies the scheme (e.g., &lt;code class=&quot;notranslate&quot;&gt;https://&lt;/code&gt;) to determine the protocol&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extract Domain&lt;/strong&gt;: The hostname (e.g., &lt;code class=&quot;notranslate&quot;&gt;google.com&lt;/code&gt;) is separated for DNS resolution&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extract Path&lt;/strong&gt;: The resource path (e.g., &lt;code class=&quot;notranslate&quot;&gt;/search&lt;/code&gt;) tells the server which resource to return&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extract Query&lt;/strong&gt;: Query parameters (e.g., &lt;code class=&quot;notranslate&quot;&gt;?q=hello&lt;/code&gt;) provide additional request data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extract Fragment&lt;/strong&gt;: The fragment (e.g., &lt;code class=&quot;notranslate&quot;&gt;#section&lt;/code&gt;) identifies a specific part of the page&lt;/li&gt;
&lt;/ol&gt;
&lt;p dir=&quot;auto&quot;&gt;Example: &lt;code class=&quot;notranslate&quot;&gt;https://google.com/search?q=hello&lt;/code&gt;&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Protocol: &lt;code class=&quot;notranslate&quot;&gt;https&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Domain: &lt;code class=&quot;notranslate&quot;&gt;google.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Path: &lt;code class=&quot;notranslate&quot;&gt;/search&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Query: &lt;code class=&quot;notranslate&quot;&gt;q=hello&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;visual-explanation&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Visual Explanation&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#visual-explanation&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;graphviz-container&quot; style=&quot;display: flex; justify-content: center; margin: 1.5rem 0; overflow-x: auto;&quot; dir=&quot;auto&quot;&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;!-- Generated by graphviz version 15.1.0 (0)
 --&gt;
&lt;!-- Title: G Pages: 1 --&gt;
&lt;svg width=&quot;388pt&quot; height=&quot;206pt&quot; viewBox=&quot;0.00 0.00 388.00 206.00&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
&lt;g id=&quot;graph0&quot; class=&quot;graph&quot; transform=&quot;scale(1 1) rotate(0) translate(4 202)&quot;&gt;
&lt;title&gt;G&lt;/title&gt;
&lt;polygon fill=&quot;white&quot; stroke=&quot;none&quot; points=&quot;-4,4 -4,-202 383.55,-202 383.55,4 -4,4&quot;&gt;&lt;/polygon&gt;
&lt;!-- URL --&gt;
&lt;g id=&quot;node1&quot; class=&quot;node&quot;&gt;
&lt;title&gt;URL&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M197.35,-117C197.35,-117 12,-117 12,-117 6,-117 0,-111 0,-105 0,-105 0,-93 0,-93 0,-87 6,-81 12,-81 12,-81 197.35,-81 197.35,-81 203.35,-81 209.35,-87 209.35,-93 209.35,-93 209.35,-105 209.35,-105 209.35,-111 203.35,-117 197.35,-117&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;104.67&quot; y=&quot;-94.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;https://google.com/search?q=hello&lt;/text&gt;
&lt;/g&gt;
&lt;!-- Protocol --&gt;
&lt;g id=&quot;node2&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Protocol&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M349.48,-198C349.48,-198 275.42,-198 275.42,-198 269.42,-198 263.42,-192 263.42,-186 263.42,-186 263.42,-174 263.42,-174 263.42,-168 269.42,-162 275.42,-162 275.42,-162 349.48,-162 349.48,-162 355.48,-162 361.48,-168 361.48,-174 361.48,-174 361.48,-186 361.48,-186 361.48,-192 355.48,-198 349.48,-198&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;312.45&quot; y=&quot;-175.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Protocol: https&lt;/text&gt;
&lt;/g&gt;
&lt;!-- URL&amp;#45;&amp;gt;Protocol --&gt;
&lt;g id=&quot;edge1&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;URL-&gt;Protocol&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M152.62,-117.48C182.78,-129.35 222.16,-144.85 254.15,-157.45&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;252.7,-160.64 263.29,-161.04 255.27,-154.12 252.7,-160.64&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Domain --&gt;
&lt;g id=&quot;node3&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Domain&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M367.55,-144C367.55,-144 257.35,-144 257.35,-144 251.35,-144 245.35,-138 245.35,-132 245.35,-132 245.35,-120 245.35,-120 245.35,-114 251.35,-108 257.35,-108 257.35,-108 367.55,-108 367.55,-108 373.55,-108 379.55,-114 379.55,-120 379.55,-120 379.55,-132 379.55,-132 379.55,-138 373.55,-144 367.55,-144&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;312.45&quot; y=&quot;-121.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Domain: google.com&lt;/text&gt;
&lt;/g&gt;
&lt;!-- URL&amp;#45;&amp;gt;Domain --&gt;
&lt;g id=&quot;edge2&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;URL-&gt;Domain&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M209.77,-112.66C217.8,-113.71 225.83,-114.77 233.65,-115.79&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;233.07,-119.25 243.44,-117.08 233.98,-112.31 233.07,-119.25&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Path --&gt;
&lt;g id=&quot;node4&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Path&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M344.41,-90C344.41,-90 280.49,-90 280.49,-90 274.49,-90 268.49,-84 268.49,-78 268.49,-78 268.49,-66 268.49,-66 268.49,-60 274.49,-54 280.49,-54 280.49,-54 344.41,-54 344.41,-54 350.41,-54 356.41,-60 356.41,-66 356.41,-66 356.41,-78 356.41,-78 356.41,-84 350.41,-90 344.41,-90&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;312.45&quot; y=&quot;-67.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Path: /search&lt;/text&gt;
&lt;/g&gt;
&lt;!-- URL&amp;#45;&amp;gt;Path --&gt;
&lt;g id=&quot;edge3&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;URL-&gt;Path&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M209.77,-85.34C226.13,-83.2 242.45,-81.05 257.07,-79.13&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;257.44,-82.62 266.9,-77.84 256.53,-75.68 257.44,-82.62&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;!-- Query --&gt;
&lt;g id=&quot;node5&quot; class=&quot;node&quot;&gt;
&lt;title&gt;Query&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M351.08,-36C351.08,-36 273.82,-36 273.82,-36 267.82,-36 261.82,-30 261.82,-24 261.82,-24 261.82,-12 261.82,-12 261.82,-6 267.82,0 273.82,0 273.82,0 351.08,0 351.08,0 357.08,0 363.08,-6 363.08,-12 363.08,-12 363.08,-24 363.08,-24 363.08,-30 357.08,-36 351.08,-36&quot;&gt;&lt;/path&gt;
&lt;text xml:space=&quot;preserve&quot; text-anchor=&quot;middle&quot; x=&quot;312.45&quot; y=&quot;-13.8&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14.00&quot;&gt;Query: q=hello&lt;/text&gt;
&lt;/g&gt;
&lt;!-- URL&amp;#45;&amp;gt;Query --&gt;
&lt;g id=&quot;edge4&quot; class=&quot;edge&quot;&gt;
&lt;title&gt;URL-&gt;Query&lt;/title&gt;
&lt;path fill=&quot;none&quot; stroke=&quot;black&quot; d=&quot;M152.62,-80.52C182.78,-68.65 222.16,-53.15 254.15,-40.55&quot;&gt;&lt;/path&gt;
&lt;polygon fill=&quot;black&quot; stroke=&quot;black&quot; points=&quot;255.27,-43.88 263.29,-36.96 252.7,-37.36 255.27,-43.88&quot;&gt;&lt;/polygon&gt;
&lt;/g&gt;
&lt;/g&gt;
&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id=&quot;key-properties&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Properties&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-properties&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;Browser first checks if input is a URL or search term&lt;/li&gt;
&lt;li&gt;Non-ASCII Unicode characters in hostname get converted/encoded&lt;/li&gt;
&lt;li&gt;Missing protocol defaults to https (or http for some browsers)&lt;/li&gt;
&lt;li&gt;Malformed URLs trigger error pages or search fallback&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Built from:&lt;/strong&gt; &lt;a href=&quot;../../http&quot; class=&quot;internal alias&quot; data-slug=&quot;http&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP&lt;/a&gt; — URL specifies which HTTP resource to fetch&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builds into:&lt;/strong&gt; &lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt; — domain from URL needs DNS resolution&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../hsts&quot; class=&quot;internal alias&quot; data-slug=&quot;hsts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HSTS&lt;/a&gt; — security check happens after URL parsing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;../../browser-autocomplete&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-autocomplete&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Autocomplete&lt;/a&gt; — operates on URL input during typing&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases--gotchas&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases &amp;#x26; Gotchas&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases--gotchas&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;code class=&quot;notranslate&quot;&gt;google&lt;/code&gt; alone might be treated as search term, not URL&lt;/li&gt;
&lt;li&gt;URLs with non-ASCII characters need percent-encoding&lt;/li&gt;
&lt;li&gt;Trailing slashes can sometimes change server behavior&lt;/li&gt;
&lt;li&gt;Browser address bar “pretty prints” URLs (hides protocol, simplifies display)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry><entry>
    <title>URL to Rendering — Full Flow Analysis</title>
    <link href="https://animishraa05.github.io/wiki/https/url-to-rendering-flow" />
    <link rel="alternate" type="text/markdown" href="https://animishraa05.github.io/wiki/https/url-to-rendering-flow.md" />
    <summary>Framing This synthesis traces the complete path from pressing a key to seeing pixels on screen.</summary>
    <published>2026-04-30T00:00:00.000Z</published>
    <updated>2026-04-30T00:00:00.000Z</updated>
    <publishedTime>Apr 30, 2026</publishedTime>
    <updatedTime>Apr 30, 2026</updatedTime>
    <category term="networking" label="networking" />
<category term="browser" label="browser" />
    <author>
      <name>Animesh Mishra</name>
      <email>animesh.mishra818@gmail.com</email>
    </author>
    <content type="html">&lt;h2 id=&quot;framing&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Framing&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#framing&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;This synthesis traces the complete path from pressing a key to seeing pixels on screen. It integrates hardware, OS, network, and browser concepts into one coherent flow.&lt;/p&gt;
&lt;h2 id=&quot;the-complete-flow&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;The Complete Flow&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#the-complete-flow&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;pre class=&quot;notranslate&quot;&gt;&lt;span class=&quot;clipboard-button&quot; type=&quot;button&quot; aria-label=&quot;copy source&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;copy-icon&quot;&gt;&lt;use href=&quot;#github-copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 -8 24 24&quot; fill=&quot;currentColor&quot; stroke=&quot;none&quot; stroke-width=&quot;0&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; class=&quot;check-icon&quot;&gt;&lt;use href=&quot;#github-check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;code class=&quot;notranslate&quot;&gt;Key Press → OS Interrupt → Browser Input
    ↓
URL Parsing → HSTS Check
    ↓
DNS Lookup (Browser → OS → Router → ISP → Root → TLD → Auth)
    ↓
ARP (IP → MAC)
    ↓
TCP Handshake (SYN → SYN-ACK → ACK)
    ↓
TLS Handshake (ClientHello → ServerHello → Key Exchange)
    ↓
HTTP Request (GET / HTTP/1.1 + Headers)
    ↓
HTTP Response (200 OK + HTML)
    ↓
Browser Rendering:
  HTML Parsing → DOM Tree
  CSS Parsing → CSSOM
  DOM + CSSOM → Render Tree
  Layout (position/size)
  Painting (pixels)
  Compositing (layers)
  GPU Rendering (screen)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;layer-by-layer-analysis&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Layer-by-Layer Analysis&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#layer-by-layer-analysis&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;layer-1-hardware-keyboard&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Layer 1: Hardware (Keyboard)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#layer-1-hardware-keyboard&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../keyboard-interrupt&quot; class=&quot;internal alias&quot; data-slug=&quot;keyboard-interrupt&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Keyboard Interrupt&lt;/a&gt;&lt;/strong&gt;: Physical key press → scan code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../os-interrupt-handler&quot; class=&quot;internal alias&quot; data-slug=&quot;os-interrupt-handler&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;OS Interrupt Handler&lt;/a&gt;&lt;/strong&gt;: Converts scan code to character&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../browser-autocomplete&quot; class=&quot;internal alias&quot; data-slug=&quot;browser-autocomplete&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Browser Autocomplete&lt;/a&gt;&lt;/strong&gt;: Local suggestions (no network)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;layer-2-browser-url-processing&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Layer 2: Browser (URL Processing)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#layer-2-browser-url-processing&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../url-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;url-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;URL Parsing&lt;/a&gt;&lt;/strong&gt;: Break into protocol, domain, path&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../hsts&quot; class=&quot;internal alias&quot; data-slug=&quot;hsts&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HSTS&lt;/a&gt;&lt;/strong&gt;: Security check—force HTTPS if required&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;layer-3-network-dns--connection&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Layer 3: Network (DNS + Connection)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#layer-3-network-dns--connection&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../dns-lookup&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-lookup&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Lookup&lt;/a&gt;&lt;/strong&gt;: Domain → IP resolution
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../dns-cache&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-cache&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Cache&lt;/a&gt;&lt;/strong&gt;: Browser → OS → Router → ISP caches&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../recursive-dns&quot; class=&quot;internal alias&quot; data-slug=&quot;recursive-dns&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Recursive DNS&lt;/a&gt;&lt;/strong&gt;: Full hierarchy traversal&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../dns-hierarchy&quot; class=&quot;internal alias&quot; data-slug=&quot;dns-hierarchy&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS Hierarchy&lt;/a&gt;&lt;/strong&gt;: Root → TLD → Authoritative&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../arp-protocol&quot; class=&quot;internal alias&quot; data-slug=&quot;arp-protocol&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;ARP Protocol&lt;/a&gt;&lt;/strong&gt;: IP → MAC for local delivery&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../tcp-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tcp-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TCP Handshake&lt;/a&gt;&lt;/strong&gt;: Reliable connection (3-way)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../tls-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tls-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TLS Handshake&lt;/a&gt;&lt;/strong&gt;: Encrypted tunnel (for HTTPS)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;layer-4-application-http&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Layer 4: Application (HTTP)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#layer-4-application-http&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../http-request&quot; class=&quot;internal alias&quot; data-slug=&quot;http-request&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Request&lt;/a&gt;&lt;/strong&gt;: GET/POST + headers + body&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../http-response&quot; class=&quot;internal alias&quot; data-slug=&quot;http-response&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTP Response&lt;/a&gt;&lt;/strong&gt;: Status + headers + body (HTML)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;layer-5-rendering-browser-engine&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Layer 5: Rendering (Browser Engine)&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#layer-5-rendering-browser-engine&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../html-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;html-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTML Parsing&lt;/a&gt;&lt;/strong&gt; → &lt;strong&gt;&lt;a href=&quot;../../dom-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;dom-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DOM Tree&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../css-parsing&quot; class=&quot;internal alias&quot; data-slug=&quot;css-parsing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSS Parsing&lt;/a&gt;&lt;/strong&gt; → &lt;strong&gt;&lt;a href=&quot;../../cssom&quot; class=&quot;internal alias&quot; data-slug=&quot;cssom&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;CSSOM&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../render-tree&quot; class=&quot;internal alias&quot; data-slug=&quot;render-tree&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Render Tree&lt;/a&gt;&lt;/strong&gt;: DOM + CSSOM (visible only)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../layout&quot; class=&quot;internal alias&quot; data-slug=&quot;layout&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Layout&lt;/a&gt;&lt;/strong&gt;: Calculate positions and sizes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../painting&quot; class=&quot;internal alias&quot; data-slug=&quot;painting&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Painting&lt;/a&gt;&lt;/strong&gt;: Rasterize to pixels&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../compositing&quot; class=&quot;internal alias&quot; data-slug=&quot;compositing&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Compositing&lt;/a&gt;&lt;/strong&gt;: Combine layers&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../gpu-rendering&quot; class=&quot;internal alias&quot; data-slug=&quot;gpu-rendering&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;GPU Rendering&lt;/a&gt;&lt;/strong&gt;: Hardware acceleration&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;key-insights&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Key Insights&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#key-insights&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Each layer is independent&lt;/strong&gt;: Keyboard works without network; DNS works without HTTP; Rendering works without network&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caching everywhere&lt;/strong&gt;: DNS caches at 4+ levels; browser caches HTML/CSS/JS&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security is layered&lt;/strong&gt;: HSTS (app) + TLS (transport) + HTTPS (protocol)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rendering is parallel&lt;/strong&gt;: HTML parsing + CSS parsing happen somewhat independently&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GPU acceleration&lt;/strong&gt;: Only the final stages (compositing, paint) use GPU&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;contrasts&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Contrasts&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#contrasts&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;HTTP&lt;/th&gt;
&lt;th&gt;HTTPS&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Encryption&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;TLS (all data encrypted)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Port&lt;/td&gt;
&lt;td&gt;80&lt;/td&gt;
&lt;td&gt;443&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security&lt;/td&gt;
&lt;td&gt;Vulnerable to MITM&lt;/td&gt;
&lt;td&gt;Protects against eavesdropping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;td&gt;Faster (no handshake)&lt;/td&gt;
&lt;td&gt;Slower (TLS handshake overhead)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&quot;connections&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Connections&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#connections&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p dir=&quot;auto&quot;&gt;This synthesis connects to ALL 29 concept pages in this ingestion, plus existing pages:&lt;/p&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../dns&quot; class=&quot;internal alias&quot; data-slug=&quot;dns&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;DNS&lt;/a&gt;&lt;/strong&gt; (existing, updated)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../tls-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tls-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TLS Handshake&lt;/a&gt;&lt;/strong&gt; (existing, updated)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../tcp-handshake&quot; class=&quot;internal alias&quot; data-slug=&quot;tcp-handshake&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TCP Handshake&lt;/a&gt;&lt;/strong&gt; (existing, updated)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../socket&quot; class=&quot;internal alias&quot; data-slug=&quot;socket&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;Socket&lt;/a&gt;&lt;/strong&gt; (existing, updated)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;../../https&quot; class=&quot;internal alias&quot; data-slug=&quot;https&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;HTTPS&lt;/a&gt;&lt;/strong&gt; (new concept page)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;edge-cases&quot; dir=&quot;auto&quot;&gt;&lt;span class=&quot;highlight-span&quot;&gt;Edge Cases&lt;/span&gt;&lt;a data-role=&quot;anchor&quot; data-no-popover href=&quot;#edge-cases&quot; class=&quot;internal&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;use href=&quot;#github-anchor&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul dir=&quot;auto&quot;&gt;
&lt;li&gt;&lt;strong&gt;Packet loss&lt;/strong&gt;: &lt;strong&gt;&lt;a href=&quot;../../tcp-packet-drop&quot; class=&quot;internal alias&quot; data-slug=&quot;tcp-packet-drop&quot;&gt;&lt;span class=&quot;indicator-hook&quot;&gt;&lt;/span&gt;TCP Packet Drop&lt;/a&gt;&lt;/strong&gt; triggers retransmission&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS failure&lt;/strong&gt;: Browser shows error page (DNS_PROBE_FINISHED_NXDOMAIN)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TLS error&lt;/strong&gt;: Certificate warnings, HSTS blocks override&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTML errors&lt;/strong&gt;: Parser auto-corrects malformed HTML&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS errors&lt;/strong&gt;: Silently ignored (lenient parsing)&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
</feed>