## 3 Materials and Methods
### Methodology
Each test performed for each scenario lasts 3 min. In each one of them, node N1 is continuously sending packets from the top of the network stack, so all the layers described before are involved in the communication. In this way, each packet takes a variable time to be transmitted, which depends on the MAC schedule and the transceiver configuration. Then, when a packet has been sent, the node waits for 100 ms to start sending the next packet, and so on until the test time is over. Therefore, the time \begin{table}
\begin{tabular}{c c c} \hline \hline  & \multicolumn{2}{c}{\(T_{beacons}\)=13 ms} \\ \hline
**RDC** & \(T_{MAC}\) & \(T_{packets}\) \\ \hline
10\% & 130 ms & 117 ms \\
15\% & 87 ms & 74 ms \\
20\% & 65 ms & 52 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 1: MAC times for different RDC values. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**PTDC** & **Task Type** & \(T_{ON}\) & \(T_{PROC}\) & \(T_{OFF}\) \\ \hline \multirow{3}{*}{5\%} & TT1 & 2 ms & 40 ms & 38 ms \\  & TT2 & 10 ms & 200 ms & 190 ms \\  & TT3 & 50 ms & 1000 ms & 950 ms \\ \hline \multirow{3}{*}{25\%} & TT1 & 2 ms & 8 ms & 6 ms \\  & TT2 & 10 ms & 40 ms & 30 ms \\  & TT3 & 50 ms & 200 ms & 150 ms \\ \hline \multirow{3}{*}{50\%} & TT1 & 2 ms & 4 ms & 2 ms \\  & TT2 & 10 ms & 20 ms & 10 ms \\ \cline{1-1}  & TT3 & 50 ms & 100 ms & 50 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Processing task times for different PTDC and task type values. between packets is defined by the sum of the variable transmission time and this fixed wait time. It is considered that node GW has received a packet when it reaches the top of the network stack. Node N2 does not send or receive any packet from its application layer, it just forwards packets from its routing layer. Each packet sent is filled with 40 application bytes and contains a unique and incremental identifier. This is the maximum application payload length allowed by the network stack, since up to 24 bytes are reserved for protocol headers and the maximum buffer size of many radio transceivers is 64 bytes. The incremental identifier allows us to count the number of received and missed packets in the GW node. In addition, a timestamp is also included, so we can also obtain the latency of each packet when it is received, since all the nodes are synchronized. In the GW node, we also calculate the throughput at the end of each test by dividing the number of application bytes received by the test time. We consider this latency and throughput as our communication performance metrics. Finally, we also monitor the running tasks in node N1 by using Percepio Tracealyzer software [28]. This tool allows us to obtain the execution parameters of the tasks running in the sensor node, such as the execution time, the wait time and the turnaround time. Specifically, the wait time is the metric we have used to evaluate the effect that the communication parameters have in the processing task, since it is the time the task is blocked by other tasks running in the OS. Summarizing, we have performed a set of experimental tests by changing the RDC, the PTDC, the task type and the scheduling priorities. For each test, we obtain the throughput, the latency and the wait time of the reference processing task. This way, we evaluate the influence that the PTDC and the processing task type have in the communication performance. In addition, we also evaluate the process management influence by changing the priority scheme. In the opposite direction, the RDC communication parameter is changed to evaluate its influence on the processing task wait time.