# Performance Comparison of NB-Fi, Sigfox, and LoRaWAN
## 3 An Overview of NB-Fi, Sigfox, and LoRaWAN
### Frame Format
#### 3.2.3 LoRaWAN  
The uplink frame structure is shown in Figure 6. It begins with a preamble, which allows the receiver device to synchronize and defines the frame modulation scheme since it is modulated with the same spreading factor as the rest of the frame. Typically, the preamble duration is 12.25 \(T_{s}\), where \(T_{s}\) is the symbol duration.  
The preamble is followed by a PHY Header and Header CRC fields, which are 20 bits long together and are encoded with the most reliable code rate of \(\frac{4}{8}\). The Header field  
Figure 4: Uplink frame structure in Sigfox.  
Figure 5: Downlink frame structure in Sigfox.  
contains information about the code rate, payload length, and whether the Payload CRC field is present in the frame (downlink frames do not contain the Payload CRC field).  
The frame duration is \(T_{frame}=(n+12.25)T_{s}\), where \(n\) is the number of symbols needed to transmit the PHY Payload and the PHY Header and is calculated as follows [32]:  
\[8+max\bigg{(}\bigg{[}\frac{8 PL-4 SF+28+16\cdot[CRC_{\text{\emph{s}present}}]}{CR( SF-2 DE)}\bigg{]},0\bigg{)}. \tag{3}\]  
_PL_ is the payload length in bytes, \(SF\) is the spreading factor, \(CR\) is the code rate, and _CRC_ispresent_ equals 1 if the PHY Header CRC is present in the frame, which means that it is the uplink frame, and 0, otherwise; \(DE\) is 1 if the low data rate optimization is enabled and 0 otherwise. Low data rate optimization is an option that can be enabled in LoRa transmitters to improve the robustness of transmission to variations in frequency.  
The next field is the PHY Payload. It starts with a MAC Header, which is 1 byte long and contains information about protocol version, message type (data/management, uplink/downlink frame), whether the message should be acknowledged, or if it is a vendor-specific message.  
MAC Header is followed by a Frame Header which contains the following information:  
_Device Address_: a 4 byte field. The first two bytes identify the network; other bits are assigned dynamically and identify the sensor in the network;  
_Frame Control_: a 1-byte field, used for network control information, such as whether to use the data rate specified by the BS for uplink transmission, whether this message is an acknowledgment of the previous message, whether the BS has more data for the sensor;  
_Frame Counter_: sequence number;  
_Frame Options_: a 0 to 15 bytes long field, which is used for changing data rate or transmission power, validating connection, etc.;  
_Frame Port_: allows for distinguishing several flows between a sensor and a BS. If it is equal to 0, then the frame contains MAC commands instead of user data.  
The next field is MIC, which is used as a digital signature of the message.  
The overall size of the PHY Payload field is \(13+FP+FOps\) bytes, where \(FP\) is the Frame Payload length and \(FOps\) is the Frame Options length. Therefore, if a BS or a sensor wants to send an empty message (i.e., to acknowledge frame reception), they will have to send 13 bytes of payload in it, which leads to significant overhead. The maximal Frame Payload length and bitrate depend on the \(SF\), used to transmit the frame. Table 2 lists maximal and minimal values of frame durations in the uplink and downlink \(T^{max}_{up}\), \(T^{min}_{up}\), \(T^{max}_{down}\), \(T^{min}_{down}\), and the maximal values of Frame Payload \(PL\) depending on the \(SF\). Note that, if a BS does not have any data to transmit and simply wants to acknowledge  
Figure 6: Uplink frame structure in LoRaWAN.  
the reception, it transmits a frame in the downlink without any payload, which means that the duration of such frame equals \(T_{down}^{min}\).  
In LoRaWAN, the downlink frame structure is identical to the uplink frame except for the Header CRC field, which is omitted in the downlink frame.