Zigbee, Thread & Matter · Study deck

6LoWPAN Header Compression

6LoWPAN header compression is a reconstruction contract.

Radio Remi is your guide for this deck.

6lowpaniphcipv6
Radio Remi, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain the IPHC field decisions that control traffic class, flow label, next header, hop limit, source address, destination address, and context use.
  • Review whether an IPv6 address can be elided, shortened, context-compressed, or must remain inline.
  • Distinguish stateless link-local reconstruction from stateful context-based compression.
  • Interpret UDP NHC evidence, including port-compression limits and checksum handling.
iotclass.org

Major section

Start With the Packet That Must Fit

A normal network header may be larger than the useful data.

  • Compression helps only if the receiver rebuilds the exact meaning.
  • Internet Protocol means the addressing rules used to move network packets.
  • IPv6 means version 6 of those rules.
  • IEEE 802.15.4 means a low-power radio and link standard.
iotclass.org

Major section

Start With the Packet That Must Fit (continued)

The useful question is not which field is shortened first, but what evidence proves the adaptation still carries the right meaning.

  • 6LoWPAN means a way to carry IPv6 over that small radio.
  • User Datagram Protocol (UDP) means sending separate messages without a lasting connection.
  • A payload means the useful data inside one message.
iotclass.org

Major section

Start With the Packet That Must Fit (continued)

A shorter frame must not hide a changed source or stale result.

  • This runway does not prove the best context or radio budget.
  • The deeper sections show which fields can be inferred, when context is shared, how UDP shrinks, and where tests must catch a bad rebuild.
  • Compression, fragmentation, reassembly, and retries make sense when they are tied to that visible journey.
iotclass.org

Major section

In 60 Seconds · Compression Claim

Packet captures should prove both the compressed frame and the reconstructed IPv6 packet.

  • IPHC compresses IPv6 by recording which fields are carried, shortened, or reconstructed.
  • Address compression is strongest when link-local addresses can be rebuilt from IEEE 802.15.4 link-layer addresses.
  • A release record must state when compression assumptions need retesting.

Why it matters

Compression claim:: The packet path is acceptable because every omitted IPv6 or UDP field can be reconstructed from a named source, the compressed and decompressed views agree, and context or port assumptions are monitored for drift.

iotclass.org

Major section

IPHC Review Path · Header Size and Recoverability

A link-local telemetry message, a global CoAP request, a multicast control message, and a routed diagnostic response can produce different compression evidence even inside the same mesh.

  • A standard IPv6 header is 40 bytes.
  • The important evidence rule is simple: compression omits bytes, not meaning.

Numbers to remember

40 bytesA standard IPv6 header is 40 bytes.

Why it matters

The path starts with traffic scope because compression is traffic-specific.

6LoWPAN IPHC review path.
6LoWPAN IPHC review path.
iotclass.org

Major section

IPHC Field Decisions · Address Reconstruction

IPHC does not magically shrink a packet.

  • A reviewer should identify the decision for each field before accepting a packet-size claim.
  • A QoS-marked path needs evidence, not assumption.
  • UDP is commonly reviewed with NHC; unsupported headers need inline evidence.
  • Hop limit: Common hop-limit values can be encoded compactly.

Key terms

Address compression
Address compression is usually the largest part of the review.
Fully elided link-local addresses
Fully elided link-local addresses are a special case.
iotclass.org

Major section

Context Custody

The sender and receiver must agree on the same prefix, index, lifetime, and owner; otherwise the packet can decompress to a plausible but wrong destination and look like a routing or application failure.

  • That context needs an owner, a distribution method, and a failure signal.
  • A successfully formed global IPv6 address is not automatically removable from a 6LoWPAN frame.
  • The joined trace names the reconstruction source for both omitted addresses and shows why the same payload now fits one frame.
iotclass.org

Major section

UDP NHC Evidence

UDP NHC is a second review, not an automatic consequence of IPHC.

  • The reviewer should confirm how the next header is encoded, which UDP fields are carried, and whether port compression actually applies to the tested ports.
  • Port compression is often where best-case examples drift away from real application traffic.
  • A default application port, an ephemeral port, or a security-wrapped exchange can produce a different NHC result.
iotclass.org

Major section

Routed Prefix With Context · Application Port Surprise

Scenario:: A node sends a message through a border router to a service prefix shared through context compression.

  • A gateway failover or prefix change should trigger retest.
  • Scenario:: A learner expects maximum UDP NHC compression, but the application uses ports that do not match the stack's most compact mode.
  • If the larger header pushes the packet toward fragmentation, the fragmentation chapter becomes part of the approval path.
iotclass.org

Major section

Common Mistakes · Release Checklist

Fragmentation blind spot: Forgetting that weaker compression can push a packet into fragmentation and change the reliability review.

  • Traffic scoped: The message type, address scope, route boundary, security mode, and application ports are named.
  • Field decisions recorded: The record says which IPv6 and UDP fields are inline, compressed, or reconstructed.
  • Context verified: Any stateful prefix context has an owner, index, lifetime, distribution method, and visible failure path.
iotclass.org

Major section

Stateless Address Autoconfiguration and Dispatch

An IEEE 802.15.4 extended address is already an EUI-64; forming the IPv6 interface identifier inverts its universal/local bit.

  • The mapping is reversible only while the link-layer address assignment remains valid.
  • A short address change, PAN rejoin, or context change is therefore a header-decompression and neighbour-cache event, not just an administrative rename.
  • The LOWPAN_IPHC base encoding occupies two octets, beginning with the dispatch pattern that identifies IPHC.

