# COALA: A Protocol for the Avoidance and Alleviation of Congestion in Wireless Sensor Networks
## 3 Proposed Protocol Description
### Steady-State Phase  
The steady-state, which is explained in this subsection, begins as soon as the initialization phase is completed. Its operation is mainly based on the utilization of the neighbor tables that, as mentioned above, have been created, during the initialization phase, for all network nodes. A typical neighbor table of a network node contains the current values of the following parameters:  
* node ID,
* level number
* position
* energy
* buffer occupancy
* popularity index
* availability index
* vicinity index  
The overall data routing process, during the steady-state, is based on the current values of all neighbor tables that are dynamically updated. Specifically, similarly to [11] every network node, which has data to send to the sink, examines its own neighbor table and discovers the candidate recipients among its neighbors who have smaller level number, i.e., its neighbors, which are located at a level closer to the sink, if any. Therefore, at this point, each node neglects all of its connections with other nodes, which are located either at the same level with itself or at lower levels and focuses at the nodes that are placed at an upper level in the network taxonomy, as shown in Figure 0(b). In the case that there are at least two candidate recipient nodes having \(AI=1\), COALA protocol suggests that the transmitting node must relay its data through the node that has the minimum vicinity index. For instance, referring to Figure 0(b), if node 14 has data to send upwards to the sink, then it has two candidate nodes through which it can relay its data, i.e., node 9 and node 10. If these nodes are both available (i.e., have \(AI=1\)) then node 9 will be selected, since \(VI(9)=2/5=0.4\) and \(VI(10)=3/4=0.75\). This is because node 9 may receive data from 2 lower level nodes and transmit data to 3 upper level nodes, while node 10 may receive data from 3 lower level nodes and transmit data to 1 upper level node. Thus, theoretically node 10 is more likely to be congested than node 9 if normalized flow rate patterns are considered. This initial routing criterion enhances the corresponding initial consideration suggested in [11]. This procedure is carried on until the whole routing path has been determined. The selected path information is stored in the header of the data packets transmitted. In this way, every time that a node has data to send to the sink, a dynamically updated spanning tree is created in order to route all data load through the theoretically less probable to be congested shortest path. It is important to notice that this process is based on purely static information, which is well-known as soon as the steady-phase is terminated. However, in the case that the node that is selected to be the next to receive data, becomes unavailable (due to either buffer or energy limitations or lack of available upper level neighbors) the routing process necessarily changes. Specifically, the data has to be relayed via an alternative path. For this reason, COALA protocol proposes the utilization of a multivariable cost function that aims to evaluate the overall cost of every neighboring node, by taking into consideration the buffer occupancy, the dissipated energy, the level number, the availability index, the popularity index, the vicinity index and the geographical distance of this node.