Communication Networks · Visualized

OSI Model & Encapsulation

Reference Models

The OSI and TCP/IP layer stacks — how every piece of data is wrapped, addressed and unwrapped.

2 interactive subtopics — each one animated, step-through and explained.

OSI Model & Encapsulation

Reference Models

The OSI model splits networking into seven cooperating layers, each serving the one above and using the one below. When you send data, every layer adds its own header (encapsulation); on the receiver the headers are stripped in reverse order (de-encapsulation). Layering lets engineers change one piece — say Wi-Fi instead of Ethernet — without touching the rest.

How OSI Model Works

  1. L7 Application produces the data (HTTP request, email…).
  2. L6 Presentation formats it (encoding, TLS encryption, compression).
  3. L5 Session manages the dialogue between the two programs.
  4. L4 Transport adds port numbers → Segment; L3 adds IP addresses → Packet.
  5. L2 Data Link adds MAC addresses + error trailer → Frame; L1 Physical sends raw bits over the medium.
  6. The receiver peels the headers bottom-up until only the original data reaches the peer application.

OSI Model Worked Example

Try it: Play — watch “Hello” descend the sender stack gaining headers, cross the wire as bits, and climb the receiver stack losing them.

Data → [TH]Data segment → [IPH][TH]Data packet → [FH][IPH][TH]Data FCS frame → bits. Each header is written by exactly one layer and read by the same layer on the far side.

L7 ApplicationL6 PresentationL5 SessionL4 TransportL3 NetworkL2 Data LinkL1 PhysicalL7 ApplicationL6 PresentationL5 SessionL4 TransportL3 NetworkL2 Data LinkL1 PhysicalSENDERRECEIVERmedium
Transport hdr IP hdr Frame hdr payload
Stage 1 / 16
“Hello” is ready to leave the browser. Watch it gain one header per layer going down.

OSI Model: Key Facts to Remember

PDUs by layerApplication: data · Transport: segment · Network: packet · Link: frame · Physical: bits
Remembering order“Please Do Not Throw Sausage Pizza Away” = Physical→Application
Trouble-shooting“Can you ping it?” is literally testing L1–L3 before blaming L7 apps

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Cloud hosting for side projectsShip the portfolio project that gets you hired — free credits for new accounts.Claim credits Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses

See how packets really travel

Networks are built on the structures and algorithms you can watch step by step — queues, trees, and routing algorithms.