Last Article of 2024

Last Article of 2024

Here we are again—on the gates of 2025, ready to bid farewell to 2024. As we stand on the cusp of a new year, staring at the endless opportunities that lie ahead, let’s take a moment to reflect: Time passes by really fast, so make sure to utilize it wisely. Don’t get caught up in comparing the grass on the other side. There will always be patches that seem greener, but the key is to keep watering your own grass consistently and stay so focused on it that you have no time to watch the other side.

With that, let’s get back to the agenda of this article—unveiling the secrets of the Application Layer!

The overview

The Application Layer is the topmost layer in the TCP/IP model, sitting proudly at the summit of all the networking layers. As the name suggests, this layer is where users interact with applications, making it the bridge between the user and the underlying network services.

It’s not just about shiny interfaces or fancy designs; this layer plays a crucial role in handling various protocols that enable communication and functionality between applications across networks. Think of it as the host of a grand networking party, making sure everyone (every application) communicates effectively without stepping on each other’s toes.

HTTP

HTTP (Hypertext Transfer Protocol) is the most commonly used protocol to access the World Wide Web. It’s the protocol that allows you to request and transfer web pages, videos, images, and other content from a web server to your device. Whether you’re browsing a website, watching a video, or reading a blog post, HTTP is the magic behind the scenes that makes it all possible.

HTTP carries data in a MIME-like format, which is essentially just a way of packaging different types of content (text, images, video, etc.) for transport across the web.

A key difference between HTTP and SMTP (Simple Mail Transfer Protocol) is that HTTP is stateless and connectionless. What does that mean?

  • Stateless means that after the request and response, the client and server don't remember each other. It's like a one-night stand: You both meet, do your thing, and then forget each other until the next time you need something.

  • Connectionless means that a connection is only made when the client requests it, and it is closed as soon as the request is fulfilled. No lingering, no endless chatter.

    HTTP Response

And that brings us to URLs (Uniform Resource Locators)—the address that tells HTTP exactly where to go. Here's how it works:

url-parts-copy-(1)

  1. Method: The action you want to perform (like GET or POST)

  2. Host: The server where the information is stored

  3. Port (optional): Not always present, but it's like a special entrance into the server

  4. Path: The specific file or location of the information you're after.

Some common methods we use daily without even thinking about it include:

  • GET: When you retrieve data from a resource (like opening a webpage).

  • POST: Used to submit data to be processed to a specified resource (like when you fill out a form and submit it).

  • PUT: Used to update a resource on the server, typically replacing the entire resource with new data.

  • PATCH: Very similar to PUT, but used for partial updates to an existing resource.

  • DELETE: Used to remove a resource from the server.

The Magic Behind Fetching Your Favorite Content from the Web Library

Think of the World Wide Web as a giant, magical library filled with an endless array of content—web pages, videos, songs, memes, and more. The web servers act like the librarians of this library, storing all the "books" (websites and web pages) neatly organized on their shelves, ready for you to request.

And what about you? You’re like a reader with a super-fast drone (your browser) that zips around fetching exactly what you want. But to communicate with the librarian (web server), you use a special language called HTTP.

For instance: You: "Hey HTTP, please fetch me that hilarious cat video!"
The librarian (web server): "Got it! Here’s your cat video!"

Just like that, HTTP ensures the drone delivers your request: plain text, videos, audio, or images. It’s quick and efficient—kind of like a friend who always comes through with exactly what you need, no questions asked.

Of course, if you want that delivery to be extra secure, HTTPS steps in, bringing along a trusty security guard to keep your data safe from any unwanted interruptions.

Domain Name System (DNS): Making the Internet Human-Friendly

Every host on the internet has an IP address, but let's be real—who wants to remember long strings of numbers all the time? (Unless, of course, those numbers are somehow related to someone special 😉). Enter the DNS protocol, which saves the day by translating those complex IP addresses into easy-to-remember domain names, and vice versa. It's like having a superpower to call up your favorite website just by remembering its name, instead of trying to recall a long, tedious string of digits.

So, how does DNS work when you type in a domain name? It’s like a treasure hunt for the perfect IP address!

  1. Root Name Server: When you make a request for a domain name (like www.example.com), the DNS resolver starts its journey by first contacting the root name server. There are only about 13 root servers around the world. These servers don’t have the IP address for your specific domain, but they point you in the right direction. They direct you to the top-level domain (TLD) server—think of it as sending you to a larger directory.

  2. TLD Server: The TLD server is responsible for domains like .com, .org, .edu, and even country-specific domains (like .in for India or .uk for the UK). The root server doesn’t know where exactly,www.example.com is, but the TLD server knows which server holds the information. So, it gives the DNS resolver the IP address of the authoritative name server.

  3. Authoritative Name Server: This server holds the final answer to your query, and it knows the IP address of the requested domain. When the DNS resolver reaches here, it gets the exact IP address of the domain (like www.example.com), allowing your browser to connect to the right server and fetch the website.

    How-DNS-Works

