Adaptive Queue Management and Traffic Class Priority Based Fairness Rate Control in Wireless Sensor Networks

Congestion control in Wireless Sensor Networks (WSNs) is one of the key areas of research and different algorithms have been proposed using either of the notions of fair rate allocation, traffic class priority, and queue management. Use of the any one of the above is not adequate to address the challenges. Hence, in this paper, we have proposed a novel congestion control algorithm using the combined notions of fair allocation of bandwidth, prioritizing traffic classes, and Adaptive Queue Management (ADQM). The proposed Weighted Priority based Fair Queue Gradient Rate Control (WPFQGRC) scheme achieves the fair distribution of spare bandwidth by considering the traffic class priority, average queue size, and the connected loads of a node. Average queue size at every node is adapted based on the proposed notion of the gradient of the differential of Global Priority (GP) with respect to the differential of queue size. The output rate of a given node is computed based on the GP of the node and the average queue size. The spare bandwidth of a node is fairly distributed by taking into account the connected load of the given node. The proposed algorithm is developed to suit to a general topology of WSN, however for the sake of illustration, we have considered a tree topology network that deals with both Real-Time (RT) and Non-Real Time (NRT) traffic classes. The proposed algorithm is implemented in NS3 platform in Linux environment and the performance of the algorithm is evaluated in terms of throughput, packet loss, packet delay, traffic class patterns, node mobility, and the average queue size. The performance of the proposed algorithm is found to be superior to that of Yaghmaee et al.’s, Brahma et al.’s, Monowar et al.’s, Sarode et al.’s, Difference of Differentials Rate Control (DDRC), Weighted Priority based DDRC (WPDDRC), and Priority based Fairness Rate Control (PFRC) algorithms respectively.

Wireless Sensor Networks (WSNs) have multifold challenges [1] and with the advancement of technology WSN is able to effectively handle multimedia data such as image, video, and audio from the environment, and hence is known as Wireless Multimedia Sensor Networks (WMSNs) [2], [3]. Many sensor nodes with one or many base stations are able to make different topologies. WSNs have a wide range of applications such as environmental condition monitoring, patient health monitoring, structural health monitoring, animal habitat monitoring, defence surveillance, agricultural health monitoring, farm soil parameter testing, and industrial monitoring.
WSNs have many features [4], [5] including traffic characteristics, diverse applications, unique network topology, resource constraints, and small message size. The Quality of Service (QoS) is affected by limited power, lossy medium, limited resource, less storage capacity, dense deployment, low bandwidth utilization, and frequent change in topology, which results in low reliability, low energy efficiency and high congestion in the network [6]. Congestion is a crucial issue which occurs mainly due to collision, buffer overflow, and unfair transmission rate. This motivates many researchers to work on different congestion control and avoidance algorithms [7] to enhance the QoS of the network.
Multimedia data includes RT data which is gathered by the source nodes from the environment. Usually, the RT traffic is bursty [5], [6] in nature which requires high reliability and low latency, and hence prioritization is necessary for service differentiation. In this regard, the notion of traffic class priority is considered by Yaghmaee et al. [8] to propose a congestion control and rate control service differentiation model. In this model, they have considered four types of traffic classes such as RT traffic, low priority Non-Real Time traffic (NRT3), medium priority Non-Real Time traffic (NRT2), and high priority Non-Real Time traffic (NRT1) in separate queues. The performance of the algorithm is evaluated based upon low delay bound, high normalized throughput, and low loss probability. Yaghmaee et al. in their subsequent work [9] have used the notion of priority in monitoring the health conditions of different patients. Additionally, Swain et al. [10], [11] have also prioritized the traffic classes in their proposed rate control algorithms using their proposed notion of difference of differentials.
Besides the notion of traffic class priority, the notion of fairness has also been used to develop congestion control algorithms. Towards this end, an Interference-aware Fair Rate Control (IFRC) scheme is proposed by Rangwala et al. [12] by controlling the average queue size of topology with multiple base stations. To tackle the issue of fair distribution of bandwidth, a rate-based Fairness Aware Congestion Control (FACC) protocol is proposed [13] based upon queue occupancy and hit frequency. Subsequently, a traffic management protocol, decoupling the congestion control module and fairness module is proposed by Brahma et al. [14] to improve the bandwidth utilization of the network. The authors have adaptively calculated the optimum transmission rate to allocate bandwidth to each traffic flow to achieve optimum throughput and fairness of each node in random topology. To increase the efficiency of the network based upon the notion of fairness, Kafi et al. [15] have proposed a Reliable, Efficient, Fair, and Interference-Aware Congestion Control (REFIACC) algorithm to control the wireless losses and interferences in a large sensor network. Recently, in our previous work [16], we have proposed a Priority-based Fairness Rate Control (PFRC) scheme where the fair allocation of bandwidth is achieved based upon traffic class priority, the connected load, and fixed queue size. In [16], authors have considered a fixed queue size for all the nodes at a given level of the network. The fixed queue size can not take care of the changing traffic pattern at different nodes and might onset congestion. Therefore, the queue size needs to be take care of different traffic patterns. Besides, the priority of the traffic class can be considered together with the fair allocation strategy to enhance the performance while avoiding congestion. This motivates us to pursue further research with the combined notion of the GP and fair allocation of bandwidth in the Adaptive Queue Management (ADQM) framework to enhance the throughput.
Though the combined notion of priority and fairness is able to address the issue of congestion to some extent, the congestion of a network is still influenced by the buffer overflow. To circumvent the problem of buffer overflow, Warrier et al. [17] have proposed a differential backlog algorithm using cross-layer optimization and the notion of queue differential. Further, queue-based congestion detection and rate control algorithm is proposed by Liang et al. [18] by evaluating the congestion level at each node. The issues of congestion and hotspot of body sensors are addressed by a rate control scheme proposed by Monowar et al. [19], where they have developed a temperature rise model jointly based on the queue occupancy and traffic intensity. It is found in the literature that performance of priority and fairness based rate control algorithms depends upon the queue size despite overcoming congestion to a certain degree. It is also found from the literature that the use of either the notions of traffic class priority or fairness control could overcome the issue of congestion to a certain extent.
In a network of mixed traffic, both prioritization of traffic class and the fair allocation of bandwidth should affect the queue size, which in turn will control congestion. Thus, queue size at every node, if adaptively managed, may lead to congestion avoidance due to varieties of the traffic class. Hence, in this research work, we have attempted to develop an Adaptive Buffer Management strategy to overcome congestion in a network with different traffic classes. Our ADQM strategy takes care of the GP, a refined one to take care of RT traffic class, and the notion of fair allocation, which depends on the connected load of a node at a given instant of time. Thus, the proposed ADQM strategy jointly takes care of the effect of priority and fair allocation. Our key contributions are as follows.
• The average queue size of a node is updated based on the proposed notion of the gradient of the difference of GP with respect to the differential queue size of two different layers. This is intended to link the priority with that of the queue size which inturn plays a vital role in controlling the output rates.
• The output rate of each node is obtained based on the modified GP and the average queue size, which is updated at each instant. Since the output rate is dependent on the modified GP and average queue size, the rate is controlled based on the updated queue size and hence will help in overcoming the congestion.
• The spare bandwidth gets updated based on the average queue size. The updated rate of a node is computed taking into consideration the connected load of a node. This ensures the fair distribution of the bandwidth depending upon the connected load and priority thus avoiding the issue of congestion.
In this paper, we have proposed a new congestion avoidance algorithm based on the adaptive queue size management that takes into account the GP and fair allocation of bandwidth. The average queue size is updated by the Exponentially Weighted Moving Average (EWMA) notion reinforced by the newly introduced notion of the gradient of the difference of GP with respect to differential queue size. The modified GP and the updated queue size at a given instant of time are used to compute the spare bandwidth. The updated bandwidth is fairly allocated among other nodes based on the connected load and the updated queue size. Thus, the proposed algorithm is based on the aspect of prioritizing the traffic class, fairness control, and queue management at individual nodes. QoS parameters have been compared with seven existing techniques and found to have improved results. We have evaluated the performance of the proposed algorithm using the NS3 platform [20] in a Linux environment under limited node mobility conditions. The nomenclatures used in this paper are provided in Table . The rest of the paper is organized as follows. Section 2 provides related works and motivation while Section 3 presents the proposed rate control scheme. The concept of node priority is presented in Section 4. The weighted priority based fair queue gradient rate control scheme is described in Section 5 while Section 6 analyzes and discusses the experimental results and finally, Section 7 concludes the paper.

