Layer 7 — Application
The OSI layer where applications meet the network: HTTP, DNS, SMTP, and their data.
Level: beginner
What is it?
Layer 7 is where the message has meaning to a program: a GET, a DNS question, an SMTP MAIL FROM. Protocols here specify verbs, headers, and payloads. The OSI 'application' is not the GUI — it is the protocol the process speaks.
Why does it matter?
When users say 'the website is down', the first skilled question is whether DNS, TLS, TCP, or HTTP is the part that failed. That is an L7-vs-below split.
Mental model
The letter’s words. Lower layers deliver bytes; this layer parses them as a request.
How it works
- Purpose: application-level messages and the protocols that define them.
- PDU: data (messages). Addressing: URLs, hostnames, service names — not ports (those are L4).
- Protocols: HTTP/HTTPS, DNS, SMTP, FTP, SSH, DHCP, WebSockets (upgrade).
- Devices: end hosts, L7 load balancers and API gateways, reverse proxies.
- Example: GET /index.html, Host: example.com.
Real-world usage
- Every user-facing protocol
- L7 load balancing and WAF
Common mistakes
- Calling the browser 'layer 7'
- Putting ports at L7
Interview questions
Is HTTP layer 7?
Yes in OSI teaching. In TCP/IP it sits in the application layer on top of TCP (or QUIC).
Does a URL include a layer-4 idea?
The host is resolved by DNS (L7); the port is L4. The path is application.
| Protocol | Port (typical) | Transport | Job |
|---|---|---|---|
| HTTP | 80 | TCP | Hypertext / APIs |
| HTTPS | 443 | TCP (or QUIC) | HTTP over TLS |
| DNS | 53 | UDP/TCP | Name → record |
| SMTP | 25/587 | TCP | Mail transfer |
| SSH | 22 | TCP | Remote shell / tunnel |
| DHCP | 67/68 | UDP | Host configuration |