<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Harithsa, Vishruth (he/him)</title>
    <description>The latest articles on DEV Community by Harithsa, Vishruth (he/him) (@theharithsa).</description>
    <link>https://dev.to/theharithsa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F640996%2Fb846cb43-0b82-4a00-bcf0-67aacac0d46c.jpeg</url>
      <title>DEV Community: Harithsa, Vishruth (he/him)</title>
      <link>https://dev.to/theharithsa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/theharithsa"/>
    <language>en</language>
    <item>
      <title>Internet Communication - How Browsers Sends HTTP Requests?</title>
      <dc:creator>Harithsa, Vishruth (he/him)</dc:creator>
      <pubDate>Sat, 10 Jul 2021 03:42:36 +0000</pubDate>
      <link>https://dev.to/theharithsa/internet-communication-how-browsers-sends-http-requests-133b</link>
      <guid>https://dev.to/theharithsa/internet-communication-how-browsers-sends-http-requests-133b</guid>
      <description>&lt;h2&gt;
  
  
  It’s time to see how the browser communicates with the webserver
&lt;/h2&gt;

&lt;p&gt;In my previous article on how technology works, I covered how browsers render webpages on the screen after receiving a response from the server. As a quick recap, you can visit my article at this link to understand how technology works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk82i2kwh16zb8pcx4pfb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk82i2kwh16zb8pcx4pfb.png" alt="Technology"&gt;&lt;/a&gt;&lt;br&gt;
This week we will be studying how the browser initiates an HTTP request to get the response from the server. We will go through each step that is shown in this flow.&lt;/p&gt;




&lt;h2&gt;
  
  
  How browser sends HTTP requests?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv6iqwhcqdw9349bq0hs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv6iqwhcqdw9349bq0hs.png" alt="How browser sends HTTP requests?"&gt;&lt;/a&gt;&lt;br&gt;
High-level communication flow from the browser to the server which goes through certain steps before sending/receiving the data. This is not one-way communication. It is the 2-way street where before reaching the server, the browser tries to connect to the server and vice-versa. If anyone step fails to complete, the browser will not successfully reach the destination server with the IP.&lt;/p&gt;

&lt;h3&gt;
  
  
  #1 Looking for DNS
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5scw1hr6i3uig4nm13u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5scw1hr6i3uig4nm13u.png" alt="Looking for DNS"&gt;&lt;/a&gt;&lt;br&gt;
Finding DNS is like searching for the love of the HTTP request’s life. It keeps searching all the available cache servers before searching in global DNS servers (Like Matrimony sites). 4 types of cache are available by default, Browser, OS, Router, and ISP. There are other types as well where we can use our own caching servers. Those advanced topics we will see in the future. For now, knowing the type of available caches is important.&lt;/p&gt;

&lt;h3&gt;
  
  
  #2 DNS Server — How it works?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff67swnniaspamspb1f0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff67swnniaspamspb1f0z.png" alt="DNS Server — How it works?"&gt;&lt;/a&gt;&lt;br&gt;
Once the request goes out of the browser after checking the ISP cache for the IP address for the DNS, it hits multiple DNS servers across the internet to find the right IP address for you (If you can’t find a girl in this country you can always try in others). This uses a recursive method to find the different name servers (NS) associated with the domain name. So the search keeps happening until it finds the right NS. This request nature is small packets that contain details of the source and destination IPs. When it hits the right name server, it gets the DNS address of the DNS and is sent back to the browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  #3 TCP/IP Connection
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8l8oukon9drwc7gr4gn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8l8oukon9drwc7gr4gn.png" alt="TCP/IP Connection"&gt;&lt;/a&gt;&lt;br&gt;
It follows a 3-way handshake to get this done, like asking if it is available to take a new connection from the server. If the server responds with yes, then the browser will send the acknowledgment to the server.&lt;/p&gt;

&lt;h3&gt;
  
  
  #4 Sending HTTP requests
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrt5xjwstbo5eia2wj42.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrt5xjwstbo5eia2wj42.png" alt="Sending HTTP requests"&gt;&lt;/a&gt;&lt;br&gt;
With the type of request specified, the browser will send the information to fetch the required web pages from the server. It uses different headers to send the request. Based on this header authentication, the server will respond to the request and send the HTML formatted web page to the browser.&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary:
&lt;/h2&gt;

&lt;p&gt;In summary, if we see step by step sending a request to the server/datacenter, it all starts with the user who enters the web address or interacts with the application they are using. Before sending requests to the internet, the browser checks for its internal cache and then checks the OS cache then it checks for router cache. If it fails to find the right IP, it goes on and checks with Internet service providers. Even now if it fails to get the right IP for the mentioned DNS, it starts to check in internet DNS servers that are globally available. &lt;/p&gt;

&lt;p&gt;In DNS, each domain has different nameservers where it connects to respective servers that hold these domain names. For example, .com (root level &amp;amp; top-level domain) will go to a different nameserver, and google (2nd level domain) will go to another nameserver. Then now this google.com will go and check for the third-level domain name server in the Google data center. This process is called DNS lookup. Here browser will get the complete IP address of the server where it should communicate or send requests to. &lt;/p&gt;

&lt;p&gt;Before sending an HTTP request, the browser does a 3 level handshake with the server which includes, SYN (synchronize) and ACK (acknowledge) requests. This uses TCP/IP protocol. &lt;/p&gt;

