11  Networking Reference

In 60 Seconds

This reference chapter provides quick-lookup tables for essential networking terminology, IoT protocol-to-layer mappings, visual galleries of networking concepts (topologies, addressing, protocol stacks), and advanced MCQ assessments to validate mastery of IoT networking fundamentals.

11.1 Learning Objectives

By the end of this chapter, you will be able to:

  • Define and Apply Core Terminology: Classify essential networking terms (IP address, MAC address, subnet, MTU, RSSI) and apply them to IoT deployment scenarios
  • Compare Protocol Stacks: Differentiate how MQTT, CoAP, and LoRaWAN map to OSI and TCP/IP layers, and explain the trade-offs of each
  • Select the Right Topology: Evaluate star, mesh, bus, and tree topologies and select the appropriate one for a given IoT use case
  • Calculate IPv6 Address Space: Calculate the number of subnets and host addresses available for an IoT deployment given a CIDR prefix
  • Analyze Gateway Behavior: Explain how an IoT gateway operates at Layer 3 to route packets between sensor networks and the cloud
  • Troubleshoot Connectivity Issues: Apply a layer-by-layer diagnostic approach to identify the root cause of IoT network failures
  • Demonstrate Assessment Mastery: Answer scenario-based MCQ questions that validate understanding of OSI layers, NAT, TCP/UDP, and addressing

This reference collects key networking concepts, terms, and diagrams in one place. Think of it as a quick-lookup dictionary for networking – when you encounter an unfamiliar term or need to recall how something works, you can find it here without reading an entire chapter.

“I keep forgetting which port MQTT uses!” said Sammy the Sensor. Max the Microcontroller handed him a reference card. “That is why this chapter exists – it is your networking cheat sheet. MQTT is port 1883, CoAP is 5683, and HTTP is 80. Keep this bookmarked!”

“I use the visual galleries when I need to remember how topologies work,” said Lila the LED. “Star topology has everything connected to one central hub. Mesh topology has devices connected to each other. The pictures make it click way faster than re-reading paragraphs.”

“And the terminology table is gold,” added Bella the Battery. “Latency, throughput, jitter, packet loss – all the key terms with simple definitions in one place. When your teacher or boss uses a networking word you do not recognize, look it up here before asking.”

“Think of this as your IoT networking dictionary,” Max summarized. “You do not read a dictionary cover to cover – you look up what you need, when you need it. Bookmark this page and come back whenever you need a quick refresher!”

11.2 Prerequisites

Before using this reference, ensure you have completed:

  • Networking Basics: Knowledge Check: Self-assessment questions with detailed answers
  • Networking Basics: Labs: Hands-on practice with ESP32 and Python

11.4 Key Concepts Reference

These are the essential networking concepts you should be able to explain and apply:

  • OSI Model: 7-layer theoretical framework for network communication (Physical, Data Link, Network, Transport, Session, Presentation, Application)
  • TCP/IP Model: 4-layer practical model actually used on the internet (Link, Internet, Transport, Application)
  • IPv4 Addressing: 32-bit addresses (e.g., 192.168.1.100) with public, private, and reserved ranges; facing exhaustion
  • IPv6 Addressing: 128-bit addresses (e.g., 2001:0db8:85a3::8a2e:0370:7334) with virtually unlimited space for IoT devices
  • MAC Addresses: 48-bit hardware identifiers (Layer 2) for local network communication; format: AA:BB:CC:DD:EE:FF
  • TCP vs UDP: TCP provides guaranteed delivery with higher overhead; UDP offers speed with best-effort delivery
  • Network Topologies: Point-to-point, star, mesh, and tree/hierarchical arrangements each with different trade-offs
  • MQTT and CoAP: Application-layer protocols; MQTT uses TCP (port 1883) for reliable messaging, CoAP uses UDP (port 5683) for constrained devices
  • Network Troubleshooting: Systematic layer-by-layer approach from Physical (signal strength, obstacles) to Application (DNS, ports)
  • IoT Security: Default credential changes, TLS encryption, network segmentation, firmware updates, and minimal port exposure
  • RSSI: Received Signal Strength Indicator in dBm; values above -70 dBm are considered good for reliable connections
  • Bandwidth and Latency: IoT data is typically small; sensor readings measured in bytes not megabytes; optimize for constrained networks
