Cross-Layer Design for Smart Routing in Wireless Sensor Networks

radio enable for the deployment of large-scale and distributed systems that are designed with technologies that are most suitable to their applications. Various technologies may be selected based on throughput requirements, cost of deployment and energy efﬁciency. Software radio enables these systems to dynamically tune operating parameters around current networking conditions to improve capacity.

Next-generation sensor networks require performance optimization by considering both the potential performance that can be achieved and the corresponding impact on a node's energy capacity. This enables nodes to make more informed resource allocation decisions.
With that said, the dependencies of next-generation applications on various performance and energy factors vary. Many of these applications are critical and require immediate response such as those for physical security, industrial processes and infrastructure monitoring; however, those for temperature control and ambient light measurement, for example, are less critical and are able to conserve energy at the expense of less performance-heavy resource allocation. Hence, the aim is to create a flexible cross-layer platform for distributed WSNs that considers the criticality of the resource allocation for next-generation applications.
This chapter covers the main research areas that arise in designing smart routing protocols and require specific engineering attention: • Network Architecture -determining the optimal configuration of the distributed architecture and the deployment of WSNs at areas of interest to extend the WMN; • Optimization Metrics -identifying cross-layer performance and energy factors that impact resource allocation: application requirements, available routes, channel quality, battery life, physical (PHY) layer considerations (transmit power, operating channel and bandwidth), and the energy efficiency of the wireless communication protocol; • Criticality -defining the dependency of commercial applications on performance and energy considerations; • Route Selection -selecting the route with the optimal trade-off between performance and energy conservation for a given application criticality; • Coexistence -providing connectivity between heterogeneous communication interfaces to bridge sensor and mesh technologies such as Bluetooth and WiMax, respectively; and, • Energy Harvesting -quantifying the impact of replenishing energy reserves from kinetic, solar or heat energy on resource allocation.
Each of these topics will be covered in this chapter.

Network architecture
Wireless mesh networks (WMNs) are the architectural enabler for wireless sensor networks (WSNs). As mentioned, WMNs provide the opportunity to deploy WSNs in an incremental fashion to execute sensory applications at multiple locations of interest on a per-need basis; WMNs also provide an alternative to carrying Internet Protocol (IP) traffic in rural or hostile environments where access to fibre may not be available. This provides feedback of sensory data from a WSN to a centralized controlling station over a long haul through a mesh node that is assigned to govern a sensor cluster.
These specially-assigned mesh nodes, called cluster-heads, are selected based on proximity, or deployed to extend the network, to the sensory location(s) of interest. Cluster-heads provide a bridge to the mesh network and may assume supervisory control of their subordinate sensors, which are typically limited in their resources and computational capabilities. To perform these functions, cluster-heads are equipped with the additional resources to handle the traffic load, although they likely carry multiple types of traffic, only one of which may be sensory. A WMN enabling a WSN is presented in Figure 1. We design a network architecture to analyze the impact of smart routing on resource allocation for WSN applications with varying requirements. This architecture, presented in Figure 2, consists of multiple sensor clusters and an overlay WMN that spans roughly a one kilometer area. In this network, one sensor cluster is formed of high-bandwidth Ultrawideband (UWB) sensors that are suited to data intensive applications such as video monitoring; UWB is a high-speed alternative to Zigbee for sensor networks with low power consumption but is inherently short range [2]. A second sensor cluster of Zigbee sensors is deployed to execute a low bandwidth application such as temperature monitoring. The WMN uses WiMax mesh technology to connect these geographically distributed clusters to the central controlling stations. This station is responsible for communicating with an outside controller or processing center, or is the processing center itself. The communication technologies chosen are presented as a single scenario but typically depend on the range of communication required, node density and required bandwidth requirements of the applications of interest.
In terms of node interaction, cluster-heads perform supervisory control of sensors and optimize resource allocations for sensors that they govern. Sensors correspondingly inform their cluster-heads of the state of their resources periodically.
Ideally, mesh nodes, including cluster-heads, are organized in a hexagonal topology for maximum connectivity [1]. These mesh nodes are placed at the center of their clusters around which sensors are typically positioned randomly. However, while we would ideally like to maintain a hexagonal topology of mesh nodes, this may not always be practical because the organization of mesh nodes depends highly on the sensory locations of interest. For example, if a sensor cluster is deployed to monitor stresses on bridge infrastructure, or the military is interested in monitoring certain high security areas, it will likely not be possible to deploy a mesh node at an ideal location. It is important to note that, in networks for which a hexagonal mesh topology is not possible, network planners must be aware of potential single points of failure. In these cases, load balancing or redundancy should be explored to ensure that mesh nodes are not overburdened.
In this analysis, neither sensor nodes nor mesh nodes are wired to power sources. This allows us to explore a general architecture and expands the number of environments in which, and applications for which, the system can be deployed. In reality, certain mesh nodes may be connected to power sources if the locations in which the mesh nodes are deployed have power sources readily available. Another option is energy harvesting to replenish energy reserves over time, which we will cover later in this chapter.

