Packet.School
HomeLevelsSandboxPricingAbout
XP1,240
L2 · OSI Model
Level 2
6 lessons
  • 01What is the OSI Model?
  • 027 Layers Detailed
  • 03TCP/IP Model
  • 04Packet Journey
  • 05Encapsulation
  • 06Level 2 Quiz
Levels/L2 · OSI Model/Lesson 05
Lesson · 05

Encapsulation

Encapsulation is the process of wrapping data by adding headers as it passes through each layer. On the way down each layer stamps its own signature onto the packet; at the destination each layer peels its header back off.

Duration
4min
Level
L2
Type
Lesson
Progress
5/ 6

01Data transformation

As data moves from the application layer down to the physical layer, it changes its name and structure:

L7 · Application
DATA
L4 · Transport
TCP
DATA → Segment
L3 · Network
IP
TCP
DATA → Packet
L2 · Data Link
ETH
IP
TCP
DATA
FCS
L1 · Physical
101010101010... → Bits

02What each layer adds

LayerUnitAdded
ApplicationDataApplication payload
TransportSegmentTCP/UDP header (Port)
NetworkPacketIP header (IP address)
Data LinkFrameMAC header + FCS trailer
PhysicalBitsElectrical signals

03Header contents

TCP Header (Transport Layer)

TCP
Transport Control Protocol Header

The transport layer header carries everything needed to guarantee reliable delivery.

Fields
Source Port · 16 bit Dest Port · 16 bit Sequence No Ack No Flags: SYN ACK FIN Checksum
Purpose
  • Which application? → Port
  • Packet lost? → Sequence No
  • Connection open? → Flags

IP Header (Network Layer)

IP
Internet Protocol Header

The network layer header identifies the packet's origin, destination, and how it should be routed.

Fields
Source IP · 32 bit Dest IP · 32 bit TTL Protocol (TCP=6)
Purpose
  • Where to? → Destination IP
  • Where from? → Source IP
  • Prevent routing loops → TTL

04De-encapsulation

The reverse happens at the destination — each layer strips its own header:

L2 · Data Link
ETH
IP
TCP
DATA
FCS
L3 · Network
IP
TCP
DATA — ETH header removed
L4 · Transport
TCP
DATA — IP header removed
L7 · Application
DATA — Delivered to application

05Why encapsulation?

  1. Modularity — Each layer works independently
  2. Flexibility — Changing one layer doesn't affect the others
  3. Error control — Each layer checks its own errors

06Summary

  • Encapsulation = Wrapping at each layer on the way down
  • Each layer adds its own header
  • Data → Segment → Packet → Frame → Bits
  • De-encapsulation unwraps headers at the destination
Previous
Packet Journey
Next
Level 2 Quiz
On this page
  • Data transformation
  • What each layer adds
  • Header contents
  • De-encapsulation
  • Why encapsulation?
  • Summary
Packet.School

An open, interactive curriculum for computer networking.

v3.0 · MIT22 lessons live

Learn

  • Lessons
  • Sandbox
  • Levels
  • Pricing
  • About

Simulations

  • Packet Journey
  • DNS Lookup
  • DHCP Simulator
  • Subnet Calc
  • Network Builder
  • Terminal

Project

  • About
  • Changelog
  • GitHub
  • Contributing
  • Style guide

Newsletter

One short email when a new level ships. No tracking pixels.

© 2026 Packet.School — MIT licensed☕ Support with a coffeebuilt in the open · last updated 2026.05.14