Try It: IPv6 Subnet Space Calculator

Explore how many subnets and addresses are available for different IPv6 prefix allocations.

Quick Check: Key Concepts


11.5 Comprehensive Quiz

Test your mastery with these advanced scenario-based questions.


11.6 Quick Glossary

This glossary provides quick definitions for essential networking concepts used throughout this chapter.

Term Definition Example/Context
IP Address Unique numerical identifier for a device on a network IPv4: 192.168.1.100, IPv6: 2001:db8::1
MAC Address Hardware address burned into network interface card (NIC) 00:1A:2B:3C:4D:5E (48 bits, Layer 2)
Port Number 16-bit number identifying application/service on a device HTTP: 80, HTTPS: 443, MQTT: 1883
Router Layer 3 device that forwards packets between different networks Home router connects LAN to internet
Switch Layer 2 device that forwards frames within same network Connects multiple devices in LAN
Gateway Device connecting different network types/protocols IoT gateway: Zigbee sensors -> Wi-Fi -> cloud
NAT Network Address Translation, maps private IPs to single public IP 192.168.1.x -> 203.0.113.42:port
Subnet Logical subdivision of IP network for organization/security Home: 192.168.1.0/24 (256 addresses)
Subnet Mask Defines which portion of IP is network vs host 255.255.255.0 = /24 (first 3 octets = network)
DNS Domain Name System, converts names to IP addresses iot.example.com -> 203.0.113.42
DHCP Dynamic Host Configuration Protocol, assigns IPs automatically Router assigns 192.168.1.100 to new device
Packet Unit of data at Layer 3 (Network), contains IP headers IP packet = header + payload
Frame Unit of data at Layer 2 (Data Link), contains MAC addresses Ethernet frame = preamble + header + payload + FCS
Datagram UDP packet (connectionless) Sensor sends UDP datagram with reading
Segment TCP packet (connection-oriented) TCP segment = header + data + checksum
MTU Maximum Transmission Unit, largest packet size without fragmentation Ethernet: 1500 bytes, LoRaWAN: 51-222 bytes
Bandwidth Maximum data transfer rate of a connection Wi-Fi 802.11ac: up to 1.3 Gbps
Latency Time delay for packet to travel from source to destination Wi-Fi: 2-5ms, LoRaWAN: 1-10 seconds
Throughput Actual data rate achieved (always < bandwidth) 100 Mbps link might achieve 85 Mbps throughput
Protocol Set of rules governing communication between devices TCP, UDP, IP, MQTT, CoAP
TCP Transmission Control Protocol, reliable connection-oriented transport HTTP, MQTT, FTP use TCP (Layer 4)
UDP User Datagram Protocol, unreliable connectionless transport DNS, CoAP, streaming video use UDP
IPv4 Internet Protocol version 4, 32-bit addresses (4.3 billion) 192.168.1.1, exhausted for IoT scale
IPv6 Internet Protocol version 6, 128-bit addresses (340 undecillion) 2001:0db8:85a3::8a2e:0370:7334
6LoWPAN IPv6 over Low-power Wireless PANs, compresses IPv6 for 802.15.4 40-byte IPv6 header -> 2-8 bytes
OSI Model 7-layer reference model for network protocols Physical, Data Link, Network, Transport, Session, Presentation, Application
TCP/IP Model 4-layer practical internet model Link, Internet, Transport, Application
Topology Description Pros Cons IoT Use Case
Star All devices connect to central hub/switch Easy to add devices, failure isolated Hub is single point of failure Wi-Fi access point, home network
Mesh Devices interconnect with multiple paths Redundant, self-healing Complex routing, more power Zigbee, Thread, WSN
Bus All devices on single cable Simple, cheap Collisions, single point of failure CAN bus (automotive)
Tree Hierarchical star networks Scalable, organized Central points of failure Industrial networks, buildings
Ring Devices in closed loop Predictable latency Break disrupts all Rarely used in IoT
Layer Name Function Protocols IoT Examples
7 Application User applications, APIs HTTP, MQTT, CoAP Sensor data APIs
6 Presentation Data format, encryption TLS, SSL, JSON Data serialization
5 Session Connection management NetBIOS, RPC Session establishment
4 Transport End-to-end delivery TCP, UDP Reliable vs fast delivery
3 Network Routing between networks IP, ICMP, RPL Internet routing
2 Data Link Local delivery, MAC Wi-Fi, Ethernet, BLE Wireless protocols
1 Physical Physical transmission Radio waves, cables 2.4 GHz, sub-GHz
Feature TCP UDP When to Use
Connection Connection-oriented (3-way handshake) Connectionless TCP: Critical data; UDP: Real-time
Reliability Guaranteed delivery, retransmissions Best-effort, no guarantees TCP: Commands; UDP: Streaming
Ordering In-order delivery No ordering guarantee TCP: File transfer; UDP: Gaming
Overhead 20+ bytes header, state management 8 bytes header, no state TCP: MQTT; UDP: CoAP, DNS
Speed Slower (reliability mechanisms) Faster (no handshake) TCP: Cloud sync; UDP: Voice
Use Cases HTTP, MQTT, FTP, email DNS, CoAP, streaming, VoIP TCP: Accuracy; UDP: Latency
Comparison of three IoT protocol stacks. MQTT over Wi-Fi uses 5 layers: MQTT application, TCP transport, IPv4/IPv6 network, Wi-Fi 802.11 data link, and 2.4 GHz physical. CoAP over 6LoWPAN uses 5 layers: CoAP application, UDP transport, IPv6 with 6LoWPAN compression network, 802.15.4 data link, and 868/915 MHz physical. LoRaWAN uses simplified 3-layer stack: Application payload, combined LoRaWAN MAC for transport and network, and LoRa modulation for data link and physical layers.
Figure 11.1: Three common IoT protocol stacks compared: MQTT over Wi-Fi (full TCP/IP), CoAP over 6LoWPAN (constrained IPv6), and LoRaWAN (simplified LPWAN)
Class Range Default Mask Typical Use
A 1.0.0.0 - 126.0.0.0 /8 (255.0.0.0) Large enterprises
B 128.0.0.0 - 191.255.0.0 /16 (255.255.0.0) Medium networks
C 192.0.0.0 - 223.255.255.0 /24 (255.255.255.0) Small networks, home
Private 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 Various Internal networks, NAT
Loopback 127.0.0.1 /8 Testing on same device
Link-Local 169.254.0.0/16 /16 Auto-config (no DHCP)
Port Protocol Service IoT Relevance
80 TCP HTTP Web APIs, REST endpoints
443 TCP HTTPS Secure web, cloud APIs
1883 TCP MQTT IoT messaging (unencrypted)
8883 TCP MQTTS MQTT over TLS/SSL
5683 UDP CoAP Constrained devices
5684 UDP CoAPS CoAP over DTLS
8080 TCP HTTP Alt Alternate web port
123 UDP NTP Time synchronization
53 UDP/TCP DNS Domain name resolution
22 TCP SSH Secure shell access
502 TCP Modbus Industrial IoT
5353 UDP mDNS Local device discovery
RSSI (dBm) Quality Description IoT Impact
-30 to -50 Excellent Very close to AP/gateway Max throughput, reliable
-50 to -60 Good Normal operating range Good performance
-60 to -70 Fair Distant, obstacles Reduced speed, occasional drops
-70 to -80 Poor Edge of range Frequent reconnections
< -80 Very Poor Out of range Connection unstable/impossible
Try It: RSSI Signal Quality Checker