Software radio
In wireless sensor networks (WSNs) that are based on multiple technologies, software radio is required to convert operating parameters between otherwise incompatible communication protocols. The conversion must consider the varying dependencies of these technologies on a number of characteristics that affect communication and performance. For example, in our network architecture, the cluster-head must convert transmission parameters between sensor and mesh communication technologies. These parameters include: • Operating bandwidth, • Transmit power, • Transmission frequency, and • Modulation scheme.
WSNs that are based on software radio enable for the deployment of large-scale and distributed systems that are designed with technologies that are most suitable to their applications. Various technologies may be selected based on throughput requirements, cost of deployment and energy efficiency. Software radio enables these systems to dynamically tune operating parameters around current networking conditions to improve capacity.

Cross-layer design
Layering systems are the norm in the design of communication protocol stacks. However, wireless systems are not always suited to the common layered protocol stack architecture. For example, in a layered architecture using the Transmission Control Protocol (TCP), a failed packet is considered a sign of congestion, as opposed to simply a lost or corrupted packet which is the case in wireless systems. For sensor networks, and smart routing specifically, given the need to conserve sensor energy and maximize application performance, cooperation between several layers in the protocol stack is crucial. This can only be achieved in a cross-layer architecture. Cross-layer design ensures that the route that best meets both performance and energy requirements can be determined. • Vertical calibration between layers (Figure 3f).
In next-generation wireless sensor networks (WSNs), a number of these protocols may be used. For example, upward information flow (Figure 3a) may be used to provide the application layer with available routes from the network layer, channel availability from the link layer and remaining energy information from the physical (PHY) layer. Furthermore, downward information flow (Figure 3b) or back-and-forth information flow (Figure 3c) may be used between the application layer and the PHY layer. For example, the application layer may inform the PHY layer of transmission parameters such as transmit power and operating frequency to use during transmission.
The design of a cross-layer optimization algorithm for WSNs that consider both performance and energy factors requires efficient communication between protocol stack layers such as the PHY, link, network and application layers. Direct signaling between application layers reduces latency in the communication between multiple layers and is crucial in the design of cross-layer optimization algorithms [9]. The direct signaling scheme for our protocol stack model is illustrated in Figure 4. The goal of direct signaling is to exchange information between important protocol layers for smart routing. This ensures that the required information to perform cross-layer optimization is retrieved, and allocation decisions are sent, with minimal delay. For example, the cluster-head's PHY layer will inform the application layer of the sensor and mesh node state information which includes energy rating information, surrounding interference and more. State information and coordination protocols to provide feedback to the cluster-head are covered in Section 9. The link layer and network layer will also inform the application layer of the channel conditions and available path information, respectively. Furthermore, upon executing the cross-layer optimization policy, the application layer will inform the PHY layer of the necessary resource allocations and the link layer of the next-hop information. Direct signaling enables these interactions with minimal delay for optimized and timely responses in our distributed network.
For any two non-adjacent layers, l x and l y , the propagation latency T DS l x ,l y for the direct signaling method is calculated as, where T L l x ,l y is the propagation latency between layers l x and l y in a traditional layered protocol stack with (n − 1) layers between them. Hence, the direct signaling method provides a speed-up factor of (n − 1) [9].

Problem statement
In solving the smart routing problem via cross-layer design, the goal is to solve the 4-tuple defined by, • Path (or next hop); • Operating channel; • Transmission power; and, • Throughput, to identify the most suitable path that satisfies both performance needs of an application and energy conservation considerations; this path routes data from a source sensor to a centralized controlling station. In doing so, the cross-layer optimization policy focuses on functions at three layers: path selection at the network layer; channel selection at the link layer; and, transmit power allocation at the physical (PHY) layer. Hence, the 4-tuple defines the operating point for the network in solving the resource allocation for a single transmission.
The 4-tuple forms the basis of utility functions that model the preferences of nodes in allocating various PHY layer resources to throughput; the optimization problem exists since these PHY layer resources also impact network lifetime. Utility functions quantify the performance benefits and power costs associated with the allocation prior to selecting the optimal operating point. In doing so, the criticality of the application plays a major role in determining the necessary tradeoff for the given sensor.

