This review consolidates your understanding of the OSI (7-layer) and TCP/IP (4-layer) network models, covering encapsulation, addressing at different layers (MAC, IP, port), ARP resolution, and how these traditional models map to IoT-specific reference architectures. It is organized into two focused companion chapters: model comparison and supplementary resources.
33.1 Overview
Network layering models are the foundation for all networking knowledge. They define how data moves from an application on one device to an application on another, passing through well-defined layers of abstraction. This review brings together the key concepts you have studied – OSI layers, TCP/IP mapping, encapsulation, addressing, and IoT-specific reference models – so you can see the complete picture before moving on to protocol-specific chapters.
Chapter Navigation
This review has two companion chapters for deeper study:
Compare OSI and TCP/IP: Differentiate the 7-layer OSI model from the 4-layer TCP/IP model, mapping each OSI layer to its TCP/IP equivalent
Apply Encapsulation: Trace data flow through network layers, demonstrating how each layer adds its own header during transmission and strips it upon receipt
Explain Addressing: Distinguish MAC (Layer 2), IP (Layer 3), and port (Layer 4) addressing and explain the role each plays in delivering data across networks
Analyze ARP: Explain how ARP resolves IP addresses to MAC addresses and predict the behavior of ARP in broadcast and unicast scenarios
Evaluate IoT Models: Compare traditional OSI/TCP/IP models with IoT-specific reference architectures (Cisco 7-level, ITU-T, IEEE 2413) and select the appropriate model for a given analysis task
Calculate Protocol Overhead: Apply the packet size formula to calculate payload efficiency for different IoT protocol stacks and compare results to justify protocol selection
Note that the TCP/IP model merges OSI layers 5-7 into a single Application layer and OSI layers 1-2 into a single Link layer, resulting in four layers instead of seven.
Putting Numbers to It
Layering decisions directly change packet size, airtime, and battery drain.
Worked example: Compare a 12-byte telemetry message on two stacks.
For CoAP over UDP over 6LoWPAN (with IPHC/NHC header compression on an 802.15.4 link):
Component
Header Size
802.15.4 MAC (short addresses)
11 bytes
6LoWPAN IPHC (compressed IPv6)
7 bytes
NHC-compressed UDP
4 bytes
CoAP (minimal, NON message)
4 bytes
Total overhead
26 bytes
Total packet
38 bytes
For MQTT over TCP over full IPv6 on 802.15.4:
Component
Header Size
802.15.4 MAC
11 bytes
Full IPv6
40 bytes
TCP (no options)
20 bytes
MQTT PUBLISH (minimal)
4 bytes
Total overhead
75 bytes
Total packet
87 bytes
Payload efficiency is \(12/38 \approx 31.6\%\) for CoAP/UDP/6LoWPAN versus \(12/87 \approx 13.8\%\) for MQTT/TCP/IPv6. For the same 12 bytes of sensor data, the uncompressed stack transmits about \(87/38 \approx 2.3\times\) more bytes – directly impacting battery life for constrained IoT devices.
What is this chapter? This is a consolidation chapter that ties together everything you have learned about network layering models. Think of it as a map showing how all the pieces connect.
When to use this chapter:
After studying OSI and TCP/IP models
Before diving into specific protocols (MQTT, CoAP, etc.)
When you need to understand where protocols fit in the stack
Key Models to Know:
Model
Layers
Use
OSI
7 layers
Reference model for understanding
TCP/IP
4 layers
Practical internet protocol suite
IoT Stack
Varies
Application-specific combinations
Why This Matters for IoT: Understanding layers helps you choose the right protocol for each part of your IoT system – from physical connections to application messaging. For example, a battery-powered sensor needs lightweight protocols (CoAP over UDP) while a cloud dashboard can afford heavier ones (MQTT over TCP).
AI-generated visual diagrams for different learning styles
Next steps and advanced topics
Decision Framework: Choosing Between OSI and TCP/IP Models for IoT Protocol Analysis
When to use the OSI 7-layer model:
Scenario
Why OSI
Example
Troubleshooting complex issues
Granular layer separation identifies exact failure point
“Application works but data corrupts” – check Presentation layer encoding
Teaching network concepts
Clear separation of concerns aids learning
Session layer (L5) manages connection state independently
Protocol design
Explicit definition of each layer’s responsibilities
Designing a new IoT protocol stack
When to use the TCP/IP 4-layer model:
Scenario
Why TCP/IP
Example
Implementing real systems
Matches actual protocol implementations
Building MQTT clients – Application layer directly uses TCP
Debugging network stacks
Aligns with Linux networking layers
Analyzing tcpdump output shows 4-layer structure
Performance analysis
Fewer layers = clearer overhead attribution
Measuring protocol efficiency
Decision Rule: Use OSI for conceptual understanding and detailed troubleshooting. Use TCP/IP for implementation, debugging, and real-world protocol analysis.
Real Example: A LoRaWAN gateway fails intermittently. OSI analysis reveals:
L1 Physical: Radio signal OK
L2 Data Link: Frame Check Sequence errors – Problem identified at L2
Fix: Adjust spreading factor to improve error correction
TCP/IP would group L1 and L2 into “Link Layer”, making the root cause harder to isolate.
Common Mistake: Assuming More Layers Means Better Security
The Mistake: “OSI has 7 layers, so it must be more secure than TCP/IP’s 4 layers.”
Why It’s Wrong: Security is implemented by protocol features (encryption, authentication), not by the number of abstraction layers. Both OSI and TCP/IP are reference models for organizing protocols – they do not inherently provide security.
The Reality:
TLS (Transport Layer Security) provides encryption in both models
IPsec (Network Layer Security) works identically in OSI and TCP/IP
Application-layer encryption (e.g., MQTT payload encryption) is independent of the model
The Fix: Evaluate security based on implemented protocols (TLS 1.3, AES-256, certificate-based authentication), not on the number of layers in the reference model.
33.6 Review Activities
33.6.1 Match Protocols to Layers
33.6.2 Order the Encapsulation Steps
Common Pitfalls
1. Reviewing Without Attempting to Draw the Models From Memory
Reading about OSI layers is passive. Fix: close the notes and draw both OSI and TCP/IP models from memory, labelling each layer with one protocol and one function.
2. Not Connecting the Review to Practical IoT Scenarios
Reviewing abstract layer definitions without connecting them to concrete IoT examples (e.g., “6LoWPAN adapts IPv6 at the Network layer for IEEE 802.15.4 links”) leaves knowledge fragile. Fix: for each review topic, write one sentence connecting it to a real IoT protocol or product.
3. Spending All Review Time on Well-Known Layers
Students often spend most review time on layers they already understand (Application, Transport) and neglect the Data Link and Physical layers. Fix: allocate review time proportionally to how well you understand each layer, spending more on weaker areas.
🏷️ Label the Diagram
Code Challenge
33.7 Summary
This review consolidated layered network models and their practical application to IoT systems:
OSI (7-layer) and TCP/IP (4-layer) models provide theoretical and practical frameworks for organizing network protocols
Encapsulation proceeds top-down during transmission, with each layer adding its own header around the payload from the layer above
Addressing operates at multiple layers: MAC at Layer 2 for local hop-by-hop delivery, IP at Layer 3 for end-to-end routing, and port numbers at Layer 4 for process demultiplexing
ARP resolves IP to MAC using broadcast requests and unicast replies on the local network segment
IoT reference models extend beyond traditional networking with edge computing, analytics, and business layers
Protocol stack overhead varies significantly – compressed stacks like CoAP/UDP/6LoWPAN achieve roughly 2x better payload efficiency than uncompressed alternatives