Network Layers

What is the primary role of the application layer?

The application layer's main job is to give programs a standard way to use the network. Learn how it works with a web page example and what it does not do.

On this page
  1. The short answer
  2. Where it sits
  3. What it does for applications
  4. What the application layer does not do
  5. An example: loading a web page
  6. Application layer versus application software
  7. Trying it yourself

The short answer

The primary role of the application layer is to give programs a standard way to use the network. It sits at the top of the OSI model and is the layer that network-aware software calls when it needs to send or receive data. A web browser asks for a page, an email client checks for new mail, and a file manager opens a share on another computer. In each case, the application layer supplies the rules, called protocols, that make the request understandable to the server at the other end.

Where it sits

The OSI model has seven layers. The application layer is layer 7, the top one, and it depends on the layers below it: presentation, session, transport, network, data link and physical. Those lower layers move data between machines, handle addressing and send the actual signals. The application layer is concerned with what the message means.

The TCP/IP model used on the internet is simpler. It has four layers, and its application layer covers the job that the OSI model splits across session, presentation and application.

What it does for applications

  • Finds the other side. Programs often start with a name, not an address. A DNS query turns a name into an IP address before any application data is sent.
  • Defines the conversation. HTTP specifies request methods such as GET and the status codes that come back. SMTP specifies the steps for sending mail.
  • Makes software interoperable. Two programs written by different companies can work together because they follow the same protocol.
  • Hands data down the stack. The application layer prepares the message. A lower layer, usually TCP or UDP, moves it across the network.

What the application layer does not do

It does not choose routes or handle IP addressing; that is the network layer’s work. It does not send bits over cables or radio signals; the data link and physical layers do that. And it is not the same as application software. Your browser runs on your computer, but the application layer is the set of network rules the browser uses.

An example: loading a web page

When you open https://example.com in a browser:

  1. The browser uses DNS, an application-layer protocol, to find the server’s IP address.
  2. The browser opens a TCP connection to port 443. TCP works at the transport layer.
  3. The browser sends an HTTPS request over that connection. The request and the response are the application-layer part, carried over encryption.
  4. The network layer routes the packets across the internet.
  5. The data link and physical layers carry the frames over Ethernet or Wi-Fi.

Only steps one and three are application-layer work, but the page does not load unless every layer does its job.

Application layer versus application software

The word “application” causes confusion. Application software is a program you run, such as a word processor or a game. The application layer is a networking concept. A program uses it whenever the program talks over a network. A program that only works on files on your own disk does not use it.

For the full picture of all seven layers, see what are the 7 network layers and their functions.

Trying it yourself

On Linux or macOS, curl with the verbose flag shows the application-layer exchange:

curl -v https://example.com

Lines that start with > are what your client sent, and lines that start with < are what the server returned. The first response line is the HTTP status line, such as HTTP/2 200.

On Windows 10 and later, curl.exe -v https://example.com shows the same exchange.

The complete guide to network layers

Services Provided by the Application Layer
Read the guide

Keep exploring

Guides from other topics

All topics →