Skip to content

Latest commit

 

History

History
78 lines (67 loc) · 3.12 KB

File metadata and controls

78 lines (67 loc) · 3.12 KB

Altnet Protocol Specification (v1)

PHY

Param Default (EU868) Notes
Freq 868.1 / 868.3 / 868.5 MHz 3-channel hop
SF 9 (chat), 7 (voice) configurable
BW 125 kHz
CR 4/5
Sync word 0x34 (custom) per-realm configurable
Max payload 200 B (cap below LoRa 222)

On-air frame

| MV(1) | FT(1) | FL(1) | SRC(4) | DST(4) | TTL(1) | SEQ(4) | FR(1) | NF(1) | PAYLOAD(n) | MIC(4|8) |
  • MV = 0xA0 | (version & 0x0F). Current version = 1.
  • FL bits: b0 ENC, b1 ACK_REQ, b2 FRAG, b3 EMERG, b4 ADMIN, b5 BCAST, b6 RSV, b7 RSV.
  • Header (18 B) is AAD for CCM.
  • MIC = 4 B for control frames, 8 B for data/admin.

Frame types

FT Name Reliable Notes
0x01 HELLO no neighbor beacon, contains caps + node role
0x02 RREQ no reactive route request
0x03 RREP implicit route reply on reverse path
0x04 RERR no broken link
0x10 DATA_TXT optional text app payload
0x11 DATA_VOICE no best-effort voice frame
0x12 DATA_BIN optional binary blob
0x20 ACK unicast ACK
0x30 ADMIN_CMD yes signed admin command
0x31 ADMIN_RSP yes response
0x40 TIME_BEACON no coarse time sync
0x50 KEY_EXCHANGE yes session key derivation
0xF0 IDS_REPORT yes suspicious-activity report → admin

Routing

Hybrid AODV-lite + proactive HELLO neighborhood.

  • HELLO every T_HELLO = 30 s ± 5 s jitter; payload = {role, fw_ver, free_slots, ts}.
  • Neighbor table entry: {id, rssi_ewma, snr_ewma, last_seen, link_q} where link_q = clamp((rssi+130)/30, 0, 1) * (1 - dup_rate).
  • Route lookup:
    1. If dst ∈ neighbor table → direct.
    2. If route cache hit → use cached next-hop.
    3. Else broadcast RREQ(req_id = (src,seq), dst, hop_metric=0).
  • Intermediate node forwards RREQ if (src,req_id) not seen, TTL>0, decrement TTL, add own link_q cost.
  • Destination sends RREP along reverse path; nodes install reverse + forward route, expiry T_ROUTE = 5 min.
  • RERR on N consecutive ACK failures (default N=3).

Reliability

  • ACK with echoed SEQ. Retransmit up to R = 4 with backoff T_rt = T_BASE * 2^k * SF_factor + rand_jitter.
  • Dedup: per-source (src, seq) cache, 64-deep ring per neighbor.

Fragmentation

  • App payload > MTU split into ≤ 180-B fragments. FR = index, NF = total.
  • Reassembly buffer per (src, msg_id); timeout 30 s.
  • ACK happens at message level (after reassembly), not per fragment in v1.

Duty cycle

  • 1% (EU868) per band tracked over 1-hour window.
  • Emergency frames (FL.EMERG) bypass with audit log.

Time sync

  • TIME_BEACON from gateway/admin every 5 min: {epoch_ms, drift_hint}.
  • Replay nonce includes epoch_min; tolerated skew ±5 min.

Localization

RSSI-based path-loss model: $$ d \approx 10^{(P_{tx} - RSSI - PL_0) / (10 n)} $$

with PL_0 (1 m reference loss) and n (path-loss exponent) tuned per deployment. Multilateration: weighted least squares over ≥3 anchors. Time-of-flight is not reliable on SX127x at LoRa rates; we expose a TOF stub for SF7 short-range only as advisory.