Skip to main content

OSI and TCP/IP Models

Learning Objectives

  • List all seven layers of the OSI model in order and state the core responsibility of each.
  • List the four layers of the TCP/IP model and map each one to its OSI equivalent.
  • Explain encapsulation and de-encapsulation as data moves down and up the protocol stack.
  • Identify which protocols (HTTP, TCP, IP, Ethernet, etc.) belong to which layer in both models.
  • Explain why the TCP/IP model became the de facto standard even though OSI is taught first.
  • Use layer terminology to describe where a specific network fault or protocol operates.

Quick Answer

The OSI model and the TCP/IP model are two layered frameworks for describing how data moves across a network. OSI has seven layers (Physical, Data Link, Network, Transport, Session, Presentation, Application); TCP/IP has four (Network Access, Internet, Transport, Application) that combine several OSI layers into single practical layers. Both models matter because they give engineers a shared vocabulary for isolating problems and designing protocols — "the issue is at Layer 3" instantly tells another engineer to think about IP addressing and routing rather than cables or applications. OSI is the more detailed teaching model; TCP/IP is the model the actual internet runs on. Every protocol you'll ever study (HTTP, TCP, IP, Ethernet) has a specific home in both stacks.

Why Two Models Exist

Definition. The OSI (Open Systems Interconnection) model is a seven-layer conceptual framework, published by ISO in 1984, describing what a network protocol stack should do, layer by layer. The TCP/IP model is a four-layer framework that describes what the actual protocols the internet was built on do do.

How it works. OSI was designed first, as a vendor-neutral standard meant to guide the design of new protocols. But by the time OSI was finished, TCP/IP — developed independently for ARPANET — was already running in production and won out for real-world adoption. So today: OSI survives as the model everyone uses to talk about networking (because its layers are more granular and easier to teach), while TCP/IP survives as the model that actual internet protocols are organized around.

Example. When your professor says "SSL/TLS operates at the Presentation layer," they're using OSI vocabulary, even though no real protocol stack has a separate Presentation layer — that job is absorbed into the Application layer in the TCP/IP model actually running on your machine.

Real-world example. Cisco networking certifications (like CCNA) test OSI layer knowledge constantly, because "which layer is this problem at" is the single most useful diagnostic question in real network troubleshooting — a slow website could be a Layer 1 cabling issue, a Layer 3 routing issue, or a Layer 7 application bug, and the fix is completely different in each case.

Why it matters. Layered thinking is what lets the internet function at all: a browser developer never needs to know how Wi-Fi radio signals work, and a Wi-Fi chip designer never needs to know what HTML is. Each layer only needs to talk to the layer directly above and below it, using a fixed interface.

Common misunderstanding. Students often assume OSI is "the old broken model" and TCP/IP is "the new correct one." In reality, OSI isn't broken — it was never fully implemented as actual running protocols. It survives specifically because it's a better teaching and diagnostic tool, with finer-grained layers than TCP/IP.

The OSI Model: Seven Layers

Definition. The OSI model divides network communication into seven layers, each layer providing services to the layer above it and relying on services from the layer below it.

How it works — layer by layer, bottom to top:

LayerNameResponsibilityExample Protocols/Units
1PhysicalTransmits raw bits over a physical medium (voltage, light, radio)Ethernet cables, Wi-Fi radio, fiber optics — unit: bit
2Data LinkFrames bits, handles MAC addressing, and detects/corrects errors on the same local linkEthernet, PPP, switches — unit: frame
3NetworkRoutes data between different networks using logical addressesIP, ICMP, routers — unit: packet
4TransportProvides end-to-end delivery, reliability, and flow control between applicationsTCP, UDP — unit: segment/datagram
5SessionEstablishes, manages, and terminates sessions (dialogues) between two applicationsNetBIOS, RPC session setup
6PresentationTranslates, encrypts, and compresses data into a format both ends understandSSL/TLS, JPEG, ASCII/Unicode encoding
7ApplicationProvides the interface end-user software actually interacts withHTTP, FTP, SMTP, DNS

