15  Lab: LoRaWAN Simulation

Packet Traces, Class A Timing, ADR Decisions, Gateway Copies, Payload Checks, Security Symptoms, and Release Records

lorawan
simulation
lab

15.1 Start Simple

Use this lab as a rehearsal for reading evidence. A simulated packet trace is not field proof, but it can teach the habit of asking what each record shows and what it leaves unproven. Start with one uplink, one receive window, one ADR decision, and one duplicate gateway copy. Then decide what a release reviewer would still need from the real deployment.

In 60 Seconds

This lab uses simulated LoRaWAN records instead of an external emulator. You will inspect packet traces, Class A receive timing, ADR decisions, duplicate gateway copies, decoded payload samples, and security symptoms. The goal is not to build a radio stack. The goal is to learn how an operator decides whether simulated records are meaningful enough to prepare for field validation.

15.2 What This Lab Checks

  • How to read a simulated LoRaWAN packet trace without confusing trace fields with application meaning.
  • How Class A timing records separate uplink success from downlink opportunity.
  • How ADR decisions should be tied to link records and exception handling.
  • How duplicate gateway copies are deduplicated before application delivery.
  • How security symptoms such as counter rejects and MIC errors route to security checks.
  • How to write a release packet that treats simulation as preparation, not final proof.

15.3 Learning Objectives

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

  • Identify the fields needed in a LoRaWAN packet-trace check.
  • Explain Class A receive-window behavior from a timeline record.
  • Check an ADR decision using link records and exception notes.
  • Confirm duplicate gateway-copy handling before application routing.
  • Classify simulated failure symptoms and assign the right owner.
  • Prepare a simulation release record with field-validation triggers.

15.5 Lab Check Map

The lab follows a controlled record path from trace to release packet.

A seven-step numbered pipeline connected by arrows: lab question, packet trace, Class A timing, ADR decision, payload check, owner action, and release packet.
Figure 15.1: LoRaWAN simulation lab check map: a seven-step record path - lab question, packet trace, Class A timing, ADR decision, payload check, owner action, and release packet - each step numbered and connected by arrows.

Use the map this way:

  • Lab question: decide what the simulation is testing.
  • Packet trace: inspect device address, counter, port, message type, and payload status.
  • Class A timing: confirm receive opportunities after an uplink.
  • ADR decision: connect adjustment to link records and exception policy.
  • Payload check: verify the application receives useful decoded fields.
  • Owner action: assign rechecks for failed or ambiguous records.
  • Release packet: record what the simulation proved and what still needs field validation.

15.6 Minimum Check Knowledge

Trace

Packet fields are records

Device address, counter, port, MIC status, and payload status explain what the simulated packet path did.

Timing

Downlink has a window

Class A downlink depends on receive opportunities after an uplink, not on an always-listening device.

ADR

Adjustment needs records

ADR decisions should reference link history, exception devices, rollback rules, and monitoring ownership.

Release

Simulation is preparation

Simulated success prepares field validation; it does not replace gateway and application records from the target environment.

15.7 Lab 1: Packet Trace Check

Start with a simulated packet trace. The trace should show what the device sent, what the gateway heard, and what the application decoded.

An uplink frame split into MType, DevAddr, FCnt, FPort, FRMPayload, and MIC segments, with frame-counter and payload status chips, above a path from device uplink to gateway copy, server route, and application sample.
Figure 15.2: LoRaWAN packet-trace simulation check: a scenario banner over an uplink-frame anatomy bar (MType, DevAddr, FCnt, FPort, FRMPayload, MIC), two green status chips for frame counter and payload, and a device-to-application path of gateway copy, server route, and application sample.

Check the trace this way:

  • Does the scenario state what the simulated device is supposed to prove?
  • Does the trace show device address, counter state, port, message type, and MIC status?
  • Does the gateway record show whether the packet was heard and forwarded?

15.8 Practice Exercises

