ConceptDifficulty: Beginner2 min

The Application Layer: Where Programs Speak Their Own Protocols

Everything below delivers bytes; the application layer decides what those bytes mean.

The application layer, layer 7, is where programs define their own protocols: the format of each message and the rules for exchanging them. The layers below move bytes from one program to another without caring what they say. HTTP, DNS, SMTP and SSH each decide what those bytes mean, and each rides on a transport, TCP or UDP, chosen for what it needs.

Picture a laptop that loads a web page, checks for email and opens a remote shell on a server, all in the same minute. The same network card, IP address and TCP carry all three. What differs is the language spoken inside each connection.

Several application protocols, each on the transport that suits it

An application protocol defines three things.

The messages. What a request and a reply look like: lines of text in HTTP/1.1 and SMTP, binary records in DNS and HTTP/2.

The conversation. Who speaks first and what may follow what. An SMTP server greets the client before anything else; an HTTP server waits for a request.

The transport. Each protocol picks one. DNS uses UDP because its questions are small and independent; email and web pages use TCP because every byte matters.

In the OSI model, layers 5 and 6, session and presentation, sit between transport and application. In practice the protocols in this topic handle those jobs themselves, which is why the TCP/IP model counts one application layer where OSI counts three.

Because the layer is defined by programs, it is also where most problems a developer can fix live. A network engineer looks at routes and ports; an application developer looks at what was asked for and what came back.

So when a request reaches the right server and still fails, the question has moved up to layer 7: what did each side say, and did they agree on the protocol.