Age of Information and Energy Consumption in Iot: An Experimental Evaluation
Age of Information and Energy Consumption in Iot: An Experimental Evaluation
Age of Information and Energy Consumption in Iot: An Experimental Evaluation
Abstract—The Age of Information (AoI) is an end-to-end of AoI on energy but were mainly aimed at studying AoI-
metric frequently used to understand how “fresh” the infor- aware systems in some operating scenarios [12], [13].
mation about a remote system is. In this paper, we present
arXiv:2405.05849v1 [cs.NI] 9 May 2024
TABLE II: Network connections in the experimental setup. acts as the time-reference server for the RPI. The ethernet
connection is characterized by an extremely low latency, being
Connection RTT Download Upload Hops
the two devices in the same lab room, and is used only for
RPI - Server 80 ms 28 Mbit/s 15 Mbit/s 12 synchronization traffic. All the other traffic exchanged by the
Laptop - Server 5 ms 200 Mbit/s 160 Mbit/s 3 two devices flows via the cellular connection and the Internet.
The overall configuration corresponds to a rather common
scenario in the IoT domain, in which the RPI acts as a device
communication technologies3 . The RPI represents a battery- installed somewhere that produces data, typically collecting
powered device. To measure its power consumption, it is information by monitoring the environment. The subscriber
powered by the Otii Arc Pro from Qoitech power monitor [28]. on the laptop in turn can be considered as a cloud application
The Otii power monitor is featured with a Asynchronous that deals with the collection of the data produced, applying
Receiver-Transmitter (UART) interface that is used to send logic that may be sensitive to the freshness of the information
commands to the RPI device and to annotate the recorded obtained from the data. The two parties exchange information
trace with timestamps to precisely confine the portion of the through the broker, hosted in the cloud as the subscriber, which
total energy required during the execution of an experiment. represents a centralized entity enabling indirect communica-
The RPI publisher is then connected via cellular connection to tion according to the MQTT protocol. Table I summarizes the
a MQTT broker hosted on a server in the University of Pisa hardware specs of the experimental setup, while Table II pro-
cloud network. vides a characterization of the network connections between
The final component of the experimental setup is a laptop, the hardware components.
which has a twofold function. Firstly, it acts as a MQTT
subscriber client, connected to the broker via the University A. Implementation
of Pisa network (with WiFi access). The connection between The client has been implemented relying on the Quinn
the broker and the subscriber is characterized by a relatively library [29], a rust-based implementation of the IETF QUIC
low latency, being the two components in the same network. protocol. We did not use a standard MQTT client as available
Secondly, the laptop acts as the controller of the experiments. QUIC-based implementations are rather limited in number.
It is connected to both the RPI and the Otii to provide Quinn provides an async API and it is based on the Tokio
the configuration parameters and the automation for each async runtime [30]. Quinn also uses the Rustls [31] library
experiment. for the cryptographic functionality. In particular, our client
The goal of the study is to evaluate the system from the also uses the mqttbytes [32] libraries for producing MQTT
point of view of the AoI and the energy needed on the messages according to the specification. The client just imple-
publisher side. We are not interested in the energy consump- ments the subset of the MQTT protocol needed for our exper-
tion of the machine hosting the subscriber as we suppose iments, like sending messages to the broker and receiving the
that the alerting/controlling system mentioned before is not corresponding acknowledgments. To achieve higher message
executed on a battery-operated device. Similarly, the energy rates, the client uses a task to send messages to the broker and
needed to run the broker is not of interest, as it is generally another task to keep track of the corresponding incoming acks.
executed on reasonably powerful machines without constraints The client also includes the buffering mechanisms previously
in terms of energy. With this setup, we can measure both the mentioned: a task produces new information at a nominal rate
energy consumption on the RPI and the AoI, as the difference and uses a buffer to communicate with the sender task. The
between the instant when the message was generated and the latter is responsible for extracting information from the buffer
instant when it was received. To obtain a precise measure and sending it through the network. The buffer is managed
of the AoI, the two devices (the Raspberry Pi 3B+ and the according to two strategies: (i) a FIFO queue with a capacity
laptop) need to be adequately synchronized. To achieve the of 1, 16, and 1024 messages, and (ii) a drop-head-on-full
desired synchronization, we used an approach based on the queue of capacity 1. In the first case, the two tasks can be
Network Time Protocol (NTP) protocol. The two devices are blocked when the queue is full or empty and no messages
connected via a second ethernet connection, and the laptop are lost. In the second case, a message can be lost if a new
one is produced before the current one is transmitted. In this
3 Experiments have been carried out only using 4G access. case, the producing task never blocks and always operates
according to the nominal rate. The strategies will be hereafter
indicated as FIFO 1, FIFO 16, FIFO 1024, and DROP. The
broker is an instance of the Rumqttd server. The subscriber
Time-below
is rather simple and receives messages when relayed by the b
median
5/10 = 0.50
A. Age of Information 10
2.5
their corresponding TLS ones. Figure 5c shows the power
consumption over the nominal rate. After this initial sudden
increase, the power continues rising with the rate but with a
2.0
slower slope. This trend is valid for all configurations up to the
rate of 2000 msg/s. From such a rate onward the DROP policy
1.5
stops increasing and the same applies for FIFO 1, but only in
the QUIC configuration. The FIFO-1 TLS encounters an upper
1.0
40 60 80 100 bound around the rate of 5000 msg/s. Other configurations,
AoI [ms]
even if subjected to some fluctuations, present a quite evident
Fig. 4: Example of Pareto Front. increasing trend up to the maximum rate. This suggests that
the power consumption is dominated by the transmission rate.
Once the maximum rate for a configuration is reached, further
of an experiment will be longer. For each configuration, we increases in the nominal rate won’t produce any significant
executed one run, except for the last one, where we executed variation in the average power. It must be noted that below
30 runs. Besides the metrics used to compute energy and AoI, 2000 msg/s QUIC always shows a higher power consump-
the RPI collects also context metrics useful to explain the tion. Over that threshold, things get more confused, even if
obtained results, such as the cellular network quality and the generally QUIC consumes more than its corresponding TLS
clock synchronization precision. configuration.
Figures 5d and 5e show the Pareto fronts for the FIFO poli-
A. Impact of the Generation Rate cies and the DROP policies, respectively. The results for the
For these experiments, we set the message payload to 128 B, rate of 1 msg/s are omitted for the sake of clarity, as they ob-
no additional delay on the cellular link, and a single core tain a median AoI of approximately 500 ms, even if the power
on the RPI. We varied the nominal generation rate on the consumption is extremely low. For the FIFO configurations,
publisher from 1 msg/s to 8000 msg/s, with the following the rates that appear in the front do not exceed 2000 msg/s.
steps: 1, 10, 100, 1000, 2000, ..., 8000. We show results for As previously observed, excessively high transmission rates
both the transport protocols (QUIC and TLS), and all the do not guarantee advantages for either power consumption or
buffering strategies. Figure 5a shows the relationship between AoI. Besides that, in general, the lower the rate the lower
the real generation rate and the nominal generation rate, for the consumption and the higher the AoI, and vice-versa, and
both transport protocols and the different buffering strategies. the QUIC configurations obtain the lower AoI. It is worth
The figure shows that the buffer size poses an upper limit on noticing that the high density of points in the left extreme also
the real generation rate. The bigger the buffer, the higher the shows that, once approaching the lower AoI bound, any further
real rate that can be obtained. For FIFO policies, this happens improvement requires a significant increment in the power
because, once the buffer is full, the publisher blocks. This consumption. In the DROP configurations, we can notice that
automatically reduces the real publishing rate so that it is also rates higher than 2000 msg/s are present in the front. This
compatible with the maximum message throughput that can happens because higher rates, even if higher than the nominal
be sent out via the network. The presence of a larger buffer one, produce “fresher” information, thus helping keep the AoI
allows the publisher to cope with the transient reduction of low, at the cost of possible information loss.
throughput due to changing network conditions and, more
importantly, it allows the aggregation of multiple messages B. Impact of Additional Delay
within a single transport-layer packet. For the DROP buffering For these experiments, we artificially applied additional
strategy, the real rate corresponds to the number of messages delay on the cellular link in both directions (uplink and
that are transmitted by the RPI. It has to be noted that for the downlink). Specifically, the delay was added on the server
FIFO 1 policy, the rate obtained by TLS is much higher than machine via the Linux Traffic Control (TC) command. We
the one obtained by QUIC. This happens because in its base performed runs with additional delays from 20 to 80 ms, at
configuration, TCP with TLS uses the Nagle algorithm, which steps of 20 ms. For what concerns AoI, as could be expected,
performs a much more aggressive aggregation than QUIC. an upward shift can be appreciated in Figure 6, which shows
For each rate and each protocol/transport configuration, we the raw results for the QUIC, FIFO 16 configuration with a
computed median AoI and average power. The median AoI rate of 1000 msg/s. The shift is less evident for lower rates,
starts from high values when the rate is low, and then decreases as the AoI values are already high. The maximum achievable
Median AoI over rate Average Power over rate
Real and Nominal rate 110
8000 Quic, DROP Tls, DROP Quic, DROP Tls, DROP
Quic, DROP Tls, DROP Quic, FIFO-1 Tls, FIFO-1 Quic, FIFO-1 Tls, FIFO-1
Quic, FIFO-1 Tls, FIFO-1 Quic, FIFO-16 Tls, FIFO-16 Quic, FIFO-16 Tls, FIFO-16
Quic, FIFO-16 Tls, FIFO-16 3.00
7000 100 Quic, FIFO-1024 Tls, FIFO-1024 Quic, FIFO-1024 Tls, FIFO-1024
Quic, FIFO-1024 Tls, FIFO-1024
2.75
6000 90
2.50
4000 2.25
70
3000 2.00
60
2000
1.75
50
1000
1.50
40
1
1 1000 2000 3000 4000 5000 6000 7000 8000 100 1000 2000 3000 4000 0 1000 2000 3000 4000 5000 6000 7000 8000
Nominal rate [msg/s] Nominal rate [msg/s] Nominal rate [msg/s]
(a) Real rate vs. nominal rate. (b) Median AoI over rate (c) Average power over rate
1.7
10 10 10
1.6 1.6
50 60 70 80 90 40 50 60 70 80
Median AoI [ms]) Median AoI [ms])
(d) Pareto front for FIFO configurations (e) Pareto front for DROP configurations
300
7K
2K 1K 3K
4K 1K
1K
1K 1K1K 2.2 1K
2.2 1K 1K 5K3K
5000 1K
1K
100
1K 1K 100 1K 100
4000 2.0 1K 1K
100 1K 10 2.0 100 1K
100
100 100
3000 100
1.8 1.8
2000
10 10 10 1010 10 10 10
1000 1.6 101010 10 10 1.6 10 10
0 40 60 80 100 120 140 160 180 40 60 80 100 120 140 160
0 ms 20 ms 40 ms 60 ms 80 ms Median AoI [ms]) Median AoI [ms])
(a) Maximum rate for different delays. (b) Pareto fronts for FIFO delayed configurations (c) Pareto fronts for DROP delayed configurations
TABLE III: Median AoI varying the payload size for TLS, power consumption for the configurations with higher payload
FIFO-16, rate 100 configuration sizes, while the AoI decreases as the payload increases, for
the rate of 100 msg/s and in some configurations even 1000
Payload size Median AoI
msg/s. Table III shows this behavior for the TLS, FIFO 16, rate
128B 107.38 100 msg/s configuration. Particularly interesting are the Pareto
256B 85.04 fronts for the payload size of 2048 B (Figure 8), which show
512B 65.52 the configurations with a rate of 100 mgs/s as the best ones
1KB 60.24 for AoI. In fact, at higher rates, the AoI values are extremely
2KB 55.46 high. This happens because the system is not able to handle
the required throughput, and this does not depend on the queue
size, as testified by Figure 9, which shows the anomalous
The improvement in terms of AoI with respect to the second behavior for both the FIFO 1024 and the DROP queues.
highest point in the front is negligible, at the unjustifiable cost Therefore, the cause seems to be due to oversized buffering
of higher energy consumption. The same considerations found that takes place somewhere between the transmitter and the
for the case with no additional delay apply also to the DROP receiver, either in the RPI (on-device bufferbloat [36]) or in the
configurations. In particular, these configurations benefit also cellular network infrastructure. It has to be noticed a difference
from higher rates, as already pointed out. between the AoI obtained with QUIC and TLS, with QUIC
that always obtains a better performance. For what concerns
C. Impact of Different Payload Sizes power consumption, the least power-demanding transmission
In previous experiments, we considered a fixed payload size protocol is TLS, however, when the payload size increases the
of 128 B. However, there could be scenarios characterized by difference between the protocols tends to shrink, especially for
advanced sensors producing more complex, thus bigger data the FIFO configurations.
structures. In addition, multiple sensors could be attached to
the same device which would in turn produce bigger packets D. Impact of Multiple Cores
containing more than one message. In these experiments, In this experiment, we evaluate the impact on power con-
we evaluate the impact of greater payload sizes on energy sumption and AoI of enabling an additional core on the
consumption and AoI. We consider the following payload RPI. The software we developed is single-threaded, and con-
sizes: 128 B, 256 B, 512 B, 1024 B, 2048 B. The maximum currency is implemented via asynchronous mechanisms, that
payload size of 2048 B allows us to consider application exploit the idle times dictated by I/O operations to carry out
scenarios where a large amount of data has to be fitted in other tasks. However, in parallel with our software, multiple
a single message, as well as to account for possible effects kernel threads are executed, responsible for handling network
on the AoI of messages that do not fit in a single segment at operations and other system tasks. Thus, enabling more than
the transport layer. For these experiments, we considered only one core could benefit the overall system’s performance.
rates up to 1000 msg/s as (i) the best results for AoI in the Enabling the second core allowed the system to reach
previous experiments were obtained with rates around 1000- higher rates, and, more importantly, a lower AoI. This is
2000 msg/s, (ii) the combination of large payload size and high particularly evident for QUIC in the FIFO 1 configurations, as
transmission rate would produce a very high throughput witch can be observed in Figure 10a. This effect is not found in the
could not be sustainable by the RPI and IoT devices in general. DROP configurations, as the possibility to overwrite the buffer
The analysis of the Pareto fronts highlights a slightly higher content allows always to deliver the “freshest” information.
Pareto Front (FIFO) Pareto Front (Drop)
100 2.2 100
Quic, FIFO-1 Quic, DROP
100 Tls, FIFO-1 Tls, DROP
2.1 Quic, FIFO-16 Pareto front
Tls, FIFO-1024 2.1
100 Pareto front
Average Power [W]
1.8 1.8
1.7 10
1.7 10 10 10
50 60 70 80 90 50 60 70 80 90
Median AoI [ms]) Median AoI [ms])
(a) FIFO. (b) DROP.
3000 3000
1500 1500
2500 2500
AoI [ms]
AoI [ms]
AoI [ms]
AoI [ms]
2000 2000
1000 1000
1500 1500
500 500
0 0 0 0
0 10 20 30 40 50 60 70 0 10 20 30 40 50 60 70 0 10 20 30 40 50 60 0 10 20 30 40 50 60
Time [s] Time [s] Time [s] Time [s]
90
2.0 2.0
Median AoI [ms]
80
Power [W]
Power [W]
1.5 1.5
70
60 1.0 1.0
50
0.5 0.5
40
0 500 1000 1500 2000 2500 0.0 0.0
Transmission rate [msg/s] 1 10 100 1K 2K 3K 4K 5K 6K 7K 8K 1 10 100 1K 2K 3K 4K 5K 6K 7K 8K
(a) AoI comparison enabling second core for QUIC, (b) Energy comparison enabling second core for QUIC, FIFO-1 and DROP.
FIFO-1.
The positive impact of the second core has a drawback, in Figure 10b. For DROP configurations, it is not possible
paid in terms of additional energy required to power the to spot a clear difference in power consumption. For FIFO
hardware component, but not in all configurations, as shown configurations instead, the impact on the power consumption
Median AoI over transmission rate Power transmission rate
Quic 2.4 Quic
Tls Tls
140 Tls (nagle disbled) Tls (nagle disbled)
120 2.2
Median AoI [ms]
Power [W]
100
2.0
80
1.8
60
1.6
40
0 250 500 750 1000 1250 1500 1750 2000 0 250 500 750 1000 1250 1500 1750 2000
Transmission rate [msg/s] Transmission rate [msg/s]
(a) AoI over transmission rate. (b) Power over transmission rate.
is significant as the rate gets higher. This is because the second Pareto Front (FIFO)
core allows higher transmission rates, which, in turn, can Quic
2.4 2K Tls
increase the power consumption of the network card. Tls-nagle-off
Pareto front
E. Impact of the Transport Protocol 2K
2.2 1K
1K