II. RELATED WORKS
In the early eighties, the issues of congestion control and avoidance were the research focus in the wireless paradigm, and in this regard in the year 1986, Jacobson and Karels have noticed the fact that bandwidth drops because of congestion collapses. This motivated Jacobson [21] to propose several new congestion avoidance algorithms followed by Floyd et al. [22]. Subsequently, a hop-by-hop control scheme is proposed by Mishra et al. [23] but their scheme does not take into account the TCP delay while this aspect is considered by Wan et al. [24] in their Congestion Detection and Avoidance Algorithm (CODA). Throughput and delay are the two key parameters of QoS in the network. In this regard, the issues of throughput instability and large delay in TCP are addressed by Zhai et al. [25] in multi-hop ad-hoc networks while Hull et al. [26] have addressed the issue of MAC layer protocol. Besides MAC layers, protocols in the transport layer have also been proposed in [27] to support multiple applications in the network. The congestion control algorithm is further improved by Sankarasubramaniam et al. [28] by proposing Event-to-Sink Reliable Transport (ESRT) scheme to detect reliable events in the network. The algorithms proposed in the above-mentioned research works don't work with all types of MAC protocols and also don't consider the notion of rate control. But the notion of rate control is considered by Alam et al. [29] while proposing a Congestion-aware and Rate-controlled Reliable Transport mechanism (CRRT) and by Liang et al. [18] for proposing a reliable transport protocol in WSN. Additionally, cross-layer optimization is also used to propose congestion control (DiffQ) algorithm [17].
In a wide variety of applications such as health monitoring, defence, environmental monitoring, and traffic surveillance, a huge amount of data are transmitted from source to sink. This leads to congestion which can be addressed using the notion of priority in the WSN. In this regard, Yaghmaee et al. [8] have proposed a priority based rate control mechanism in which the GP of each node is considered in a network. They have also extended their work [9] for different health care applications to monitor the health conditions of patients. Our earlier work [10] used the notion of traffic class priority to propose a priority-based adaptive rate control mechanism to control the congestion at each node. Priority concept is also used by different researchers [30]- [32] to improve the QoS of the network. It is found from the literature that using the notion of priority, QoS of the network could be improved but this could not overcome the issue of hotspots arising out of high data rate in the network. This problem is dealt by Monowar et al. [19] by proposing a single solution of the rate control scheme in WBAN.
It is known that unfairness in bandwidth distribution and queue overflow [33] are the major consequences of congestion. Therefore, the issues of fair distribution of bandwidth and queue management are addressed by researchers [33] to overcome congestion. Towards this end, Sarode et al. [33] have proposed three rate control mechanisms using buffer occupancy and priority traffic scheduler to achieve high reliability in long-distance transmission of packets. In [33], authors have not considered any queuing model at the node level. But the queue size of a node plays an important role in overcoming congestion. Queue size is considered in [34]- [36] to control congestion and inturn improve QoS. Rezaee et. al. [37] have used the concept of Active Queue Management (AQM) to propose an optimized congestion management protocol and a three-state machine to detect the congestion, and thereafter have extended their work [38] to health care applications. The notion of priority is also extended to wearable sensor based healthcare applications [39]. Despite using the notion of priority, there may be a possibility of heavy congestion during the transmission of medical data from a patient to the hospital server, that results in a huge amount of packet loss. To ameliorate this situation, a Relaxation Theory (RT) combined with Max-Min Fairness (MMF) mechanism has been proposed by Yaakob et al. [40] to increase the performance of the network. Recently, using the notion of priority queue, an IoT enabled WSN is also proposed by Chanak et al. [41] for smart healthcare applications.
The probability of congestion is higher near the sink node than that of other nodes due to the high flow rate of packets. To handle this issue, the notion of load balancing and fair bandwidth allocation along with the notion of priority have been considered by many researchers to avoid congestion. A scalable and distributed algorithm is proposed by Ee et al. [42] to control the congestion together with fairness for many-to-many routing in sensor networks. Subsequently, an Interference-aware Fair Rate Control (IFRC) scheme has been proposed by Rangwala et al. [12] to control the congestion by observing the average queue size in different topologies with multiple base stations. Further, to tackle the fairness issue, an Aggregate Fairness model with a localized Algorithm (AFA) has been proposed by Chen et al. [43] to fairly allocate the bandwidth in a network. The sole issue of fair distribution of the bandwidth is also addressed by Yin et al. [13] and Brahma et al. [14] to overcome congestion. In the context of fair distribution, Yin et al. [13] have proposed a rate-based Fair Aware Congestion Control (FACC) protocol to fairly allocate the bandwidth to different flows based on queue occupancy and hit frequency. But, Brahma et al. [14] have proposed a distributed congestion control to assign a fair and optimum transmission rate throughout the network. In these research works, authors have not considered the notion of priority together with the notion of fair allocation of bandwidth. It is to be noted that the joint use of fairness control and traffic class priority is expected to enhance the QoS effectively by overcoming congestion. In this regard, traffic class priority, fixed queue size at nodes of different layers of the network, and the connected load to a node are used in our previous work [16] to propose the a Priority based Fairness Rate Control (PFRC) scheme. The notion of fairness is also used to enhance the energy efficiency and network lifetime. A decentralized and Weighted Fairness guaranteed Congestion Control Protocol (WFCC) is proposed by Li et al. [44] and recently, a Reliable, Efficient, Fair and Interference-Aware Congestion Control (REFIACC) algorithm has been proposed by Kafi et al. [15] to control the link interferences in each node of a large sensor network.
Besides the notion of fair bandwidth allocation, load balancing also plays an important role in overcoming congestion. This notion is used to propose traffic-balancing routing algorithm [45], QoS-aware Cross-layered Multichannel Routing (QCM2R) scheme [46], Congestion-aware Clustering and Routing (CCR) scheme [47], and Congestionaware and Traffic Load balancing Scheme (CTLS) [48] using multisink and multichannel approach. Often, the networks encounter random load conditions which is a challenging task. The load balancing task under such a scenario is also addressed by Ding et al. [49] to propose an optimizing Routing algorithm for congestion control. The issue of congestion in a grid sensor network is different from the conventional sensor network and this is addressed where the routing decisions are fixed using the grid densities and grid hop-count [50]. Additionally, QoS of the network is enhanced by Secure Selective Dropping Congestion Control (S2DCC) scheme by Tortelli et al. [51]. Further, the notion of hierarchy is used [52], [53] to distribute the load to overcome congestion. Hierarchy-based congestion control and the energy-balanced scheme are also proposed [54] to avoid congestion.
Very Recently, optimization algorithms such as particle swarm optimization [55], cuckoo search [56] algorithms, Imperialistic Competitive Algorithm (ICA) [57] are used to optimize the rate adjustment at the child nodes and the parent nodes. Zhuang et al. [58] have proposed a Congestion-Adaptive Data Collection (CADC) scheme to achieve accuracy for high data rate in cyber-physical system, and this algorithm uses the notion of lossy compression. Further to enhance the QoS, Tan et al. [59] have proposed a Differentiated Rate Control Data Collection (DRCDC) algorithm to avoid the congestion using information entropy theory.
Though several congestion control algorithms have been proposed, there is scope to improve upon the congestion strategies considering queue size, traffic class priority and fair distribution of bandwidth. Thus, we are motivated to pursue the same using the above criteria.