Network definition
Define our distributed wireless sensor network (WSN) N = (G(C l (V i , M i ), E l ), S) that is composed of a set of sensor nodes V i and mesh nodes M i to solve the smart routing problem. These sensor and mesh nodes are organized into clusters C l (V i , M i ) and connected in a two-tier network via directed link set E l . The nodes are connected according to a topology Figure 2.
We make the following additional definitions: • the set of all nodes in the network, Z = V i ∪ M i ; • the set of technologies available to each node in the network, • the number of sub-networks (sensor and mesh networks) in the distributed WSN, S N ; • the set of residual energies of all nodes in network, • the set of initial energies of all nodes in network, • the set of channels available to all nodes of a given sub-network, • the energy efficiencies of various communication protocols, Q = {q t vx |∀t v x ∈ T}; • the central controlling station, v j ∈ M i ; • a cluster-head node, v m ∈ M i ; • the maximum number of hops in a path, K ; • the number of hops in a single path, K ≤ K ; • the average battery replenishment rate from energy harvesting, r h ; • the path between any sensor v i and central controlling station v j through cluster-head v m , where the number of nodes along a simple path between v i and v j can be computed as, K = n(path v i ,v j ) ≤ (K + 1); and, • the (K + 1) x W x |V i | matrix, X, of all the paths from all sensor nodes in the network to the central controlling station, where W is the maximum number of paths over all nodes. |V i | is the cardinality of the sensor node set.
The selection of K limits the maximum number of hops along a path and, hence, the number of nodes used to route traffic. Communication protocols have varying dependencies on multi-hop routing given their ranges of acceptable transmit powers and operating ranges, and as such they will likely have different path lengths. However, energy consumption characteristics between a transmitter and receiver suggest that it is better for the network to reduce the number of hops in a path at the expense of using a higher transmit power [3]. Hence, based on our network topology, we set a self-imposed limit to reduce the path length. This is configurable given the network scenario in question.

Assumptions
To perform this study, we make the following assumptions: 1. All clusters perform periodic data delivery according to a Poisson process with exponentially distributed inter-arrival times of events with parameter λ; 2. Sensor node are frequency-agile and can tune their frequencies to select different operating channels; 3. Mesh nodes use software radio to communicate with both sensor nodes and mesh nodes over different communication technologies; 4. All nodes within a cluster use omni-directional antennas with equal gains; 5. Neither sensor nodes nor mesh nodes are wired to power source so that we may explore a general architecture; 6. Mesh nodes are placed in a hexagonal topology for topology optimality and maximum network coverage as discussed in Section 2; 7. Sensor nodes are aware of their positions and are equipped with the Global Positioning System (GPS). Sensor localization will be considered in future work; 8. The central controlling station contains a mesh node and is the sink of transmissions in the network; 9. Single channels are not used end-to-end for a path and each hop chooses a different operating channel; 10. Each sensor node follows a M/M/3/3 queueing model with three operating channels and no queue. This limits the competition between all nodes to only three channels to leave sufficient capacity available to carry relay traffic; and, 11. The cluster-head has real-time channel state information, which can be assumed because our sensor nodes are fixed, allowing us to assume a slow fading model.

Link utility function
In forming our optimization functions via cross-layer criteria, we define the communication resources r f associated with a wireless channel f ∈ F; F is the channel set of a given communication protocol. The capacity of a channel c f is dependent on a number of factors including r f , but in this study we focus on the case where where our resource of interest r f = (P t v x , f ) is the selected power at transmitter v x in sending data to receiver v y on wireless channel f , |H v x ,v y , f | 2 is the channel gain between v x and v y , N v y , f is the Gaussian noise power on the channel from the perspective of the receiver v y , and I v y , f is the interference of v y on channel f . As we form our link utility function, it evaluates the allocation of our resources ,v y , f and the power cost associated with transmitting at rate R v x ,v y , f over the link.
The use of the FDMA Shannon capacity allows us to perform adaptive resource allocations based on the real-time state of the network by relating the data rate to physical (PHY) layer parameters. In our study, r f = (P t v x , f ) only because we consider that all channels have equal bandwidths w f . However, since the Shannon capacity is theoretical, we limit the Shannon capacity with additional regulatory limits.
is the basis of the resource negotiation between a prospective transmitter and receiver in network and is shown in (3). It is formed from the receiver's perspective as the difference between a benefit function and a cost function. Figure  5 shows a sample plot of the link utility function represents the benefit gained as a function of R v x ,v y , f . This is modeled by a logarithmic function which is monotonically increasing and follows the law of diminishing returns. As a result, an initial increase in R v x ,v y , f is more important to a node than further increases in R v x ,v y , f as the node approaches the incoming channel capacity, The second term is the cost function that models the power cost of utilizing a link in a path. The cost is a function of the energy efficiency coefficient of the technology used for the communication link, q t vx ∈ Q. By multiplying q t vx by the ratio of l/m, we retrieve the energy efficiency for the full packet size including overhead. The power consumption in sending a packet over the prospective link (in watts) is found by multiplying q t vx (in joules/bit) by the transmission rate R v x ,v y , f (in bits/sec). The result is the amount of energy over time, or power, used in transmitting a packet over the link. By considering the Shannon rate in (2), we observe that the link utility is a function of physical resources for both throughput and power cost. ψ(E) is a function of the transmitter and receiver's residual energy E, which represents the maximum of the inverse residual energy of the transmitter v x and receiver v y as, Hence, if either the transmitter or receiver of the link have a low residual energy, the cost of using the link increases. In this manner, we encourage the optimization algorithm to select nodes with higher residual energy in the network.
Since the range of available transmit power is small (on the order of milliwatts or microwatts), the algorithm is sensitive to small changes in link cost. Consider a situation where a node has half of its battery power remaining. While it should be able to operate normally, a doubling of the link cost, in the absence of a function like ψ(x), forces the selection of zero transmit power. The effect is worse at larger R due to a higher link cost. As a result, ψ(E) scales the power cost to operate within the limits of the optimality range.
for a Ultrawideband (UWB) and WiMax transmission, and of the form, for a Zigbee transmission. The two forms of ψ(x) are due to the achievable rates of the communication technologies of interest and the scale required to fit the power cost within the necessary operating range.
The α, β, γ, and δ parameters are coefficients of the empirical benefit and power cost that define the criticality of the application, which will be covered in Section 8. The parameter α scales the empirical benefit to provide a greater weight to the utility gained by achieving a higher transmission rate. Meanwhile, the three scaling factors, β, γ and δ are parameters in ψ(x) that may be obtained via curve-fitting after determining the desired operating points for a particular networking configuration as a function of E.
Based on this information, it is necessary for the cluster-head to receive feedback of the real-time residual energies of sensors. This is achieved through the feedback of hello messages that will both announce presence in the network and provide feedback of node state information to the cluster-head. If the cluster-head is required to perform the cross-layer optimization in between two received hello announcements, the cluster-head will extrapolate the residual energies of both v x and v y based on the elapsed time since the last update to ensure accurate optimization.
The necessary coordination protocols will be covered in Section 9.