&lt;p&gt;Once the server sends the response as it is ready to accept new requests, the browser acknowledges it and starts to send HTTP requests (GET/POST) with headers. &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;em&gt;Happy reading. I hope you all had a great week. Keep learning and never give up on your dreams.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This article is also published in &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fwww.linkedin.com%2Fpulse%2Finternet-communication-how-browsers-sends-http-vishruth-harithsa" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fmedium.thetechnologist.in%2Finternet-communication-how-browsers-sends-http-requests-27f56c6bf9e5" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to/theharithsa/internet-communication-how-browsers-sends-http-requests-133b"&gt;Dev Community&lt;/a&gt;, &lt;a href="https://dt-transform.com/docs/blog/internet_communication/http_requests" rel="noopener noreferrer"&gt;Transform Docs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>browsers</category>
      <category>communication</category>
      <category>httprequests</category>
      <category>technology</category>
    </item>
    <item>
      <title>Internet Communication - How Browsers Render Webpages?</title>
      <dc:creator>Harithsa, Vishruth (he/him)</dc:creator>
      <pubDate>Sat, 03 Jul 2021 02:53:38 +0000</pubDate>
      <link>https://dev.to/theharithsa/internet-communication-how-browsers-render-webpages-5go1</link>
      <guid>https://dev.to/theharithsa/internet-communication-how-browsers-render-webpages-5go1</guid>
      <description>&lt;p&gt;In this article, we will spend more time looking at the diagrams than reading text so 6 diagrams explain how internet communication works. In this article mainly we focus on browser rendering HTML pages. Let's start with the overall flow diagram of how communication happens between the client (Web browser) and the server (Backend). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4lmoyGXx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bot6krwkd555ob2du8x9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4lmoyGXx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bot6krwkd555ob2du8x9.png" alt="How Tech Works?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the browser receives the response from the server as shown in the above diagram (10), the browser starts its work in displaying the received HTML code onto its canvas (window). &lt;/p&gt;




&lt;h2&gt;
  
  
  Rendering Webpages
&lt;/h2&gt;

&lt;p&gt;Rendering and painting webpages on the screen are divided into 4 steps to make your understanding better about the process. There are in-depth steps that are involved to render webpages as it is the topic of some other season.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2QtI88cH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yriotwlj0gy89j1rdse0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2QtI88cH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yriotwlj0gy89j1rdse0.png" alt="Rendering Webpages"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It all starts with the user who enters the URL in the address bar of the browser. You can see the detailed article that talks about the communication flow and it comes under the primary skillset of a performance engineer. There are around 105 steps that take place before the browser displays a webpage to you. &lt;/p&gt;

&lt;h3&gt;
  
  
  #1 Content-Type
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bpsJ64tc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zdv4sn9pie7xr0sgz99i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bpsJ64tc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zdv4sn9pie7xr0sgz99i.png" alt="Content-Type"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this step, the browser will mostly understand the content it is getting to render by the type it is sent by the request header. Once it detects the type, the browser engine will start taking control in the next step. &lt;/p&gt;

&lt;h3&gt;
  
  
  #2 Render Tree Construction
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ELmnjcIs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7fe7tnenomp0ggf8j8rg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ELmnjcIs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7fe7tnenomp0ggf8j8rg.png" alt="Render Tree COnstruction"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In render tree construction, there are two trees where it constructs the DOM tree and CSSOM. By combining those 2 trees, the final output will create and this is the render tree.&lt;/p&gt;

&lt;h3&gt;
  
  
  #3 Layout Operation
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CByUuoQD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lf7znkji14umhmgus7ly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CByUuoQD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lf7znkji14umhmgus7ly.png" alt="Layout Operation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This happens as soon as the render tree is constructed. In this stage, a box model is created based on the screen size and device data it captures from inbuilt device APIs. Upon the creation of the box model, it starts painting the contents on the screen. Will see the flow of it tomorrow. &lt;/p&gt;

&lt;h3&gt;
  
  
  #4 Rasterizing/Painting &amp;amp; Composition Operation
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fkR0mL-t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0q7h3g6ycciy5dr0xk6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fkR0mL-t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0q7h3g6ycciy5dr0xk6.png" alt="Rasterizing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this, we discuss how the browser paints all the contents that are collected and rendered in the previous layout operations. It collects the data and creates layers using GPU (Modern Browsers). Once Layers are created, it will start painting on the screen and this happens by splitting each layer into each type of content like text, images, or rich media. This will happen for each layer that is painted on the browser window. Finally, we see a clean and smooth-looking web page (If it is designed well). &lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.html5rocks.com/en/tutorials/internals/howbrowserswork/"&gt;How Browsers Work: Behind the scenes of modern web browsers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-tree-construction"&gt;Render-tree Construction, Layout, and Paint&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/jspoint/how-the-browser-renders-a-web-page-dom-cssom-and-rendering-df10531c9969"&gt;How the browser renders a web page? — DOM, CSSOM, and Rendering&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Happy learning and feel free to ping me if you have any doubts in here or even on LinkedIn.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is published in &lt;a href="https://www.linkedin.com/pulse/internet-communication-how-browsers-render-webpages-vishruth-harithsa"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://dev.to/theharithsa/internet-communication-how-browsers-render-webpages-5go1"&gt;Dev Community&lt;/a&gt;, &lt;a href="https://medium.thetechnologist.in/4563786653e4"&gt;Medium&lt;/a&gt;, &lt;a href="https://dt-transform.com/docs//blog/internet_communication/rendering_webpages"&gt;Transform Docs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>browsers</category>
      <category>webfundamentals</category>
      <category>technology</category>
      <category>communication</category>
    </item>
  </channel>
</rss>
