Overall protocol type and operation
- This example is a Baloo “Crystal” benchmark. Baloo is a synchronous flooding engine (Glossy-style concurrent transmissions) scheduled in time slots. Crystal-style collection typically runs short, repeated floods within a round (e.g., beacon/sync flood → data flood(s) → ack flood), where every node that receives a packet immediately relays it a fixed number of times to propagate the flood network-wide with very low jitter.
- Therefore, it is a flooding-based, time-slotted protocol leveraging synchronous transmissions (not CSMA). Reliability is obtained via spatial/temporal diversity (many concurrent relays, repeated transmissions), not per-link ARQ.

How the two tunables affect PRR, energy, and latency

1) tx_power (radio transmit power in dBm)
- PRR:
  - Higher tx_power increases link SNR and enlarges the effective flooding radius, improving the chance that each hop in the flood succeeds. This generally raises PRR, especially at the network edges or under interference.
  - In synchronous flooding, all relays transmit the same packet. Using a uniform tx_power across nodes is beneficial to maintain capture/constructive-interference conditions. Mismatched powers can slightly degrade performance if a much stronger node consistently dominates.
- Energy:
  - TX energy per unit time grows with output power. Since each node both receives and transmits during a flood, total energy per flood increases with tx_power for every relay.
  - Radio on-time does not change with tx_power, so energy increase is mainly from the higher TX power level itself.
- Latency:
  - Per-flood latency is largely unaffected directly by tx_power (slot timing is fixed). Indirectly, higher tx_power can reduce the need for extra rounds/retries at the application level, lowering end-to-end latency across a session.

2) n_tx_max (maximum number of relay transmissions per flood)
- Meaning in this context:
  - In Glossy/Baloo-style floods, each node that receives the flood will retransmit it a configured number of times. n_tx_max caps those back-to-back relay transmissions. It directly sets the flood’s length.
- PRR:
  - More relay transmissions create temporal diversity and more opportunities for late receivers to join the flood, raising PRR. Gains typically show diminishing returns beyond about 2–4 transmissions in stable indoor testbeds; harsher channels may benefit up to ~5–7.
- Energy:
  - Nearly linear increase with n_tx_max. Each extra transmission adds another TX+RX cycle for all participating nodes, so network-wide energy per flood scales roughly linearly with n_tx_max.
- Latency and throughput:
  - Flood duration grows roughly linearly with n_tx_max: T_flood ≈ n_tx_max × (T_packet + RX↔TX turnaround/guard). For IEEE 802.15.4 at 250 kbps and short payloads, this is on the order of ≈1–2 ms per extra transmission.
  - Longer floods reduce slot/round capacity (lower throughput) and increase per-packet latency.

Practical tuning guidance

- Start point (typical indoor testbed):
  - tx_power: around −7 dBm to 0 dBm often balances PRR and energy without saturating front-ends or causing excessive interference. If your nodes are far apart or there is strong external interference, move toward 0…+5 dBm (if supported).
  - n_tx_max: 2–3 for small/medium, dense topologies; 3–5 for sparse or interference-prone deployments.
- If the goal is highest PRR:
  - First increase n_tx_max to 3, then 4, watching for diminishing gains. This is the most robust way to raise flood reliability because it adds temporal diversity.
  - If PRR remains short of target, raise tx_power stepwise while keeping all nodes at the same setting.
- If the goal is lowest energy at a target PRR:
  - Fix a PRR target (e.g., ≥99%). Sweep n_tx_max upward from 1 while keeping tx_power moderate (e.g., −7 to −3 dBm). Stop at the smallest n_tx_max that meets the PRR target; then step tx_power down until PRR starts to drop. This finds a near-Pareto point.
- If the goal is lowest latency:
  - Prefer raising tx_power while keeping n_tx_max as low as your PRR target allows (often 2–3). Each increment in n_tx_max adds ≈1–2 ms of flood time.
- Environmental adaptation:
  - Interference bursty? Favor a slightly higher n_tx_max rather than cranking tx_power; temporal diversity is more effective against bursts.
  - Very dense network? You can reduce tx_power to limit interference footprint and still maintain PRR via redundancy (n_tx_max=3).
  - Sparse/long links? Increase tx_power first; then add n_tx_max if needed.
- Measurement-driven loop:
  - Log per-flood success and per-round PRR. Increase n_tx_max if you see frequent late joins or edge-node losses; adjust tx_power if losses correlate with RSSI/SNR drops or when all transmissions in a flood fail together.
- Guardrails:
  - Keep tx_power uniform across nodes to preserve synchronous-flood properties.
  - Respect regulatory EIRP limits.
  - Remember n_tx_max affects all floods in a round (e.g., sync, data, ack), so total round duration increases multiplicatively.

Summary of effects
- tx_power: PRR ↑, Energy ↑, Latency ≈ (indirectly ↓ at system level if fewer retries).
- n_tx_max: PRR ↑ (diminishing returns), Energy ↑≈linear, Latency ↑≈linear, Throughput ↓.