III. PROPOSED RATE CONTROL SCHEME A. TRAFFIC CLASS PRIORITY
The RT and NRT traffic classes are prioritized in the proposed scheme. The NRT traffic class encompasses the high priority, medium priority, and low priority NRT classes and they are denoted as HNRT, MNRT, and LNRT respectively. Each of the traffic classes is assigned with different priority levels to differentiate the services. A node is categorized as either a parent node (Pi) or a child node (Cj). Hence, there are child nodes in a given j th layer followed by the i th layer of parent nodes. For the sake of illustration, a two-level hierarchy is shown in Fig. 1 but this can also be extended to multi-level hierarchy. There is a sink node followed by the parent nodes which are denoted as Q th , (Q + R) th , and (Q + R + S) th node. These nodes are designated as parent nodes which are connected to the child nodes ranging from 1, 2, . . . , (Q + R + S − 1) th . The proposed algorithm is developed for the general topology of Fig. 1 but for the sake of illustration, a specific topology is derived from the general topology with Q, R, and S values fixed at 5,3, and 2 respectively. This specific topology is shown in Fig. 2, which consists of one sink node, three parent nodes, and seven child nodes. In the network shown in Fig. 2, P1, P2, and P3 are the parent nodes and C1-C7 are the child nodes. The RT class is assigned to C1-C6, and P1 nodes, the HNRT class is assigned to C1-C4, C7, P2, and P3 nodes, the MNRT class is assigned to C1, C2, C5, C7, and the LNRT class is assigned to C1, C3, C6, P1, and P2 nodes. We have tested our proposed algorithm on this topology but the algorithm is also valid for the general topology.  Since four types of traffic classes are considered, we have defined the traffic class priority of each node as the sum of the source priorities. Then the proposed total priority for i th parent node and j th child node is defined as the sum of the product of traffic class priorities, geographical priorities, and the difference of the weighted RT class to the weighted sum of NRT classes as shown in (2) and (4). GP of each parent node is defined as the sum of the GPs of corresponding child nodes and the total priority of the parent node itself. Due to the unequal traffic at each child node, the transmission rate is also different for different nodes. So each node controls its transmission rate according to its GP i.e., r Pi out ∝ GP Pi . High priority nodes will have higher transmission rates than the low priority nodes. To achieve both fair and efficient transmission rate of each node, we have considered both the notion of prioritizing the traffic class and the notion of fair distribution of the spare bandwidth at the parent level and the sink level in the network.

