Skip to content

Inspect ZRP zones and bordercasts

Print intra-zone tables, trace bordercasts and compare radius costs with reproducible failure checks.

Blueprint Bina: I want you to inspect the failed case and the record that explains the next decision., your practice guide

Blueprint Bina: I want you to inspect the failed case and the record that explains the next decision.
Predict the reading, then compare it with the measurement.

Python 3 in your browser (JupyterLite)

Python · no install

Print intra-zone tables, trace bordercasts and compare radius costs with reproducible failure checks.

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-09-10.

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-09-10; the tool may have moved on — the text steps are the contract.

  1. 1 Step 1

    Do
    Run python main.py and inspect step 1: freeze the legacy topology.
    You will see
    15 nodes: three rows x five columns; horizontal and vertical unit links; rows: 0 1 2 3 4 / 5 6 7 8 9 / 10 11 12 13 14. STEP 1 scenario-contract ready
    Why it matters
    The exact legacy adjacency graph has a six-hop diameter. Keeping that separate from its eight-hop emergency example prevents mixing assumed and measured values.
    JupyterLite step 1 showing the executed Python and its observed result.
    Step 1 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  2. 2 Step 2

    Do
    Run python main.py and inspect step 2: print radius-2 intra-zone tables: nodes 0-7.
    You will see
    node destination:next-hop/hops (self omitted); 0 1:1/1 2:1/2 5:5/1 6:1/2 10:5/2. STEP 2 local tables 0-7 complete
    Why it matters
    IARP stores local next hops and distances. These first eight tables show which destinations are ready without reactive discovery.
    JupyterLite step 2 showing the executed Python and its observed result.
    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 python main.py and inspect step 3: print radius-2 intra-zone tables: nodes 8-14.
    You will see
    node destination:next-hop/hops (self omitted); 8 2:3/2 3:3/1 4:3/2 6:7/2 7:7/1 9:9/1 12:7/2 13:13/1 14:9/2. STEP 3 local tables 8-14 complete
    Why it matters
    The remaining seven tables complete the network record. Zone-edge membership explains who can receive bordercast queries.
    JupyterLite step 3 showing the executed Python and its observed result.
    Step 3 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  4. 4 Step 4

    Do
    Run python main.py and inspect step 4: follow local lookup and out-of-zone bordercast.
    You will see
    Local 0->6: path=[0, 1, 6] queries=0; origin border query_hops. STEP 4 bordercast measured
    Why it matters
    A local target needs no bordercast. An external target pays query and reply work, and duplicate suppression bounds each query recipient.
    JupyterLite step 4 showing the executed Python and its observed result.
    Step 4 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  5. 5 Step 5

    Do
    Run python main.py and inspect step 5: compare radius costs on the same workload.
    You will see
    r entries refresh queries query_tx reply total; 1 44 15 13 13 6 34. STEP 5 radii 1,2,3 compared
    Why it matters
    Larger zones trade more proactive refresh and memory for fewer reactive queries. Count hop transmissions as well as border recipients.
    JupyterLite step 5 showing the executed Python and its observed result.
    Step 5 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  6. 6 Step 6

    Do
    Run python main.py and inspect step 6: detect degeneration and check the legacy arithmetic.
    You will see
    r=10 >= diameter 6; node-0 zone size=15; Node-0 border=[]; reactive queries=0. STEP 6 overlarge zone diagnosed
    Why it matters
    A radius beyond network diameter eliminates the reactive half of ZRP. The supplied overhead arithmetic is illustrative, separate from this run’s packet counts.
    JupyterLite step 6 showing the executed Python and its observed result.
    Step 6 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  7. 7 Step 7

    Do
    Run python main.py and inspect step 7: validate faults and fresh local tables.
    You will see
    one-hop: forward=[0, 1] reverse=[1, 0] PASS; partition: forward=None reverse=None PASS. STEP 7 fault checks PASS
    Why it matters
    A one-hop oracle, a disconnected graph, asymmetric links and a removed edge test different failure assumptions. Fresh zones must not silently reuse obsolete paths.
    JupyterLite step 7 showing the executed Python and its observed result.
    Step 7 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  8. 8 Step 8

    Do
    Run python main.py and inspect step 8: replay 30 edge-loss seeds with matched input.
    You will see
    seeds=42..71; independent edge-loss probability=0.12; Reachable radius-runs=81/90; reachability oracle agrees for all 90. STEP 8 validation PASS
    Why it matters
    Matching edge-loss seeds across radii isolates radius choice. A reachability oracle checks correctness; a physical testbed is needed to measure radio performance.
    JupyterLite step 8 showing the executed Python and its observed result.
    Step 8 · 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 sensor network has frequent local traffic and occasional distant messages. Which ZRP feature matches that pattern?

    Return to the chapter’s knowledge check
  2. A team enlarges ZRP zones to reduce discovery traffic. Which cost should it expect to review?

    Return to the chapter’s knowledge check

Caution

Use fictional inputs. This deterministic teaching model omits real radio interference and hardware timing; its counts explain this scenario, not field performance.

Return to ZRP Routing: Tuning and Deployment · Browse Labs