lorawan icon indicating copy to clipboard operation
lorawan copied to clipboard

MIC, packet size and Time-On-Air

Open brunocitoni opened this issue 2 years ago • 0 comments

Expected Behavior

According to the specifications (either 1.04 or 1.1), each LoRa message should finish with a 4-octet message integrity code (MIC). I could not see this anywhere, and since I noticed the Time-on_air is slightly lower than it should be I assume that's the reason. MACFrame

Actual Behavior

I could not see the MIC mentioned or implemented anywhere, and the Time-On-Air of the packets reflect this, with slightly lower time-on-air obtained via lora-phy.cc with respect to the calculators found online such as https://avbentem.github.io/airtime-calculator/ttn/eu868.

By adding 4 bytes to the LoRaFrameHeader (quick and dirty way) in lora-frame-header.cc (uint32_t size = 8 + m_fOptsLen + 4; in LoraFrameHeader::GetSerializedSize) the Time-on-Air is then correct.

Steps to Reproduce the Problem

  1. run a simulation by monitoring the return value for LoraPhy::GetOnAirTime
  2. compare to online time-on-air calculators

brunocitoni avatar May 29 '22 11:05 brunocitoni