## 2 Priority-based Coverage-aware Congestion Control (PCC)
### Protocol and Algorithm Design of PCC  
_PCC_ is a distributed protocol. First, a distributed protocol is more robust to node or link failures than a centralized protocol. Second, a distributed protocol does not have to collect global information and distribute centrally determined control information, which may introduce large overheads that are not acceptable in a WSN. Third, the distributed algorithm is more scalable in large WSNs. The protocol structure of _PCC_ is shown in Figure 4. It operates both at the network and the MAC layers, which are shown in the left and the right branches, respectively. As in the left branch, when new packets arrive (from the application layer of the node or from other nodes as in Figure 2) into the network queue (Part _1.1_ in _PCC_), we selectively drop packets in the queue during congestion according to an optimization algorithm (Part _1.2_ in _PCC_), introduced in the next subsection. Since our protocol is distributed, each packet \(i\) has an additional field in the header, \(P_{i}\), to store the cumulative survival probability of the packet along the path. Therefore, at a sensor node when a packet chosen to be dropped, we need to update the \(P_{i}\) for all the remaining packets in the queue. Furthermore, as in the right branch of Figure 4, when the MAC layer is ready to transmit a packet (Part _2.1_ in _PCC_), we need to update \(P_{i}\) of this packet with the probability that the packet will survive in the MAC/PHY link transmission from the node (Part _2.2_ in _PCC_), and the packet is then send it to the next hop (Part _2.3_ in _PCC_). When a sensor node \(A\) generates a packet \(i\), we initialize \(P_{i}=1\). Along the path from node \(A\) to the sink, all relaying nodes including \(A\) updates \(P_{i}\) based on the packet dropping probability in network layer and link layer transmission error and loss in the MAC/PHY layer. The cumulative survival probability of a packet reaching any node in the network is used to determine the dropping probability of the packet in the node. As we explained in Section 2.1, _PCC_ supports two priority classes of packets, _Event_ and _Non-Event_ packets. In any node in the network, suppose that the total buffer size is \(Q\) and in the queue there are \(N_{E}\)_Event_ packets and \(N_{N}\)_Non-Event_ packets with the total number of packets \(N=N_{E}+N_{N}\). We set up two thresholds, \(Q_{min}\) and \(Q_{max}\) as shown in Figure 2, for handling different kinds of packets and apply the following logic. 1. \(0\leq N\leq Q_{min}\): buffer all incoming packets. 2. \(Q_{min}<N<Q_{max}\): begin dropping _Non-Event_ packets while keeping all _Event_ packets. The dropping rate is selected such that the average number of _Non-Event_ packets \(\overline{N_{N}}=F_{N}(N)\). 3. \(Q_{max}\leq N\leq Q\): drop all _Non-Event_ packets and begin to drop some _Event_ packets. The dropping rate is selected such that the average number of _Event_ packets \(\overline{N_{E}}=F_{E}(N)\). Function \(F_{N}(N)\) and \(F_{E}(N)\) will be discussed later on. As we discussed in Section 2.1, the coverage fidelity and high _Event_ packet throughput are important objectives. Therefore, we cannot randomly select packets in the queue to drop. In order to achieve coverage fidelity we need to give fair chance to all packets from different sensor nodes in the network to reach the sink. In other words, assuming that the accepting probability of a packet \(i\) is \(k_{i}\) (i.e., (\(1-k_{i}\)) is the dropping probability), we would like to ensure that \(\forall i,j\), \(P_{i}\times k_{i}=P_{j}\times k_{j}\). In this case, we can guarantee that packets from different nodes have the same or similar probability to reach the sink.