B. PROPOSED MODEL
The block diagram of the proposed scheme is shown in Fig. 3.
The proposed scheme is validated on the tree topology shown in Fig. 2. As seen from Fig. 3, the Congestion Detection Unit (CDU) takes into account the difference of the output and the input rates of a given node to detect the onset of congestion. This information is fed to the Fairness Control Unit (FCU) which controls the rate to avoid the congestion. The Rate Adjustment Unit (RAU) takes input from the Fairness Control Unit (FCU) which gives rise to the fair allocation of the bandwidth to different nodes. The FCU takes into account the adaptive queue size of a given node from the Adaptive Queue Management Unit (ADQMU) and the Priority Adjustment Unit (PAU). FCU determines the spare bandwidth and using the same it achieves a fair allocation of bandwidth to a given node. The queue size of each node is adapted taking care of the redefined GP and the current queue size of the nodes. Specifically, the average queue size is adapted using the proposed notion of the gradient of the difference of the weighted GP with respect to the differential current queue size. This adapts the average queue size of every node. This in turn, helps the FCU achieve the fair allocation of bandwidth. Finally, the RAU adapts the output rates of individual units and feeds to Congestion Control Unit (CCU) which in turn updates the rates of all the child nodes to avoid the congestion.

IV. NODE PRIORITY
Prioritizing traffic classes plays a vital role in circumventing congestion. Based on the traffic class priority, the Source Priority (SP) and Global Priority (GP) of a node can be determined. These GPs of the nodes do play an important role in congestion avoidance. In our proposed scheme, GP is taken into account in the Adaptive Queue Management strategy.
Let T Sink s denote the service time of the current packet at the sink node and T Sink s denotes the average service time. Let r Sink out denote output transmission rate of the sink node and r Pi out denotes the output transmission rate of i th parent node. Let Q Sink (n + 1), Q Pi (n + 1) and Q Cj (n + 1) denote the average queue sizes of the sink, parent and child nodes at n th packet arrival. The traffic class priority (P Pi TC ) of i th parent nodes is defined as: where, m corresponds to the type of traffic class, m ∈ {RT , HNRT , MNRT , LNRT } and SP i m is the source priority of the i th parent node. In order to prioritize each of the traffic classes, we have assigned weights to each of the traffic classes but maximum priority is assigned to the RT traffic class which is by and large bursty in nature. With the above notion, using (1) the weighted total priority (P Pi w ) of the i th parent node is proposed as: where W RT denotes the weight of RT traffic class, and W HNRT , W MNRT , and W LNRT correspond to the weights of HNRT, MNRT, and LNRT traffic classes and the corresponding priority values assigned to them are 10, 6, 3, and 1 respectively, γ is a tunning parameter, 0 < γ ≤ 1 and P Pi GE is the geographical priority of i th parent node and its value is different for different terrain such as hilly area or plain area but in our simulation this value is taken as 1 for plain area throughout the simulation. This indicates that more priority is assigned to the RT traffic class than those of NRT ones while computing P Pi w . Similarly, the traffic class priority (P Cj TC ) of j th child nodes is computed as: where, m corresponds to the set of traffic classes, m ∈ {RT , HNRT , MNRT , LNRT } and SP Cj m is the source priority of the j th child nodes. Similarly, the weighted total priority (P Cj w ) of j th child node using (3) is defined as: where, γ is a tunning parameter, 0 < γ ≤ 1 and P Cj GE is the geographical priority of j th child node and assigned with a value of 1. The weighted GP at the j th child node (GP Cj w ) using (4) is expressed as: The weighted GP at the i th parent node (GP Pi w ) using (5) and (2) is found to be: where, C(i) is the number of child nodes connected to i th parent node. The weighted GP at the sink node (GP Sink w ) using (6) is computed as: where, C(Sink) is the number of child nodes connected to sink node. Thus, the GPs of the sink node, parent nodes, and the child nodes of the network are calculated. In the literature [8], [9], the total priority of a node is contributed by P TC and P GE . But, in our case we have changed the notion of priority by assigning proper weights to the RT and NRT traffic classes. In our prioritization strategy, we have assigned maximum priority to the RT traffic class while other NRT traffic classes are assigned with reduced priority. The total priority of a node is contributed not only by the P TC and P GE but also by the weights of the RT class and weights of the NRT traffic classes. This additional priority contribution due to the RT class and NRT classes takes care of the connected load of a node in addition to its geographical priority. However, this notion which was used in our earlier work [11], [16] is also used in this proposed work.

V. WEIGHTED PRIORITY BASED FAIR QUEUE GRADIENT RATE CONTROL (WPFQGRC) SCHEME
Queue management is one of the pivots while developing the proposed algorithm. Particularly, Adaptive Queue management is imperative to handle the issue of congestion. Before developing the algorithm, we present briefly the notion of Adaptive Queue Management.

