The objective of this section is to model the delay of (a) a series of existing single copy DTN routing algorithms applied to on-body settings and (b) two specific routing algorithms that are specifically developed to leverage the locality of *WBAN* topology as function of postural body movements.

Definition 1 (link state).

The state of a link between two on-body nodes and at the th discrete time slot is represented as , which is assigned the value 1 or 0 to indicate the state to be connected or disconnected, respectively. The time slot here is an observation time slot which corresponds to the *Hello* interval period for neighbor/link discovery. In our prototype implementation, it was set to be 1.4 sec.

Definition 2 (link disconnection probability).

The Link Disconnection Probability (LDP) for the link between node- and node- is represented as . The quantity represents the probability that after an arbitrarily chosen time slot, the link remains disconnected for consecutive disconnected time slots. In a sufficiently long topology trace, spanning time slots, if represents the number of occurrences of such -slot long disconnections, then the LDP can be expressed as

The case represents situations for which the arbitrarily chosen slot is a part of one of the periods (except the last slot on the period) or the last slot during one of the periods (see Figure 5). Similarly, the case represents situations for which the arbitrarily chosen slot is a part of one of the periods (except the last slot on the period) or the last slot during one of the periods. With above definition of , we have , and its expected value can be represented as

where is the Expected Link Delay, representing the average number of disconnection slots after an arbitrarily chosen slot. In other words, can be expressed as , where is the average disconnection duration for link to .

### 5.1. Opportunistic Routing

In DTN opportunistic routing (OPPT) [18–20] a source node delivers packet to the destination node only when the two nodes come into direct contact. This single copy mechanism offers a simple DTN routing approach in which the delay can be very large, especially in scenarios with low mobility or infrequent link formation between the source and destination. This protocol is simple to implement and suited well for the processing- and energy-constrained on-body sensors for which complex algorithms should be avoided. It is highly energy efficient due to the single transmission requirement for each packet delivery. However, the expected packet delivery delay for OPPT can be quite high, especially when the source and the destination nodes are rarely in direct contact with each other. The protocol is also very sensitive to the source-destination link quality since it relies only on that single direct link for all packet delivery. Opportunistic routing is modeled and analyzed in this section for estimating the worst case delay performance and for finding an upper-bound for packet delivery delay in a *WBAN* setting.

Since a source node delivers a packet to destination only when and a packet at node can be generated at any arbitrary time slot, the delivery delay for a packet is as developed in (2). This is true only when the packet generation rate is low enough so that no more than one packet is generated during a period (see Figure 5). This means that the generated packet can be delivered at the very beginning of the immediately following period without any additional wait.

However, when the packet generation rate is higher so that multiple packets are generated during a period, the packets need to be delivered one per time slot during the next period. This backlog clearance adds an additional delay component that needs to be added in addition to the from (2). Let represent the number of packets generated during the period. With being the packet generation rate at the source node , . After the subsequent period starts, these packets are flushed one packet per time slot, requiring time slots. During these slots, another packets are generated which are then cleared one per slot.

Combining the backlog clearance delay with the Expected Link Delay (ELD), the average delivery delay for the packets generated during the period can be written as . Average delay for the packets generated during the period can be written as . Therefore, the overall average packet delay for on-body opportunistic routing can be expressed as

or

where Expected Link Delay (ELD) can be computed in (2) and . Note that this expression is valid when the system is stable in the sense that on an average, all packets generated during the and periods are able to be delivered during the period for the link between nodes and .

### 5.2. Randomized Routing

In randomized routing protocol (RAND), if a node with a data packet does not have a direct connection with the destination, the node forwards the data packet to a neighbor chosen at random [19, 20]. The packet is subsequently forwarded in the same way, till it is received at the destination. Unlike for hot-potato routing [20] in large networks, the delay performance of RAND can often be better than that of opportunistic routing in small body area networks only with few nodes. Smaller topologies have lesser number of end-to-end path combinations, leading to quicker delivery. Also, the network partitioning, as shown in Figure 3, helps reducing the path combinations even further. Packet looping, which is inherent in a randomized routing protocol, can be avoided by recording a packet's traversed path in it incrementally so that a forwarding filtering can be implemented. A packet is never forwarded to a node that is recorded in that packet's already traversed path. Like OPPT, the randomized protocol is also simple to implement but can deliver lower packet delay compared to OPPT. A packet being forwarded using the RAND protocol, however, can suffer from a large number of unnecessary forwarding before it is delivered at the destination. In other words, this protocol can be quite energy-inefficient.

