6LoWPAN header-size budget
Compare IPv6 and 6LoWPAN header and payload budgets for link-local, mesh-local and global addressing.

Packet Pete: inspect the input, calculation and observed output before choosing a route.
Predict the reading, then compare it with the measurement.
Python 3 in your browser (JupyterLite)
Python · no installCompare IPv6 and 6LoWPAN header and payload budgets for link-local, mesh-local and global addressing.
Open the notebook in your browser and run each Python cell; no install or account is needed.
Three ways to run: use JupyterLite here with no install; run main.py locally from the downloadable lab folder; or open the same notebook in Google Colab.
Steps
Step 1
- Do
- In the JupyterLite notebook, run step 1 to set the 127-byte frame and MAC assumptions.
- You will see
- RFC 4944 section 4 frame example; PHY limit=127 bytes; maximum MAC overhead=25 bytes; available MAC payload=102 bytes
- Why it matters
- The PHY limit exceeds the space available to upper layers.

Step 1 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 2
- Do
- In the JupyterLite notebook, run step 2 to calculate the uncompressed IPv6 plus UDP baseline.
- You will see
- Uncompressed IPv6 + UDP case; IPv6 dispatch=1 byte; IPv6=40 bytes; UDP=8 bytes; header total=49 bytes
- Why it matters
- An uncompressed baseline makes the comparison meaningful.

Step 2 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 3
- Do
- Run step 3 to list every compressed field charged.
- You will see
- RFC 6282 compressed field assumptions; IPHC=2 bytes (includes dispatch); UDP NHC=1 byte; both ports in 0xf0b0-0xf0bf=1 byte; checksum=2 bytes
- Why it matters
- IPHC, NHC, ports, checksum and context all consume bytes.

Step 3 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 4
- Do
- In the JupyterLite notebook, run step 4 to compare address-context budgets.
- You will see
- Address case | compressed header | app bytes in MAC payload; link-local, stateless IID elision | 6 B | 96 B; mesh-local, shared context + CID | 7 B | 95 B
- Why it matters
- Context availability determines inline address cost.

Step 4 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 5
- Do
- In the JupyterLite notebook, run step 5 to record the savings and the boundary.
- You will see
- RESULT CARD: compression depends on address context; uncompressed payload=53 B; link-local compressed payload=96 B
- Why it matters
- The budget is conditional on MAC and compression settings.

Step 5 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
Chapter checks
These questions refer to the chapter’s examples. Use the return links to review their answers.
A 6LoWPAN design promises that every packet will compress to the same tiny header size. What evidence should a reviewer request?
Return to the chapter’s knowledge checkWhich release evidence best proves an IPv6 and 6LoWPAN deployment is ready for constrained IoT traffic?
Return to the chapter’s knowledge check