# Buffer with N Policy and Active Management
## 1 Introduction  
Energy efficiency of wireless sensor network (WSN) nodes is a key design factor, especially when they are powered by batteries, which is often the case. To reduce the energy consumption of these nodes, the so-called N policy was proposed to organize the buffer and transmission of packets efficiently. The idea is to suspend the output transmission periodically. Initially, the node only collects the arriving packets in the buffer, without transmitting them further. The queue is growing in the buffer, but the output radio is turned off, thus reducing the power usage of the node. This phase of operation, i.e., the energy-saving phase, lasts as long as the queue size remains below a critical threshold, \(K\). Once the queue size reaches \(K\), the output radio is activated, and the transmission phase begins. In this phase, the packets are transmitted, so the queue is drained, while new packets can still be inserted in the buffer. The transmission phase lasts until the buffer empties out completely. When this happens, the output radio is turned off again, and the second energy-saving phase begins. Then the scheme repeats, with alternating energy-saving and transmission phases. Naturally, some packets may arrive during the transmission phase. They are inserted into the queue and processed normally. This means, however, that in the transmission phase, the queue size may occasionally exceed \(K\). Therefore, the buffer size, \(N\), should be greater than \(K\), at least by a little bit. In the original N policy, passive queue management was assumed, i.e., an arriving packet could be dropped only when the buffer was overflowed and there was no morespace for another packet. The original N policy has already been researched in several papers, and solutions to the appropriate queuing models have been obtained (this literature will be reviewed in the next section). Using the results of these papers, we can predict very well the performance of a buffer with the N policy, given the parameters of the input traffic and the critical threshold. Unfortunately, there is very little we can do if we want to tune the performance of a buffer with the original N policy, i.e., achieve a desired queue size, throughput, energy consumption, or any trade-off between them. The only parameter we can use to adjust the performance is, in fact, the critical threshold \(K\). The value of this threshold has, unfortunately, a very small effect on the system energy efficiency. (This will be shown in Section 5). Therefore, we have limited abilities to adjust the system's performance. To overcome this, herein we consider an extended N policy, equipped additionally with active queue management. Namely, each packet may be removed randomly upon arrival, with the probability determined by the buffer occupancy. Moreover, two distinct parameterizations of dropping probabilities are used--one in the energy-saving phase and another in the transmission phase. It is evident that applying such active buffer management greatly expands our ability to tune the system's performance. We can adjust not only \(K\) but also the two functions that assign dropping probabilities to queue lengths in each phase (dropping functions). This enables controlling the queue size in each phase and the duration of each phase, and thus the contribution of each phase to the average system performance. Obviously, in order to consciously design a WSN node with the N policy and active management, we need formulae describing how its key performance characteristics depend on the two dropping functions, the critical threshold, and the arrival process. The goal of the paper is to find and prove such formulae for the model of buffer with the N policy and active management.