Definition 3 (forwarding probability).

In RAND forwarding, a node- forwards a packet uniformly randomly to one of its currently connected neighbors. Therefore, at any time slot , the probability of node forwarding a packet to node is defined as

where is the number of nodes in the on-body network. Equation (5) is applicable as long as node currently has at least one neighbor, and none of those neighbors is the destination node (i.e., ). In case when node has destination as a current neighbor, the packet is forwarded to node with probability "1". Also, when node has no current neighbors, it keeps buffering the packet (i.e., ), resulting in for all . Incorporating all these situations, (5) can be expanded as

Definition 4 (forwarding matrix).

The forwarding matrix captures the forwarding probabilities at time slot across all possible links in the network with nodes and can be represented as

The Forwarding Matrix has two notable properties. First, the elements in the th row are all zeros since the destination node never forwards a packet. The elements in the th column, however, are either 1 or zero (not explicitly shown above), depending on node 's instantaneous connectivity with the other nodes as expressed above in (6). Second, the summation of all elements in all rows (except the th row) should be 1. The Forwarding Matrix, which depends on the link states , can be created after the forwarding probabilities are computed using (6) based on the observed link states from the collected WBAN topology traces.

Consider a data packet that is generated at node during the th time slot, and delivered to node at the th time slot, resulting in a delay of slots. The value of can vary from 0 to infinity. Let the probability of the above event (i.e., delivering the packet with a delay of slots) be represented as the delivery probability , which can be expressed as

which is the element of the product matrix for a packet generated at time slot and delivered at time . Equation (8) shows the probability of delivering a packet with a delay of slots, where can range from 0 to infinity. Therefore, the expected RAND forwarding delay for a packet that was generated at the th time slot can be written as

where is the length (in number of slots) of the experimental topology traces obtained in Section 4. Considering sufficiently long on-body topology traces (i.e., large ), the maximum value of in (9) is set to be instead of infinity.

To clarify the above forwarding concept further, let us explore the following example in Figure 6. Consider a 4-node (i.e., ) body sensor network with node-1 as the source and node-3 as the destination. Example forwarding matrixes , , and and the corresponding network topologies at time slots 1, 2, and 3, obtained from the topology trace, are given in Figure 6.

Using the above matrixes, the delay probabilities can be computed as , , and using (8). According to , at time slot 1, node-1 has two neighbors (2 and 4), node-2 has one neighbor (node-1), and node-4 has a direct connection with the destination node-3. Assume that a packet is generated at source (node-1) at time slot 1. Since node-1 has no direct connection with (i.e., ), the packet will be randomly forwarded to either node 2 or 4 with probability 0.5 each, but the probability of delivering it to the destination node-3 is zero in the current slot-1 (out of all possible infinite number of slots in future). This is captured by which is the [1, 3] element of matrix .

At time slot 2, the packet will be forwarded to 3 through 2 with probability 1, that is, if 2 has already received the packet in slot 1. Otherwise (i.e., the packet was forwarded to node 4 in slot 1), the packet will be forwarded to node-1 or node-2 by node-4 at slot 2. Therefore, the probability of delivering the packet to the destination node-3 in slot-2 (out of all possible slots) is 0.5. This is captured by from the [1, 3] element of the product matrix.

Since in , the packet is guaranteed to be delivered to node-3 in slot-3. Since the probability of delivery in slot-1 was zero, and in slot-2 was 0.5, and the delivery is guaranteed in slot-3 (i.e., if it was not delivered in slot-2), the probability of delivering the packet in slot-3 (out of all possible slots) is 0.5. In other words, the probability of delivery with a delay of 2 slots (i.e., ) is 0.5. This is also captured as from the [1, 3] element of the product matrix . Using , , and , the expected delay for random forwarding for this example WBAN topology trace is time slots.

