Data Encapsulation Workbench
Data Encapsulation Workbench
Build and inspect protocol data units as application data moves down and back up the network stack
animation
networking
encapsulation
osi-model
protocols
iot
Interactive data encapsulation animation for learning protocol data units, header and trailer overhead, decapsulation, MTU pressure, and IoT header-compression tradeoffs.
Animation
OSI and TCP/IP
Header Overhead
IoT Links
Data Encapsulation Workbench
Watch an application message become a transport segment, network packet, link frame, and physical bit stream. Then reverse the path to see what the receiver strips during decapsulation.
100 B
Application payload
158 B
Final frame bytes
63%
Useful payload ratio
Frame
Current PDU view
Try
Set Application payload to 100 B, choose UDP + IPv6 + 802.15.4, and Step through Encapsulate.
Observe
Current PDU view grows at each of 5 stages, Final frame bytes adds every header/trailer, and Useful payload ratio falls.
Explain
UDP contributes 8 B, IPv6 contributes 40 B, and the selected link framing adds its own bytes; 6LoWPAN compression reduces network overhead only when context permits.
Technical boundaries. Selected fixed headers and trailers determine byte totals; optional fields, compression-context loss, MTU fragmentation, retransmission distributions, encryption padding, link aggregation, hardware offload, and memory alignment are excluded.
Learning Brief
Encapsulation means each lower layer treats the entire upper-layer unit as its payload and adds control information needed for its own job.
What changes?
Ports, addresses, MAC fields, checksums, and frame trailers are added around the original message.
Why IoT cares
Small radio frames make every byte expensive; compression and lightweight protocols preserve payload room.
Scenario
Controls
Application Data
Stage 1 of 5The sender starts with the application message before protocol headers are added.
Layer Path
Current Byte Layout
Diagnosis
Packet Trace
Quick Reference
PDU Names
Application message, transport segment/datagram, IP packet, link frame, physical bits.
Common Header Sizes
UDP 8 B, TCP base 20 B, IPv4 minimum 20 B, IPv6 base 40 B, Ethernet header 14 B plus 4 B FCS.
Payload Efficiency
Useful payload ratio = application bytes divided by the final transmitted frame bytes.
MTU Pressure
Large headers can force fragmentation or adaptation-layer work before the packet can cross a small radio link.
Decapsulation
The receiver validates and removes each lower-layer wrapper before passing the remaining payload upward.
IoT Design Hint
CoAP/UDP, header compression, and careful payload sizing are common ways to keep constrained traffic efficient.
How to Read the Workbench
Layer Path
Green layers have already handled the PDU. The orange layer is the layer currently adding or removing its fields.
Byte Layout
Each colored block is a protocol field group. The application data block should stay visible as headers accumulate around it.
Diagnosis
Use the efficiency and MTU messages to decide whether the selected stack is sensible for a constrained IoT link.
Technical Accuracy Notes
IPv4 and TCP
The workbench uses minimum IPv4 and TCP base headers. Options can increase both values.
IPv6 and Extension Headers
The IPv6 base header is 40 B; extension headers are separate and are not included unless a scenario explicitly adds them.
6LoWPAN Example
The compressed case is an educational example. Real compressed sizes depend on addressing mode, context, hop limit, ports, and mesh/security fields.
Link-Layer Variability
IEEE 802.15.4 frame overhead changes with addressing and security fields. This page uses a small representative frame to show MTU pressure.
Ethernet Wire Detail
The frame byte total includes Ethernet header and FCS. Preamble and inter-frame gap are physical-layer timing overhead and are kept out of the frame byte count.
Layer Models
The display maps practical TCP/IP behavior onto OSI-style names so learners can connect both vocabularies.
Source Links
UDP Header
RFC 768 - User Datagram Protocol
IPv4 Header
RFC 791 - Internet Protocol
IPv6 Header
RFC 8200 - IPv6 Specification
TCP Header
RFC 9293 - Transmission Control Protocol
6LoWPAN Compression
RFC 6282 - IPv6 Header Compression
IEEE 802.15.4 Overview
IEEE 802.15.4-2020 standard page