A. ADAPTIVE QUEUE MANAGEMENT (ADQM)
The Queue size of a sensor node plays an important role in handling congestion in WSN. Increase in number of packets in the queue implies that further increase of rate would lead to congestion at an early stage whereas less number of packets in the queue indicates that the rate can be further increased before the onset of congestion. Therefore, the fairness of the rate control mechanism is quite a pertinent issue where the spare bandwidth at a given instant of time needs to be distributed with the fairness.
The congestion detection parameters used in the literature are packet loss, queue size, packet service time, packet service ratio, node delay, channel busyness ratio, channel quality, and queue utilization. One of the key parameters for the indication of congestion is queue overflow. Therefore, management of the queue size is one of the crucial problems in wireless sensor networks [17]- [19], [22], [29]. Each node has an individual queue size that varies with the data transmission. When the queue size exceeds the maximum threshold limit, the output transmission rate is increased and vice versa. In this process, the queue management system reflects on the transmission rates of each node in the network.
In this regard, a fair rate control mechanism has been proposed [14] to achieve an optimum transmission rate with the notion of decoupling the congestion control unit and the fairness unit. In [14], a fixed value of queue size is considered throughout the network. But, each parent node in the network as shown in Fig. 2 is connected to a number of child nodes and hence a fixed queue size for all the nodes may not appropriate to take care of the congestion using the notion of fair distribution of the bandwidth. This problem can be overcome by adapting the queue size of each node depending on the traffic. In this regard, Alam et al. [29] have proposed a Congestion-aware and Rate-controlled Reliable Transport (CRRT) scheme where they have used the notion of EWMA to determine the average queue occupancy at a given node. Subsequently, Manowar et al. [19] have also used the same notion for hotspot avoidance in implantable body area networks. We have addressed this issue by improving the existing notion of AQM.
Therefore, it is imperative to develop a novel ADQM strategy taking into account the dominant features of the network. In this research work, we have taken care of the GP and the connected loads of a given node to develop a novel adaptive queue management strategy.

