## 4 Proposed Scheme
### Priority-Based Medium Access  
We propose a fully distributed medium access scheme such that the node with high score is likely to access the channel earlier than those with lower score. To facilitate understanding we begin with the limiting case such that the length of minislots vanish however the contention window remains fixed. Namely we let \(\delta=t_{c}/m\) and \(m\rightarrow\infty\). Thus choosing a minislot to transmit data corresponds to selecting a real number from the continuous interval \([0,t_{c}]\) which is the time instant to start transmission. In this case it is easy to find a fully distributed scheme without collision: for example Node \(i\) sets a timer for channel access at the beginning of each frame where the timeout is set to \((1-y_{i})t_{c}\). Then with probability 1 Node \(i^{*}=\operatorname*{argmax}_{i\in I}\left[y_{i}\right]\) will win the channel access. Thus if Node \(i^{*}\) is \(k\) hops away from the sink, the maximum-score data reaches the sink in exactly \(k\) frames with probability 1. If we consider a balanced tree for the data gathering tree, the maximum score data is retrieved in \(k\sim O(\text{log}(n))\) frames. In practice however, the minislot \(\delta\) cannot be indefinitely small. \(\delta\) should account for propagation delay and should be sufficiently long such that the transmission from a station can be detected by its neighboring nodes [28]. For example in 802.11a, \(\delta\) is given by 9 \(\mu s\). We propose a fully distributed priority based scheme when \(\delta\) is strictly positive and \(m\) is finite. The idea in the above case of continuous contention window with vanishing \(\delta\) was to _defer_ transmission based on the score. For \(\delta>0\) with finite \(m\), however, one should not defer transmission in a deterministic manner, otherwise once multiple nodes collide at a frame they will repeat colliding in all subsequent frames, resulting in a deadlock. In the proposed scheme a node defers the _participation_ in channel contention, by remaining idle during the first several minislots, say \(k<m\) minislots. Note \(k\) is determined based on the score. Since \(m\) is fixed, this has an effect of _shrinking_ the individual contention window to \(m-k\) for the sensor. We refer to such shrunk contention window size as the _effective contention window_ (ECW) for the node. The sensor selects a minislot for transmission randomly and uniformly over the remaining \(m-k\) minislots. Specifically the proposed scheme operates as follows. We introduce global system parameters denoted by \(\beta\) which is a strictly positive integer, and \(\gamma\) which is a strictly positive real number. Details on these parameters will be explained later. For Sensor \(i\) let us denote the data to be transmitted/forwarded by the score \(y_{i}\in[0,1]\). The counter \(c\in\mathbb{Z}_{+}\) is incremented each time collision occurs, and is reset to 0 once a transmission is successful. 1. Set the window length \(w\) as \[w=(2^{c}\cdot\lceil m\cdot(y_{i})^{\gamma}\rceil+\beta)\wedge m\] (2) where \(a\wedge b\) denotes \(\min(a,b)\) and \(\lceil\cdot\rceil\) denotes the ceiling function. 2. Select a minislot randomly from \(m-w+1,\ldots,m\) with the equal probability of \(w^{-1}\). The details are provided as follows. The idea is that a node delays channel contention by the number of minislots that increases with decreasing \(y_{i}\). Thus the sensors with higher \(y_{i}\) gets higher chance of transmission, since such sensors are likely to participate in contention earlier during the contention phase. The choice of the effective window size \(w\) given by Equation (2) renders the size be roughly proportional to \(y_{i}^{\gamma}\), if we ignore \(\beta\). The term \(2^{c}\) accounts for binary exponential back-off (BEB), _i.e._, ECW size increases exponentially with the number of successive collisions. An example is illustrated in Figure 2 assuming \(m=10\), \(\gamma=1\), \(c=0\) and \(\beta=1\). There are three contending sensors with ID 1, 2 and 3.