Skip to content
Free learning tool

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.

Cheat sheet:

The matching layer lights up in both models, with a brief explanation.

Examples:

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.

LayerFunctionData unitProtocolsOSI layers
4 Application layerApplication Layer · DoD: Process/ApplicationContains application protocols such as HTTP, DNS, and SMTP and also handles the tasks of OSI layers 5 and 6: sessions, encoding, and encryption.DataRPC, 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, MySQL7 Application layer, 6 Presentation layer, 5 Session layer
3 Transport layerTransport Layer · DoD: Host-to-HostConnects 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, UDP4 Transport layer
2 Internet layerInternet Layer · DoD: InternetAddresses devices using IP addresses and forwards packets through routers across different networks to their destination. It corresponds to OSI layer 3.PackageIP (IPv4, IPv6), ICMP, IPsec, ARP3 Network layer
1 Network access layerLink Layer · DoD: Network AccessTransmits 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.FrameEthernet, WLAN, DSL, PPP, VLAN, STP, ARP2 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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

FeatureOSI modelTCP/IP model
Layers74
SourceISO standard, published in 1984 as ISO 7498; now ISO/IEC 7498-1Originated from the US Department of Defense (DoD) ARPANET; described in RFC 1122 (1989)
PurposeVendor-neutral reference model, now used mainly for learning and troubleshootingDescribes the protocols the internet actually uses
Session and presentationSeparate layers 5 and 6Part of the application layer, handled by TLS or the application itself, for example
Lowest layerSplit into physical (1) and data link (2)One network access layer for cables, wireless connections, and MAC addresses
In practiceTerms 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.

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

New

Practice 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

New

Interactively 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

New

Enter 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

New

Trace 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 Support
Learned the theory?

Put 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.

4.4/5 Trustpilot32,000+ Active serversSince 2010

No setup. No risk. Online in seconds.

Flexible TermCancel anytimeOnline in 60 seconds

Looking for more tools? View all network tools