Objective function
The profit function, U a v i ,v j (t), calculates the suitability of candidate path path v i ,v j = {v i , ..., v m , ..., v j } to route a message from a source sensor v i to the central controlling station v j through cluster-head v m . The profit function shown in (6) is our objective function where the goal is to find the candidate path with the maximum profit, U a * v i ,v j (t). The profit gained by using a candidate path is calculated as the average of the optimized link utilities, L * , across each hop along a path.
is formed of two summations that separate the optimization of the sensor cluster and mesh network portions of a path. The first summation represents the sum of link utilities as computed via the optimized link utility function L * across all nodes along a candidate path inside the cluster only; g represents the number of hops along the path within the cluster before reaching cluster-head v m and is computed as The second summation represents the sum of link utilities for a candidate path.
We divide the utility sum by the hop count of the path to calculate the average link utility in the path. By doing so, we are able to more closely analyze the difference between a k-hop path and (k+)-hop path in choosing the optimal route. If we were to use total rather than average link utility, the algorithm would favor the (k+)-hop path as the summation of more link utilities leads to a higher U a v i ,v j . In a power-constrained network, this over-utilizes already limited resources. Hence, by evaluating the average link utility, we are in fact reducing latency and conserving power. It should be noted, however, that, if a path with more hops has the highest average link utility U a * v i ,v j , it will be chosen by the optimization policy as the path with the best tradeoff between performance and energy consumption across all candidate paths.

Constraints
The constraints on the optimization as presented in (6) provide the boundaries for the selection of optimal resource parameters for both sensor and mesh nodes. The first constraint, provides a power allocation restriction that a cluster node v x+1 in an end-to-end path cannot receive and transmit on the same channel f x , that is f x = f x+1 . This restricts node v x and v x+1 , which are successive nodes in a path, from allocating power on the same transmission channel. The second constraint, is the corresponding power allocation restriction for the mesh network.
The third constraint, P v x , f x , P v z , f z ≥ max(P MIRS , P SNR , P min ), ∀v x , v z ∈ path v i ,v j , restricts the minimum power that the receiver can receive. P MIRS corresponds to the minimum input signal power at the receiver, or the minimum input receiver sensitivity (MIRS), defined in Table 1. The P SNR constraint is the minimum power required to reach the signal-to-noise ratio (SNR) threshold at the receiver. The third term, P min , represents the lower bound on the transmit power that keeps There is a fourth factor that is the lower bound on the available capacity at the transmitter, which is zero and is thus ignored.  [12][13][14][15] The fourth constraint, The final constraint limits a path to at most K hops to reduce power dissipation due to routing.

Steps in resource allocation
The cluster-head executes the following steps to perform resource allocation for a sensor v i : 1. Path Identification: The cluster-head forms the (K + 1) x W path sub-matrix, A ⊂ X, of the available paths from v i to the central controlling station v j . For the purposes of this chapter, we will assume that X is known.

Power Optimization:
The cluster-head optimizes the transmit powers across all links for each candidate path a ∈ A for v i using (4) and (5). The cluster-head stores the optimized

