## 2 Priority-based Coverage-aware Congestion Control (PCC)
### Protocol and Algorithm Design of PCC
Therefore, our scheme is to find \(K_{E}=[k_{1},k_{2},\ldots,k_{N_{E}}]\) and \(K_{N}=[k_{1},k_{2},\ldots,k_{N_{N}}]\) under the following constraints:  
\[\sum_{i\in N_{E}}k_{i} = F_{E}(N) \tag{1}\] \[\sum_{j\in N_{N}}k_{j} = F_{N}(N)\] (2) \[\forall i,j\in N_{E} P_{i}\times k_{i} = P_{j}\times k_{j}\] (3) \[\forall i,j\in N_{N} P_{i}\times k_{i} = P_{j}\times k_{j} \tag{4}\]  
Figure 4: A block diagram illustrating the overall structure of _PCC_. However, solving the above problem can result in conflicts. For example, consider three (Event) packets with \(P_{1}=0.1\), \(P_{2}=0.25\) and \(P_{3}=0.5\), and \(F_{E}(3)=2\). Solving the above problem yields \(K_{E}=[1.25,0.5,0.25]\). Note that \(k_{i}\) is the accepting probability within \([0,1]\), so \(k_{1}\) is not an acceptable probability measure. In other words, it is impossible to strictly guarantee the constraints (3) and (4). To resolve this, we borrow another popular fairness metric, _Jain's Fairness Index_([11]) \(\frac{(\sum_{i}x_{i})^{2}}{(n\epsilon\sum_{i}x_{i}^{2})}\), to give a relatively fair opportunity to packets. The optimization problem for both _Event_ and _Non-Event_ packets can be stated as follows  
\[\text{maximize}_{\{K\}}\quad\frac{(\sum P_{i}\times k_{i})^{2}}{N_{P}\times \sum(P_{i}\times k_{i})^{2}} \tag{5}\]  
such that  
\[\sum_{i\in N_{P}}k_{i} = F(N) \tag{6}\] \[\forall i\in N_{P}\quad k_{i} \in [0,1] \tag{7}\]  
where \(K\) is the decision variable and \(K\), \(N_{P}\), \(F(N)\) could be either \(K_{E}\), \(N_{E}\), \(F_{E}(N)\) or \(K_{N}\), \(N_{N}\), \(F_{N}(N)\) corresponding to _Event_ and _Non-Event_ packets, respectively. It is difficult to implement the quadratic optimization problem in Equation (5) with limited resources in the sensor nodes. Therefore, a simpler algorithm is required. Note that our initial objectives are Equations (3) and (4), so for both _Event_ and _Non-Event_ packets, the objective can be restated as  
\[P_{1}\times k_{1}=P_{2}\times k_{2}=\ldots=P_{N_{P}}\times k_{N_{P}}=c \tag{8}\]  
\[\sum_{i\in N_{E}}k_{i} = F_{E}(N) \tag{1}\]0 (9) \[\Rightarrow \sum_{i}\frac{c}{P_{i}}=F(N)\quad(\because\sum_{i}k_{i}=F(N))  
\(f_{drop}(N)\) is the dropping probability of the new packet given \(N\) packets in the queue. In our system, since the queue handler could drop any number of packets, _PCC_ can implement different kinds of \(F_{E}(N)\) and \(F_{N}(N)\) functions. Note that the basic purpose of \(F_{E}(N)\) and \(F_{N}(N)\) is to reduce the congestion as a result the dropping probability monotonically increases with the number of packets in the queue. In general, \(F_{N}(N)\) can be a linear, convex, or concave function within [\(Q_{min}\), \(Q_{max}\)] through two fixed points, (\(Q_{min}\), \(N_{N}\)) and (\(Q_{max}\), 0) as shown in the left part of \[\sum_{i\in N_{E}}k_{i} = F_{E}(N) \tag{1}\]1 Clearly, with the convex function, packets are dropped very aggressively resulting in lower buffer utilization, while the concave function is more conservative and will result in higher buffer utilization. The linear function is between the convex and concave functions. Input: \(\vec{P},F(N)\)  
Output: \(K\)  
```
1:Initial \(K\Leftarrow[0]\)
2:while TRUE do
3:for\(i=1\) to \(N_{P}\)do
4:\(k_{i}=\frac{F(N)}{\sum_{i}\frac{k}{P_{i}}\times P_{i}}\)
5:endfor
6:\(counter\Leftarrow 0\)
7:for\(i=1\) to \(N_{P}\)do
8:if\(k_{i}>1\)then
9:\(k_{i}\Leftarrow 1\)
10:\(counter\Leftarrow counter+1\)
11:\(\vec{P}\Leftarrow\vec{P}\setminus P_{i}\)
12:endif
13:endfor
14:if\(counter=0\)then
15:return\(K\);
16:else
17:\(F(N)\Leftarrow F(N)-counter\)
18:endif
19:endwhile
```  
**Algorithm 1** Optimization Algorithm  
When \(N>Q_{max}\), we begin dropping _Event_ packets. Furthermore, since we drop all _Non-Event_ packets, \(N=N_{E}\), which means the buffer is occupied only by _Event_ packets. Since the buffer utilization ratio should monotonically increase with congestion, it implies \(F_{E}(N)\leq F_{E}(N+1)\).