Iterative vs Recursive Query in DNS

Now, let's look at the two types of DNS queries: Iterative and Recursive.

  1. Recursive Query:

    • In a recursive query, the client (your DNS resolver) asks the DNS server to find the IP address, and the server is responsible for going through all the steps (from root to authoritative server) and finding the answer.

    • It’s like giving someone a treasure map and saying, “Go find the treasure and bring it back to me.” The server handles all the work and gives you the result.

  2. Iterative Query:

    • In an iterative query, the DNS server gives you the best answer it can based on what it knows. If it doesn’t know the exact answer, it will point you to another server that might know more.

    • It’s like saying, “I don’t know where the treasure is, but I’ll send you to someone who might.” You keep going from server to server until you get the answer, and then the client has to ask the next server if needed.

DNS Cache: Speeding Up the Process

Now, there’s something called DNS cache. Think of it as a memory bank of recently visited websites. Whenever a domain name is requested, the resolver stores the result in its cache. This means the next time you visit that domain, the resolver doesn’t have to go through the whole root-TLD-authoritative server process again. It can simply pull the answer from the cache, speeding up the whole process. So, you can say DNS cache is like a cheat sheet to avoid the hassle of looking up things from scratch every time!

Next Up: Simple Mail Transfer Protocol (SMTP)

Now let’s talk about a protocol we all use (often without realizing it)—the Simple Mail Transfer Protocol (SMTP)! This protocol is responsible for transferring electronic mail between users. So, next time you hit "send" on that job application email (like the one I’m sure you’ve sent to a hiring manager 😉), just remember, SMTP is doing all the behind-the-scenes work to make sure it gets to the recipient.

Simple Mail Transfer Protocol

SMTP Process Explained

Here’s how the email process works with SMTP:

  1. Composing the Email: The sender writes an email using a Mail User Agent (MUA). This is the tool or app you use to send your emails, like Gmail or Outlook. The email will contain the body of the message, and of course, the sender’s and receiver’s email addresses.

  2. Sending the Email: Once you hit "Send," the Mail Transfer Agent (MTA) client takes over. This component sends the email from the sender’s MUA to the appropriate Mail Transfer Agent (MTA) server. Think of the MTA as the postman of the email world, ensuring your email reaches the right server.

  3. Storing the Email: Once the email reaches the recipient’s MTA server, the Mail Delivery Agent (MDA) stores the message in the recipient’s mailbox until they retrieve it. So, the MDA is like the email version of a post office that holds onto your letter until you pick it up.

SMTP, unlike other protocols, is all about sending the email from one server to another. It doesn’t deal with storing emails (that’s the job of the MDA). It's focused solely on transmitting that message across the network, ensuring it gets to the right place.

And just like that, your email reaches its destination, all thanks to SMTP!

Terminal Network

Now, let's talk about Telnet—a protocol that allows you to access a remote system from your local system, making it easy to interact with and manage systems far away. Telnet is like having a magic doorway that lets you control remote computers, even if they're halfway across the world.

How Telnet Works

The user logs in to the remote system via Telnet from their local system. But here's the catch: different operating systems interpret certain characters differently. For example, the way "Enter" or "Backspace" works might vary between systems like Linux and Windows.

To tackle this problem, Telnet uses a concept called Network Virtual Terminal (NVT) characters. These are a standardized set of characters used by Telnet, so both systems can understand each other, even if they're on different operating systems.

Here’s how it works:

  1. Telnet Client: The user’s local system (the client) encrypts the characters it sends and prepares them for transmission.

  2. Telnet Server: The remote system (the server) receives the encrypted characters, decrypts them, and interprets them according to the NVT standard.

By using this method, Telnet resolves issues caused by operating systems interpreting characters differently, ensuring a smooth connection between systems, no matter the OS.

So, thanks to Telnet, you can access and control systems remotely without worrying about character confusion!

Remote Login

Conclusion

Thank you so much for reading through this article! I truly hope it was both informative and enjoyable, and that the lighthearted touches kept you engaged throughout.

Crafting this piece took a bit of extra time and effort because I wanted to deliver something unique in a world full of AI-generated content. Your feedback and suggestions are always welcome—after all, we're all in this journey of growth and learning together.

Wishing you a fantastic end to 2024 and an exciting start to 2025! May your application layer always perform flawlessly, your connections remain strong, and your data flow uninterrupted. And in case I don’t get the chance—Good morning, good afternoon, good evening, and good night! 🎥🌟 (A cheeky reference to The Truman Show—hope you caught it!)

Keep learning, stay curious, and I’ll catch you in the next one!