The Application Layer
Everything below this layer exists to serve it. The Application layer is where users and their programs meet the network — and where almost every exam question about ports lives. Learn exactly which protocol uses which port and on which transport, and you have already claimed a large block of easy marks.
Layer 7: the interface between people and packets
In the OSI model, the Application layer (7) is the top of the stack. It is the layer through which a user’s data enters the network and through which received data is handed back to a program. The layers below it — transport, network, data link, physical — do all the routing and delivery, but they have no idea what the data means. Only Layer 7 does. Your browser sends GET /index.html HTTP/1.1; the network below happily moves those bytes without understanding them.
Two important clarifications for the exam:
- The OSI Application layer is not the application itself. The program runs outside the OSI model; the layer provides the rules (protocols) the program uses to format and exchange data.
- In the TCP/IP model, OSI layers 5–7 (Session, Presentation, Application) are collapsed into a single Application layer. When an exam says “Application layer”, check whether it means the TCP/IP layer (which includes session and presentation duties) or OSI layer 7 specifically.
What belongs to each collapsed layer? Presentation (6) deals with data format, encoding, compression, and encryption; Session (5) manages the dialogue between two hosts — establishing, maintaining, and tearing down sessions. Both are folded into TCP/IP’s Application layer, which is why certificates, TLS handshakes, and compression appear so close to the application in practice.
Application, service, and protocol
Three words that are routinely confused. Keep them straight and your answers to “what is this process doing?” questions will be coherent: the application starts, the service opens a socket and listens, and the protocol governs every message that crosses that socket.
| Term | Meaning | Example |
|---|---|---|
| Application | The program the user runs. | Chrome, Outlook, curl |
| Service | A background process that is always listening and provides a function to clients. | The httpd web daemon, the DHCP server daemon |
| Protocol | The rules of exchange that the application and service both follow. | HTTP, SMTP, DNS, FTP |
Client–server and peer-to-peer
Application-layer traffic follows one of two architectural models. The exam expects you to recognise both and to give an example of each.
| Characteristic | Client–server | Peer-to-peer |
|---|---|---|
| Roles | Fixed: one server, many clients | Dynamic: every peer serves and requests |
| Centralisation | A dedicated (often admin-managed) server | No central server or coordinator |
| Scalability | Server capacity is the bottleneck | Scales well — more peers add capacity |
| Security / management | Central control, easy to secure and back up | No central control, hard to secure or back up |
| Protocol examples | HTTP/HTTPS (web), SMTP/POP3/IMAP (email), DNS | BitTorrent (file sharing), older Skype |
Sessions, sockets, and ports
Two hosts that want to talk first establish a session. In OSI terms the Session layer (5) does the establishing, maintaining, and tearing down; the Presentation layer (6) handles encoding so both sides understand each other; and the Application layer (7) produces the actual data. In the TCP/IP model all of this happens inside the single Application layer — but the mechanism that carries a session is the socket.
IP:port, for example 203.0.113.10:443). A TCP or UDP connection is defined by two sockets: source socket and destination socket.The destination port tells the receiving host which service should get the data; the source port is usually an ephemeral (short-lived) port chosen by the client so the server knows where to reply. The server then demultiplexes: arriving data on port 443 goes to the web server, on port 25 to the mail server, on port 53 to the DNS service. One IP address can host dozens of services at once precisely because ports separate them.
How L7 rides on L4 well-known ports
The Application layer does not add IP addresses or do routing — that is the Network layer’s job. What Layer 7 effectively does is name a destination service using a well-known port that the Transport layer puts in its header. The application binds to a port, TCP/UDP listens on that port, and any packet carrying that destination port is delivered to the application.
Port numbers are grouped into three ranges (RFC 6335):
- Well-known (System) ports 0–1023. Assigned to the major services:
80HTTP,443HTTPS,25SMTP,53DNS. - Registered (User) ports 1024–49151. Assigned to vendor and lesser-known apps (for example
3389RDP,8080HTTP-alt). - Dynamic/private (Ephemeral) ports 49152–65535. Not assigned; clients pick a random source port from this range for outgoing connections.
Why is DNS on UDP while HTTP is on TCP? The answer is the nature of the exchange: one small request, one small reply, no way to retransmit meaningfully later → UDP; large, ordered, must-arrive-complete data (web pages, email, files) → TCP. A single DNSSEC response can exceed UDP’s 512-byte limit, so DNS also falls back to TCP (Lesson 3 covers this). The exam will ask you to pick the transport by reading the application’s needs, so train the mapping both ways: format to protocol, protocol to port, port to transport.
| Protocol | Port(s) | Transport | Typical use |
|---|---|---|---|
| DNS | 53 | TCP and UDP | Name resolution; UDP for queries, TCP for zone transfers and large responses |
| DHCP | 67 / 68 | UDP | IP configuration; 67 = server, 68 = client |
| HTTP | 80 | TCP | Web browsing, unencrypted |
| HTTPS | 443 | TCP | Web browsing over TLS, encrypted |
| FTP | 20 / 21 | TCP | File transfer; 21 = control, 20 = data (active mode) |
| TFTP | 69 | UDP | Trivial, unauthenticated file transfer (for example switch IOS backup) |
| SMTP | 25 | TCP | Email transfer between mail servers |
| POP3 | 110 | TCP | Email download to the client |
| IMAP4 | 143 | TCP | Email kept on the server, folders synced to the client |
| Telnet | 23 | TCP | Remote terminal, cleartext (insecure) |
| SSH | 22 | TCP | Encrypted remote terminal and file transfer |
| NTP | 123 | UDP | Time synchronisation |
| SNMP | 161 / 162 | UDP | Network management; 161 = agent queries, 162 = traps |
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics, Network Fundamentals — application layer and ports. cisco.com.
- Cotton, M., Eggert, L., Touch, J., Westerlund, M. & Cheshire, S. RFC 6335: IANA Procedures for the Management of the Service Name and Transport Protocol Port Number Registry (2011), defines the System (0–1023), User (1024–49151) and Dynamic (49152–65535) ranges. rfc-editor.org/rfc/rfc6335.
- IANA. Service Name and Transport Protocol Port Number Registry (authoritative port assignments for 20/21, 22, 23, 25, 53, 67/68, 69, 80, 110, 123, 143, 161/162, 443). iana.org/assignments/service-names-port-numbers.
- Mockapetris, P. RFC 1035: Domain Names — Implementation and Specification (1987), §4.2 (UDP/TCP usage for port 53). rfc-editor.org/rfc/rfc1035.
- Postel, J. & Reynolds, J. RFC 959: File Transfer Protocol (1985), defines control port 21 and data port 20. rfc-editor.org/rfc/rfc959.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.