The old practice worksheet chapter is folded into this lab. Use these exercises after the packet trace, timing, ADR, and release-packet checks.

15.8.1 Exercise One: Record Worksheet

Fill a one-page worksheet for a proposed LoRaWAN device:

  • application promise;
  • regional profile and payload size;
  • device class and downlink promise;
  • activation method and counter reset behavior;
  • gateway records and duplicate-copy handling;
  • ADR policy and exception devices;
  • application acceptance record;
  • release owner and retest trigger.

15.8.2 Exercise Two: Class Decision

Given a low-power meter that sends periodic readings and rarely receives commands, choose the class behavior and state what records would prove the downlink promise. The answer should explain why a successful uplink does not prove routine downlink availability.

Run it: Before you name the class, watch how each class actually delivers a downlink in the workbench below. Run the Class A fallback path to confirm the meter only hears a command right after its own uplink, then compare Class B ping slots and the Class C window to see the power-versus-downlink trade you are choosing against. Send a Configuration command or Emergency alert and read the Watch For panel to see which devices are Ready versus waiting on a Beacon or clock – that is the evidence a class decision must cite about the downlink promise.

15.8.3 Exercise Three: Activation Recovery

Given a device that returns after reset with rejected frames, identify whether the next check belongs to activation, frame counters, key custody, application decoding, or radio link records. State what record clears the issue.

Run it: Work this activation-recovery question in the OTAA join workbench below. Step a JoinRequest through to JoinAccept and watch the DevNonce and MIC so you can tell an activation or key fault (bad MIC, replayed DevNonce) from a frame-counter or decoder fault. Switch the Key model between the LoRaWAN 1.0.x and 1.1 split-key models, then reset the device and re-join to see which record – nonce, MIC, or frame counter – actually clears the rejected-frame symptom the exercise describes.

15.8.4 Exercise Four: ADR Suitability

Given mixed fixed and moving devices, identify which devices can use ADR from recent uplink history and which need conservative settings or exception handling.

Run it: Decide ADR suitability by running each device profile in the ADR animation below. Compare a Rooftop meter against a Mobile tracker and an Obstruction event and watch how SNR and link margin drive the ADR decision toward a lower spreading factor and TX power – or fail to, when the link keeps moving. The stable fixed node converges to an efficient data rate, while the mover shows why it needs conservative settings or exception handling, which is exactly the fixed-versus-moving split this exercise asks you to make.

15.8.5 Exercise Five: Payload And Airtime Check

Given a payload that grew during product design, decide whether to reduce payload, change cadence, add gateway records, revise ADR policy, or reject the release packet until the airtime effect is checked.

Run it: Test the grown payload in the capacity workbench below before you accept or reject the release. Set the Region model and raise the Application payload to the new size, then read the Formula Trace to see airtime climb and duty-cycle headroom shrink. Now try the mitigations the exercise lists – lengthen the Report interval, cut Uplink repeats, or shift the Spreading-factor mix toward SF7-SF9 – and watch which one restores margin, so your decision to reduce payload, change cadence, or reject the packet is backed by the airtime numbers.

15.8.6 Exercise Six: Multi-Issue Scenario

When a scenario includes missed uplinks, duplicate gateway records, invalid MIC errors, and application decode gaps, split the records by owner before proposing a fix.

  • Does the server record show whether duplicate copies were merged?
  • Does the application sample show useful decoded fields?
  • Are missing or rejected records classified instead of ignored?

15.9 Check 1: Packet Trace Records

15.10 Lab 2: Class A Timing Check

Class A timing helps learners separate uplink success from downlink opportunity. A simulation record should show the uplink, receive opportunities, downlink attempt, and fallback path.

LoRaWAN device class comparison timeline showing Class A receive windows only after an uplink, Class B beacon-scheduled receive slots, and Class C near-continuous listening.
Figure 15.3: LoRaWAN device class comparison: Class A opens RX1 and RX2 windows only after an uplink (lowest power), Class B adds beacon-scheduled slots, and Class C listens almost continuously.

