The Application Layer of Internet

When you open a browser, send an email, or stream a video, you’re using network applications.

What Is a Network Application?

A network application is any software program that runs on end systems (laptops, phones, or servers) and communicates over the Internet.

Examples -

  • Web browsers and servers (using HTTP)
  • Email clients (using SMTP, POP3, IMAP)
  • Messaging apps (like WhatsApp)
  • File-sharing services (like BitTorrent)

Each application is designed to communicate using a specific set of rules known as application-layer protocols.


How Network Applications Work

Here are the main building blocks and design choices behind every network application.

Application Architecture

  • Client-Server Model - One machine (the server) provides services, and other machines (the clients) request those services. Example- A web browser (client) sends a request to a web server, which responds with the web page.
  • Peer-to-Peer (P2P) Model - ****All participating devices (called peers) both request and provide services to each other. Example- BitTorrent, you download and upload pieces of files from/to other peers.

Processes Communicating

A process is a program running on a device. When network applications communicate, it’s really the processes that are talking and not the computers themselves. Each process is identified by -

  • IP address (which host it’s on)
  • Port number (which application on that host)

Example: Your web browser might talk to a web server at IP 192.0.2.1 on port 80 (HTTP).


The Role of Sockets

A socket is like a door through which data flows in and out of a process. It serves as the interface between the application and the transport layer (TCP or UDP).


Transport Services Needed by Applications

ServiceWhat It MeansWho Needs It
Reliable Data TransferEnsures no data is lost or duplicatedEmail, file transfer
ThroughputNeeds guaranteed data rateVideo streaming
TimingLow delay between messagesOnline gaming, voice calls
SecurityData should be encrypted/authenticatedBanking apps, messaging apps

What Is an Application-Layer Protocol ?

An application-layer protocol defines message types and Message format (what fields are in the message) and the rules for sending/receiving messages (when to respond, what happens on error, etc.)

Examples of Application Protocols -

ProtocolUsed ForTransport Layer Used
HTTPWeb browsingTCP
SMTPSending emailTCP
POP3/IMAPRetrieving emailTCP
DNSTranslating names to IPsUDP (mostly)
BitTorrentFile sharing (P2P)TCP

Designing Your Own Protocol ?

If you’re building a custom network app, and want to create your own protocol then you define -

  1. The type of messages (e.g., HELLO, DATA, BYE)
  2. The format of the messages (e.g., JSON, XML, plain text)
  3. The rules for how messages are exchanged
  4. Whether you want TCP or UDP as your transport protocol

Example - a multiplayer game might send position updates using UDP every 50ms, while a messaging app might use TCP to ensure messages aren’t lost.