11.7 Practice Activities


11.8 Chapter Summary

Networking is the foundation of IoT – without connectivity, you have isolated devices instead of the “Internet of Things.” This reference chapter consolidates essential networking concepts for IoT developers.

Core Concepts Covered:

We explored the OSI and TCP/IP models, understanding how they structure network communication from physical transmission through application-level protocols. While OSI provides a 7-layer theoretical framework, TCP/IP’s 4-layer practical model reflects what actually runs on the internet.

IP addressing is central to IoT. IPv4’s 4.3 billion addresses are exhausted, making IPv6 critical for IoT’s future with its 340 undecillion possible addresses. Private IPv4 ranges enable local networks, while NAT translates between private and public addresses.

Transport protocols determine reliability vs. speed trade-offs: TCP guarantees delivery with higher overhead, while UDP prioritizes speed with best-effort delivery. For IoT, UDP is often preferred for sensor readings where occasional loss is acceptable.

Network topologies significantly impact system design. Star topology is simple but creates single points of failure. Mesh topology is self-healing and extends range but adds routing complexity.

Key Takeaways:

  • OSI provides theoretical framework; TCP/IP is practical implementation
  • IPv6 solves address exhaustion; essential for massive IoT
  • Topology choice impacts reliability, range, and complexity
  • Protocol selection depends on power, bandwidth, reliability needs
  • Security must be designed in, not added later

