The Application Layer is the top layer of the TCP/IP suite. It contains the high-level protocols that user applications (like web browsers) use to communicate across the network. The two most fundamental protocols for web browsing are DNS and HTTP.
Humans are terrible at memorizing random numbers. If you want to visit Google, you don't type 142.250.190.46 into your browser; you type google.com.
However, routers only understand IP addresses. The Domain Name System (DNS) is a massive, globally distributed database that acts as the phonebook of the Internet, translating human-readable domain names into machine-readable IP addresses.
When you type codingstuff.io in your browser:
8.8.8.8)..io domains..io. The TLD server responds with the address of the specific Authoritative Name Server for codingstuff.io.(Note: Because speed is critical, DNS primarily uses the lightweight UDP protocol on Port 53).
Once the browser has the IP address, it establishes a TCP connection to that server (Port 80 for HTTP, Port 443 for HTTPS). It then uses HTTP to request the web page.
HTTP is a Stateless, Request-Response protocol.
A client sends an HTTP request message. It consists of:
GET to fetch data, POST to submit a form, PUT, DELETE)./index.html).User-Agent: Mozilla/5.0, Accept-Language: en-US).The server processes the request and sends an HTTP response message. It consists of:
200 OK: Request succeeded.301 Moved Permanently: Redirect.403 Forbidden: You don't have permission.404 Not Found: The resource doesn't exist.500 Internal Server Error: The server's backend code crashed.Content-Type: text/html).Standard HTTP sends all data in plain text. Anyone intercepting the network traffic can read your passwords. HTTPS uses TLS/SSL encryption to wrap the HTTP data in a mathematically unbreakable cryptographic tunnel before it leaves your computer.