An Adjust Duty Cycle Method for Optimized Congestion Avoidance and Reducing Delay for WSNs

: With the expansion of the application range and network scale of wireless sensor networks in recent years, WSNs often generate data surges and delay queues during the transmission process, causing network paralysis, even resulting in local or global congestion. In this paper, a dynamically Adjusted Duty Cycle for Optimized Congestion based on a real-time Queue Length (ADCOC) scheme is proposed. In order to improve the resource utilization rate of network nodes, we carried out optimization analysis based on the theory and applied it to the adjustment of the node’s duty cycle strategy. Using this strategy to ensure that the network lifetime remains the same, can minimize system delay and maximize energy efficiency. Firstly, the problems of the existing RED algorithm are analyzed. We introduce the improved SIG-RED algorithm into the ADCOC mechanism. As the data traffic changes, the RED protocol cannot automatically adjust the duty cycle. A scheduler is added to the buffer area manager, referring to a weighted index of network congestion, which can quickly determine the status of network congestion. The value of the weighting coefficient W is adjusted by the Bayesian method. The scheduler preferably transmits severely urgent data, alleviating the memory load. Then we combined improved data fusion technology and information gain methods to adjust the duty cycle dynamically. By simulating the algorithm, it shows that it has faster convergence speed and smaller queue jitter. Finally, we combine the adjusted congestion weight and the duty cycle growth value to adjust the data processing rate capability in the real-time network by dynamically adjusting it to adapt to bursts of data streams. Thus, the frequency of congestion is reduced to ensure that the system has higher processing efficiency and good adaptability.


Introduction
With the expansion of the application range and network scale of wireless sensor networks, congestion often occurs in the WSNs [Rajalingham, Gao, Ho et al. (2014); Yin, Zhou, Zhang et al. (2017); Qin, Luo, Xiang et al. (2019)]. The main reason is the limited processing power of the nodes, the insufficient utilization rate of the storage space, and the limitation of the bandwidth capacity. It makes this part of the data too late to process, resulting in a large number of packet queuing, discarding a large number of data packets, reducing the performance of the network, and causing the communication business to stagnate. Because WSNs many-to-one communication [Zhou, Tan, Yu et al. (2019)] is accessible. This results in excessive energy consumption, node failure, and even network paralysis. Thus, Wireless Sensor Network's various performances of wireless sensor networks are facing significant challenges. Therefore, whether congestion can be avoided and reduced is a crucial factor in judging the quality of wireless sensor networks.

Related work
WSNs systems have become more and more complex. In recent years, a large number of researchers have focused on solving wireless sensor networks. The current queue management mechanism can be divided into two types, namely active queue management AQM and passive queue management POM. It develops some energy-saving methods, which mainly focus on adjusting and optimizing the duty cycle to reduce network congestion. The most fundamental purpose is to reduce network congestion. The problem of congestion occurs in the network, and then some energy-saving methods are developed. The main focus is on adjusting and optimizing the duty cycle, slowing down the network congestion phenomenon, and automatically adjusting the duty cycle of each node according to the change of data traffic in the network. The transmission packet realizes the adaptive adjustment of the duty cycle [Xu, Zhou and Yang (2011) ;Carrano, Passos, Magalhāes et al. (2014); Rasouli, Kavian and Rashvand (2014) ;Chen, Liu, Li et al. (2017)], which increases the wake-up time of the node and reduces the energy consumption of its idle monitoring. In response to the emergence of a large number of data streams in the network, how to ensure the timely transmission of data Sink has been a research hotspot. The adjustment of the WSN to optimize the duty cycle mechanism is discussed.

Active queue management
Braden Proposed an active queue management (AQM) research protocol in the IETF, as a technical means of end-to-end congestion control, expecting AQM to ensure higher throughput while reducing queue queuing delay On the current Internet, packet loss is a mechanism for congestion notification of peer nodes. The way to solve the router's "full queue" is to drop packets before the queue is full so that the node responds to congestion before the queue overflows. This method belongs to the "congestion avoidance" algorithm. Once a large number of data streams (real-time or non-real-time multimedia data streams) appear in the network, it will cause an enormous burden on the routing nodes of the system. The effect of the ongoing congestion is not apparent.

