DEV Community

Cover image for Understanding HTTP, Cookies, Email Protocols, and DNS: A Guide to Key Internet Technologies
Vignesh J
Vignesh J

Posted on

Understanding HTTP, Cookies, Email Protocols, and DNS: A Guide to Key Internet Technologies

Introduction

This is the fifth part of the computer networking series. If you haven't read the previous parts, make sure to check them out. In this post, we'll discuss the HTTP protocol, Cookies, how email works, and the Domain Name System (DNS).

Table of Contents

HTTP

HTTP (HyperText Transfer Protocol) is a client-server protocol that defines how data is requested and sent between clients and servers.

  • When a client makes a request to the server, it's called an HTTP request.
  • When the server sends back data to the client, it's called an HTTP response.

HTTP

HTTP operates at the application layer of the OSI model and uses TCP to ensure reliable data transmission.

HTTP is stateless, meaning the server doesn't store any information about the client by default.

HTTP Methods

HTTP methods indicate the action the server should take in response to a request. The most common methods are:

  • GET: Requests data from the server.
  • POST: Sends data to the server.
  • PUT: Replaces the current resource with the provided data.
  • DELETE: Deletes data on the server.

Error/Status Codes

Status codes inform the client about the result of their request.

Common Examples:

  • 200: Request was successful.
  • 404: Resource not found.
  • 400: Bad request.
  • 500: Internal server error.

Categories:

  • 1XX: Informational responses.
  • 2XX: Success codes.
  • 3XX: Redirection messages.
  • 4XX: Client errors.
  • 5XX: Server errors.

Cookies

Cookies are unique strings stored on a client's browser by a website to track user sessions.

  • When you visit a webpage for the first time, a cookie is set.
  • On subsequent visits, the cookie is sent with the request header to maintain session states.

Third-Party Cookies

Third-party cookies are created by websites other than the one you're visiting. They are used to:

  • Track browsing history.
  • Personalize ads and services.

How Email Works

Email communication uses application layer protocols like SMTP, POP, and IMAP, with TCP ensuring reliable transport.

SMTP

SMTP (Simple Mail Transfer Protocol) handles the sending of emails.

  1. The sender's SMTP server connects to the receiver's SMTP server.
  2. After establishing a connection, the email is transferred.
  3. For emails within the same domain, no external connection is needed.

SMTP

Command Example:
To find SMTP servers:

nslookup -type=mx gmail.com

Enter fullscreen mode Exit fullscreen mode

POP

POP (Post Office Protocol) retrieves emails from the server.

  • The client authorizes with credentials (email ID and password).
  • Emails are downloaded to the client.

POP

IMAP

IMAP (Internet Message Access Protocol) enables viewing emails on multiple devices by keeping emails synchronized with the server.

Domain Name System (DNS)

The DNS translates domain names into IP addresses, acting as the internet's directory.

Example:
When you type google.com, the DNS resolves it to an IP address to connect your device to the server hosting Google.

Domain Hierarchy

For mail.google.com:

  • .com → Top-Level Domain.
  • google → Second-Level Domain.
  • mail → Subdomain.

DNS Hierarchy

DNS Lookup Process:

  1. The browser first checks the local cache for the domain's IP address.
  2. If not found, it queries the local DNS (e.g., your ISP's DNS).
  3. If still unresolved, the request moves to root servers, top-level domains, and authoritative DNS servers to find the IP address.

Top-Level Domains (TLDs):

  • .com → Commercial.
  • .edu → Education.
  • .in → Country-specific.

The DNS infrastructure is managed by ICANN (Internet Corporation for Assigned Names and Numbers).

Useful Resource:
To explore root DNS servers, visit root-servers.org.

Final Words

This concludes the fifth part of the computer networking series. We've covered HTTP, Cookies, Email communication, and DNS. Stay tuned for the next part, where we'll dive deeper into more networking concepts!

Follow me on Linkedin | GitHub | Twitter

Top comments (4)

Collapse
 
rohan_sharma profile image
Rohan Sharma

That's great!

Collapse
 
vignesh_j profile image
Vignesh J

Thank you!

Collapse
 
rohan_sharma profile image
Rohan Sharma

I'm following this series. Thanks for sharing the content. I like it a lot!

Collapse
 
vignesh_j profile image
Vignesh J

Thank you so much! I'm glad you're enjoying the series. Your support means a lot!