Scenario: A smart city project needs to assign IPv6 addresses to 10,000 street sensors using stateless address autoconfiguration (SLAAC). The city has been allocated the prefix 2001:0db8:85a3::/48.

Requirements:

  • Each neighborhood gets a /64 subnet
  • Devices generate interface IDs from their MAC addresses
  • Calculate addresses for 3 sample sensors

Step 1: Understand the Address Structure

IPv6 address format:

2001:0db8:85a3:0000:0000:0000:0000:0000/48
└─────Global prefix (48 bits)─────┘└──Subnet (16 bits)──┘└─Interface ID (64 bits)─┘

With a /48 allocation, we have 16 bits for subnetting = 2^16 = 65,536 possible /64 subnets.

Step 2: Assign Subnet IDs

Neighborhoods receive sequential /64 subnets: - Downtown: 2001:0db8:85a3:0001::/64 - Waterfront: 2001:0db8:85a3:0002::/64 - University District: 2001:0db8:85a3:0003::/64

Each /64 subnet provides 2^64 = 18.4 quintillion addresses — far more than needed for any neighborhood.

Step 3: Generate Interface IDs from MAC Addresses

Sensor MAC addresses using EUI-64 format:

Sensor 1 (Downtown):

MAC: DC:A6:32:AB:CD:EF
1. Split MAC in half: DC:A6:32 | AB:CD:EF
2. Insert FFFE: DC:A6:32:FF:FE:AB:CD:EF
3. Flip 7th bit (U/L bit): DC → DE
   Binary: 11011100 → 11011110
4. Interface ID: DEA6:32FF:FEAB:CDEF
5. Full address: 2001:0db8:85a3:0001:DEA6:32FF:FEAB:CDEF/64

Sensor 2 (Waterfront):

MAC: 00:1B:44:11:22:33
1. Split: 00:1B:44 | 11:22:33
2. Insert FFFE: 00:1B:44:FF:FE:11:22:33
3. Flip 7th bit: 00 → 02 (00000000 → 00000010)
4. Interface ID: 021B:44FF:FE11:2233
5. Full address: 2001:0db8:85a3:0002:021B:44FF:FE11:2233/64

Sensor 3 (University):

MAC: B8:27:EB:12:34:56
1. Split: B8:27:EB | 12:34:56
2. Insert FFFE: B8:27:EB:FF:FE:12:34:56
3. Flip 7th bit: B8 → BA (10111000 → 10111010)
4. Interface ID: BA27:EBFF:FE12:3456
5. Full address: 2001:0db8:85a3:0003:BA27:EBFF:FE12:3456/64

Step 4: Verify Address Uniqueness

Each sensor’s MAC address is globally unique (assigned by manufacturer), guaranteeing unique IPv6 addresses within the deployment. SLAAC performs Duplicate Address Detection (DAD) to confirm uniqueness on the local link.