Stabilized RED
SRED is a method of passive queue management POM. SRED has designed a data structure named "zombie" list, which is equivalent to the cache stream cache. The initial value of the "zombie" list is set to empty. Once the packet arrives, the packet flow identifier must be added to the list to generate a new "zombie", which records the number of the latest streams passing through the queue. If the "zombie" list is full, you need to randomly select a "zombie" from the "zombie" list and compare it with the next arriving packet. Wang et al. [Wang, Min, Zhou et al. (2011);Feng, Wang, Liu et al. (2015)] proposed a dynamic duty cycle medium access control (MAC) protocol for the WSN. It dynamically adjusts the duty cycle of nodes by calculating node utilization and average sleep delay. The point is that it does not take into account that the change of the duty cycle also requires energy consumption. If it is changed without consideration, it will affect the life of the network and cannot solve the load balancing phenomenon. Yang et al. [Yang, Li and Guo (2011)] proposed a dual-Qcon method to jointly control the dual index of the duty cycle and the queue threshold based on the end-to-end delay. He adopts the control queue management network congestion status to determine the delay notification mechanism. By adjusting the sleeping time of the corresponding node, the local queue length is adjusted at the determined queue threshold. However, the limitation of Dual-Qcon lies in the use of fixed step size. Look for the best control of this situation. To meet the processing data capabilities of different congestion requirements, it is necessary to comprehensively consider the packet loss rate, delay, energy consumption, real-time queue length, cache queue length. To balance the network carrying capacity with other parameters so that the relationship between energy consumption and network performance is not affected on the premise of affecting the life of the network, making it more effective in alleviating packet loss, system delay, and congestion in the network.

System model and problem statement
This article is based on the OMNET [Varga (2010)] platform simulation experiment platform, Visual Basical is used to experiment with this situation. The experimental network radius is R , the node emission radius is r , and the event generation rate is λ the threshold of the node radius 0 r , Wait the parameters of the network model are shown in Table 1. The wireless sensor network model in which the ADCOC protocol is located and the description of each network parameter used in the experiment are as follows. When the network lifetime is not reduced, the energy consumed is minimized. Finally, we respectively give the network lifetime, network energy consumption, and delay. Related simulations and detailed theoretical proofs.

The network model
The network model adopter is similar to the literature [Gui and Zhou (2016)], N homogeneous sensor nodes are randomly deployed in a two-dimensional planar network with a network radius of R , a node communication radius of r Each node continuously monitors the surrounding environment, which does not move after being deployed.

Data fusion
When a large amount of data in the network [Wang, Qin, Xiang et al. (2019)] urgently needs to complete the transmission task, and the real-time queue is too long, exceeding the space range accommodated by the receiver, considering that the nodes in the network are dense, the data fusion technology [Xu (2007) ;Yao, Cao and Vasilakos (2015); Su, Xu, Fei et al. (2016)] is adopted, so that the packet length becomes smaller. We maximize the use of data transmission and reception to solve some of the problems of the column. There are options to optimize the aggregation point to minimize the delay. It involves multiple network parameters, theoretically analyze the network parameters. The relationship between the air ratio and the length of the queue, theoretical analysis, and experimental results confirm the validity of the theoretical analysis of the ADCOC method.

Energy consumption model
Due to the limited energy supply of nodes and the queue of transmitted data is limited, which can lead to considerable packet loss, degrade the performance of the sensor network and result in the congestion phenomenon in the network. Because of the situation, we adopt the typical energy consumption model in [Peng and Low (2012)]. Eqs.
(1) and (2) In this paper, the specific Settings of the above parameters are taken from the literature. The internal data table from the sensor node is shown in Tab. 1.

Problem statements
The goal of WSN ] is to maximize the life of the network while reducing the energy consumption, delay, and packet loss rate, to maintain a longer network lifetime. Therefore, the problems studied can be summarized in the following aspects. (2)

The main design of ADCOC strategy 4.1 Research motivation of ADCOC scheme
Due to the limited resources in the network, a large amount of data needs to be transmitted [Rosberg, Liu, Dinh et al. (2010)], resulting in the queue waiting, resulting in data packet loss. Congestion will cause the network performance [Long, Liu, Dong et al. (2015); Luo, Qin, Xiang et al. (2019)] to be degraded due to the retransmission of wireless sensor data. Facing the sensor node encountering a large number of bursty data streams. If you do not urgently deal with sudden and effective data, it is easy to cause congestion. Therefore, we need to deal with these problems with an effective ADCOC protocol.

General design of ADCOC
Firstly, it is introduced into the duty cycle mechanism by using the improved red algorithm idea. Then, according to the weight of the congestion, the scheduler optimizes the data transmission emergency sequence. The data fusion technology and the information gain method are used to dynamically adjust the duty ratio of the data node to reduce the transmission delay of the emergency data without affecting the network life.
Maximize the processing power of network data, thereby weighing the relationship between energy consumption and network performance, to more effectively alleviate the phenomenon of packet loss, system delay, congestion, etc. in the network. Discussed RED, SIG-RED, RED-PD, SIG-PD, RED-ADC, SIG-ADC strategies have better performances in terms of delay and system resource utilization ] than other existing methods in the case of the same packet loss.