Example. A mnemonic students use: "Please Do Not Throw Sausage Pizza Away" for Physical, Data Link, Network, Transport, Session, Presentation, Application.

Real-world example. When you make a video call, the Session layer keeps track of the ongoing call as a single logical conversation even as the Transport layer below it breaks the audio/video into many independent packets — if the call needs to be "resumed" after a brief drop, that's session-layer bookkeeping.

Why it matters. Each layer isolates a specific kind of failure. A cut Ethernet cable is a Layer 1 problem. A switch not learning MAC addresses is Layer 2. A misconfigured router is Layer 3. A server refusing connections is Layer 4 or above. This vocabulary is standard across the entire networking industry.

Common misunderstanding. Students frequently assume the Session and Presentation layers exist as distinct pieces of real software running on a modern computer. In practice, no widely used stack implements Layer 5 or Layer 6 as separate components — their responsibilities (session tracking, encryption, formatting) are folded into Layer 7 application code (e.g., a browser handles both TLS and HTTP itself, sitting at what TCP/IP just calls the Application layer).

The TCP/IP Model: Four Layers

Definition. The TCP/IP model (also called the Internet Protocol Suite) organizes the same networking job into four layers, matching the protocols that actually run on real hardware today.

How it works — the four layers mapped to OSI:

TCP/IP LayerCorresponds to OSI LayersKey Protocols
Network Access (Link)Physical + Data Link (1-2)Ethernet, Wi-Fi (802.11), ARP
InternetNetwork (3)IP, ICMP
TransportTransport (4)TCP, UDP
ApplicationSession + Presentation + Application (5-7)HTTP, HTTPS, FTP, SMTP, DNS, SSH

Example. When your browser loads a page: the Application layer (HTTP) generates a request, the Transport layer (TCP) breaks it into segments and adds port numbers, the Internet layer (IP) adds source/destination addresses and figures out routing, and the Network Access layer (Ethernet or Wi-Fi) actually puts bits on the wire or over the air.

Real-world example. Every internet router you've ever used only needs to understand the Network Access and Internet layers to do its job — it reads the IP header, decides the next hop, and forwards the frame, without ever looking inside the Transport or Application layer data. This separation is exactly why routers can be fast and protocol-agnostic about what's inside the packet.

Why it matters. TCP/IP is what's actually implemented in every operating system's networking stack (Windows, Linux, macOS, Android, iOS). When you troubleshoot with tools like ping, traceroute, or netstat, you're interacting directly with TCP/IP layers, not OSI's seven.

Common misunderstanding. Some students think TCP/IP is "missing" the Session and Presentation layers entirely, as if those functions simply don't happen. They do happen — they're just not separated into their own layer; they're handled inside application code (e.g., a browser managing its own TLS session and cookies).

Encapsulation: How Data Actually Travels

Definition. Encapsulation is the process of wrapping data with layer-specific headers (and sometimes trailers) as it moves down the protocol stack from Application to Physical, so each layer's information travels alongside the payload.

How it works. At the sender, data starts as an application message, then:

  1. Transport layer wraps it into a segment (adds TCP/UDP header — ports, sequence numbers).
  2. Network layer wraps that into a packet (adds IP header — source/destination IP).
  3. Data Link layer wraps that into a frame (adds MAC header and trailer — source/destination MAC, CRC).
  4. Physical layer converts the frame into bits transmitted as electrical, optical, or radio signals.

At the receiver, this process reverses exactly — de-encapsulation — with each layer stripping off its own header and passing the remainder up to the layer above.

Example. Sending "Hello" over HTTP: the string becomes an HTTP request (Application), gets a TCP header with port 443 (Transport), gets an IP header with the server's IP (Network), gets an Ethernet header with the router's MAC address as next hop (Data Link), and finally becomes electrical pulses on a cable (Physical).

Real-world example. Wireshark, a packet capture tool, visually displays this exact nesting — click on a captured packet and you'll see the Ethernet frame containing an IP packet containing a TCP segment containing the actual HTTP data, each header inspectable independently.

