𝟭. 𝗬𝗼𝘂 𝗲𝗻𝘁𝗲𝗿 𝘁𝗵𝗲 𝗨𝗥𝗟 𝗶𝗻 𝘁𝗵𝗲 𝗯𝗿𝗼𝘄𝘀𝗲𝗿. When you type any URL (e.g Google.com ) you basically want to reach the server where the website is hosted.
𝟮. 𝗧𝗵𝗲 𝗯𝗿𝗼𝘄𝘀𝗲𝗿 𝗹𝗼𝗼𝗸𝘀 𝗳𝗼𝗿 𝘁𝗵𝗲 𝗜𝗣 𝗮𝗱𝗱𝗿𝗲𝘀𝘀 𝗼𝗳 𝘁𝗵𝗲 𝗱𝗼𝗺𝗮𝗶𝗻 𝗻𝗮𝗺𝗲 𝗶𝗻 𝘁𝗵𝗲 𝗗𝗡𝗦(𝗗𝗼𝗺𝗮𝗶𝗻 𝗡𝗮𝗺𝗲 𝗦𝗲𝗿𝘃𝗲𝗿). DNS is a list of URLs and their corresponding IP address just like the telephone book has phone numbers corresponding to the names of the people.
𝗧𝗵𝗲 𝗗𝗡𝗦 𝗰𝗵𝗲𝗰𝗸𝘀 𝗮𝘁 𝘁𝗵𝗲 𝗳𝗼𝗹𝗹𝗼𝘄𝗶𝗻𝗴 𝗽𝗹𝗮𝗰𝗲𝘀 𝗳𝗼𝗿 𝘁𝗵𝗲 𝗜𝗣 𝗮𝗱𝗱𝗿𝗲𝘀𝘀. 𝗖𝗵𝗲𝗰𝗸 𝗕𝗿𝗼𝘄𝘀𝗲𝗿 𝗖𝗮𝗰𝗵𝗲: The browser maintains a cache of the DNS records for some fixed amount of time. It is the first place to run a DNS query. 𝗖𝗵𝗲𝗰𝗸 𝗢𝗦 𝗖𝗮𝗰𝗵𝗲: If the browser doesn't contain the cache then it requests to the underlying Operating System as the OS also maintains a cache of the DNS records. 𝗥𝗼𝘂𝘁𝗲𝗿 𝗖𝗮𝗰𝗵𝗲: If your computer doesn't have the cache, then it searches the routers as routers also have the cache of the DNS records. 𝗜𝗦𝗣(𝗜𝗻𝘁𝗲𝗿𝗻𝗲𝘁 𝗦𝗲𝗿𝘃𝗶𝗰𝗲 𝗣𝗿𝗼𝘃𝗶𝗱𝗲𝗿) 𝗖𝗮𝗰𝗵𝗲: If the IP address is not found at the above three places then it is searched at the cache that ISP maintains of the DNS records. If not found here also, then ISP’s DNS recursive search is done. In "DNS recursive search", a DNS server initiates a DNS query that communicates with several other DNS servers to find the IP address.
𝟑. 𝐓𝐡𝐞 𝐁𝐫𝐨𝐰𝐬𝐞𝐫 𝐢𝐧𝐢𝐭𝐢𝐚𝐭𝐞𝐬 𝐚 𝐓𝐂𝐏 𝐜𝐨𝐧𝐧𝐞𝐜𝐭𝐢𝐨𝐧 𝐰𝐢𝐭𝐡 𝐭𝐡𝐞 𝐬𝐞𝐫𝐯𝐞𝐫. When the browser receives the IP address, it will build a connection between the browser and the server using the TCP protocol. 𝗧𝗵𝗲 𝗰𝗼𝗻𝗻𝗲𝗰𝘁𝗶𝗼𝗻 𝗶𝘀 𝗲𝘀𝘁𝗮𝗯𝗹𝗶𝘀𝗵𝗲𝗱 𝘂𝘀𝗶𝗻𝗴 𝗮 𝘁𝗵𝗿𝗲𝗲-𝘄𝗮𝘆 𝗵𝗮𝗻𝗱𝘀𝗵𝗮𝗸𝗲. It is a three-step process. 𝟭. 𝗦𝘁𝗲𝗽 𝟭 (𝗦𝗬𝗡): As the client wants to establish a connection so it sends an SYN(Synchronize Sequence Number) to the server which informs the server that the client wants to start a communication. 𝟮. 𝗦𝘁𝗲𝗽 𝟮 (𝗦𝗬𝗡 + 𝗔𝗖𝗞): If the server is ready to accept connections and has open ports then it acknowledges the packet sent by the server with the SYN-ACK packet. 𝟯. 𝗦𝘁𝗲𝗽 𝟯 (𝗔𝗖𝗞): In the last step, the client acknowledges the response of the server by sending an ACK packet. Hence, a reliable connection is established and data transmission can start now.
𝟒. 𝐓𝐡𝐞 𝐛𝐫𝐨𝐰𝐬𝐞𝐫 𝐬𝐞𝐧𝐝𝐬 𝐚𝐧 𝐇𝐓𝐓𝐏 𝐫𝐞𝐪𝐮𝐞𝐬𝐭 𝐭𝐨 𝐭𝐡𝐞 𝐬𝐞𝐫𝐯𝐞𝐫. 𝟓. 𝐓𝐡𝐞 𝐬𝐞𝐫𝐯𝐞𝐫 𝐡𝐚𝐧𝐝𝐥𝐞𝐬 𝐭𝐡𝐞 𝐢𝐧𝐜𝐨𝐦𝐢𝐧𝐠 𝐫𝐞𝐪𝐮𝐞𝐬𝐭 𝐚𝐧𝐝 𝐬𝐞𝐧𝐝𝐬 𝐚𝐧 𝐇𝐓𝐓𝐏 𝐫𝐞𝐬𝐩𝐨𝐧𝐬𝐞 𝐚𝐥𝐨𝐧𝐠 𝐰𝐢𝐭𝐡 𝐭𝐡𝐞 𝐬𝐭𝐚𝐭𝐮𝐬 𝐨𝐟 𝐭𝐡𝐞 𝐫𝐞𝐬𝐩𝐨𝐧𝐬𝐞 (𝐞.𝐠 𝟐𝟎𝟎 𝐟𝐨𝐫 𝐎𝐊). 𝟔. 𝐓𝐡𝐞 𝐛𝐫𝐨𝐰𝐬𝐞𝐫 𝐝𝐢𝐬𝐩𝐥𝐚𝐲𝐬 𝐭𝐡𝐞 𝐇𝐓𝐌𝐋 𝐜𝐨𝐧𝐭𝐞𝐧𝐭.
All these processes happen in the background and within milliseconds. #networking