B. WPFQGRC STRATEGY
In order to adapt the queue size, it is necessary to consider the connected traffic of a node and its priority. Besides, due to the nature and rate of the traffic class, the traffic priorities need to be assigned with proper weightage. Therefore, the average queue size at a given instant of time at the sink, parent, and child nodes should take care of both the priority levels and connected load.
The queue size of a node is dependent on its connected load for congestion avoidance and its update also depends upon the priority and queue size of the destination node. For example, if the queue size of the parent node P1 needs to be updated, its adaptation strategy needs to take care of the current queue size and the priority of the destination node i.e. sink node besides considering the priority and the queue size of itself. Therefore, it is intitutively appealing that the adaptation of queue size will be contributed by the gradient of the difference of GPs of P1 and the sink node with that of queue sizes of P1 and the sink node. Similar notion is adapted for child nodes as well. This proposed notion is used to reinforce the existing EWMA [29] notion. Let Q Sink , Q Pi , and Q Cj denote the average queue size at sink node, i th parent node and j th child node respectively. Fig. 4 shows the average queue size of each node and the gradients allocated with different nodes. It is known that the average queue occupancy of a node with the notion of EWMA [29] is given by, where, Q(n + 1) and Q(n) are the average queue sizes for (n+1) th and n th packet respectively, Q cur is the current queue size, and α is the tuning parameter between 0 and 1.
The queue size at (n + 1) th packet takes into account the current queue size and the average queue size at the previous packet. The increase in queue size necessitate the increase in rate to avoid congestion. In order to increase the transmission rate, the GP of a node needs to be changed accordingly. Since the GP of a node is affected by queue size, hence change in GP will affect the average queue size. Hence, as presented above, the change in GPs at two levels is expected to be affected by the change in the average queue size. Therefore, we modify (8) to propose the following adaptation of the average queue size.
. (9) where, GP w (n) Q cur (n) denotes the gradient of the differences, GP w (n) = GP w (n) − GP w (n − 1) and Q cur (n) = Q cur (n) − Q cur (n − 1). Where GP w (n) and GP w (n − 1) denote the weighted global priorities at n th and (n − 1) th packet respectively. Similarly, Q cur (n) and Q cur (n − 1) denote the queue sizes at the n th and (n−1) th packet arrivals respectively. In the topology shown in Fig. 4, the gradient is different for different connected nodes of either the sink node or the parent node. δ is a tunning parameter between 0 and 1. For example, the gradient at the sink will be evaluated based on the difference of GPs of the sink and the connected parent node with that of the average queue size. As seen in Fig. 4, there will be three gradients corresponding to three parent nodes. We need to compute the minimum average queue size at the sink node to overcome congestion. Therefore, we take into account the minimum of the three gradients. Therefore, (9) is modified with the proposed minimum gradient as, where GP w (n) Q cur (n) min denotes the minimum gradient between two nodes. The rate of change of gradient in (9) and (10) could often be more than unity and hence when multiplied by current value, will have large contribution to the queue adaptation. Therefore, the parameter, δ in (9) and (10) controls the queue adaptation rate. A large value of δ might lead to very large queue adaptation whereas very small value of δ VOLUME 9, 2021 will have very less contribution from the priority. In both the cases, performance of the network is affected and hence the parameter δ is tuned to obtain optimal throughput. Since, three parent nodes P1, P2 and P3 are connected to the sink node, the minimum gradient between sink node and i th parent node is computed as: Sink,Pi min (11) which can also be expressed as: where, are the gradients computed taking into account the sink node and the parent nodes.
is defined as the gradient of weighted differential GP to the current differential queue size between the sink node and the parent node P1. Similarly, correspond to the gradients while considering the sink node and the parent nodes P2 and P3 respectively. Next, we consider the parent nodes and the child nodes.
Let GP w (n) Q cur (n) Pi,Cj denotes the gradient of the difference of weighted GP of the i th parent node and the j th child node with that of the difference of the current queue sizes. It is to be noted that a given parent node is connected to many child nodes and therefore there will be different gradient values for different parent nodes. Analogous to the sink node case, we consider the minimum gradient Pi,Cj min which corresponds to the minimum gradient between i th parent node and j th child node and in this regard, the minimum gradients between different parent nodes and child nodes are expressed as: Accordingly, the gradients are computed between the sink node, parent nodes and the child nodes. According to (10), the updated average queue size at the sink node using (12) is given by: Using the above minimum gradients (13) the average queue size of i th parent node is updated as: where, α Pi is a positive constant for i th parent node and is between 0 and 1, δ Pi is a gradient weight parameter between 0 and 1, Q i cur is the current queue size of the i th parent node. Analogously Q j ADQM (n + 1) for a child node is: . (16) where, α Cj is a positive constant between 0 and 1. δ Cj is a weighting parameter between 0 and 1 and Pi,Cj denotes the gradient between the i th parent node and the j th child node. The gradient of each child node is the only gradient computed using the connected parent node. Hence, the minimum gradient for a child node is the only available gradient as provided in the last term of (16). It is to be noted that the output transmission rate at the sink node (r Sink out ) is inversely proportional to the average service time (T is computed using the notion of Exponential Weighted Sum, which is defined as: where, α 1 is a constant, 0 < α 1 ≤ 1. As seen in Fig. 4, the parent nodes P1, P2 and P3 are connected to the sink node and hence the output rate of the sink node r Sink out is dependent on the weighted GP and the average queue size of the parent node and sink node as well. The queue size at the given node can be controlled to avoid congestion. If the queue size is less, then the output rate of the node can be increased further till the queue size is sufficient for the onset of congestion. The output rate of a given node is proportional to the weighted GP (GP w ) of that node and inversely proportional to the average queue size of the node. Hence for the sink node, the output rate using (7) and (14) can be expressed as: Analogously, for the i th parent node the output rate is given by, Taking the ratio of (18) and (19)  Hence, the output rate of the i th parent node using (20) can be expressed as: where k is the proportionality constant. Selecting k to be unity, (21) reduces to, . (22) In the same line as above, the output rate of a child node can be expressed as: where, r j out is the output transmission rate of j th child nodes. The parent nodes are transmitting data to the sink node and hence the output transmission rate of each parent node contributes to the input transmission rate of the sink node. Hence, the input transmission rate of the sink node (r Sink in ) can be expressed as: r Pi out (n + 1). (24) Similarly, the child nodes are transmitting data to their corresponding parent nodes. Hence the input transmission rate of the i th parent node (r i in ) is given by, where r j out is the output transmission rate of j th child node. C(Sink) and C(i) denote the number of child nodes of the sink node and the number of child nodes of i th parent node respectively.
It is known from the literature that Katabi et al. [34] have proposed the desired increase or decrease of the number of bytes of the aggregate traffic transmitted in a control interval. Thus, according to Katabi et al. [34] the aggregate feedback (φ), in terms of the number of bytes, is computed in the control interval and is given by, where β and λ are tuning parameters used for stability, d is the average Round Trip Time (RTT), S is the defined as the difference of link rate and input traffic rate, and Q is the persistent queue size. Dividing both sides of (26) by d we obtain, Since d is the time during which φ bytes are transmitted, the ratio φ d can be perceived as the aggregate transmission rate ( r). Before onset of congestion, the maximum output transmission rate (r out ) is equal to the link capacity. Therefore, the spare bandwidth (S) which is the difference of link capacity and the input traffic rate, can be expressed as (r out − r in ). Besides, the queue size Q in (27) is the average queue obtained by the proposed ADQM strategy which is denoted by Q ADQM . Hence, the aggregate transmission rate for ADQM strategy ( r ADQM ) can be expressed as: where, β and λ are the stability parameters and are related as λ = β 2 √ 2 [34]. T cl is the control interval [14], which is defined as: where, T Quedelay is the queueing delay, T Interpktarrtime is the inter-packet arrival time and T MACpkttime is the MAC packet transmission time. Hence, using (28) and (29) the aggregate transmission rates of sink and parent nodes can be computed as: r Pi ADQM (n + 1) = β · (r Pi out (n + 1) − r Pi in (n + 1)) From (30) and (31), it may be noted that the distributions of spare bandwidths S Sink or S Pi are tantamount to the distribution of the aggregate transmission rate r Sink ADQM or r Pi ADQM . Therefore, the aggregate transmission rates ( r Sink ADQM ) and ( r Pi ADQM ) are distributed in a fair way among the connected loads of sink and parent nodes. In our earlier work [16], we have considered fair distribution among the nodes depending on the connected load of a given node. Adhering to the same notion, the updated transmission rate propagated by the sink node to the i th parent node, is given by; r Pi out,ADQM (n + 1) where L Sink is the connected load to the sink. Similarly, the new updated output transmission rate propagated by the i th parent node towards the j th child node after the fair distribution of the aggregate transmission rates among the respective loads (L Pi ) of i th parent node, is given by; r Cj out,ADQM (n + 1) The updated rates at the sink node, parent node, and child node are thus determined depending on the adaptive queue size of a given node. The flowchart of the WPFQGRC algorithm is presented in Fig. 5.
In the proposed scheme, the adaptive queue management depends on the gradient of change in GP of a given node with that of the change in queue size. Further, for a given parent node at i th level, the minimum gradient is considered among all the connected child nodes. Hence, the algorithm is valid for any number of child nodes connected to the parent node. Similarly, this gradient computation can be evaluated for any number of parent nodes at i th level of the topology as shown in Fig. 4. Since the adaptation of queue size is dependent on the gradient computation at a node of i th layer with that of the (i − 1) th layer, adaptation at any number of layers can be computed. Thus, the algorithm is valid for any number of parent nodes in a layer, any number of connected child nodes and finally for any number of layers. Hence, the algorithm is suitable for a generalized network topology as shown in Fig. 1.

VI. RESULTS AND DISCUSSIONS
The network topology shown in Fig. 2 is considered in our simulation. This particular topology is derived from the general topology [8] shown in Fig. 1. The different traffic classes considered in our simulation are the RT and different NRT traffic classes. Specifically, three different NRT traffic classes such as HNRT, MNRT, and LNRT traffic classes are considered. This specific topology with the proposed algorithm is implemented in NS3 [20] platform in Linux environment. We have developed the necessary codes for the algorithms implemented in NS3 platform. Different traffic classes of the nodes are also shown in Fig. 2 where the communication among different nodes is established by AODV protocol. It is to be noted that RT data needs to be assigned with the highest priority followed by HNRT, MNRT, and LNRT data. Therefore, in our simulation, RT data is assigned with a priority value of 10, whereas HNRT, MNRT, and LNRT are assigned with priority values of 6, 3, and 1 respectively. Other simulation parameters are presented in Table 1.
The notions of priority, fair distribution of bandwidth and queue size are taken into consideration while developing the proposed algorithm. Therefore, the fair distribution of the
Sink,Pi min //Calculation of average queue size of Sink node based on ADQM strategy 6: Pi,Cj min //Calculation of average queue size of parent nodes based on ADQM strategy r Sink in (n + 1) = i∈C(Sink) r Pi out (n + 1) //Calculation of input transmission rate of Sink node based on ADQM strategy 11: r Pi in (n + 1) = j∈C(i) r Cj out (n + 1) //Calculation of input transmission rate of parent nodes based on ADQM strategy 12: r Sink ADQM (n + 1) = β · (r Sink out (n + 1)− r Sink in (n + 1)) − λ · Q Sink ADQM (n+1) T cl //Compute the aggregate transmission rate at the sink node 13: if r Sink ADQM (n + 1) > 0 then 14: r Pi out (n + 1) = r Pi out (n + 1) + if r Pi ADQM (n + 1) > 0 then 18: r Cj out (n + 1) = r Cj out (n + 1) + r Pi ADQM (n+1) L Pi //Evaluation of the updated output transmission rate of j th child node else 19: end for 20: Return the updated output rates to child nodes bandwidth is affected by the priorities of the traffic classes and the queue size as well. Though the performance of each node is analyzed, for the sake of illustration, we have presented the results of the child nodes C1 and C2 and the corresponding parent node P1.
It is to be noted that the adaptation of queue size for each node is imperative for congestion avoidance and hence three QoS parameters such as throughput, packet loss, and packet delay are determined for each node. The above three parameters for child node C1 are presented in Figs. 6, 7, and 8. In order to demonstrate individual algorithm's effect on throughput, we have plotted throughput of different algorithms separately in Figs. 6. It may be observed from Fig. 6 that the throughput for the proposed WPFQGRC algorithm is the highest where as it is lowest for Brahma et al.'s algorithm. Similarly, the variations of three parameters for child node C4 are shown in Figs. 9, 10 and 11 and the corresponding results for the parent node P1 are presented in Figs. 12, 13 and 14. As seen in Fig. 2, the RT load and three types of NRT loads such as HNRT, MNRT, and LNRT are connected to child node C1 and therefore the effect of these connected loads are expected to be evident in the parent node P1. In Fig. 6  From the implementation point of view, we have only considered the notion of node priority and the queue management strategy for Monowar et al.'s algorithm. The concept of hotspot avoidance is not considered in our implementation. The delay parameter for the corresponding node is shown in Fig. 8. It is evident from Fig. 8 that there is minimum amount of delay for WPFQGRC algorithm. This may be attributed to the fact that the proposed algorithm is based on the combined notion of traffic class priority, fair distribution of bandwidth, and ADQM strategy. In addition to the above three aspects, the algorithm takes into account the number of child nodes of a given parent node. In case of child node C4, similar effects are also observed in Fig. 9, 10 and 11. The rates of the child nodes also affect the parent node and in this regard, node P1 has two child nodes and hence the rate of parent node P1 is expected to be higher than either of the nodes. This phenomenon is reflected in Fig. 12. Therefore, as seen from Fig. 12, the proposed algorithm produced throughput of 950 Kbps while other algorithms produced less throughputs than that of the proposed algorithm. As observed from Fig. 13 and Fig. 14, the findings of the loss and delay parameters of parent node P1 are similar to those of child nodes C1 and C4.

A. EFFECT OF TRAFFIC CLASS PATTERNS, NODE MOBILITY, AND AVERAGE QUEUE SIZE 1) EFFECT OF TRAFFIC CLASS PATTERNS
Since Brahma et al.'s algorithm does not take into account the priority of traffic classes, the algorithm is excluded from the study of the effect of the traffic patterns. In this regard, different traffic patterns are connected to child nodes C1, C2, C3, and C4 and their effects on the throughputs of these four child nodes are studied. Further, the effect on the corresponding parent node P1 is also analyzed. Though any type of traffic pattern can be connected to a node, for the sake of illustration, three different traffic patterns namely TP1, TP2, and TP3 are considered at child node C2. These patterns are TP1 (RT+HNRT+MNRT), TP2 (RT+HNRT), and TP3 (RT+MNRT+LNRT). Out of these three traffic patterns, TP1, and TP2 include the RT traffic class and are expected to have more priorities than that of TP3, which does not include the RT traffic class. Fig. 15(a) and (b) show the throughputs of three different traffic patterns for seven different algorithms. As observed in Fig. 15(a) and (b), the throughputs for the three traffic patterns of Monowar et al.'s algorithm are the lowest while the throughputs of the proposed WPFQGRC algorithm are the highest ones. This is due to the fact that the proposed WPFQGRC algorithm takes care of the priorities of traffic class pattern, while simultaneously adapting the queue size and distributing the spare bandwidth in a fair manner. As TP3 pattern has low priority due to the absence of RT class, the corresponding throughput is the lowest. Similar observations are also made for Yaghmaee et al., DDRC, Sarode et al., WPDDRC, and PFRC algorithms. But, the throughput is found to be maximum for the TP1 traffic   pattern, which includes RT traffic class that has been assigned with high priority. Hence, it is found that throughputs are dependent on the traffic patterns and particularly, as expected, high throughput is achieved for high priority traffic pattern.
As C2 is connected to P1, the effect of traffic patterns on the parent node P1 is also studied which is shown in Fig. 16(a) and (b). Though the traffic patterns connected to   child nodes may vary, for the sake of illustration, all the child nodes are connected to preassigned traffic patterns. The node P1 is also connected with a fixed traffic pattern. Therefore, the throughput of P1 depends upon the combined effect of the traffic patterns of the child nodes and the parent node as well. In this case, as observed from Fig. 16    while the throughputs achieved by the proposed WPFQGRC are the highest ones. Further, in case of Monowar et al.'s algorithm, TP3 traffic pattern produced the lowest throughput while TP1 produced the highest one. This is because of the fact that TP1 has higher traffic class priority than that of TP3 pattern. Similar observations are also made for the other algorithms. In case of the parent node also, the performance of the proposed WPFQGRC algorithm is the best among all the algorithms.