Schedule method of the ADCOC scheme 4.3.1 The duty cycle of RED-PD protocol
To alleviate a large amount of packet loss in the tail-discarding strategy, a large amount of buffer is wasted. The RED congestion control mechanism is introduced into the duty cycle of the adjustment node. Therefore, the packet loss rate b p obtained according to the improved RED algorithm is applied to account for in the air ratio; we call it the RED-PD protocol. Through the above packet loss rate b p , the duty cycle τ [Naveen and Kumar (2013); Li, Li and Zhao (2014)] value under different conditions can be obtained. Based on the packet loss rate b p Recalculate duty cycle the network is extremely congested, the queue is full, and all packets are discarded after congestion occurs. At this moment, the duty ratio reaches the maximum value 1. According to the above formula, in the original drawing, the RED-PD image in Fig. 1.
It is mainly divided into three parts: First, calculate the average queue length avg using Eq. (4), and use it as a congestion counter. Estimate the degree. Then calculate the probability of discarding the packet b p using Eq. (5). Finally compare the obtained avg value with the interval and the packet loss rate b p to obtain the value of the duty cycle τ under different conditions using Eq. (6). Duty cycle is presented at a linear vertical growth rate until it becomes a value of 1; the packet loss rate is randomly discarded to completely discarded. Steep is a problem of unstable performance.

the duty cycle of Sigmoid-PD strategy
There is a jump in the probability of packet loss, which makes the probability of packet loss change sharply. The input value of the internal change is squeezed between the output values of [0,1], and the Sigmoid function is used to make the packet loss rate of the Sigmoid-PD algorithm smoother. As can be seen from the above Fig. 2, packet loss rate curve can achieve a smooth transition in the whole process of change, and packet loss rate curve is "concave" shape when average queue length exceeds the maximum threshold value [Liu, Ren, Li et al. (2012)]. Adjust target captain to the minimum value expressed by the lower limit of the variable; the maximum value is expressed by the upper limit of the variable. The max p adjustment process is following in Eq. (7): Represents the correlation coefficient function of the packet loss rate that depends on the Sigmoid function. It is the average queue length and is the upper and lower threshold of the variable of the target queue length. It is determined as the upper and lower thresholds change. We can be obtained Eq. (10), which are calculated using Eqs. (7)-(9). Bringing the S-type function packet loss function obtained above into the new packet loss rate using Eq. (6). It can obtain the new packet loss rate value of the SIG-PD strategy, and bring it into the duty cycle calculation using Eq. (6). The excess of random discard to complete discard should be "smoothed". The duty cycle value calculated with the packet loss rate using the Sigmoid function is shown in Fig. 2.

Dynamically adjusting the duty cycle according to the ADCOC protocol
Router cache management technology mainly uses queuing theory to study network traffic. It adds a scheduler in the memory buffer manager and adjusts the value of the weighted congestion coefficient w through Bayes rules. According to the congestion weight w, the transmission congestion is severe. Urgent data, the scheduler optimizes the data transmission emergency sequence and then uses the improved data fusion technology and information gain method to adjust the queue node dynamically. All the link-layer queuing models in this paper adopt the structure of Fig. 3. In the scheme of this paper, when the source node sends packets, so innovatively proposes a dynamic adjustment of the duty cycle of the node based on the real-time queue length, An Adjust Duty Cycle method for Optimized Congestion with Medium Access Control. To prevent network congestion caused by excessive congestion window growth, a scheduler is added to the buffer manager that receives the data stream in Fig. 4. The memory manager serves as a management component of the memory buffer, including the scheduler. The function is to store data and storage management. The function of the controller is to allocate the buffer space, allocate storage space for the newly arrived data stream, and put the tuple into the queue of the corresponding stream, and transmit it to the processor according to the selected data. To obtain the congestion weight w of the communication process, the "gradient descent method" can be chosen to solve the hidden data. Hypothetical indicates the period time and £ represents the time point.
Given network topology and initialization lmn W . The optimization is handled as follows by the following steps: 1) Calculating the gradient: The first l, m, n of the nth processing cycle, the waiting time of the data in the buffer area is calculated by the weighted lmn W .
The probability of the right end of the Eq. (12) is calculated for each training tuple in ( ) i p ς n , call this probability λ . When the variable represented by l Y , l Z is hidden from view to an ς X , the corresponding probability λ can be calculated .
2) A small step along the gradient direction iteratively updates the weights with the following formula, represents the learning rate of the step size, which helps to converge to a locally optimal solution, as shown in Eq. (13).
( ) 3) Renormalize the weights. Since the weight lmn W is a probability value, the interval must be between [0, 1], and for all l, m, n, to ensure that lmn W is equal to 1, we get Eq. (14).
This approach minimizes the number of expected test values required to cluster a given tuple, and dynamically adjusts the incremental duty cycle maximization index ∆ ′ process as follows: The expected information needed to cluster the tuples in D is provided by the expected information required for clustering tuples in D. Where is the probability any tuple in D belongs to the class ,and use � , � | | ⁄ to estimate, as depicted in Eq. (15).
The information gain metric bias has a lot of output tests, which tend to choose attributes with a large number of values. Normalize information gain using "data fusion", clustering information is similar ( ) DataFusi D , as follows in Eq. (16).