Why it matters

Header compression works because the receiver can reconstruct omitted values from link context and shared prefix state.

iotclass.org

Major section

Stateless Address Autoconfiguration and Dispatch (continued)

A third context-identifier octet appears when source or destination compression selects one of up to 16 shared contexts.

  • The remaining IPHC bits say whether Traffic Class and Flow Label are carried, whether Next Header is compressed, how Hop Limit is represented, and which source/destination address parts are inline, statelessly derived, or context-derived.
  • That final distinction prevents a common error. "2, 12, or 20 bytes" are worked outcomes for particular field and context choices, not three packet types.
  • Header compression works because the receiver can reconstruct omitted values from link context and shared prefix state.
iotclass.org

Major section

Figure Review: Parse, Fragment, Reconstruct · Summary

The fastest way to debug a compressed packet is to reconstruct its header stack in parser order and ask why every optional header exists.

  • Once fragmentation or mesh-under routing is present, individual bit fields become byte offsets, address widths, and forwarding state.
  • 6LoWPAN header compression is reliable when it is treated as evidence.

Key terms

Compression
Compression is safe only when the receiver can identify a trusted source for every omitted IPv6 field.

Numbers to remember

5 bytesFRAGN · 5 bytes carries an offset[7:0] measured in eight-byte units
Four 6LoWPAN header-stack cases.
Four 6LoWPAN header-stack cases.
iotclass.org

Major section

Key Takeaway · Concept Relationships

IPHC and fragmentation: Compression should be reviewed before fragmentation because packet growth can change whether splitting is needed.

  • 6LoWPAN Header Compression Evidence should tie compression choices to IPv6 addressing, context state, packet size, interoperability, debugging visibility, and deployment evidence.
  • IPHC and routing: Route-over forwarding still depends on correct reconstructed IPv6 addresses at each relevant boundary.
  • IPHC and deployment: Stateful context compression is an operations responsibility, not just an encoding feature.
iotclass.org

Deck summary

Key takeaways

A normal network header may be larger than the useful data.

  • The useful question is not which field is shortened first, but what evidence proves the adaptation still carries the right meaning.
  • A shorter frame must not hide a changed source or stale result.
  • Packet captures should prove both the compressed frame and the reconstructed IPv6 packet.
  • A link-local telemetry message, a global CoAP request, a multicast control message, and a routed diagnostic response can produce different compression evidence even inside the same mesh.
iotclass.org

Retrieval practice

Recall check 1 of 4

Radio Remi says: answer from memory, then check your reasoning.

Q1When is 6LoWPAN IPHC address compression strongest?

AWhen link-local addresses can be rebuilt from the IEEE 802.15.4 link-layer address
BWhen every node stores the full 128-bit IPv6 address in flash memory
CWhen the application payload is encrypted end to end
DWhen the network uses only globally routable prefixes everywhere
Show answer

Answer: A IPHC compresses most when link-local addresses can be reconstructed from the IEEE 802.15.4 link-layer address.

iotclass.org

Retrieval practice

Recall check 2 of 4

Radio Remi says: answer from memory, then check your reasoning.

Q2What does 6LoWPAN IPHC primarily compress, and what makes that safe?

AThe IPv6 header, using flags and context so omitted fields can be reconstructed by the receiver.
BThe application payload, using a lightweight compressor before the packet reaches IPv6.
CThe IEEE 802.15.4 MAC header, by replacing radio addresses with random short tokens.
DOnly oversized packets, by splitting them into fragments instead of changing header fields.
Show answer

Answer: A IPHC reduces IPv6 header bytes only when the receiver can rebuild the logical IPv6 packet.

iotclass.org

Retrieval practice

Recall check 3 of 4

Radio Remi says: answer from memory, then check your reasoning.

Q3A compressed 6LoWPAN packet omits a link-local source address. What evidence should a reviewer require before accepting that omission?

AA statement that IPHC always removes every IPv6 address field from compliant packets.
BProof that the receiver can reconstruct the source address from the link-layer address.
COnly the compressed frame length, because a short frame proves reconstruction worked.
DA screenshot of application data, because addressing is hidden below the application layer.
Show answer

Answer: B IPHC address elision is a reconstruction claim and must be verified against link-layer evidence and the decompressed IPv6 packet.

iotclass.org

Retrieval practice

Recall check 4 of 4

Radio Remi says: answer from memory, then check your reasoning.

Q4A border router changes the global prefix used by a 6LoWPAN mesh, but some nodes still compress packets using the old context index. What is the strongest review response?

AAccept the network as healthy, because the context index number is unchanged and the index, not the prefix, is what compressed packets actually carry on the air.
BDisable compression permanently across the mesh, since any feature that depends on shared state is too fragile for production.
CRecord context owner, prefix, lifetime, distribution path, sender and receiver tables, and the visible failure signal before approving the new prefix.
DOnly check that the application eventually retries, because retried traffic proves the mesh healed the mismatch on its own.
Show answer

Answer: C Context-based compression is safe only when context ownership, synchronization, and failure handling are explicit.

iotclass.org

Print reference

Answers

Answer key.

  1. A · IPHC compresses most when link-local addresses can be reconstructed from the IEEE 802.15.4 link-layer address.
  2. A · IPHC reduces IPv6 header bytes only when the receiver can rebuild the logical IPv6 packet.
  3. B · IPHC address elision is a reconstruction claim and must be verified against link-layer evidence and the decompressed IPv6 packet.
  4. C · Context-based compression is safe only when context ownership, synchronization, and failure handling are explicit.
iotclass.org