TCP/IP model: The 4 layers explained simply
Explore the TCP/IP model (also called the DoD model) interactively: network access, internet, transport, and application layers, with their roles, data units, and protocols, alongside the OSI model. Enter a protocol or port such as DNS, ICMP, or 443 to see which layer it belongs to. Includes an encapsulation animation, port quiz, and cheat sheet for training, study, and exams.
Built by Justin Schuessler
Free, with no sign-up or installation: runs entirely in your browser.
Want to try out ports, firewalls and services yourself? Get your own VPS with root access.
The matching layer lights up in both models, with a brief explanation.
OSI model
TCP/IP model
The application is at the top, the cable at the bottom. The same height means the same role in both models.
Assignment
Enter a term, protocol, device, or port number above, or click an example. You'll see which layer it belongs to and why.
- Filled: layer matching the search term
- Outlined: the layer whose details appear below
- Edge case: textbooks assign it to different layers; both interpretations are explained
TCP/IP model, layer 4
Application layer
Application Layer, “Process/Application” in the DoD model
Contains application protocols such as HTTP, DNS, and SMTP and also handles the tasks of OSI layers 5 and 6: sessions, encoding, and encryption.
- Data unit (PDU)
- Data
- Addressing
- no separate layer
- In the OSI model
Typical devices
Protocols and formats
Edge case: textbooks assign it to different layers. Click to see both interpretations.
Example result
How the TCP/IP model classifies a port
Enter a term, protocol, device, or port number, and the tool shows the matching layer in both models and explains why. This is an example; your search will return an answer for your term.
Example · Input: 443
Input
- Search term
- 443
Output
- Matches
- 443/TCP (HTTPS)
- OSI model
- 4 Transport layer / 7 Application layer
- TCP/IP model
- Transport layer / Application layer
- Reason
- The port number is an address at the transport layer (OSI 4); the service behind it belongs to the application layer (OSI 7).
Why this tool
Explore the model behind the internet
Once you can confidently map protocols and ports to their layers, you've mastered the TCP/IP model. Every feature is designed to help you do that.
Four layers, clearly mapped
See the TCP/IP layers alongside the OSI model: Application spans three OSI layers, and Network Access spans two. Clear at a glance.
Find protocols and ports
DNS, ICMP, ARP or port 443: each search shows the layer in both models and a brief explanation.
Understand TCP and UDP
Using HTTPS and DNS as examples, see when TCP sends a segment and when UDP sends a datagram.
Follow the encapsulation process
Follow each header from the application down to the cable and back up at the receiving end, as an animation or step-by-step list.
Port quiz for exam prep
Test yourself on standard exam ports in both directions, including whether they use TCP or UDP. Questions are shuffled every round.
Printable cheat sheet
TCP/IP and OSI side by side on one page, with data units, protocols, ports and memory aids, as a PDF or PNG.
How it works
How to learn the TCP/IP model with this tool
No account or installation required, right in your browser.
Step 1
Click a layer
Click one of the four TCP/IP layers to expand its function, data unit, addressing, devices and protocols. The corresponding OSI layers light up too.
Step 2
Map a protocol or port to a layer
Enter a protocol, device, or port, such as DNS, ICMP, or 443. The matching layer lights up in both models, with a brief explanation of why it belongs there.
Step 3
Follow encapsulation
Open the Encapsulation tab and follow an HTTPS request or DNS query header by header to the recipient, as an animation or a list of every step.
Step 4
Practice in practice mode
Sort the layers, match protocols and devices, and practice standard ports: port for a service, service for a port, and TCP or UDP.
Step 5
Download cheat sheet
Download the cheat sheet showing the TCP/IP and OSI models side by side as a PDF or PNG for printing and revision.
Step 6
Share match
The search term and selected layer appear in the address bar. Copy the link to share a match.
Overview
The 4 layers of the TCP/IP model
From top to bottom according to RFC 1122, with each layer's name in the DoD model and the OSI layers it encompasses.
| Layer | Function | Data unit | Protocols | OSI layers |
|---|---|---|---|---|
| 4 Application layerApplication Layer · DoD: Process/Application | Contains application protocols such as HTTP, DNS, and SMTP and also handles the tasks of OSI layers 5 and 6: sessions, encoding, and encryption. | Data | RPC, NetBIOS, TLS (SSL), Character encoding (ASCII, UTF-8), MIME, Data formats (JPEG, PNG, MPEG), HTTP, HTTPS, DNS, DHCP, SSH, FTP, SMTP, IMAP, POP3, Telnet, SNMP, NTP, LDAP, SMB, RDP, TFTP, Syslog, MySQL | 7 Application layer, 6 Presentation layer, 5 Session layer |
| 3 Transport layerTransport Layer · DoD: Host-to-Host | Connects programs on both ends through ports: reliably and in order with TCP, or quickly and without acknowledgments with UDP. It corresponds to OSI layer 4. | Segment (TCP) / datagram (UDP) | TCP, UDP | 4 Transport layer |
| 2 Internet layerInternet Layer · DoD: Internet | Addresses devices using IP addresses and forwards packets through routers across different networks to their destination. It corresponds to OSI layer 3. | Package | IP (IPv4, IPv6), ICMP, IPsec, ARP | 3 Network layer |
| 1 Network access layerLink Layer · DoD: Network Access | Transmits frames across the local network to the next device, such as a router. It combines OSI layers 1 and 2: cables, radio, and MAC addresses. | Frame | Ethernet, WLAN, DSL, PPP, VLAN, STP, ARP | 2 Data link layer, 1 Physical layer |
Encapsulation
Data encapsulation in the TCP/IP model
When sending, each layer adds its header to the data; at the receiving end, each layer removes its header. In the Encapsulation tab, you can follow this process for an HTTPS request and a DNS query.
Application layer: data
The application creates the payload, such as the browser's HTTP request. With HTTPS, TLS encrypts it before it moves down the layers.
Transport layer: segment or datagram
TCP or UDP adds its header with source and destination ports. TCP creates a segment; UDP creates a datagram, for example for a DNS query.
Internet layer: packet
The IP header, containing the source and destination IP addresses, turns it into a packet that routers forward from network to network.
Network access layer: frame
The Ethernet header with MAC addresses and the checksum (FCS) at the end form a frame, which travels as a sequence of bits over a cable or wireless connection.
Terms
TCP/IP model, DoD layer model, and 5-layer model
Three names, one technology: these models describe the same internet, just at different levels of detail.
TCP/IP model according to RFC 1122
Four layers: Network Access, Internet, Transport and Application. That's how the standard describes the internet.
DoD model
The same four layers using the US Department of Defense names: Network Access, Internet, Host-to-Host and Process/Application.
Five-layer model
A teaching model that splits network access into physical and data link layers: Physical, Data Link, Network, Transport and Application.
Comparison
Difference between the OSI and TCP/IP models
Both models describe the same communication. The OSI model breaks it down in more detail and helps with learning and troubleshooting. The TCP/IP model describes how the internet is actually built.
| Feature | OSI model | TCP/IP model |
|---|---|---|
| Layers | 7 | 4 |
| Source | ISO standard, published in 1984 as ISO 7498; now ISO/IEC 7498-1 | Originated from the US Department of Defense (DoD) ARPANET; described in RFC 1122 (1989) |
| Purpose | Vendor-neutral reference model, now used mainly for learning and troubleshooting | Describes the protocols the internet actually uses |
| Session and presentation | Separate layers 5 and 6 | Part of the application layer, handled by TLS or the application itself, for example |
| Lowest layer | Split into physical (1) and data link (2) | One network access layer for cables, wireless connections, and MAC addresses |
| In practice | Terms such as “Layer 2 switch” or “Layer 7 firewall” | The protocols themselves: IP, TCP, UDP, HTTP, DNS |
From model to practice
Try out ports, firewalls, and services yourself
The best way to learn the layers is to work with them: install a service, open a port in the firewall, and check connectivity. These tools show you what happens at each layer.
Port Checker
Checks whether a port on your server is reachable from outside: layer 4 in practice.
Traceroute
Shows every router on the way to the destination: layer 3 and ICMP in action.
Subnet Calculator
Calculates the network address, broadcast address, and usable hosts: essential tools for layer 3.
What is my IP?
Shows the public IP address you use on the internet.
A server of your own with root access is ideal for experimenting with SSH, web servers, DNS, or firewall rules. View VPS
Discover more
More tools
DNS Lookup
Look up a domain’s A, AAAA, MX, TXT, NS, CNAME, SOA and CAA records, plus Reverse DNS for any IP.
Built by Luca Stanek
Subnet Calculator
Calculate the network address, broadcast address, subnet mask, and usable host range from a CIDR address, and convert between CIDR and IP ranges (IPv4 and IPv6).
Built by Jakub Martyniak
Subnetting exercises
NewPractice subnetting with random exercises at three levels: determine the network address, broadcast address, host range and number of hosts, check your answers and view the solution step by step.
Built by Luca Stanek
OSI model
NewInteractively learn the 7 layers of the OSI model: click layers, assign terms such as switch, ARP, or port 443, and explore animated encapsulation, a quiz, and a cheat sheet for the IHK exam.
Built by Justin Schuessler
What is my IP?
Display the public IP address, IPv4/IPv6 version, reverse DNS record, and approximate country.
Built by Jakub Martyniak
Port Checker
Check whether specific ports are open on an IP or hostname—select a protocol or game instead of scanning all ports at once.
Built by Sebastian Rademacher
Common Ports & firewall commands
NewEnter a port or service to learn what it does and copy ready-to-use firewall commands for ufw, iptables, nftables, firewalld and Windows. Includes the complete IANA port list and a port check.
Built by Justin Schuessler
Traceroute
NewTrace the route from our locations to you (and back), with packet loss at each hop and a plain-language analysis.
Built by Julian Alker
Ping Test
Measure ping, jitter, and packet loss to all Game Server locations and get a recommendation for the best one.
Built by Marvin Kluck
FAQ
Frequently asked questions
Quick answers about the TCP/IP model, its layers, TCP, UDP and the key ports.
Find the matching layer in the TCP/IP and OSI models for any term, protocol, device, or port, with an explanation. Enter 443 and the tool shows 443/TCP (HTTPS) on the TCP/IP layers Transport layer / Application layer: the port number belongs to the transport layer, while the service belongs to the application layer. Click a layer to see its purpose, data unit, addressing, and protocols.
The TCP/IP model, also called the TCP/IP reference model, describes how data travels across the internet in four layers. It is named after its key protocols: TCP (Transmission Control Protocol) at the transport layer and IP (Internet Protocol) at the internet layer. It is defined in RFC 1122. Unlike the OSI model, it grew out of practical use: the protocols came first.
From bottom to top: 1 network access layer (Link Layer) for cables, wireless connections, and MAC addresses; 2 internet layer (Internet Layer) for IP and routing; 3 transport layer (Transport Layer) for TCP and UDP; and 4 application layer (Application Layer) for protocols such as HTTP, DNS, SMTP, and SSH.
Four, as described in RFC 1122. Some textbooks, such as those by Tanenbaum or Kurose, split the network access layer into physical and data link layers. This produces five layers: physical, data link, network, transport, and application. It's a teaching model between OSI and TCP/IP, not a separate standard. It describes the same technology.
Because it originated in ARPANET, which was funded by the US Department of Defense (DoD). In the DoD model, the layers are called Network Access, Internet, Host-to-Host, and Process/Application. They correspond to the same four layers as in the TCP/IP model.
The OSI model has seven layers and serves as a reference for learning and troubleshooting. The TCP/IP model has four layers and describes how the internet actually works. OSI layers 5, 6 and 7 together form the application layer, while OSI layers 1 and 2 form the network access layer.
Network Access: Ethernet, Wi-Fi, ARP and PPP. Internet: IP (IPv4, IPv6), ICMP and IPsec. Transport: TCP and UDP. Application: HTTP, HTTPS, DNS, DHCP, SSH, FTP, SMTP, IMAP, POP3 and many more. In the TCP/IP model, TLS belongs to the application layer because it runs over TCP.
TCP establishes a connection with a three-way handshake, assigns sequence numbers, acknowledges receipt and retransmits lost data. It's reliable but slower, making it suitable for websites, email and SSH. UDP sends datagrams without a connection or acknowledgements. It's fast and lightweight, making it suitable for DNS, live streaming, internet telephony (VoIP) and online games.
The key ones: 20/21 FTP, 22 SSH, 23 Telnet, 25 SMTP, 53 DNS, 67/68 DHCP, 80 HTTP, 110 POP3, 123 NTP, 143 IMAP, 161 SNMP, 389 LDAP, 443 HTTPS, 445 SMB, 587 SMTP Submission, 993 IMAPS, 995 POP3S, and 3389 RDP. In practice mode, the port quiz tests standard ports in ten questions: port for a service, service for a port, and TCP or UDP.
No. The tool runs entirely in your browser, with no login and no requests to a server. Only your search term appears in the address bar so you can share a result, and your browser stores your quiz high scores locally.
Any more questions?
Contact SupportPut it into practice: try your own VPS
With a ZAP-Hosting VPS, you can set up services, ports and firewall rules yourself and see how the layers work together.
No setup. No risk. Online in seconds.
Looking for more tools? View all network tools