( ) ( )
This value represents information generated by dividing the training data set D into v partitions corresponding to the v outputs of the attribute W test, and define the gain rate, as shown in Eq. (17).
The gain rate GainRatio(A) obtained is used for the duty cycle ∆ growth rate. The specific process of adjusting the duty cycle is as follows: 1) If the Eq. (18) 3) If the Eq. (24) is satisfied, the dynamic adjustment incremental duty ratio maximization index ∆ ′and the processing speed capability of the network congestion is adjusted. The corresponding adjustment is shown in the following Eqs. (25)- (27): By using the scheduler, and aggregator to handle real-time queue conditions [Zhuo, Qin, Xiang et al. (2020)]. The specific steps for implementing the algorithm are as follows, As shown in Tab. 2. xx: random number seed number; temp: currently holds the queue length(the difference between randomly arriving packets and the network processing one hundred packets per second) ; lowerbound: lower packet limit; upperbound: upper packet limit; dropdata: the packet loss rate; cach_length: number of capacity packets in the cache queue; cur_length: current queue length(the queue length at the moment after the last entry into the cache queue) ; ℎ : processes one hundred packets per hour; ℎ ′: corresponding data processing capacity after adjusting the duty cycle; 0 : minimum node duty cycle; ∆ : maximum increase of duty cycle, ∆ ∈ {0, 1 − 0 }; ∆ ′: the duty cycle used by the node is the final duty cycle calculated by the algorithm As depicted in Fig. 5, the relationship between the amount of data received by a fixed duty cycle when generating a regular data stream. Fig. 6 relationship between received data volume after the dynamic adjustment of the duty cycle. Comparing Fig. 5 with Fig.  6, the improved ADCOC strategy is better than the improved RED approach. Based on the RED protocol in Fig. 6, the amplitude of the duty cycle is fixed every time, which cannot fully reflect the adaptive dynamic and flexible adjustment. Advantages. When a large number of data streams burst, the uniform fixed duty cycle will significantly increase the queue delay of the node. To better adapt to the network load, the following Fig.  6 shows that the curve of the packet loss is always in the current queue length curve. Below, the amount of packet loss is significantly reduced, network congestion is optimized, reflecting the dynamic adjustment of the duty cycle of the node according to the length of the queue. It can be seen from the comparison of Figs. 5 and 6 that the duty cycle flexibility adjustment mechanism of the ADCOC protocol is More advantageous.

Performance analysis of the ADCOC
OMNET++ is an open network simulation platform that provides open-source code for large networks. The experimental network parameters are set as follows: Maximum tuples allowed in experiments The delay is randomly selected from a set of discrete values: 200 ms, 400 ms, 2 s, 3 s, the memory buffer size is set to 100 (tuple unit), the CPU processing period and the buffer scheduling period are set to 6 s, 2 s, and the queue size is 20. The initial duty cycle is 0.4. After testing, in the experiment, the two typical strategies of fixed duty ratio RED and SIG are mainly used, and the duty ratio of the packet is adjusted to adjust the duty ratio RED-PD, SIG-PD. Strategy, and using the ADCOC queuing theory of this paper to dynamically adjust the duty cycle RED-ADC, SIG-ADC two improved strategies, simulation comparison of various performance aspects. Among them, all nodes of the RED protocol use the same duty cycle, and the other two. The RED-ADC and SIG-ADC protocols adaptively adjust the node duty cycle based on the congestion of data in the queue.