Check timing records this way:

  • Does the timeline distinguish uplink completion from receive opportunity?
  • Does the downlink attempt show whether it was queued, delivered, delayed, or missed?
  • Does the fallback action explain what happens if the device is not listening?
  • Does the application distinguish sensor-report success from command-delivery success?
  • Is the recheck trigger tied to device class, command promise, and owner action?

15.11 Check 2: Class A Timing

15.12 Lab 3: ADR And Duplicate-Copy Check

ADR and duplicate-copy handling are easier to understand in simulation, but the check still needs clear records and boundaries.

LoRaWAN ADR and duplicate-copy simulation check with link history, ADR proposal, exception device, gateway copy, deduplication, decoded sample, and release decision.
Figure 15.4: LoRaWAN ADR and duplicate-copy simulation check showing link history, ADR proposal, exception device, gateway copy, deduplication, decoded sample, and release decision.

ADR and duplicate-copy checks:

  • Does the ADR decision reference link history rather than a fixed preference?
  • Are exception devices identified before applying broad settings?
  • Does the simulation show duplicate copies from multiple gateways as expected behavior?
  • Does the server merge duplicates before application routing?
  • Does the decoded sample show one application record was created?
  • Are rollback and field-validation triggers documented before release?

15.13 Check 3: ADR And Duplicate Copies

15.14 Lab Release Readiness

The lab is complete only when learners can explain what the simulation proved and what it did not prove.

Trace

Accepted records

Store packet traces, timing records, ADR decisions, duplicate-copy records, and decoded samples.

Limits

Simulation boundary

Name what was not represented, including physical environment, gateway placement, and field variation.

Failure

Symptom routing

Route rejected counters, MIC errors, missing payloads, and delayed commands to the right check path.

Next

Field validation

Define the field records needed before the simulated design can be trusted outside the lab.

15.15 Check 4: Lab Release Packet

15.16 Match The Simulation Records

15.17 Order The Simulation Check

15.18 Label The Simulation Lab Map

15.19 Common Pitfalls

Simulation helps learners practice record checks. It does not prove real gateway placement, physical environment, or application operations.

A complete lab record connects device trace, gateway hearing, server handling, decoded application data, and owner actions.

Rejected counters, MIC errors, missed downlinks, and decode failures are useful learning records when they are classified and routed.

A simulation release packet should name exactly what field records are required before the same design is trusted outside the lab.

Overview: Simulation Is A Bounded Proof

A LoRaWAN simulation lab is useful when it proves one narrow claim and records the boundary around that claim. The learner should be able to say which scenario was tested, which records were accepted, which records were missing, and which field checks still own the final release decision.

For example, a desk simulation may show a sensor uplink, a valid frame counter, one gateway copy, a network-server route, and a decoded temperature field. That is useful evidence for the packet path, but it is not proof that the field gateway hears the same device through walls, that RX windows match the command promise, or that ADR remains safe after the device moves. The release claim should stay as narrow as the records: this scenario, this profile, this payload, this timing assumption, this server route, and these missing field checks.

The strongest lab outcome is a release answer, not a pass/fail screenshot. It separates useful evidence from missing evidence, names exceptions, assigns an owner, and states the trigger that forces a field test. If those pieces are absent, the simulation may still be a good exercise, but it is not yet a release record. A short note such as "bench trace only, field gateway unproven" is more honest than a broad green label. It also tells the next reviewer exactly where to resume.

LoRaWAN simulation release answer structure showing useful evidence, missing evidence, decision, exception, owner, and trigger.
Simulation evidence becomes usable when the release answer separates accepted proof from missing field checks, exceptions, owners, and retest triggers.
Claim

Name the scenario

State the device behavior, region, activation method, payload, and downlink promise before reading the trace.

Record

Keep the path together

Connect device frame, gateway copy, network-server handling, application decode, and owner action in one record.

Limit

Preserve the boundary