Channel Optimization:
The cluster-head ranks channels according to their optimized link utilities to find the most preferred channels of a node along a candidate path. The cluster-head will attempt to allocate the most preferred channel at each hop. However, since this may not always be possible given channel constraints, it may be necessary to iterate over possible bin combinations to find the valid combination with the largest link suitability over all links. The optimal valid channels for path a are denoted as f * 1 , . . . , f * K . 4. Path Optimization: The cluster-head assigns an overall suitability coefficient or profit, (6) as the average link utilities using the optimal channel allocation f * 1 , . . . , f * K for the path. 5. Path Selection: The cluster-head ranks the paths by the suitability coefficient and selects the candidate path with the highest U a v i ,v j . The suitability of the selected path is denoted as U a * v i ,v j and the cluster-head will retrieve the corresponding frequencies f * 1 , . . . , f * K , transmit powers P t * 1, f * 1 , . . . , P t * K, f * K , and rates r * 1 , . . . , r * K . 6. Routing Decision Propagation: The cluster-head will inform each node v x (sensor or mesh node) along the selected path of their necessary operating frequency f * v x , transmit power P t * v x , f * vx , and next-hop v y in a routing decision update (RDU).
,v y , f k ) solves the smart routing problem.

Application criticality
The criticality c r of an application is defined as, which represents the ratio of the weights placed on the empirical benefit and power cost, respectively. At one extreme, c r (∞, E) allocates maximum resources towards throughput performance, while, at the other extreme, c r (0, E) emphasizes energy conservation for minimum energy routing. The associated optimized link utility L * v x ,v y , f for minimum energy routing is, where the goal is to minimize the link's power cost. The corresponding objective function is, where the effect of minimum energy routing is seen in the third constraint, which enforces that the minimum required power to transmit between node pairs is chosen.
The impact of application criticality on resource allocation will be analyzed by comparing the throughput performance of smart routing versus minimum energy routing.

Packet formats
In gathering the required node information for the cross-layer policy, we define the state of a node v x that includes: • Node identifier (NID): the ID of sensor or mesh node v x ; • Sub-network identifier (SNID): the ID of the sub-network (sensor or mesh network) in which the node v x resides; • Energy rating information (ERI): the remaining energy of node v x in the form of a percentage of the initial energy capacity, e v x /E v x ; and, • Surrounding interference temperature (SIT): the measurement of the surrounding interference plus noise (I + N) energy as measured by node v x .
State information is broadcasted to announce presence in the network and is also used in the propagation of resource allocation to nodes selected during the optimization process using a coordination channel. The state information above and the position of a node are all that a cluster-head requires to optimize a request.
From this point onwards, we shall denote V and M as the cardinalities of the sensor and mesh nodes sets as V = |V i | and M = |M i |, respectively, to simplify equations.

Hello messages for presence broadcast
Node state information is used in the formation of hello messages sent between mesh nodes, and also between sensor nodes and their cluster-heads to announce presence in the network. The exchange of hello messages maintains accurate connectivity tables at the cluster-head. These hello messages also update the cluster-head's knowledge of the state of a sensor or mesh node v x in terms of remaining energy capacity.
The hello packet format is presented in Figure 6 where the LAT and LONG fields represent the latitude and longitude of the node, respectively, using GPS. The node identifier (NID) field is used to identify the source of the hello packet and, hence, is the number of bits necessary to represent the node identifier. Thus, the NID field has a length of ceil(log 2 (V)) or ceil(log 2 (M)) bits depending on if the sender is a sensor or mesh node. The sub-network identifier (SNID) is the number of bits needed to identify the sub-network in which the node resides. The energy rating information (ERI) field is 14 bits in fixed point number representation to represent the percentage of initial energy capacity remaining (using a scaling factor of 1/100), i.e. sending 14 bits that represent 10,000 in decimal yields an ERI of 100.00%; we use fixed point number representation for the ERI field, as opposed to single precision floating point (32 bits long), because the ERI has a fixed number of digits -two -after the decimal point. Hence, we reduce the number of bits needed to represent the residual energy.

NID SNID ERI SIT LAT LONG Padding
PD bits 32 bits 32 bits 32 bits 14 bits ceil(log2(SN)) bits ceil(log2(V)) or ceil(log2(M)) bits The surrounding interference temperature (SIT) field, on the other hand, given real-time variations in the level of interference, is represented in full 32-bit single precision floating point format. Full 32-bit single precision floating point is also used to represent both the LAT and LONG fields. As nodes are stationary, it may only be necessary to include the LAT and LONG fields in the initialization phase to inform cluster-heads of node positions, after which it may not be required. Nevertheless, we include the LAT and LONG fields in the hello message, while P D bits of padding may be used to fill out the packet.
Data aggregation is also critical in these networks to preserve sensor energy and reduce the amount of routed information in the network. Figure 7 illustrates an example of data aggregation in a distributed wireless sensor network (WSN) in which presence information is exchanged and specific data aggregation nodes are used to merge information from one or more neighbors. In the example presented, the identifiers of the sensors in the sensor cluster are aggregated at node 4 and node 5 to give a single message to the cluster-head at node 6 of the NIDs [1 2 3 4 5]. Data aggregation for presence information occurs in both the sensor and mesh networks where all mesh nodes are data aggregators and exchange information until there is a consistent view among all mesh nodes.
For a distributed WSN of S N = 3 sub-networks (with two sensor clusters and the mesh network presented in Figure 2), V = 1, 000 sensor nodes per cluster and a mesh network composed of M = 7 mesh devices, the hello packet has a length of 16 bytes. This includes ten or three bits for the NID field, and padding of six or thirteen bits, depending on if the source is a sensor or mesh node, respectively.
We design one hello packet format for both the sensor and mesh network to simplify the system design process and to reduce decoding complexity. A packet length of 15 bytes could have been used in the mesh network, but we choose to have a common packet format at the expense of a transmitting an extra byte of padding. With that said, separate packet formats may need to be considered depending on the number of sensor and mesh nodes in the network and the overhead associated with using a single format.