Why it matters. Encapsulation is what makes layers genuinely independent. A switch only needs to read the Data Link header; it never touches or understands the Transport-layer payload buried inside. This is why you can swap Wi-Fi for Ethernet without changing anything about how TCP or HTTP work.

Common misunderstanding. Students often think encapsulation adds the headers all at once. It happens progressively, one layer at a time, and each header is meaningful only to its corresponding layer on the receiving end — a switch discards the Ethernet header once it's used it, a router discards nothing but reads the IP header, and so on down the chain of devices the packet passes through.

Key Terms

TermDefinition
OSI ModelSeven-layer conceptual framework for network communication: Physical, Data Link, Network, Transport, Session, Presentation, Application
TCP/IP ModelFour-layer practical framework matching real internet protocols: Network Access, Internet, Transport, Application
EncapsulationThe process of wrapping data with a header (and sometimes trailer) at each layer as it travels down the stack
De-encapsulationThe reverse process — stripping headers off as data travels up the stack at the receiver
SegmentThe Transport-layer data unit (TCP calls it a segment, UDP calls it a datagram)
PacketThe Network-layer data unit, carrying an IP header
FrameThe Data Link-layer data unit, carrying MAC addressing
Protocol Data Unit (PDU)The generic name for the unit of data at any given layer (bit, frame, packet, segment, message)

Common Mistakes

MisconceptionWhy it's wrongCorrect understanding
"TCP/IP replaced OSI because OSI failed."OSI was never intended to be fully implemented as running software; it succeeded as a teaching and diagnostic reference, which is exactly the role it still fills today.Both models coexist: OSI is used for discussion and troubleshooting vocabulary, TCP/IP is what's actually implemented in operating systems and hardware.
"The Session and Presentation layers don't exist in real networks."Their functions (session tracking, encryption, encoding) absolutely happen — TLS encryption and cookie-based sessions are everywhere — they're just not implemented as separate layers, folded instead into Application-layer software.TCP/IP's single Application layer absorbs OSI's layers 5, 6, and 7 into one practical layer.
"Each layer needs to understand what every other layer is doing."Layers are deliberately independent — a switch never looks at TCP ports, and a router never looks at MAC addresses beyond the next hop.Each layer only interacts with the layer immediately above and below it through a fixed interface, which is what allows independent evolution of protocols at each layer.

Comparison and Connections

Conceptvs.Key Difference
OSI ModelTCP/IP ModelOSI has 7 granular layers used for teaching/diagnostics; TCP/IP has 4 practical layers matching real running protocols.
SegmentPacketA segment is the Transport-layer unit (TCP/UDP header); a packet is the Network-layer unit (IP header) wrapping the segment.
EncapsulationDe-encapsulationEncapsulation adds headers moving down the stack at the sender; de-encapsulation strips them moving up the stack at the receiver.
Network Access Layer (TCP/IP)Physical + Data Link (OSI)TCP/IP merges OSI's two lowest layers into one, since in practice they're implemented together (e.g., an Ethernet or Wi-Fi card handles both).
Application Layer (TCP/IP)Session + Presentation + Application (OSI)TCP/IP merges OSI's top three layers because real applications (browsers, mail clients) handle session state and encoding themselves.

Practice Questions

Recall

  1. Name all seven layers of the OSI model in order, from bottom to top. Answer guidance: Physical, Data Link, Network, Transport, Session, Presentation, Application.
  2. Name all four layers of the TCP/IP model in order, from bottom to top. Answer guidance: Network Access, Internet, Transport, Application.

Understanding

  1. Explain why the TCP/IP Application layer is said to "absorb" three OSI layers. Answer guidance: Because real application software (like a browser) directly handles session management (e.g., keeping a login session alive) and presentation tasks (like TLS encryption and character encoding) as part of its own code, rather than relying on separate protocol layers for those jobs.
  2. Why does a router only need to read up to the Network layer of a packet to do its job? Answer guidance: Routing decisions are based entirely on the destination IP address in the Network-layer header; the router doesn't need to inspect Transport or Application data to decide the next hop.

