# Distributed Routing and Channel Selection for Multi-Channel Wireless Sensor Networks +
## 5 Towards a Completely Distributed and Dynamic Approach
### Proposed DRCS Scheme  
The proposed distributed channel selection and routing scheme DRCS for single-radio WSNs distributes transmission over multiple channels to dynamically adapt the current consumption in the nodes so that their remaining lifetimes are balanced. This extends the overall lifetime of the network. We define the _receiver channel_ of a node to be its designated channel for receiving all incoming packets. On the other hand, a _transmit channel_ is the channel to which a node switches temporarily to transmit, which is the receiver channel of its intended destination. According to DRCS, nodes select their receiver channels to enable distribution of traffic over multiple channels. Since nodes listen to their receiver channels by default, overhearing is limited to neighboring transmissions on a node's receiver channel only. Transmit channels are chosen dynamically to prolong the lifetime of the _neighboring node with the worst battery health-metric_. For example in Figure 7, assume that \(r_{A},r_{B},r_{C}\) are the receiver channels of the senor nodes \(A\), \(B\) and \(C\) respectively. At any time instance if \(A\) chooses \(B\) to be its parent, then it switches to \(r_{B}\) at the time of transmission, and then switches back to \(r_{A}\) when the transmission is over. At a different time instance if \(A\) chooses \(C\) to be its parent, it switches towhile transmitting. Thus notice that channel selection is tied to parent selection, which leads to route determination. Hence the proposed approach leads to a _joint channel selection and routing_ in the WSNs. As shown in Figure 8, the channel selection scheme in DRCS runs in two stages, which is described below. We assume that all nodes broadcast periodic beacon messages, which include their node ID, their receiver channel, the ETX value, and their battery health-metrics. First stageIn this stage, all nodes use a common default channel. Each node chooses a random backoff (this ensures that nodes choose channels one after another) and selects _the least used channel in its neighborhood_ when the backoff timer expires. This channel becomes the node's receiver channel, which it announces to its neighbors via beacon packets. If there are multiple channels that are least used, the tie is broken by choosing a random channel among the channels that make the tie. The purpose of such receiver channel selection is to ensure that the receiver channels are uniformly distributed throughout the network. All nodes store their neighbors as well as the neighbors' receiver channel information. After a certain time interval \(\tau\), the second stage begins. Second stageIn the second stage, all nodes switch to their receiver channels. In this stage, nodes dynamically perform parent selection, and consequently, their transmit channels, based on periodic assessments of the battery health and ETX parameters. This is done as follows. For any channel \(c\), each node calculates \(\mathcal{H}_{c}=\min\{H_{i}\}\)\(\forall\)\(i\in S_{c}\) where \(S_{c}\) is the set of neighbors that are in receiver channel \(c\) and \(H_{i}\) is the health metric of node \(i\). In order to transmit to the sink, nodes that are immediate neighbors of the sink switch to the common default channel for transmitting DATA packets (we assume that the sink always remains in the default channel). All other nodes choose a transmit channel \(c\) with a probability of \(\frac{\mathcal{H}_{c}}{\mathcal{H}}\), where \(\mathcal{H}=\sum\mathcal{H}_{c}\)\(\forall\) channel \(c\) in the node's neighborhood such that there is at least one neighbor that is in channel \(c\), whose ETX is less than the node's ETX. The term \(\frac{\mathcal{H}_{c}}{\mathcal{H}}\) ensures that the receiver channel of the node with the worst health-metric is chosen with the lowest probability. This mechanism minimizes the overhearing for the neighboring node that has the worst health-metric. After choosing the transmit channel, a node chooses the parent among all its neighbors on \(c\) that has the best path metric to the sink.