Routing decision updates
Upon determining the optimized resource allocation for a request from a source sensor v i , a cluster-head v m will propagate a routing decision update (RDU) to each node v x ∈ path v i ,v j . The RDU is sent backwards along the path in the sensor network to the source v i , and forwards along the path in the mesh network to the central controlling station v j as shown in Figure 8. This ensures that all nodes along the path are aware of their necessary resource allocations. The cluster-head will include the following parameters such that all nodes can update their forwarding tables with up-to-date information: • Sending sensor identifier (SSID): the ID of source sensor v i that is the origin of the request; • Request identifier (RID): the ID of the request being serviced at source sensor v i given that sensors may support multiple requests; • Previous-hop identifier (PHID): the ID of node v x−1 from whom v x will receive packets; and, • Next-hop identifier (NHID): the ID of node v x+1 to whom v x will forward packets. where the resulting format of the RDU is presented in Figure 9. Additionally, the cluster-head will include the node identifier (NID) of each node along the determined path such that they can retrieve their necessary operating parameters when they receive the routing decision. The message will also include the transmit power POW (each hop in 32-bit single precision floating point format), and operating channel FRQ (four bits to represent the channel number to be used per hop) determined during the optimization process, and the sub-network identifier (SNID) of the sub-network in which the node resides. P D bits of padding may also be used.
The RDU packet is designed such that each RDU contains information for at most (K − 1) hops, with separate RDUs being sent backwards through the sensor network to the source and forwards through the mesh network to the central controlling station. Recall that, since the cluster-head acts as a bridge between the sensor cluster and the mesh network, at least one hop must reside in each sub-network. Hence, information for only (K − 1) hops is required.
For the RDU, we design our network with separate packet formats for the sensor and mesh networks, as the overhead associated with a single format is significant. In our case, the mesh network would need to transmit over eight bytes of overhead per RDU packet if we were to use a single format. As a result, given the same network conditions as for the hello packet, the RDU has a length of 27 bytes and 19 bytes for the sensor and mesh networks, respectively.

Data packets
In the data transmission process, upon receiving a data packet from the previous-hop identifier (PHID), an intermediate node v x path v i ,v j will set their next-hop based on the next-hop identifier (NHID) provided by the cluster-head in the routing decision update. Data packets will be formed of the transmitting node's node identifier (NID), originating sensor's identifier (SSID), request identifier (RID), and the following: • Payload information: the gathered sensory information for feedback; and, • Transmission priority level (TPL): the priority of the transmission (high or low) for routing preference (optional).
While transmissions from different clusters may be of different priorities, typically transmissions from a given sensor cluster all have the same priority at any given time. Hence, it is optional and configurable for the network scenario in question.

Simulation
Our distributed network is formed of a V-sized Ultrawideband (UWB) sensor cluster and a V-sized Zigbee sensor cluster that are connected to a central controlling station via an M-sized overlay mesh network. The network spans a 1 km x 1 km campus area for which V = 20 sensor nodes (excluding the cluster-head) and M = 7 mesh nodes. We simulate a small network size without loss of generality. The UWB cluster is focused in a 10 m x 10 m area for a video feedback application, while the Zigbee cluster performs temperature sensing in a 75 m x 75 m area such as a computer server room.  In terms of radio design, each Zigbee and UWB nodes uses a single transmit and receive antenna with gains of 0 dBi and 3 dBi, respectively. WiMax mesh nodes have transmit and receive antenna gains of 13 dBi and 16 dBi, respectively. For our operating parameters, we choose F 1 = F 2 = F c = 5 as the number of sub-channels in the spectrum band with corresponding bandwidths of w 1 = 75 MHz, w 2 = 12.5 kHz and w c = 6.25 MHz for UWB, Zigbee and WiMax, respectively. As can be seen in Table 4, UWB sensors also transmit four times the information per transmission than Zigbee sensors.  We also select the maximum number of hops K = 4 for a single candidate path and the energy consumption coefficient ζ = 0.5. According to Oppermann et al., "the amount of energy consumed while listening, receiving, and transitioning to receive mode is similar to that of transmitting, and cannot be ignored" and, as such, ζ is selected to divide the total energy consumption evenly between the transmitter and receiver [3]. The power consumption attributed to transmitting is higher than receiving in the communication between a transmitter and receiver; however, it should be noted that the energy consumed by listening for a transmission may be a dominant source of energy dissipation in these networks [16,17].

