6. Analytical model
6.3 Network traffic
Traffic in the network plays an important role for optimization. In WSNs, a high traffic load usually goes hand in hand with high power consumption, which shortens the lifetime of the nodes.
In the design of previous chapters, there are two kinds of traffic in the sensor network:
end-to-end 3 3 3 3
6.3 Network traffic 101
the signaling traffic (in beacon packets) and data traffic (in data and control packets).
6.3.1 Routing traffic
In the ODEUR+ routing protocol, beacon packets are only generated by the beacon node and forwarded by other sensor nodes. The beacon is generated periodically. Let tibi
(inter-beacon interval) and B denote the beacon period in seconds and the beacon size in bytes respectively. Because every node only forwards the new beacon while suppressing the old ones thanks to the duplicate detection mechanism (mentioned in Chapter 3), they only send one beacon in tibi seconds.
Hence, the routing traffic (beacon traffic) which is transmitted in the N-node network in one second can be determined by the following formula:
beacon
With the data traffic, if a node i sends a packet with the size of Mdata bytes to its next hop, and it has Ki hops to the sink, (Ki-1) intermediate nodes have to forward this packet. When a node receives a data packet, it will send an ACK packet with the size of MACK (bytes) to the sending node for it. In case there is no packet loss, the traffic of node i, which is transmitted in the network, can be defined by:
data
in which tipi is the inter-packet interval of nodes (or data period of packet), and M is the sum of the data packet size and the ACK packet size. Because MACK is previously assumed very small in comparison with the packet size Mdata (see 6.2.2), this leads to the following approximation:
data ACK data
M = M + M MMdata
Hence, the total data traffic in the network can be calculated by summing up the data traffic of all N nodes (addressed from 0 to N-1):
N-1 N-1 N-1
And the total network traffic Lnetwork(bytes/s) is summed by (6.10) and (6.12):
beacon data N-1 However, (6.13) is only used in case of perfect links, which means that a successful packet is transmitted only once.
In the lossy network, the probability of packet loss has to be taken into account.
Because of the retransmissions, there may be more data traffic for the transmission of one packet. In addition, the timeout of a retransmission is about several hundreds of
milliseconds while the inter-packet interval is in second unit, so the assumption that the total number of retransmissions of a packet can be performed in a tipi period is reasonable if n is rather small.
In each link of a path, depending on the condition around each node, the number of retransmissions can be different for each data packet. However, in the worst case that finally the forwarded packet is successfully transmitted after n times, an intermediate node has to forward n same packets (n-1 packets fail). Hence, the data traffic
, data
Li j (byte/s) over link between nodes i and j is defined as follows:
data 2 n-1
In which Pi, j is the probability of transmitting a packet successfully in one time over the link between node i and node j and it is calculated by (6.5).
With the path Pi VV (Pi = {i, j, k,…, r}) and r denoting the sink node, the total traffic to send a packet from the source node i to the sink node is:
data data
From (6.15), the total data traffic in the N-node network can be derived:
data N-1 data
The sum of (6.10) and (6.16) gives the total traffic of the network.
Getting back to the example in Figure 6.3, if the inter-packet interval is 5 seconds and the packet size is 42 bytes (using the data packet mentioned in Chapter 3) with the number n of retransmissions being 3 times, the total traffic of node 6 can be calculated as follows:
One can see that in case of lossy links, the amount of traffic transmitted is higher due to the packet loss. Figure 6.4 shows the relation between the link PRR pi, j and the total data traffic of node 6 using formula (6.15). The number of retransmissions is (n-1) and the packet size is 42 bytes. In case n is equal to 5, if a node has to retransmit the data packet 5 times, the total traffic will be 210 bytes which is 5 times greater than the packet size.
Now, if the links in the path between node 6 and node 0 are perfect, it means each node sends a successful packet with one single trial. Under this condition, all Pị, j are equal to 1. Using (6.15), the minimum total traffic of node 6 in the network can be simply calculated as follows:
6.3 Network traffic 103
Figure 6.4: The transmitted data traffic (e.g. temperature) versus link PRR of node 6.
6.3.3 Packet rate
Once the end-to-end PRR is determined, the packet rate can be measured. The packet rate measured in WiSeCoMaSys (see Chapter 5) is based on a packet counting technique. With a window time tW, the number of successfully received packets is counted in this window time. After that, the packet rate is calculated.
When the end-to-end PRR of a specific node is known by using (6.7), when end-to-end PRR is 100%, the number of successful packets within tW is theoretically determined by:
W receiving
ipi
N =t (packet)
t (6.17)
Because the end-to-end PRR of node i (
-i
end to end
PRR ) expresses the number of successfully received packets, the real number of successful packets counted in the window time tW is Nreceiving PRRPRRiiiiend to endend to- -- - (packets). Hence, the real packet rate is:
end-to-end
data i
i data
ipi
R =PRR M (byte/s)
t Mdatadata (6.18)
With the previous example, node 6 has the packet rate of 0.9989/5 = 0.1998 (packet/s) or 8.3908 (byte/s) while the theoretical packet rate of node 6 is 1/5 = 0.2(packet/s) if the links are perfect.
The formula (6.18) is used in WiSeCoMaSys to measure the packet rate of each node when WiSeCoMaSys receives a packet successfully. Although one can see that (6.18) does not depend on the window time tW, this parameter is chosen to count enough received packets, especially when the inter-packet interval is rather large. In WiSeCoMaSys, tW is set at 120 seconds by default and can be changed by users.
6.3.4 Traffic in context-aware application
The purpose of the context-aware sensing application in Chapter 4 is to reduce the
duplicate information in case the environmental conditions do not change so much.
Hence, this also reduces the network traffic and saves more energy for nodes.
Moreover, it is rather difficult to determine the probability of the events which happen due to the context match. However, in some scenarios, this probability can be known.
Hence, in the context-aware operation mode, each node only transmits an amount of traffic determined by:
P is denoted for the probability of an occurring context event at node i. Looking at (6.19), it can be seen that the data traffic in a context-aware application is always less than that in the normal operation (when packets are generated and transmitted periodically). If the observation time is tobservation, then
-i
where tcontext_matched is the period of time in which the context rule is true.
For example, a sensor network is deployed to monitor the temperature every morning in a harbor. If the morning is considered from 6:00 to 12:00, the probability of the event
“in the morning” generated by a sensor node can be reduced by 75% in comparison with the case that the network reports packets during the whole day (24 hours). More details are presented in section 7.4.1.