# Evaluation of 6 LoWPAN Generic Header Compression in the Context of a RPL Network
## 5 Methodology and Measurements
### Evaluation on a Real Testbed  
The purpose of conducting measurements on a real testbed is to quantify the impact of 6 LoWPAN-GHC on energy consumption for handling incoming and outgoing packets. We again ran two sets of measurements: one with 6 LoWPAN-GHC enabled and the other without 6 LoWPAN-GHC. We measured the power draw of two nRF52840 devices running the RPL protocol. One device served as a RPL root node and the other as a normal node. The power was measured using a Keysight N6705B DC Power Analyzer [24] for a duration of 15 s. During this period, all four types of RPL control messages were sent by the devices. The sampling frequency during the measurements was set to the smallest resolution that the measurement device was capable of, which was 40.96 us. The accuracy for the current measurements is 8 nA, and for the voltage it is 50 uV. When measuring the power draw, the radio communication was captured using an nRF52840-based radio sniffer, such that the packets could be identified in the power trace. Measurements show that the power draw of the active microcontroller (\(P_{mcu}\)) is 88 mW, whereas the transmission power draw (\(P_{tx}\)) is 157 mW.  
We consider the compression algorithm to be energy-efficient when the energy gained by transmitting fewer bytes is higher than the energy lost in compressing the packet, as shown in Equation (3). This parameter can be computed for each type of RPL control packet. Figure 6 shows the power measurements over time for each type. Before the packet is processed, the microcontroller is in a low-power state. When the microcontroller starts processing and constructing the packet, its power consumption increases. The next increase in power is due to the transmission of the packet. Finally, if the microcontroller has nothing to process, it enters the low-power state. It can be seen that the time taken to process and transmit a control packet depends on its type. The DIS, being the smallest packet, has the lowest processing and transmission time. Applying 6 LoWPAN-GHC increased the processing time with 238 us and decreased the transmission time with 81 us. In terms of energy, the processing energy increased by 20.94 uJ (+44%). This number reflects the energy spent in compressing the packet with the 6 LoWPAN-GHC mechanism, \(E_{c,ghc}\) in Equation (3). The transmission energy was reduced by 12.96 uJ (-9%). This is the difference between the \(E_{tx,nhc}\) and \(E_{tx,ghc}\). Overall, the total energy consumption increased by 8.0 uJ (+4%) for a DIS packet.  
For a DIO, which has the highest compression ratio, the energy consumption for the packet compressed increased by \(E_{c,ghc}=205.5\)\(\upmu\)ly (+164%) and the energy consumption for transmitting that packet decreased by \(E_{tx,nhc}-E_{tx,ghc}=84.95\)\(\upmu\)ly (\(-25\%\)). The total energy consumption increased by 118.2\(\upmu\)ly (+26%). For a DAO and a DAO-ACK, the total energy consumption increased by 34.5\(\upmu\)ly (+7%) and 7.7\(\upmu\)ly (+2%), respectively. It can be observed that none of the RPL control packets satisfy Equation (3).