Energy modeling
Initial energy capacities depend heavily on the energy efficiencies of the communication technology. This is intuitive since each wireless transmission depends on the amount of energy consumed during communication. As a result, we equip sensor and mesh nodes with different energy capacities. The energy efficiencies of Ultrawideband (UWB), Zigbee and WiMax are presented in Table 5, along with the expected data rates of the technologies. We also test our network with arrival rates of sensor node requests of λ 1 = λ 2 = 0.1 requests/minute.  By considering each hop as a two-stage pipeline, we also implement holding times of 1/μ 1 = 3.04 μsec and 1/μ 2 = 2.43 msec per transmission. Hence, our network models traffic intensities of a 1 = λ 1 /μ 1 and a 2 = λ 2 /μ 2 . Table 5 presents the implemented energy capacities in the network for sensors, cluster-heads and mesh relay nodes given our system parameters. These energy capacities are determined as those to reach a one week network lifetime. Hence, we equip UWB and Zigbee nodes with E 1 = 17.5 J with E 2 = 69.5 J, respectively. The energy capacity of a mesh node is chosen as E m = 1 kJ. We implement sensor energies slightly under the required levels to analyze the performance of these nodes in the final stages of the network lifetime.

Energy harvesting
The most challenging factor facing the widespread deployment of wireless sensor networks (WSNs) is the power constraint faced by sensors that affects network lifetime and performance. Energy harvesting technologies are a significant enabler for smart routing because they relax the critical power constraint by replenishing energy reserves of sensors over time. This can be achieved by converting energy sources such as kinetic, solar or heat energy into usable battery energy.
The impact of energy harvesting can be observed by comparing the rate of energy replenishment to the rate of energy consumption in the sensor network. Define the rate of energy replenishment as r h in joules per second, or watt. Given an energy consumption rate r c of a sensor, the effect of energy replenishment on network lifetime fits into one of three categories: • if r h = 0, the network lifetime remains status quo; • if 0 < r h < r c , the network lifetime is prolonged but finite; and, • if r h ≥ r c , the network lifetime is theoretically infinite.
From the perspective of resource allocation, the effect of energy harvesting can also be observed by analyzing the network lifetime. The network is able to operate at peak performance as long as sufficient transmission resources are available; this occurs until nodes are unable to maintain a high level of performance because remaining energy capacities are insufficient. Since energy harvesting enables us to prolong the network, it also increases the period of time that the network operates at high levels of throughput performance. We will analyze the impact of the replenishment rate r h on the network lifetime for smart routing.

Results
We conduct a performance evaluation of our policy based on the following metrics: • Throughput performance; • Spectral efficiency; • Network lifetime based on finite energy capacity; • Application criticality and performance improvement of smart routing vs. minimum energy routing; • Blocking probability and its dependency on the number of operating channels in the network; and, • Energy harvesting effects on energy capacity and network lifetime for various rates of energy replenishment.

Spectral efficiency
Spectral efficiency provides an accurate metric to compare our three communication technologies in terms of the attainable transmission rate per Hz. This is presented in Figure 10 in

Network lifetime
While the smart routing protocol indeed provides throughput performance benefits, we also analyze the ability of the policy to conserve energy and meet a desired network lifetime of one week. This enables us to evaluate whether the policy successfully meets both performance and energy conservation requirements. Figure 11(a) presents the average remaining energy capacities of Ultrawideband (UWB) sensors, Zigbee sensors and the WiMax mesh nodes. The UWB and Zigbee sensors are able to survive for roughly the one week network lifetime, with the outages occurring just before the end of the simulation. At the end of the simulation, the WiMax mesh network has roughly 34% of its mean battery energy remaining.
These results meet our network lifetime expectations based on the initial energy capacities in Table 5. For example, we would expect that both the UWB and Zigbee clusters would lose connectivity in the last few hours of the network lifetime. We would also expect the mesh network to maintain roughly one-third of its energy capacity at the end of the simulation. This result is significant as it shows that we can indeed design wireless sensor networks (WSNs) to plan for predictable network lifetimes, while achieving significant throughput performance. Figure 11(b) illustrates the remaining energy capacities in the final twelve hours of the simulation and the first nodes in each cluster to fully lose connectivity. Based on the initial energy capacities selected, the UWB cluster gave us almost two extra hours of connectivity over the Zigbee network. In terms of the first node outages, node 12 from the Zigbee cluster was the first node to lose connectivity; its remaining battery energy was just under that of the mean from the Zigbee cluster at 20:15. For the UWB cluster, node 6 experienced the first node outage and followed the mean battery energy of the UWB cluster quite strictly at 22:00.

