Layered network models divide networking into independent layers – the OSI model uses 7 layers for theoretical clarity while TCP/IP uses 4 for practical implementation. Each layer (Physical, Data Link, Network, Transport, Session, Presentation, Application) handles one specific function, enabling interoperability between billions of diverse devices. For IoT, these models explain how a sensor reading gets packaged with addresses and error-checking at each layer before transmission.
27.1 Overview
Layered network models are the foundation of all network communication, dividing complex networking tasks into manageable, independent layers. This section covers the theoretical OSI model, the practical TCP/IP model, addressing schemes, and hands-on implementation.
Figure 27.1: OSI 7-layer reference model
27.2 Learning Objectives
By the end of this section, you will be able to:
Explain Network Standards: Analyze why standards and protocols enable global connectivity across billions of devices
Compare OSI and TCP/IP Models: Differentiate between the seven-layer OSI and four-layer TCP/IP models and map layers between them
Explain Encapsulation: Describe how data moves through protocol layers and calculate per-layer overhead
Apply IoT Reference Models: Evaluate IoT-specific architectural frameworks and select the appropriate model for a given deployment
Configure MAC and IP Addressing: Construct and interpret hardware and network layer addresses for IoT devices
Implement IPv4/IPv6: Configure and troubleshoot both IP versions in IoT network scenarios
Resolve Addresses: Demonstrate how ARP maps MAC addresses to IP addresses and predict ARP behavior in network segments
For Beginners: Layered Network Models
Network communication is organized in layers, much like a postal system. One layer handles the physical delivery truck, another handles sorting by zip code, and another handles writing the letter itself. Each layer does its own job and passes information to the next, making complex communication manageable and predictable.
Sensor Squad: Why We Need Layers!
“I have a question,” said Sammy the Sensor. “Why can’t I just shout my data straight to the cloud? Why do we need all these layers?”
Max the Microcontroller laughed. “Imagine if everyone in a city tried to deliver their own mail by hand – total chaos! Layers divide the work so each part only worries about its own job. The OSI model has 7 layers for teaching, and TCP/IP has 4 layers for the real internet.”
“Think of it this way,” added Lila the LED. “I do not need to know HOW the Wi-Fi radio works to display information. And Sammy does not need to understand IP addresses to measure temperature. Each of us handles our own layer, and the system just works!”
Bella the Battery chimed in, “Plus, layers save energy! When engineers designed Zigbee, they only had to optimize the bottom layers for low power. The application layer stayed the same. Without layers, they would have had to redesign EVERYTHING. Layers make the whole IoT world possible – billions of different devices all communicating because they agree on the same layered rules.”
Core concepts of layered networking – Why standards matter, OSI 7-layer model, TCP/IP 4-layer model, protocol data units (PDUs), encapsulation/decapsulation processes, and IoT reference models.
Hands-on addressing and configuration – MAC addressing, IPv4/IPv6 addressing, subnet masks, ARP protocol, and practical labs for configuring network addresses.
Comprehensive review and assessment – Knowledge checks, quiz questions, worked examples, and visual reference galleries to reinforce understanding.
Topics covered:
Key concepts summary
Scenario-based knowledge checks
Protocol stack selection worked example
Visual reference gallery
Further learning resources
27.4 Quick Reference
Minimum Viable Understanding
The OSI model (7 layers) is a theoretical framework used for teaching and troubleshooting. The TCP/IP model (4 layers) is the practical implementation that powers the internet. Both use encapsulation – wrapping data in headers as it moves down the stack – and decapsulation – unwrapping headers as it moves up.
Key mapping: TCP/IP Application = OSI Layers 5-7, TCP/IP Transport = OSI Layer 4, TCP/IP Internet = OSI Layer 3, TCP/IP Network Access = OSI Layers 1-2.
Layer Type
Addressing
Scope
Data Link (L2)
MAC addresses (48-bit)
Local network segment
Network (L3)
IP addresses (IPv4: 32-bit, IPv6: 128-bit)
End-to-end routing
Quick Check: Layer Addressing
27.5 Prerequisites
Before diving into this section, you should be familiar with:
Networking Basics: Understanding fundamental networking concepts, topologies, and protocols
Key Insight: Each layer adds value (reliability, routing, framing) but also overhead. For constrained IoT devices, protocols like CoAP over UDP reduce overhead by eliminating TCP and using binary encoding instead of JSON.
Match: OSI Layers to Their Functions
Order: Data Encapsulation Steps for an IoT Sensor Message
Try It: IoT Protocol Overhead Calculator
Explore how different protocol stacks affect payload efficiency, daily data usage, and cellular costs for IoT deployments.
A network switch operates at Layer 2 and never inspects IP addresses. A router operates at Layer 3 and does not maintain TCP state. Fix: for each network device type, identify the highest layer it operates at.
2. Confusing the Data Link Layer’s Two Sublayers
The Data Link layer has two sublayers: LLC (Logical Link Control, handles flow control and multiplexing) and MAC (Medium Access Control, handles channel access). Wi-Fi and Ethernet differ at the MAC sublayer but share the LLC sublayer. Fix: distinguish LLC from MAC when comparing wireless and wired Data Link protocols.
3. Thinking IP Is Only at the Network Layer
In IoT, 6LoWPAN adapts IPv6 at a sublayer between the MAC and Network layers, and some IoT stacks omit the Network layer entirely for short-range communication. Fix: always verify which layers are present in a specific IoT protocol stack rather than assuming standard TCP/IP applies.
27.7 What’s Next
After completing these chapters, continue with the following related topics: