What Actually Happens When You Connect to the Internet?

What Actually Happens When You Connect to the Internet?

In this hyper-connected digital age, the internet’s complexity is sometimes hidden by its ease of use. Clicking on a link or entering in a URL opens up a world of knowledge, entertainment, and social interaction, hiding the complex protocols, servers, and data exchanges behind the scenes. Instantaneous global connectedness, once a dream, is now part of our daily lives, so we forget its impact. Human creativity has made such a powerful instrument as ordinary and intuitive as flipping a light switch, but we must occasionally pause and appreciate the internet’s technology and teamwork.

Accessing the internet from any device involves multiple intricate steps. Here’s a granular breakdown of what typically happens:

  1. Input URL & Initial Check: You input a URL (e.g., www.cybertipsguide.com) into a web browser. The browser checks its cache to see if it already has the IP address for the URL.
  2. Hosts File: If the IP address isn’t in the browser’s cache, the computer checks the local “hosts” file for any static entries that match the domain name.
  3. DNS Query: If the “hosts” file doesn’t contain the domain’s IP address, the system queries a DNS (Domain Name System). First, the computer contacts a local recursive or caching DNS server, often provided by your ISP. If this server doesn’t have the IP address cached from previous requests, it will proceed with the DNS resolution process. DNS Resolution Process: Root Name Server: The DNS resolver queries a root name server, which responds with the address of a Top-Level Domain (TLD) server. TLD Name Server: The resolver then asks the TLD server (e.g., .com) about the specific domain. Domain’s Name Server: The TLD server responds with the IP address of the domain’s name server. The resolver then queries this server.
  4. Obtain IP Address: The domain’s name server finally provides the IP address for the domain, which gets sent back to the computer.
  5. ARP (Address Resolution Protocol): Before the computer can send data packets to the web server, it needs to know the physical MAC address of the next device in the data path, usually your router. If your computer doesn’t already have the router’s MAC address cached, it uses ARP to obtain it. The computer broadcasts an ARP request onto the local network, asking, “Who has this IP address?” The device with that IP (usually the router) responds with its MAC address.
  6. Establish Connection: With the web server’s IP address and the router’s MAC address known, the computer initiates a connection using the TCP/IP protocol. This involves a TCP “three-way handshake” to establish a reliable connection: The computer sends a SYN packet. The web server replies with a SYN-ACK packet. The computer responds back with an ACK packet.
  7. Data Transfer: Once the connection is established, the browser sends an HTTP request to the web server, asking for the desired webpage. The web server processes the request and sends back the requested data, usually as an HTTP response containing web content like HTML, CSS, and JavaScript.
  8. Render the Page: The browser receives the data and processes it. It will render the page, execute scripts, apply styles, and display content.
  9. Close Connection: After the data transfer is complete and the webpage rendered, the computer sends a message to terminate the TCP connection with the server. This involves another handshake: The computer sends a FIN packet. The server acknowledges with a FIN-ACK. The server sends its own FIN packet. The computer responds with an ACK, finalizing the termination.

This entire process, spanning from entering a URL to viewing a fully loaded webpage, might seem lengthy, but with modern technology, it usually takes mere seconds.

You might enjoy reading more about how DNS works, visit Microsoft’s article. You should also read our article about Netstat.

Eric Peterson

Website: http://www.cybertipsguide.com

Eric Peterson is a cybersecurity expert working in CyberOps, directing and managing teams that monitor and respond to cyber threats and that help to keep companies' data and enterprises safe. He has over 20+ years of experience in IT and Cybersecurity, an M.S. and B.S. in IT Security and assurance, and over 20 industry-recognized certifications, including CISSP, CISM, CRISC, and CISA. As a published author, he has written multiple eBooks, including 'From Bytes to Barriers: Building Cyber Walls for Your Small Business' and 'Cyber Tips Guide: Navigating the Digital Age Safely.'

Verified by MonsterInsights