### 5.3. Utility-Based Routing Using Link Locality

In randomized routing, a node does not consider the locality of its connectivity with other network nodes while forwarding a packet. In utility-based routing protocols [17–21], nodes prefer to forward packets to destination through the neighbor with the latest encounter with the destination, thus leveraging the link locality in the form of its age. Each node is assigned a utility value based on the last encounter time with the destination, and a packet is forwarded to a neighbor with the highest utility value. Utility represents how useful (fast) this node might be in delivering a data packet to the destination and is often implemented using a timer. The delay of utility-based routing is expected to be lower than that in OPPT and RAND routing. Also, the number of packet forwarding in utility-based routing is expected to be smaller compared to RAND, mainly because of its exploitation of the link connection locality while selecting the next-hop during packet forwarding. The implementation of this protocol, however, can be more complex than OPPT and RAND because each node needs to compute and maintain the utility information for all neighbors in the network. Therefore, for large networks, maintaining utility information for every node can create significant scalability concerns. However, for small *WBAN* s this is less of an issue because of their small node-counts.

Let the utility function represent the utility value, of node with respect to node at the th time slot. Every time node comes in contact with node , the quantity is set to a maximum utility value and then for every time slot the node remains out of contact from the destination, the quantity is decreased based on a preset utility reduction method [19, 21] as a function of elapsed time. The update rule for can be written as

where is the maximum possible utility value to the destination. These utility values are exchanged between neighbors within the periodic *Hello* messages.

With the above definition of utility, at the th time slot node- will forward a packet (destined to node-) to node- only if and forall , where is the set of all neighbors of node- during the th time slot.

Note that the above forwarding logic assumes that each on-body node is guaranteed to intermittently come within up to 2-hop contact from the destination node. In other words, a source node is able to meet other nodes that intermittently come in direct contact with the destination node. In our experimental topology this assumption was always found true [24]. In fact for a WBAN topology, it is generally true that depending on the specific postural patterns, all nodes intermittently form direct links with all other nodes in the network. This observation makes the assumption generally applicable for WBANs which usually have a small network diameter [19, 21]. When this 2-hop reachability assumption is not valid in large *WBANS*, transitive components will need to be incorporated while computing the utility factor.

The packet routing delay in utility-based forwarding (UTILITY) can be computed using the same logic as in random forwarding (RAND) except that the forwarding probabilities in (6) need to be reformulated for UTILITY. The forwarding probability in this case can be expressed as

where represents the set of all on-body nodes and where is the set of all neighbors of node- during the th time slot. The top line of (11) represents a situation in which either node- does not have any neighbor during the th time slot, or its own utility to the destination node- is higher than those of all its current neighbors. Either way, the node buffers the packet with probability 1. The middle part of the equation codes the utility-based forwarding rule as stated after (11). The bottom part represents the situation in which the destination node- is a direct neighbor of node-, causing a direct delivery.

Once the forwarding probabilities are computed applying (11) on the on-body topology traces collected in Section 4, the forwarding matrix and the delivery probabilities are computed using the same rules presented in (7) and (8). Finally, the delivery delay is computed as using (9).

### 5.4. Probabilistic Routing with MultiScale Postural Locality (PRMPL)

Routing using PRMPL utilizes a *Postural Link Cost*(PLC) [23] which captures WBAN link localities in multiple time scales. For on-body packet forwarding, the PLC is used exactly the same way as for the UTILITY routing, that is, by replacing the utility values by the PLCs. With posture and activity changes of a human subject, the PLC link costs are automatically adjusted such that the packets are forwarded to next-hops which are most likely to provide an end-to-end path with minimum intermediate buffering/storage delays. PLC is defined as , , which represents the probability of finding . The update equations for PLC are formulated as [23, 24, 36]

