Network Layers

Services Provided by the Application Layer

Learn what services the application layer provides, which protocols use it, and how to check them on your own Linux or Windows machine with a few commands.

On this page
  1. What the application layer is
  2. Services the application layer provides
  3. Common application-layer protocols
  4. Checking application-layer services on Linux
  5. Checking application-layer services on Windows
  6. When the application layer is the problem
  7. Application-layer services when you self-host
  8. Summary

What the application layer is

The application layer is the top layer of the OSI model, the seven-layer reference model that describes how network communication is organized. It is where network-aware programs ask the network for something. A web browser requests a page, an email client fetches messages, and a file manager opens a share on another computer.

The application layer is not the program itself. Your browser is an application; the application layer is the set of protocols and services that let the browser talk to a server. The TCP/IP model used on the internet folds the top three OSI layers (session, presentation and application) into one application layer, so most of the protocols people discuss day to day are classed there.

Services the application layer provides

Descriptions of the OSI application layer usually list a handful of core services:

  • Identifying communication partners. Before two programs exchange data, one of them needs to find the other and confirm it can be reached. Name lookup with DNS is a common example, and it returns the IP address that lower layers use to deliver the traffic.
  • Determining resource availability. A program can check whether a remote server or resource is available before it sends a request.
  • Synchronizing communication. Two programs agree on how their conversation is structured, such as who sends next and how a request is marked as complete.
  • Agreeing on data handling. Protocols define the message format, the commands, and how errors are reported, so both ends read the data the same way.

In practice, these services show up as the network functions people use every day: web access, email, file transfer, remote login, directory lookup and time synchronization.

Common application-layer protocols

The protocols below are the ones you are most likely to meet on a server or in a packet capture. The ports are defaults. Services can be configured to listen on other ports.

Protocol What it is used for Default port
DNS Translating names such as example.com into IP addresses 53
DHCP Giving devices an IP address and network settings automatically 67 (server), 68 (client)
HTTP and HTTPS Web pages and web APIs 80 and 443
FTP Transferring files (control connection) 21
SSH Secure remote login and file transfer 22
SMTP Sending email between mail servers 25
IMAP and POP3 Reading email from a mailbox 143 and 110, or 993 and 995 with TLS
SNMP Monitoring and managing network devices 161
NTP Keeping system clocks in sync 123

Checking application-layer services on Linux

Start by listing what is listening on the machine. The ss command is included in most modern distributions:

sudo ss -tlnp

This shows each TCP socket in the listening state, its local port, and the program that opened it. Without sudo, some process names are hidden.

To check whether a service is running under systemd, use systemctl status. The SSH service is called ssh on Debian and Ubuntu and sshd on Red Hat-family systems:

systemctl status ssh

Before you learn how to restart network services in Linux, check the service’s status first so you know which unit owns it. A restart that targets the wrong unit can leave the real service running with its old settings.

To test a web service from the command line, request only the headers:

curl -I https://example.com

The first line of the response shows the HTTP status code, such as 200 for success.

To test name resolution:

dig example.com A

The dig tool comes from the bind-utils package on Red Hat-family systems and from dnsutils on Debian and Ubuntu.

Checking application-layer services on Windows

Command Prompt and PowerShell both work. To list listening TCP ports and the process IDs that own them:

netstat -ano | findstr LISTENING

To map a process ID to a program name:

tasklist /FI "PID eq 1234"

Replace 1234 with a process ID from the netstat output. In PowerShell, the same information is available with:

Get-NetTCPConnection -State Listen | Sort-Object LocalPort

To test name resolution, use nslookup example.com, which works on both Windows and Linux. On Windows 10 and later, curl.exe -I https://example.com fetches the headers. The .exe suffix avoids the PowerShell alias for Invoke-WebRequest.

When the application layer is the problem

A useful habit is to test from the bottom of the stack upward. If you can reach a server by IP address but names do not resolve, the fault is probably in name resolution, which is an application-layer service. If DNS works but the page still fails, check the HTTP response with curl.

Ping is a useful first test for basic reachability, but it does not use an application-layer protocol. A successful ping does not prove that a web or mail service is working.

People often ask what are the best networking tools for Linux, and the answer goes well beyond ss and curl. Those two commands cover most first-line checks on a single host, though.

Application-layer services when you self-host

Every self-hosted service, whether a web app, a mail server or a file share, is an application-layer service that listens on a port. A few habits keep them manageable:

  • Run ss -tlnp or netstat -ano after each change, so you know what is listening.
  • Open only the ports you need in the firewall, and expose services to the internet only when you mean to.
  • Check each service with the protocol’s own tool, such as curl for HTTP or dig for DNS.

Some programs you install only make outbound connections and never listen on a port, so a short listening-port list is not a complete inventory of software on the machine.

Summary

The application layer gives programs a standard way to find each other, agree on how to talk, and use network services. Most server software you run, such as web and mail servers, communicates through application-layer protocols. Checking listening ports, service status and name resolution covers most first-line troubleshooting.

Keep exploring

Guides from other topics

All topics →