2) EFFECT OF NODE MOBILITY
The effect of limited node mobility of a given node on the throughput is also studied. For the sake of illustration, node C2 is allowed to move in the neighborhood of its original position i.e. near the neighbor nodes, C1 and C3 with a mobility rate of 10 metre/sec. The throughputs of C2, with and without mobility, for all the algorithms are presented in Fig. 17. As observed in Fig. 17(a), because of the mobility of a given node, the throughput is not stable and hence starts from a low value and thereafter rises to a high value over some time interval and as the mobility is restricted to a limited zone, the throughput finally settles down to a particular value. The node moves randomly with a constant velocity i.e. 10 metre/sec. Hence, initially because of the change of positions, the GP is affected and hence the queue adaptation is affected which inturn increases the throughput. After sometime, though there is movement, the average of GP of different positions is constant and hence the throughput remains constant after sometime. It is also observed that the throughputs obtained for mobile node cases are close to that of the static cases. Similar findings are also observed for the other four algorithms as shown in Fig. 17(b). As observed in Fig. 17(b), in some cases, the throughputs for the mobile nodes rise up to 10 sec and thereafter settle at some values. The throughput obtained for the proposed WPFQGRC algorithm is the highest for both static as well as mobile cases. Hence, it is inferred that the mobility of a node affects the throughput during the initial period but subsequently the throughput is found to be close to that of the static case.

