Network security

What Is the TCP/IP Model? The 4 Layers Explained Simply

TCP/IP is the four-layer model behind the internet. Here is what each layer does, which protocols live there, and how data travels from your browser to a server.

Cysoro Security TeamPublished · 7 min read
ApplicationTransportInternetLinkNETWORK SECURITYTCP/IPmodelFour layers, one internet.
Quick answer

The TCP/IP model is a four-layer framework describing how data moves across networks: the link layer moves frames on a local network, the internet layer addresses and routes packets with IP, the transport layer delivers data to the right program with TCP or UDP, and the application layer provides services such as HTTP, DNS and email.

Key takeaways

  • TCP/IP has four layers — link, internet, transport and application — defined in RFC 1122.
  • IP routes packets between networks; TCP adds reliability and ordering, while UDP is faster and connectionless.
  • Each layer adds its own header on sending and removes it on receiving, a process called encapsulation.

Every web page you open, every email you send and every video call you join travels the same way: down four layers on your device, across networks, and back up four layers on the other side. The TCP/IP model is the map of that journey.

What is the TCP/IP model?

The TCP/IP model is a four-layer framework that describes how data moves between devices on a network such as the internet. TCP stands for Transmission Control Protocol and IP stands for Internet Protocol, the two protocols at its centre.

Each layer does one job, hands its result to the next layer, and talks to the matching layer on the other device. The protocols that fill those layers are called the TCP/IP protocol suite, or the Internet protocol suite.

The protocols came first. IP was specified in RFC 791 in September 1981, prepared for the US Defense Advanced Research Projects Agency (DARPA). The four-layer model was written down later, in RFC 1122 in October 1989, which covers the link, IP and transport layers for internet hosts.

There is no single official diagram. Some textbooks teach five layers, splitting the link layer into physical and data link parts. The four-layer version in RFC 1122 is the one used here, because it matches the standards themselves.

What are the four layers of the TCP/IP model?

The four layers, from the bottom up, are the link layer, the internet layer, the transport layer and the application layer. Data travels down the stack when you send it and up the stack when you receive it.

LayerWhat it doesData unitAddressingExample protocols
ApplicationFormats data for a program or serviceData / messageNames, URLsHTTP, HTTPS, DNS, SMTP, SSH
TransportDelivers data to the right programSegment (TCP) or datagram (UDP)Port numbersTCP, UDP
InternetMoves packets between networksPacketIP addressesIPv4, IPv6, ICMP, IPsec
LinkMoves frames across one local linkFrameMAC addressesEthernet, Wi-Fi, ARP

Think of sending a signed contract to a client in another city. You write the contract (application), number the pages and ask for a signed receipt (transport), write the street address on the envelope (internet), and a series of couriers each carry it one leg of the trip (link).

The four layers of the TCP/IP model4 — Application: HTTP, DNS, SMTP, SSH3 — Transport: TCP, UDP (ports)2 — Internet: IPv4, IPv6, ICMP (IP addresses)1 — Link: Ethernet, Wi-Fi, ARP (MAC addresses)Data goes down the stack to send, and up the stack to receive.
The four TCP/IP layers, with the protocols and addresses each one uses. Illustration by Cysoro.

What runs at the application layer?

The application layer is where software speaks directly: HTTP and HTTPS for web pages, DNS for name lookups, SMTP and IMAP for email, SSH for remote logins, and DHCP for addresses. It is the layer your apps actually use.

Encryption such as TLS sits here too, since TLS only needs a reliable, in-order stream underneath it. That is why HTTPS is HTTP plus TLS at the application layer, running over TCP below.

Routing protocols that ride on TCP or UDP, such as BGP, also belong here. If a program uses it directly, it is almost certainly an application-layer protocol.

How does the transport layer work?

The transport layer carries data between two programs on different hosts. It splits application data into segments, adds a port number so the receiving host knows which program should get it, and manages reliability and flow.

TCP is the reliable option. It opens a connection with a three-way handshake, numbers each segment, asks the receiver to acknowledge them, and retransmits anything that goes missing. That is why web pages, email and file downloads use TCP.

UDP is the lightweight option. It sends datagrams with no connection, no ordering and no retransmission. DNS lookups, live video, voice calls and online games use UDP because a late packet is worse than a lost one.

Well-known ports identify services: 80 for HTTP, 443 for HTTPS, 53 for DNS and 25 for SMTP. You can read more about the most common one in our guide to what DMARC is, which also runs over these same layers.

What does the internet layer do?

The internet layer, sometimes called the network layer, moves packets between networks. It gives every device an IP address, puts that address in a header, and lets routers forward each packet hop by hop toward its destination.

RFC 791 defines IP as providing two basic functions: addressing and fragmentation. A packet that is too large for one link is split into fragments and reassembled at the far end.

IP itself makes no promise that a packet will arrive, arrive once, or arrive in order. That job belongs to TCP above it. ICMP, the protocol behind ping, reports errors such as a destination being unreachable.

IPv4 uses 32-bit addresses, written as four numbers separated by dots, such as 192.168.1.1. IPv6 uses 128-bit addresses to solve the shortage of IPv4 addresses. Both are internet-layer protocols.

The link layer moves frames across a single local link, such as one Ethernet cable run or one Wi-Fi hop. It uses MAC addresses, the hardware addresses built into network cards, to deliver a frame to the right device on that link.

ARP, the Address Resolution Protocol, is the bridge between the two addressing systems: it asks which MAC address owns a given IP address on the local network, so an IP packet can be wrapped in a frame and sent.

Switches and access points work here. A switch forwards frames between devices on the same network, while a router, working at the internet layer, forwards packets between networks. If your Wi-Fi is slow, start by checking this layer — see our guide on how to secure your Wi-Fi for the basics of a healthy home network.