According to (12), when the link is connected, the*Postural Link Cost*(PLC) increases at a rate determined by the constant , and the difference between the current value of and its maximum value, which is 1. As a result, if the link remains connected for a long time, the quantity asymptotically reaches its maximum value of 1. When the link is disconnected, asymptotically reaches zero with a rate determined by the constant . To summarize, for a given , responds to the instantaneous connectivity condition of the link .

With time invariant , the PLC update rules in (12) capture the locality in short-term link connectivity in a manner conceptually similar to the age-based utility formulation, as developed in [19, 21]. It is, however, not the same because in the designs in [19, 21], the routing utility of a link is increased incrementally when the link is formed and is reduced to zero as soon as the link is disconnected. This formulation of utility misses out the fact that even after disconnection, the formation probability of that link may be higher than a currently connected link. In other words, those definitions of utility fairly differentiate across currently connected links, but not across the currently nonconnected links. In the formulation of PLC in (12), motivated by the logic used in PROPHET [17], we track the short-term locality even when a link is not physically connected. This extended persistency in PLC is expected to improve performance over the existing age-based utility definitions as used in [19, 21].

The next design step is to dimension the parameter for capturing link localities at a longer time scale. From (12), the rate of change of the PLC per time slot can be written as

Equation (13) indicates that for a high (e.g., 0.9), increases fast when the link is connected and decreases slowly when the link is not connected. Conversely, for a low (e.g., 0.1), increases slowly when the link is connected and decreases fast when the link is not connected. Ideally, it is desirable that for a historically good link (i.e., connected frequently on a longer time scale), should increase fast and decrease slowly, and for a historically bad link, it should increase slowly and decrease fast. This implies that the parameter needs to capture the long-term history of the link; hence it should be link specific and time varying. Based on this observation, we define *Historical Connectivity Quality* (HCQ) of an on-body link at time slot as

The constant represents a measurement window (in number of slots) over which the connectivity quality is averaged. The factor , indicates the historical link quality as a fraction of time the link was connected during the last slots. The parameter should be chosen based on the human postural mobility time constants. Experimentally, we found the optimal values that work well for a large number of subject individuals and range of postures to be in between 7 sec. and 14 sec.

Figure 7 shows the evolution of PLC and HCQ with time. The top graph shows an example link activity (indicated by ) with the first half indicating a steadily connected link with a single time slot (1.4 sec.) of disconnection at time slot 10, and the second half indicates a steadily disconnected link with single slot of connection at the 41st slot. The top graph also shows the evolution of according to (14) with a set to 7 time slots. The bottom graph shows the evolution of with constant (i.e., 0.9 and 0.1) and link-specific time varying from (14), indicating the historical link quality. When the link is steadily well connected (during the first half), a high constant (i.e., 0.9) responds well to a momentary disconnection by decreasing slowly, but recovering quickly when the link becomes reconnected. A low constant (i.e., 0.1) responds poorly in this situation by doing just the opposite, that is, a fast decrease and slow recovery.

Similarly, when the link is steadily disconnected (during the second half), a low constant (i.e., 0.1) responds relatively better than a high constant (i.e., 0.9) by increasing slowly for a momentary connection, and decreasing quickly after the link becomes disconnected. The lines for two constant values clearly show that a single constant value for is not able to handle both good-link and bad-link situations equally effectively.

As hypothesized, the link-specific and time-varying , on the other hand, is able to handle both situations well by mimicking the behavior of during the historically good-link situation and that of during the historically bad-link situation. These results clearly demonstrate the effectiveness of the HCQ and PLC concepts for designing routing utilities that can capture both short and long-term localities of the on-body link dynamics. With this multi-scale approach, the proposed mechanism should be able to outperform both age-based (UTILITY) [19, 21] and probabilistic [17] routing protocols that use only short-term locality information.

