Free tech learning for everyone, from basics to pro

Network FundamentalsNetworking SecurityBeginner

The OSI and TCP/IP models: layers, functions and encapsulation

In short: Network models break communication into layers so each part can be understood, built and fixed separately. OSI has seven layers; TCP/IP, which the internet actually uses, has four. As data moves down the layers each one adds a header, a process called encapsulation.

Why use network models?

Sending a message across a network involves many separate jobs: turning data into signals, finding the right device, choosing a route, checking for errors and presenting the result to the user. Network models split these jobs into layers. Each layer does one job and relies on the layer below it. They work much like a country's constitution: a common set of rules that everyone follows. Layered models:

  • reduce complexity by breaking a big problem into small parts;
  • standardise the interfaces between parts, so products from different vendors work together;
  • let one layer change (for example, a new cable type) without changing the others;
  • make teaching, learning and troubleshooting much easier.

The OSI model

The Open Systems Interconnection (OSI) model was published by ISO in 1984. It is a reference model, not a protocol: it describes what has to happen so that any two systems can communicate, whatever their hardware or software.

The OSI model and how it maps to the TCP/IP modelOSI modelUnit (PDU)TCP/IP model7Applicationservices for the userData6Presentationformat, encrypt, compressData5Sessionopen, manage, close sessionsData4Transportend-to-end delivery, portsSegment3Networklogical addressing, routingPacket2Data LinkMAC addressing, framesFrame1Physicalbits on the mediumBitsApplicationTransportInternetNetwork Access
Figure 1. The seven OSI layers, the data unit at each layer, and the four TCP/IP layers they map to.
LayerMain jobExamples
7 ApplicationGives applications and users access to network services.HTTP, DNS, SMTP, FTP
6 PresentationTranslates data into a standard format; handles encryption and compression.TLS encryption, JPEG, UTF-8
5 SessionOpens, manages and closes conversations (sessions) between applications.Session setup and recovery
4 TransportDelivers data end to end between applications, using port numbers; splits data into segments, controls flow and recovers errors.TCP, UDP
3 NetworkLogical (IP) addressing and routing packets from source to final destination across networks.IP, ICMP; routers
2 Data LinkMoves frames between neighbouring devices on the same link, using MAC addresses; detects errors.Ethernet, Wi-Fi; switches
1 PhysicalSends raw bits as electrical, light or radio signals.Cables, connectors, radio

Memory aid (top to bottom): All People Seem To Need Data Processing.

Encapsulation: how data travels down the layers

When you send something, each layer wraps the data from the layer above with its own control information, called a header:

Encapsulation: each layer adds its own headerApplicationDataTransportTCP headerDataNetworkIP headerTCP headerDataData LinkFrame headerIPTCPDataFCSPhysical layer: the whole frame is sent as bits (1s and 0s)
Figure 2. Encapsulation on the sending side. The receiver removes each header in reverse order (de-encapsulation).
  1. The application prepares the data, for example a web page request.
  2. The transport layer splits it into segments and adds a TCP header with port numbers, sequence numbers and a checksum.
  3. The network layer adds an IP header with the source and destination IP addresses, creating a packet.
  4. The data link layer adds a frame header with MAC addresses and a trailer with a Frame Check Sequence (FCS) for error detection, creating a frame.
  5. The physical layer sends the frame as bits.

At the receiver, the process runs in reverse (de-encapsulation): each layer reads and removes its own header, then passes the rest up.

The TCP/IP model

The TCP/IP model grew out of a US Department of Defense research project and became the model the internet actually runs on. It has four layers:

  • Application: combines OSI layers 5, 6 and 7. Protocols: HTTP, DNS, SMTP, FTP, SSH.
  • Transport: end-to-end delivery between hosts using TCP (reliable) or UDP (fast).
  • Internet: addressing and routing packets across networks with IP, plus ICMP and ARP.
  • Network Access (or Link): the physical connection and framing, such as Ethernet and Wi-Fi.

Engineers still talk in OSI layer numbers ("it's a layer 2 problem") because the seven layers are more precise, while the protocols themselves follow TCP/IP. See the OSI model, used the way engineers use it for troubleshooting tips.

Practice

Which OSI layer uses IP addresses, and which uses MAC addresses?
IP addresses: layer 3 (Network). MAC addresses: layer 2 (Data Link).
Put these in the order they are added when sending: IP header, TCP header, frame header.
TCP header first (transport), then IP header (network), then frame header (data link).
Which OSI layers does the TCP/IP Application layer cover?
OSI layers 5, 6 and 7: session, presentation and application.

Key takeaways

  • Layered models break communication into simpler jobs and let vendors interoperate.
  • OSI has seven layers: Application, Presentation, Session, Transport, Network, Data Link, Physical.
  • Data units: segment (layer 4), packet (layer 3), frame (layer 2), bits (layer 1).
  • Encapsulation adds a header at each layer on the way down; the receiver removes them on the way up.
  • TCP/IP has four layers and is what the internet really uses.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.