Do not let simulated success stand in for gateway placement, interference, antenna orientation, or field operations.

Practitioner: Write The Replayable Lab Record

The lab record should let another reviewer replay the decision without rerunning the exercise. That means the record needs enough packet, timing, ADR, duplicate-copy, payload, security, and owner evidence to explain the release decision.

Write the record as a trace through surfaces, not as a summary of screens. A useful entry might start with "meter-south-lot, EU868 profile, OTAA join, 12-byte uplink, Class A command promise, ADR enabled for fixed devices only." It then lists the device frame fields, the gateway copies, the server route, the decoded application sample, the RX1/RX2 queue result, the ADR basis, and the field condition still outside the simulation. Another reviewer should be able to see why the claim passed, why a broader claim did not pass, and which owner has to collect the next record.

When a record fails, preserve the failure instead of rewriting the scenario until it looks clean. A frame-counter reject belongs to activation and security state; a missing application row belongs to route, decoder, or storage evidence; a missed command belongs to Class A timing and queue behavior; duplicate gateway copies belong to server deduplication. Keeping those failures in separate rows prevents one vague "LoRaWAN failed" note from hiding the actual next action.

Replay Checklist

  1. Start with the lab question and expected device behavior.
  2. Capture packet fields, gateway copies, network-server route, and application decode.
  3. Separate uplink success from Class A downlink opportunity.
  4. Tie ADR changes to link history, exception devices, and rollback rules.
  5. Classify failures as radio, activation, counter, timing, decode, or owner-record gaps.
  6. Name the field-validation trigger that must pass before release.

Worked Record: Missed Downlink In A Good Uplink Test

The device sends an uplink and the application decodes the payload, but a command is missed. A replayable record separates the good uplink path from the downlink promise, checks RX1/RX2 timing, records queue behavior, assigns the command owner, and adds a field test for the promised response time.

Under The Hood: Simulation Can Hide Coupled Failures

LoRaWAN failures often cross boundaries. A payload-size change can affect airtime, data-rate fit, ADR decisions, duty pressure, downlink capacity, decoder versioning, and field support. A simulation that checks only one layer can miss the coupling that matters in production.

Consider a firmware change that adds a diagnostic field and increases the reporting cadence. The application decoder may still pass because the JSON shape is recognized, while the radio path becomes less tolerant of low data rates, retries, and busy channels. If ADR then lowers spreading factor for fixed devices, moving or obstructed devices can become exceptions. If the product also promises operator commands, the extra uplinks can change when downlinks are queued and whether the device is listening. The simulation record should therefore connect payload fit, timing, ADR, duplicate handling, and owner action instead of treating them as independent checkboxes.

Security and state can hide the same kind of coupling. A gateway can hear a frame with good radio evidence while the network server rejects it because the activation context or frame counter is wrong. A decoder can accept a sample while the release owner has not proved storage, alerting, or rollback behavior. The under-the-hood habit is to ask which boundary accepted the record, which boundary rejected it, and which later change would make the evidence stale. That stale-evidence check is what keeps simulation results useful after firmware, payload, gateway, or owner assumptions change.

Payload

Size changes radio behavior

More fields can push packets over practical limits when the device needs slower settings or retries.

State

Counters and keys gate acceptance

A gateway can hear a frame while the network server rejects it because activation or counter state is wrong.

Operations

Owners close the loop

A lab result is weak if no one owns the next field measurement, rollback rule, or retest after payload and firmware changes.

15.20 Summary

This lab uses simulated LoRaWAN records to practice packet-trace checks, Class A timing checks, ADR decision checks, duplicate-copy handling, payload checking, security symptom routing, and release packet writing. A strong lab result explains both what the simulation proved and what still needs field validation.

15.21 What’s Next?

15.22 Key Takeaway

A LoRaWAN simulation lab should test gateway placement, airtime, collisions, spreading factors, and traffic assumptions. Simulation is a planning aid, not a replacement for measured deployment data.