Step 5: Calculate Deployment Capacity

With 2^64 addresses per /64 subnet and 65,536 subnets available in the /48 allocation, the total address space is 2^80 ≈ 1.2 × 10^24 addresses. All 10,000 sensors consume only 3 of 65,536 available subnets – see the math callout below for full calculations.

Key Insights:

  1. IPv6 eliminates address scarcity: Even small allocations (/48) support massive IoT deployments
  2. Hierarchical addressing: /48 city → /64 neighborhood → EUI-64 device
  3. No NAT needed: Every sensor has globally routable address
  4. Plug-and-play: SLAAC enables automatic configuration without DHCP
  5. Privacy concern: MAC-derived addresses are trackable; consider privacy extensions (RFC 4941) for mobile devices

Comparison to IPv4:

  • IPv4 /24 network: 254 usable addresses (one per neighborhood is insufficient)
  • IPv6 /64 network: 18.4 quintillion addresses (effectively unlimited)
  • IPv4 requires NAT and DHCP server; IPv6 uses SLAAC for zero-touch provisioning

For a smart city with a /48 IPv6 allocation supporting 10,000 sensors:

Address Space Calculation: $ = 2^{80}, = 1.2 ^{24} $ $ = 2^{16} = 65{,}536, $ $ = 2^{64} = 1.8 ^{19} $

Utilization for 10,000 sensors across 3 neighborhoods: $ 333 $ $ = = 1.8 ^{-16} (0.000000000000018%) $ $ = = 0.0046% $

Growth capacity: $ = 65{,}536 - 3 = 65{,}533 $ $ = 65{,}533 ^{64} ^{24} $

Even at 99.99% waste per subnet, the city could deploy 1 billion sensors across 65,000 neighborhoods before exhausting its /48 allocation. IPv6’s address space is so vast that efficiency concerns vanish — every device gets a globally unique address without NAT, DHCP servers, or address conflicts.


11.9 Additional Resources

Books:

  • “Computer Networking: A Top-Down Approach” by Kurose and Ross
  • “TCP/IP Illustrated” by W. Richard Stevens

Videos:

Tools:

  • Wireshark: Network traffic analysis
  • nmap: Network scanning
  • PingPlotter: Visual traceroute
  • MQTT Explorer: MQTT broker monitoring

Standards:


Common Pitfalls

A list of RFC links and textbook citations provides no value until the content is actually read and understood. Fix: for each reference listed in this chapter, read at least the abstract or executive summary and write one sentence about what it contributes.

Wikipedia summaries may contain errors or oversimplifications for precise technical claims. Fix: use Wikipedia to get an overview and identify primary sources (RFCs, IEEE standards, peer-reviewed papers), then read the primary source for technical details.

Networking standards evolve rapidly. A 2010 textbook may not cover WPA3, Wi-Fi 6, or NB-IoT. Fix: check publication dates and supplement older references with the latest versions of relevant RFCs and standards documents.

11.10 What’s Next

You have completed the Networking Basics Reference. The table below maps the concepts covered here to the chapters that explore each area in greater depth.

Topic Chapter Description
MQTT, CoAP, and application protocols IoT Protocols Overview Deep dive into publish-subscribe and request-response models for IoT messaging
TCP, UDP, and transport-layer trade-offs Transport Protocols When to use TCP vs UDP vs QUIC; QoS and reliability mechanisms
Wi-Fi standards for IoT (IEEE 802.11) Wi-Fi Fundamentals and Standards 802.11b/g/n/ac/ax, channel planning, and IoT Wi-Fi power considerations
Mesh networking and RPL routing Routing and RPL IPv6 mesh routing, RPL DODAG, and parent selection for constrained networks
Network topologies in depth Network Topologies Star, mesh, tree, and hybrid topologies with real IoT deployment examples
Bluetooth and BLE for IoT Bluetooth BLE Fundamentals BLE advertising, GATT profiles, and mesh networking with Bluetooth

Return to the Networking Basics: Assessment Overview to navigate the full assessment series.