How does encapsulation work?

Encapsulation is the process of each layer wrapping the data from the layer above with its own header as data travels down the stack. The receiver removes those headers in reverse order, a process called decapsulation.

When you load a web page, the browser hands an HTTP request to TCP, which adds a header with source and destination ports and a sequence number. IP adds a header with source and destination IP addresses. The link layer wraps the packet in a frame with MAC addresses and sends it.

Each router on the way strips the frame, reads the IP header, and wraps the packet in a new frame for the next link. Only the destination host unwraps everything and hands the original request to its web server.

Encapsulation: each layer adds a headerApplication data: HTTP request+ TCP header (ports, sequence) = segment+ IP header (source and destination IP) = packet+ Ethernet header (MAC addresses) = frame
How encapsulation wraps application data in a TCP segment, an IP packet and an Ethernet frame. Illustration by Cysoro.

How does TCP/IP compare with the OSI model?

TCP/IP has four layers and describes the protocols that actually run the internet. OSI has seven layers and is mainly a teaching and troubleshooting reference, not a set of protocols anyone implements directly.

OSI layerTCP/IP layerExample
7 Application, 6 Presentation, 5 SessionApplicationHTTP, DNS, TLS
4 TransportTransportTCP, UDP
3 NetworkInternetIPv4, IPv6, ICMP
2 Data link, 1 PhysicalLinkEthernet, Wi-Fi

The mapping is approximate, because the two models were designed separately. Security teams still use OSI language every day: a "Layer 3 switch" routes, a "Layer 7 firewall" reads applications, and a "Layer 1 problem" is usually a cable.

For troubleshooting, use TCP/IP to find the real protocol and OSI terms to describe where the fault sits. Both maps point at the same network.

Where does security fit in the TCP/IP model?

Security is not a separate layer in TCP/IP, so protections are added at each layer. TLS encrypts application data, IPsec encrypts and authenticates packets at the internet layer, and WPA3 protects Wi-Fi frames at the link layer.

Each layer also has its own attacks. ARP spoofing poisons link-layer address lookups, IP spoofing forges internet-layer source addresses, TCP SYN floods exhaust transport-layer connections, and phishing targets the application layer above them all.

That is why defense in depth matters: a firewall at the transport layer, DNS filtering at the application layer, and encrypted traffic throughout. No single layer can protect the whole stack on its own.

You can check the application-layer side of your own site in seconds with our free SSL checker, which verifies the certificate and TLS setup your browser relies on.

How do you troubleshoot with the TCP/IP model?

Work from the bottom up, one layer at a time, and stop at the first layer that fails. Guessing at the application layer while the cable is unplugged wastes time.

  1. Link: is the interface up, is Wi-Fi connected, is the cable plugged in?
  2. Internet: do you have an IP address, and can you ping the gateway?
  3. Transport: is the port open, and does the connection complete?
  4. Application: does the service respond, and is DNS resolving the name?

A useful check is to find your own public address with our what is my IP tool, then compare it with the address your router reports. If they differ, your home network is using address translation, which is normal.

The bottom line

The TCP/IP model is four layers: link, internet, transport and application. IP routes packets between networks, TCP and UDP deliver them to the right program, and the application layer is where your software lives.

When something breaks, the model tells you where to look. Start at the link layer and work up, and you will find most network problems faster than by guessing. Check your own setup with the free DNS lookup tool to see how your domain resolves across the stack.

Frequently asked questions

What is the TCP/IP model in simple terms?

It is a four-layer description of how data travels on the internet. Each layer does one job — moving frames locally, routing packets, delivering data to a program, or serving an application — and hands its result to the next layer.

What are the four layers of the TCP/IP model?

From the bottom up they are the link layer, the internet layer, the transport layer and the application layer. RFC 1122 names them link, IP, transport and application, and some textbooks call the bottom layer network access instead of link.

What is the difference between TCP/IP and OSI?

TCP/IP has four layers and describes the protocols that actually run the internet, while OSI has seven layers and is mainly a teaching and troubleshooting reference. OSI layers 5, 6 and 7 fold into the TCP/IP application layer, and OSI layers 1 and 2 become the link layer.

Is TCP/IP a protocol or a model?

Both, in different senses. TCP/IP is a protocol suite — the family of protocols including TCP, IP, UDP, HTTP and DNS — and the TCP/IP model is the four-layer framework that organises those protocols by what they do.

What does TCP do that IP does not?

IP only addresses and routes packets between networks, with no guarantee they arrive. TCP opens a connection, numbers segments, checks for errors, retransmits missing data and delivers it in order to the right program.

When is UDP used instead of TCP?

UDP is used when speed matters more than guaranteed delivery, for example DNS lookups, live video, voice calls and online games. It sends datagrams without a connection or retransmission, so applications handle any loss themselves.

What is encapsulation in TCP/IP?

Encapsulation is each layer wrapping the data from the layer above with its own header as data goes down the stack, and the receiver removing those headers in reverse order. The application data becomes a segment, then a packet, then a frame.

How do I troubleshoot a network problem using the TCP/IP model?

Work layer by layer from the bottom up: check the cable and Wi-Fi at the link layer, the IP address and route at the internet layer, the port and connection at the transport layer, and the service itself, such as a web server, at the application layer.

Sources

  1. IETF — RFC 1122: Requirements for Internet Hosts — Communication Layers
  2. IETF — RFC 791: Internet Protocol
  3. Cloudflare — What is the network layer?
  4. Cloudflare — What is the Internet Protocol (IP)?
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against RFC 1122, RFC 791 and Cloudflare's networking learning centre.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free