3) EFFECT OF TRAFFIC PATTERN ON QUEUE SIZE
To overcome congestion, queue size of a node changes depending on its connected load. The average queue sizes of different child nodes and the corresponding parent nodes over the simulation time are shown in Fig. 18, 19, and 20. Fig. 18 shows the queue sizes for the four child nodes namely C1-C4 and the corresponding parent node P1. As observed in Fig. 18, at a given instant of time, the queue size of the parent node P1 is less than those of the child nodes. This is because of the fact that the rate of P1 is higher than those of the child nodes and hence the queue size is expected to be lower. Similar observations are made in Fig. 19 for parent node P2 and the corresponding child nodes. Analogous phenomenon is also observed in Fig. 20. In case of child node C2, the variations of average queue size due to different traffic patterns TP1, TP2, and TP3 are shown in Fig. 21. It is also known that the traffic patterns affect the GP of node C2 which in turn affects its average queue size. Hence,   the average queue size is different for different traffic pattern as shown in Fig. 21. The traffic pattern TP1 has high priority and therefore demands a high transmission rate to avoid congestion. Hence, the queue size is also large to overcome congestion. Similarly, the traffic pattern TP3 has the lowest priority and hence average queue size is small, which is evident from Fig. 21. Hence, it is inferred that traffic patterns do affect the queue size which is expected to overcome the congestion.

VII. CONCLUSION
It is known that considering either the notion of fairness or priority does not overcome congestion completely. This motivated us to develop the proposed novel WPFQGRC rate control scheme that takes care of the fair distribution of the spare bandwidth, the priority of traffic classes, and the proposed Adaptive Queue Management. The proposed ADQM strategy depends on the gradient of the differential GP with respect to a differential queue size corresponding to different levels of the network. The QoS parameters such as throughput, loss, and delay are found to improve as compared to other algorithms. It is also found that the proposed algorithm produced the highest throughput while overcoming congestion. The effect of traffic class pattern is also investigated and it is found that the traffic pattern affects the throughput. It is observed that high priority traffic class leads to high throughput and vice versa. The effect of limited node mobility is also investigated and it is found that because of the limited mobility, there is a drop in the throughput initially but thereafter it increased to a value close to the static case. It is to be noted that the limited mobility of the node does not deteriorate the performance appreciably. The effect of different traffic patterns on queue size is also studied and it is observed that the traffic pattern does affect the queue size. Future work will focus on the study of the effect of the mobile sink node, number of child nodes and the parent nodes on throughput and a modified queue management strategy. Instead of a single tree topology, number of clusters with cluster heads may be considered in future which can be implemented in a real time testbed.