Skip to content

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., your practice guide

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 install

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

Tier 2 · Web · paste-in setup · No account

Version tested: Python 3.12.7 / Pyodide 0.27.6 in JupyterLite 0.6.4; Chromium 148.0.7778.96; captureSource playwright:jupyterlite. Date: 2026-10-08.

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.

Open in your browser (new tab)

Steps

Screens captured against Python 3 in your browser (JupyterLite) Python 3.12.7 / Pyodide 0.27.6 in JupyterLite 0.6.4; Chromium 148.0.7778.96; captureSource playwright:jupyterlite on 2026-10-08; the tool may have moved on — the text steps are the contract.

  1. 1 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.
    Real JupyterLite notebook output for step 1 of 6LoWPAN header-size budget.
    Step 1 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  2. 2 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.
    Real JupyterLite notebook output for step 2 of 6LoWPAN header-size budget.
    Step 2 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  3. 3 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.
    Real JupyterLite notebook output for step 3 of 6LoWPAN header-size budget.
    Step 3 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  4. 4 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.
    Real JupyterLite notebook output for step 4 of 6LoWPAN header-size budget.
    Step 4 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  5. 5 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.
    Real JupyterLite notebook output for step 5 of 6LoWPAN header-size budget.
    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.

  1. 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 check
  2. Which release evidence best proves an IPv6 and 6LoWPAN deployment is ready for constrained IoT traffic?

    Return to the chapter’s knowledge check

Caution

This RFC-based teaching budget assumes 25 MAC overhead bytes, qualifying compressed ports, no security, no mesh header and no fragmentation. It does not establish the size of a particular on-air frame.

Return to IPv6 and 6LoWPAN for IoT · Browse Labs