Energy consumption
Increasing the duty cycle of the node can effectively reduce the network delay and packet loss rate, but it will increase the energy consumption of the node, so network performance (delay and packet loss rate) and energy consumption are a compromise optimization relationship [Lee (2013)]. Theorem 1: We assume that network radius is R, the node radius is r, and the probability of occurrence of the event is λ. If each node adopts the shortest path method, set the distance of the node distance sink to l , l hr x = + . The data packets assumed by this node number is as shown in Eq. (28), Which satisfies the condition of ( ) In Fig. 7, under the fixed duty cycle, RED protocol, improved SIG-ADC protocol, SIG-ADC has a larger duty cycle than RED under the same amount of data, and both duty cycles are fixed. It does not adapt to changes in network data traffic. Therefore, the two standard protocols, RED-PD and SIG-PD. Through the relationship between the above data volume and duty cycle, SIG-ADC can dynamically adjust the duty cycle dynamically and timely according to the network conditions. The ADCOC protocol in this paper makes full use of the energy in the network to reasonably adjust the duty cycle of the node so that the network data load is balanced. Theorem 2: Presuming that the distance between the network node and the sink caused by the route is l , the energy consumption of this node is shown in Eq. (29).  Fig. 8 is a comparison of the energy consumption at the data fusion rate between the packet loss theory PD and the queuing theory ADCOC. Compared with the original duty cycle, the higher the node duty ratio is adjusted, it consumes more energy, and the duty cycle produces different energy utilization. After dynamically changing the duty cycle, SIG-ADC, SIG-PD consumes. The energy is lower than RED-ADC and RED-PD energy consumption, and the sigmoid function is more conducive to prolonging the network life.

Network delay
The packet sending rate per unit time is decreased, thereby reducing the packet transmission conflict in the data packet. The transmission success rate increases and the delay and packet loss rate are low. Therefore, the collision rate of the data packet increases, and the number of retransmissions of the data packet increases, causing the delay to increase and the packet loss rate to increase. It can be seen from Fig. 9 that when the data transmission rate of the node remains unchanged, as the duty ratio increases, the delay of the data packet at the node also drops rapidly. Theorem 3: Under the ADCOC protocol, the delay 2 of the entire network and the average delay 2 [Gao, Wu and Liu (2014)] can be expressed as depicted in Eqs. (31) and (32).
It can be seen from Fig. 9 that as the duty cycle increases, the delay of ADCOC and PD increases in a stepwise jump, and the ADCOC is smaller than the PD delay. The algorithm significantly reduces the single-hop delay and proves the effectiveness of the adaptive control algorithm in improving the network delay performance.

Packet loss
Since the node has a specified maximum packet transmission rate, when the duty ratio is too small, the node cannot complete the transmission of all data packets within a limited wake-up time, which inevitably leads to an increase in the packet loss rate. In Fig. 10, As the node duty cycle increases, the node's packet loss rate also drops rapidly. Conversely, reducing the duty cycle of a node increases the latency and packet loss rate of the network. It can be seen from Fig. 11 that the SIGMOID function plays a role in adjusting the packet loss when the network first starts to generate packet loss in the case of a fixed duty ratio and is better than the RED function. Under the three strategies, the SIGMOID function has a concave effect.

Shake frequency of the ADCOC scheme
In the network, due to delays, oscillations occur, resulting in unstable systems, resulting in reduced network performance. As can be seen from Fig. 12, the delay generated by the ADCOC protocol is relatively stable at the same time interval, which is significantly better than the PD and RED protocols. Analysis and simulation results show that our improved ADCOC scheme enables the active time of the node to better adapt to the dynamic changes of the communication load, reduce the delay and packet loss, improve the network throughput.

Conclusion
The ADCOC protocol based on queuing theory dynamically adjusts the duty cycle proposed in this article, the goal is to effectively reduce the packet reception delay, packet loss rate, etc. The ADCOC protocol proves the optimization of network delay and node energy through theoretical analysis, mathematical proof and simulation results. The data transmission delay is reduced by 25.65%. The utilization rate is increased by 30.61%, and the network lifetime is guaranteed to be no less than other studies. The mechanism buffers the queue length through the packet. The priority is used to adjust the order of information transmission. The simulation results show that the ADCOC mechanism not only improves the receiving rate of the data packet node. Although this thesis has achieved some good experimental data results, in view of the relatively limited knowledge theory of individuals, and in future research, we can continue to develop more in-depth improvements and optimization strategies in the following aspects: (1) In theoretical research, once the position of the network sensor node is fixed, it is fixed. However, in actual use, the path of network nodes to move is extremely complicated, and it is a difficult and challenging task in future analysis and exploration.
(2) In theory, the algorithm for dynamically adjusting the duty cycle only considers the nodes in the far Sink area, while in the near Sink area, in view of the shortage of energy. Therefore, in the future analysis and exploration, it may be possible to use a low duty cycle to save more energy.