Note that unlike the entities in Figures 2 and 3, the PLC and HCQ in Figure 7 show the link connectivity localities which depends on the short- and long-term history of the link. The localities captures in (12) and (14) are responsible for this memory-based behavior in Figure 7 in contrast to the instantaneous link behavior in Figures 2 and 3. Figure 8 summarizes the structural difference between PRMPL [36] and the UTILITY [19, 21] age-based protocol from the link locality capture standpoint. As shown in the figure, while UTILITY extracts only short-term locality from the link on-off dynamics, PRMPL extracts an additional long-term locality by observing the Historical Connectivity Quality (HCQ) as presented in (14). Additional complexity for PRMPL over OPPT, UTILITY, and RAND is expected due to its periodic computation of per-link HCQ and PLC.

The forwarding rule in PRMPL is identical to what stated for UTILITY-based forwarding in Section 5.3 with the utility function replaced by the postural link cost . Consequently, the forwarding probabilities , the forwarding matrix , and the delivery probabilities can be computed using (7), (8), and (11), respectively, and finally, the end-to-end packet delay can be computed as using (9).

### 5.5. Distance Vector Routing with Postural Link Costs (DVRPLC)

In DVRPLC, nodes maintain end-to-end cumulative path cost estimates to a common sink node. Let us define a *Link Cost Factor* (LCF) which represents the routing cost for the link (between nodes and ) during the discrete time slot *.* The update equations for LCF are formulated as [23, 24, 36]

When the link is connected, decreases at a rate determined by , where , is the Historical Connectivity Quality, as defined in (14). If the link remains connected for a long time, the quantity asymptotically reaches its minimum value 0. When the link remains disconnected, increases at a rate determined by the quantity and the difference between the current cost and its maximum value 1. This formulation ensures that a link's routing cost always reflects the likelihood of the existence of the link while capturing its historical connectivity trends. Note that the time evolution of LCF in DVRPLC follows a rationale that is very similar to that of PLC in PRMPL. The main difference is that while the LCF reduces for connected links, the PLC increases in such situations. Similar difference exists when a link remains disconnected. To summarize, like in PRMPL, the cost in DVRPC captures both short- and long-term link localities for minimum delay packet routing.

Let be the minimum end-to-end cumulative cost from node- to the sink node-. According to distance vector routing logic, when a node needs to forward a packet to the sink node and it meets a node , the packet is forwarded to node only if the condition is found true. In other words, a lower path cost through node indicates that the latter is more likely to forward the packet to node than what node 's chances are. That justifies the packet transfer from node to with a goal of minimizing the end-to-end packet routing delay.

Note that the DVRPLC protocol attempts to minimize end-to-end cumulative routing costs. The objective is that due to this end-to-end cost minimization, DVRPLC should be able to outperform (from a delay standpoint) PRMPL which always interprets its PLC only at the link level and not in an end-to-end cumulative manner.

To execute DVRPLC, each on-body sensor node- uses the periodic *Hello* mechanism, in order to gradually develop the values with all other nodes in the network. It also iteratively updates the quantity using the computed values with respect to all its neighbors. The node then uses the *Hello* mechanism to send the quantity , its end-to-end cumulative path cost to the common destination *node*- (e.g., node 6 in Figure 1), to all other nodes that are currently connected to *node*-. This way, each node gets updated about the path costs of all of its direct neighbors' to the common destination *node*-. The update equation for

where node- has the minimum among all the current neighbors of node-.

Because of its end-to-end nature, the forwarding rule in DVRPLC is based on the end-to-end cost as opposed to that based on local parameters or as used in UTILITY and PRMPL both of which do not rely on end-to-end cost. The distance vector forwarding rule for a packet from node- to destination node- can be formalized as follows. If node-*i* is a direct neighbor of node-, forward the packet. Otherwise find node- such that node- has the minimum among all the current neighbors of node-. Then forward the packet to node- only if ; otherwise, continue buffering the node as node-. With this forwarding rule, the forwarding probabilities can be expressed as

where represents the set of all on-body nodes and where is the set of all neighbors of node- during the th time slot. The forwarding matrix and the delivery probabilities can be computed using (7) and (8), respectively, and finally, the end-to-end packet delay can be computed as using (9).