Application criticality
The impact of application criticality on throughput performance is presented in Table 7 by comparing the performance of the smart routing protocol to minimum energy routing. Smart routing selects candidate nodes that are best able to satisfy both performance and energy conservation requirements given current network conditions. While smart routing is able to achieve total network throughput that varies between 84.4 Mbps and 3.4 Gbps, minimum energy routing only achieves throughputs of 49.2 Mbps to 501.2 Mbps. This is due to minimum energy routing basing its resource allocation decisions solely on ensuring minimum energy consumption; while lower resource consumption certainly has a positive effect on increasing network lifetime, minimum energy routing gives no consideration to the impact of resource allocation on application performance. As we observe in this performance evaluation, applications that have high performance demands require greater resources and, as a result, have shorter network lifetimes; energy-conserving systems, on the other hand, allocate resources to prolong the network lifetime at the expense of application performance.   Figure 12(a) illustrates the dependency between the network blocking probability and the number of operating channels for the smart routing protocol. This shows that, as the number of operating channels increases, the blocking probability decreases according to a logarithmic relationship. However, as the traffic intensity ρ and the number of channels increases, the blocking probability decreases at a slower rate. Figure 12(a) also illustrates that the blocking probability decreases as the traffic intensity decreases, which is expected. The sharpness of  Figure 12(b) illustrates the relationship between the blocking probability and traffic intensity separately for Ultrawideband (UWB) and Zigbee for F = 5, F = 10 and F = 20 channels. Given the same traffic intensity and number of operating channels, the UWB cluster has a blocking probability that is approximately 2% lower than Zigbee on average for F = 5. For F = 10 and F = 20, UWB also has a lower blocking probability than Zigbee but the improvement decreases as the number of channels is increased. This bodes well for next-generation commercial applications for wireless sensor networks (WSNs) that use UWB as the communication technology of choice.

Energy harvesting
The impact of energy harvesting on energy capacity is illustrated in Figure 13. Figure  13(a) presents the energy dissipation of a single Ultrawideband (UWB) node with no energy harvesting for the one week network lifetime. Two energy states are observed -sleep state and transmission state. In the sleep state, the impact on energy capacity is a regular dissipation of energy due to the sensor operating in a low power state. In the transmission state, we observe a sharp decrease in energy capacity for the duration of the transmission. The energy dissipation during the transmission state is positively correlated to the energy efficiency of the technology. For the given energy capacity E 1 = 17.5 J for UWB nodes presented in Table 5, we compute the rate of energy consumption as r c = 28.6 μW. Figure 13(b) presents the impact of energy harvesting on the UWB node's energy capacity. We compare the energy capacity with r h = 0 μW with replenishment rates r h = 22 μW, 25 μW and 30 μW. For the first two cases, we observe an increase in the energy capacity over time and, hence, a prolonged network lifetime. However, the network lifetime is finite. This is observed for all cases where 0 < r h < r c . For r h = 30 μW, however, we seemingly have 100% energy capacity and hence an unlimited network lifetime. This is intuitive since the rate 12 Figure 13. Energy Dissipation and Impact of Energy Harvesting of energy replenishment is greater than the rate of consumption. In this case, the network is self-sustaining and can theoretically last forever.

Conclusions and future research
This chapter presented the smart routing protocol for large-scale networks that enables for the deployment of wireless sensor networks (WSNs) in geographically distributed locations of interest. Smart routing is based on performance measure and energy optimization using cross-layer considerations of the protocol stack. We presented the performance improvement of smart routing over minimum power routing in these distributed networks to illustrate the benefit of the smart routing protocol for enabling next-generation commercial applications. By doing so, we also presented the impact of application criticality on performance and network lifetime. Applications that have high performance demands require greater resources and, as a result, have shorter network lifetimes; energy-conserving systems, on the other hand, allocate resources to prolong network lifetime at the expense of performance.
We also covered energy harvesting and its impact on resource allocation. We determined that, since sensors are able to operate at peak performance as long as sufficient resources are available, energy harvesting enables us to maintain this level of performance for a longer period of time. If the replenishment rate r h is greater than or equal to the consumption rate r c , the network is self-sustaining and can theoretically survive on its own. Future research shall explore a number of areas to further the smart routing protocol: • Software Radio Modeling: Quantify the impact of packet conversion on energy reserves for multiple technologies including WiMax, WiFi, Ultrawideband (UWB) and Zigbee; • Distributed Source Coding (DSC): Design algorithms to reduce the amount of data that is routed from sensor networks based on the compression of multiple correlated sensor measurements. In this manner, energy may be conserved while maintaining performance; • Sensor Localization: Design sensor localization methods that are either triangulation-based or use a third-tier of nodes in the network, such as anchors, for which positions are known in the field. This reduces the dependency of the policy on GPS, until sensors equipped with GPS are made more readily available; and • Optimization Metrics: Model additional performance metrics such as delay, and additional physical (PHY) layer parameters such as bandwidth and modulation.

Author details
Sheikh Omar M. and Mahmoud Samy A. Faculty of Engineering and Design, Department of Systems and Computer Engineering, Carleton University, Ottawa, Canada