Application

  1. A user reports "the website won't load." Using OSI layer terminology, list three different layers where the fault could actually be, with a one-line example for each. Answer guidance: Layer 1 (unplugged cable/dead Wi-Fi), Layer 3 (misconfigured routing/DNS not resolving), Layer 7 (the web server application itself is crashing or returning errors).
  2. You capture network traffic with Wireshark and see a frame containing a packet containing a segment containing an HTTP GET request. Identify which header belongs to which layer. Answer guidance: Outermost = Ethernet frame header (Data Link/Network Access), next = IP header (Network/Internet), next = TCP header (Transport), innermost = HTTP request (Application).

Analysis

  1. Compare troubleshooting a "Layer 2" problem versus a "Layer 4" problem — what tools or checks would differ? Answer guidance: Layer 2 issues involve checking switch port status, MAC address tables, and cabling; Layer 4 issues involve checking whether a service is listening on the correct port, firewall rules, and TCP connection state (e.g., with netstat).
  2. Why do networking certifications still test the seven-layer OSI model heavily, even though no software stack implements all seven layers separately? Answer guidance: Because the granularity gives engineers a shared, precise vocabulary for isolating faults and understanding protocol responsibilities, even when the underlying implementation collapses several of those layers together.

FAQ

Q: Do I need to memorize both models, or just one? A: Both — exam questions and real job interviews use OSI terminology constantly ("what layer does X operate at"), but real packet captures and networking commands (like ping, traceroute) reflect the TCP/IP model's structure.

Q: Which layer does a firewall operate at? A: It depends on the firewall type. A basic packet-filtering firewall works at Layer 3/4 (IP addresses and ports); an application-layer (next-generation) firewall inspects Layer 7 content like HTTP headers and payloads.

Q: Where does Wi-Fi fit in these models? A: Wi-Fi (IEEE 802.11) spans OSI's Physical and Data Link layers — the radio transmission is Physical, and the framing/MAC addressing is Data Link — which together make up the TCP/IP Network Access layer.

Q: Why is IP at Layer 3 but TCP at Layer 4 — aren't they always used together? A: They're used together but do different jobs: IP (Layer 3) handles addressing and routing between networks, while TCP (Layer 4) handles reliability, ordering, and end-to-end connection state on top of whatever IP delivers.

Q: Is HTTPS at the Application layer or the Presentation layer? A: In OSI terms, the TLS encryption HTTPS relies on is often described as Presentation-layer functionality, while HTTP itself is Application-layer. In the TCP/IP model, both collapse into the single Application layer, since that's where the actual HTTPS implementation runs.

Quick Revision

  • OSI = 7 layers: Physical, Data Link, Network, Transport, Session, Presentation, Application (mnemonic: Please Do Not Throw Sausage Pizza Away).
  • TCP/IP = 4 layers: Network Access, Internet, Transport, Application.
  • TCP/IP's Network Access layer = OSI's Physical + Data Link; TCP/IP's Application layer = OSI's Session + Presentation + Application.
  • Physical layer unit = bit; Data Link = frame; Network = packet; Transport = segment (TCP) / datagram (UDP).
  • Encapsulation adds a header at each layer going down the stack; de-encapsulation strips headers going up at the receiver.
  • Routers operate up to Layer 3 (IP); switches operate at Layer 2 (MAC); hubs operate at Layer 1 (raw signal).
  • OSI is used for teaching and diagnostic vocabulary; TCP/IP is what's actually implemented in real operating systems and hardware.
  • No modern stack implements Session/Presentation as separate software layers — their jobs live inside application code (e.g., a browser handling TLS and cookies).
  • Wireshark captures show encapsulation directly: Ethernet frame → IP packet → TCP segment → HTTP payload, nested.
  • Knowing "what layer" a problem is at instantly narrows the likely cause and the right diagnostic tool.

Prerequisites

  • Introduction to Computer Networks

Related Topics

  • Data Link Layer
  • Transport Layer Protocols
  • Application Layer Protocols

Next Topics

  • Data Link Layer
  • Network Layer and Routing Protocols
  • Transport Layer Protocols