An active queue management method based on dynamic cache
The dynamic cache active queue management method built through deep reinforcement learning DQN solves the Bufferbloat problem, achieves lower average transmission delay and delay jitter, reduces cache capacity, reduces router hardware costs, and improves data transmission performance.
Patent Information
- Application Number
- CN202410866258.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-01
AI Technical Summary
Existing queue management algorithms are difficult to effectively deal with the Bufferbloat problem when the network scale expands, resulting in high buffer overflow probability, low data transmission performance, and difficulty in optimizing packet loss strategies under fixed buffer conditions.
Deep reinforcement learning DQN is used to build an active queue management method based on dynamic cache. By adjusting the cache capacity and learning the optimal packet loss strategy, the queue management strategy is dynamically adjusted to reduce the probability of buffer overflow and improve data transmission performance.
In NS3 network topology simulation, compared with algorithms such as FIFO, RED, ARED, and CoDel, the active queue management method based on dynamic cache achieves lower average transmission delay and delay jitter, reduces cache capacity, and reduces router Hardware costs have the advantage of reducing costs and increasing efficiency.
Smart Images

Figure CN118400336B
Abstract
Description
Technical Field
[0001] The invention belongs to the field of information engineering, and in particular relates to an active queue management method based on dynamic cache. Background Art
[0002] Queue management plays an important role in data transmission. The queue management mechanism reduces the length of the cache queue through the packet discard strategy to reduce the probability of cache overflow, effectively improve data transmission performance, and ensure fairness and reliability between each flow as much as possible. Common queue management mechanisms are mainly divided into early passive queue management (Passive Queue Management, PQM) and active queue management (Active Queue Management, AQM) which has developed rapidly in recent years.
[0003] The most widely used algorithm in PQM is the Drop-Tail algorithm. Its principle is to set a maximum value or threshold of a queue in the router. When the queue length reaches the threshold, all subsequent data packets are discarded indiscriminately until the queue length returns to within the threshold after sending downstream data packets. This is similar to the traditional First In First Out (FIFO) method. However, with the increase of network traffic and the development of network architecture, PQM is prone to deadlock, low link utilization, poor fairness and other problems. In order to solve the above problems, the early AQM algorithm evolved from the PQM algorithm. The core idea of the AQM algorithm design is to focus on what congestion detection scale to use and how to control the packet loss rate according to the congestion situation. According to the different congestion detection scales, the AQM algorithm can be divided into: Random Early Detection (RED) algorithm based on queue scale, BLUE algorithm based on link load scale and CoDel algorithm based on delay scale. Among them, RED algorithms can better alleviate the defects of traditional "tail abandonment" algorithms, BLUE algorithms can reduce the demand for buffer space of intermediate network devices due to packet loss rate, and CoDel algorithms can adjust the delay of data packets in the queue, thereby alleviating the Bufferbloat problem in the buffer area. However, the continuous expansion of network scale will further aggravate the Bufferbloat problem, and the above queue management algorithms are all based on the packet discard strategy under fixed buffer conditions, so it is difficult to effectively deal with the Bufferbloat problem. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention utilizes deep reinforcement learning DQN (Deep Q-Learning Network) to construct an active queue management method based on dynamic cache, so as to reduce the probability of cache overflow and effectively improve data transmission performance.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: an active queue management method based on dynamic cache, comprising the following steps:
[0006] S1, implement dynamic caching strategy for traffic queues: periodically adjust cache capacity based on initial cache capacity and cache upper and lower bounds until the queue in the cache is emptied;
[0007] S2. Build a DQN environment. The DQN agent performs corresponding actions according to the state in the environment. Through the iterative interaction process with the environment, the DQN agent continuously updates the current state of the environment and the corresponding actions. Q The optimal packet loss strategy is learned. The state of the environment is: queue length, dequeue rate, queuing delay, and cache capacity.
[0008] S3, build a DQN agent, define the current queue length, current queue rate, current queue delay, and current cache capacity in the environment as the state space, define the packet loss rate as the continuous action space of the agent, define the total reward function as the sum of the queue delay reward function and the throughput reward function, and use A strategy to choose actions that maximize the total reward function;
[0009] S4. Build a deep deterministic policy gradient network consisting of a policy network and a value network;
[0010] The policy network includes the current policy network and the target policy network with the same structure. It takes the state of the environment as input and obtains the packet loss probability under the current state.
[0011] The value network includes the current value network and the target value network with the same structure. The value network takes the state of the environment and the action corresponding to the current state as input to obtain the value corresponding to the current state and action.
[0012] Update the parameters of the current policy network and the current value network to the target policy network and the target value network;
[0013] S5. Get the initial state of the environment, use the current policy network, generate actions according to the current state, execute the actions to give rewards and the next state, and use the experience replay mechanism to train the deep deterministic policy gradient network to obtain the active queue management model of dynamic cache. Using the active queue management model of dynamic cache, take the current traffic queue as input to obtain the traffic queue management strategy in the cache.
[0014] Furthermore, the aforementioned step S1 includes the following sub-steps:
[0015] S101, Cache capacity Buffer Initialization: Node cache capacity Buffer Set the initial value of in bytes;
[0016] S102, cycle count count =0, the cycle count is used to implement periodic adjustment of cache capacity, and the cycle is set to T ;
[0017] S103, get the current queue and add the queue to the list, the length of the list is L , represents the number of elements in the list;
[0018] S104: Determine whether the list length exceeds L , then execute count++ , otherwise returns to step S103;
[0019] S105, Comparison count and T The size of count = T Then execute step S106, count < T The oldest queue in the list is removed, and step S103 is executed;
[0020] S106. Calculate the average queue length in the list Q avg , ,in Q (count) Indicates the queue length of a single count in the list, in bytes;
[0021] S107, based on Q avg The size of the queue and the current queue length adjust the cache capacity Buffer ;
[0022] S108, determine whether the queue in the cache is empty, if not, reset the cycle, clear the list, and execute step S102, if it is empty, end the cache update strategy.
[0023] Furthermore, the aforementioned step S107 is specifically as follows: Q avg Is it greater than the current queue length: If Q avg If it is greater than the current queue length, then determine whether the current queue length is less than Buffer 0.9 times ofBuffer= 0.9× Buffer , otherwise keep Buffer No change; further judgment Buffer Is it less than the cache lower bound? Buffer_min If so, then Buffer = Buffer_min , otherwise keep Buffer unchanged; if Q avg Is not greater than the current queue length, then Buffer Expand by 1.1 times, that is Buffer= 1.1× Buffer ; Further judgment Buffer Is it greater than the cache upper limit? Buffer_max If so, then Buffer = Buffer_max , otherwise keep Buffer constant.
[0024] Furthermore, the aforementioned step S2 is specifically: the DQN agent is based on the state of the environment s t Perform the corresponding action a t , this action determines the probability of discarding or retaining the data packet in the cache, that is, the packet loss rate. The environment calculates the reward value for the current action according to the reward function r t , and update the next state s t+1 , the DQN agent is based on s t+1 and r t Execute new actions; through the iterative interaction process with the environment, the DQN agent continuously updates the Q value and eventually learns the optimal packet loss strategy.
[0025] Furthermore, in the aforementioned step S3,
[0026] The queue delay reward function is: (1)
[0027] in, D desired Indicates the ideal queuing delay of the current queue in the cache. This variable is set manually. D current Indicates the actual queuing delay of the current queue. This variable is obtained through the GetSeconds() function in NS3;
[0028] The throughput reward function is:
[0029] (2)
[0030] in,D max Indicates the maximum queuing delay under the current cache. R play represents the physical bandwidth of the bottleneck link, that is, the data rate, N enq Indicates the number of packets currently successfully queued. N dropped Indicates the number of packets currently discarded. B current Indicates the current cache capacity;
[0031] The total reward function is:
[0032] (3)
[0033] w 1 , w 2 They are the weights of queuing delay reward and throughput reward respectively.
[0034] Furthermore, in the aforementioned step S3, The strategy is to choose a reward function that r t ( s t , a t ) Maximizing action a t , The decision-making method of the strategy is:
[0035] (4)
[0036] in a t Indicates the current state s t The packet loss rate under the condition, where is a random number in (0,1), is the exploration rate, when When , choose the action with the largest expected value; when When a parameter adjustment action is randomly selected, the exploration rate is calculated using the formula Calculate, where is the number of training rounds.
[0037] Furthermore, in the aforementioned step S4, the policy network includes an input layer, a hidden layer, a fully connected layer, and an output layer, specifically:
[0038] Input layer: includes four input units, corresponding to the state space The 4 variables in; Lcurrent Indicates the current queue length, R dequeue Indicates the current dequeue rate, D current Indicates the actual queuing delay of the current queue. B current Indicates the current cache capacity;
[0039] Hidden layer: The number of neurons in the hidden layer is 128, and the ReLU activation function is used to achieve nonlinear transformation;
[0040] Fully connected layer: The number of neurons in the fully connected layer is 128, and the ReLU activation function is used to achieve nonlinear transformation;
[0041] Output layer: uses 1 output unit to output the packet loss probability in the current state.
[0042] Furthermore, the aforementioned value network includes an input layer, a hidden layer, a fully connected layer, and an output layer, specifically:
[0043] Input layer: includes 5 input units, corresponding to and current status s t The biggest move a t ,Right now( s t, a t );
[0044] Hidden layer: Set the number of neurons in the hidden layer to 128, and use the ReLU activation function to achieve nonlinear transformation;
[0045] Fully connected layer: The number of neurons in the fully connected layer is set to 128, and the ReLU activation function is used to achieve nonlinear transformation;
[0046] Output layer: includes 1 output unit, outputs the value corresponding to the current state and action .
[0047] Furthermore, the aforementioned training of the deep deterministic policy gradient network using the experience replay mechanism includes the following sub-steps:
[0048] S401, Model initialization: Initialize the strategy network Parameters and value network Q Parameters ; Initialize the target policy network Parameters and target value network Parameters ; Initialize experience replay pool D ;
[0049] S402, Agent Training: Obtaining the Initial State of the Environment s 1; Use the current policy network According to the current status s t Generate Action ; Execute action a t And observe the rewards given by the environment r t and the next state s t+1 ; Experience Stored in the experience replay pool D Medium; From the experience replay pool D Randomly sample small batches of experience Conduct training;
[0050] S403, Experience Replay: Randomly sample a small batch of experience from the experience replay pool ;
[0051] Calculate target value based on sampling experience : (5)
[0052] Calculate the current state value ;
[0053] Calculate the loss function of the value network:
[0054] (6)
[0055] in, N Represents the size of the small batch of experience drawn from the experience replay pool each time;
[0056] Use Adam optimizer to minimize the loss function and update the parameters of the value network ;
[0057] Calculate the loss function of the policy network:
[0058] (7)
[0059] Use Adam optimizer to minimize the loss function and update the parameters of the value network ;
[0060] S404, soft update target network parameters and :
[0061] Update the parameters of the current policy network and the current value network to the target policy network and the target value network (8).
[0062] Compared with the prior art, the beneficial technical effects of the above technical solutions adopted by the present invention are as follows: NS3 network topology simulation verification shows that compared with the four main team management algorithms of FIFO, RED, ARED, CoDel, and Fq-CoDel, the active queue management method based on dynamic cache of the present invention can achieve lower average transmission delay and average delay jitter under the premise of ensuring throughput and packet loss rate, among which the average transmission delay is reduced by 27% compared with FIFO, and 1.9% compared with CoDel, and the average delay jitter is reduced by 45.6% compared with Fq-CoDel, and the average transmission delay is reduced by 4.7% compared with CoDel. In addition, the cache capacity adopted by the present invention is lower, which can effectively reduce the hardware cost of forwarding equipment such as routers, and has the advantages of reducing costs and increasing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 This is the technical solution process of the present invention.
[0064] Figure 2 It is a flow chart of the dynamic cache strategy of the present invention.
[0065] Figure 3 It is composed of the DQN environment constructed by the present invention.
[0066] Figure 4 It is a schematic diagram of the DQN packet loss strategy of the present invention.
[0067] Figure 5 It is the deep neural network structure designed by the present invention.
[0068] Figure 6 It is the updating process of the deep neural network designed in the present invention.
[0069] Figure 7 It is the network topology in NS3.
[0070] Figure 8 It is a comparison chart of the average throughput performance of the models.
[0071] Figure 9 This is a comparison chart of the average transmission delay performance of the model.
[0072] Figure 10 This is a comparison chart of the transmission delay and jitter performance of the model.
[0073] Figure 11 It is a comparison chart of the packet loss rate performance of the models. DETAILED DESCRIPTION
[0074] In order to better understand the technical content of the present invention, specific embodiments are described below in conjunction with the accompanying drawings.
[0075] Various aspects of the invention are described herein with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the invention are not limited to those described in the accompanying drawings. It should be understood that the invention is implemented by any of the various concepts and embodiments described above, as well as the concepts and embodiments described in detail below, because the concepts and embodiments disclosed in the invention are not limited to any implementation. In addition, some aspects disclosed in the invention may be used alone or in any appropriate combination with other aspects disclosed in the invention.
[0076] refer to Figure 1 The present invention provides an active queue management method based on dynamic cache, comprising the following steps:
[0077] S1. Execute a dynamic cache strategy for the traffic queue: periodically adjust the cache capacity based on the initial cache capacity and the upper and lower bounds of the cache until the queue in the cache is emptied.
[0078] S2. Build a DQN environment. The DQN agent performs corresponding actions according to the state in the environment. Through the iterative interaction process with the environment, the DQN agent continuously updates the current state of the environment and the corresponding actions. Q The optimal packet loss strategy is learned. The state of the environment is: queue length, dequeue rate, queuing delay, and cache capacity.
[0079] S3, build a DQN agent, define the current queue length, current queue rate, current queue delay, and current cache capacity in the environment as the state space, define the packet loss rate as the continuous action space of the agent, define the total reward function as the sum of the queue delay reward function and the throughput reward function, and use A strategy to choose actions that maximize the total reward function;
[0080] S4. Build a deep deterministic policy gradient network consisting of a policy network and a value network;
[0081] The policy network includes the current policy network and the target policy network with the same structure. It takes the state of the environment as input and obtains the packet loss probability under the current state.
[0082] The value network includes the current value network and the target value network with the same structure. The value network takes the state of the environment and the action corresponding to the current state as input to obtain the value corresponding to the current state and action.
[0083] Update the parameters of the current policy network and the current value network to the target policy network and the target value network;
[0084] S5. Get the initial state of the environment, use the current policy network, generate actions according to the current state, execute the actions to give rewards and the next state, and use the experience replay mechanism to train the deep deterministic policy gradient network to obtain the active queue management model of dynamic cache. Using the active queue management model of dynamic cache, take the current traffic queue as input to obtain the traffic queue management strategy in the cache.
[0085] refer to Figure 2 , step S1 includes the following sub-steps:
[0086] S101, Cache capacity Buffer Initialization: Node cache capacity Buffer Set the initial value of in bytes;
[0087] S102, cycle count count =0, the cycle count is used to implement periodic adjustment of cache capacity, and the cycle is set to T ;
[0088] S103, get the current queue and add the queue to the list, the length of the list is L , represents the number of elements in the list;
[0089] S104: Determine whether the list length exceeds L , then execute count++ , otherwise returns to step S103;
[0090] S105, Comparison count and T The size of count = T Then execute step S106, count < T The oldest queue in the list is removed, and step S103 is executed;
[0091] S106. Calculate the average queue length in the list Q avg , ,in Q (count) Indicates the queue length of a single count in the list, in bytes;
[0092] S107, based on Q avg The size of the queue and the current queue length adjust the cache capacity Buffer ; The details are as follows: Q avg Is it greater than the current queue length: If Q avgIf it is greater than the current queue length, then determine whether the current queue length is less than Buffer 0.9 times of Buffer= 0.9× Buffer , otherwise keep Buffer unchanged; due to Buffer It cannot be reduced infinitely, so further judgment is needed Buffer Is it less than the cache lower bound? Buffer_min If so, then Buffer= Buffer_min , otherwise keep Buffer unchanged; if Q avg Is not greater than the current queue length, then Buffer Expand by 1.1 times, that is Buffer= 1.1× Buffer ;because Buffer It cannot be increased infinitely, so further judgment is needed Buffer Is it greater than the cache upper limit? Buffer_max If so, then Buffer = Buffer_max , otherwise keep Buffer constant.
[0093] S108, determine whether the queue in the cache is empty, if not, reset the cycle, clear the list, and execute step S102, if it is empty, end the cache update strategy.
[0094] The present invention regards the queue and cache capacity in the aggregation node as the environment of DQN. Figure 3 As shown, the changes in the environment are mainly reflected through the updates of queue length, dequeue rate, queuing delay, and cache capacity. Figure 4 The implementation principle of the DQN packet loss strategy is shown. Specifically, the DQN agent is based on the state of the environment s t Perform the corresponding action a t , this action determines the probability of discarding or retaining the data packet in the cache, that is, the packet loss rate. The environment calculates the reward value for the current action according to the reward function r t , and update the next state s t+1 , the DQN agent is based on s t+1 and r t Execute new actions. Through the iterative interaction with the environment, the DQN agent continuously updates the Q value and eventually learns the optimal packet loss strategy.
[0095] Step S3, build a DQN agent,
[0096] 1. State space design
[0097] The present invention uses the current queue length in the environment L current , Current dequeue rate R dequeue , Current queue delay D current , and the current cache capacity B current Defined as the state space, .
[0098] The present invention defines the packet loss rate as a continuous action space, that is, .in A is a continuous packet loss probability space ranging from [0,1].
[0099] 3. Reward function design
[0100] The present invention designs a reward function from two aspects: queuing delay and throughput. The queuing delay reward function is:
[0101] (1)
[0102] in, D desired Indicates the ideal queuing delay of the current queue in the cache. This variable is set manually. D current Indicates the actual queuing delay of the current queue. This variable is obtained through the GetSeconds() function in NS3.
[0103] The throughput reward function is:
[0104] (2)
[0105] in, D max Indicates the maximum queuing delay under the current cache. R play represents the physical bandwidth (data rate) of the bottleneck link, N enq Indicates the number of packets currently successfully queued. N dropped Indicates the number of packets currently discarded.
[0106] In order to balance the queuing delay and throughput, the present invention weightedly sums the delay reward and the throughput reward to obtain the total reward function:
[0107] (3)
[0108] in, w1 , w 2 are the weights of the queue delay reward and throughput reward respectively. In order to prevent extreme values from appearing during DQN training, which may lead to algorithm instability, the reward function value is limited to between -1 and 1 by clipping.
[0109] 4. Action selection strategy design
[0110] use The strategy is to choose a reward function that Maximizing Action a t , The decision-making method of the strategy is:
[0111] (4)
[0112] in, a t Indicates the current state s t The packet loss rate under is a random number in (0,1), is the exploration rate, when When , choose the action with the largest expected value; when When , a parameter adjustment action is randomly selected. The exploration rate of the present invention adopts the formula:
[0113] Calculate, where The purpose of the exploration rate gradually decreasing as the number of training rounds increases is to explore the environment more in the early stage of training, discover more state-action pairs, and accumulate more experience. As training progresses, the agent gradually learns the patterns and laws of the environment from experience, gradually forms more accurate strategies and maximizes the long-term cumulative rewards.
[0114] In step S4, the present invention adopts the Deep Deterministic Policy Gradient (DDPG) algorithm, such as Figure 5 As shown in the figure, the policy network includes an input layer, a hidden layer, a fully connected layer, and an output layer, specifically:
[0115] Input layer: includes four input units, corresponding to the state space The 4 variables in; L current Indicates the current queue length, R dequeue Indicates the current dequeue rate, D currentIndicates the actual queuing delay of the current queue. B current Indicates the current cache capacity;
[0116] Hidden layer: The number of neurons in the hidden layer is 128, and the ReLU activation function is used to achieve nonlinear transformation;
[0117] Fully connected layer: The number of neurons in the fully connected layer is 128, and the ReLU activation function is used to achieve nonlinear transformation.
[0118] Output layer: uses 1 output unit to output the packet loss probability in the current state;
[0119] The value network includes input layer, hidden layer, fully connected layer, and output layer, specifically:
[0120] Input layer: includes 5 input units, corresponding to and current status s t Actions taken a t ,Right now( s t, a t ).
[0121] Hidden layer: Set the number of neurons in the hidden layer to 128, and use the ReLU activation function to achieve nonlinear transformation;
[0122] Fully connected layer: The number of neurons in the fully connected layer is set to 128, and the ReLU activation function is used to achieve nonlinear transformation;
[0123] Output layer: includes 1 output unit, outputs the value corresponding to the current state and action .
[0124] Step S5, training the deep deterministic policy gradient network, the parameter transfer and network update for each training cycle of DDPG are as follows Figure 6 shown.
[0125] (1) Model initialization:
[0126] 1. Initialize the policy network Parameters and value network Parameters ;
[0127] 2. Initialize the target policy network Parameters and target value network Parameters ;
[0128] 3. Initialize the experience replay pool D ;
[0129] (2) Agent training:
[0130] 1. Get the initial state S1 of the environment;
[0131] 2. Use the current policy network According to the current status s t Generate Action ;
[0132] 3. Execute actions a t And observe the reward r given by the environment t and the next state s t+1 ;
[0133] 4. Experience Stored in the experience replay pool D middle;
[0134] 5. From the Experience Replay Pool D Randomly sample small batches of experience Conduct training;
[0135] (3) Experience playback:
[0136] 1. From the experience replay pool D Randomly sample a small batch of experience ;
[0137] 2. Calculate the target value based on sampling experience :
[0138] (5)
[0139] 3. Calculate the current state value ;
[0140] 4. Calculate the loss function of the value network:
[0141] (6)
[0142] in, N Represents the size of the small batch of experience extracted from the experience replay pool each time. N =32.
[0143] 5. Use the Adam optimizer to minimize the loss function and update the parameters of the value network ;
[0144] 6. Calculate the loss function of the policy network:
[0145] (7)
[0146] 7. Use the Adam optimizer to minimize the loss function and update the parameters of the value network .
[0147] (4) Soft update target network parameters and :
[0148] (8).
[0149] .Update the parameters of the current policy network and the current value network to the target policy network and the target value network. The above process collects experience by interacting with the environment and uses the experience playback buffer to reuse samples to update the network parameters. By continuously interacting and updating network parameters in the environment, the agent can obtain higher rewards in the environment.
[0150] The present invention also verifies the effect of the present invention by building a simulation scene, as follows:
[0151] (1) Network topology design
[0152] In NS3, a typical bottleneck link network topology is designed. The topology is as follows: Figure 7 As shown in the figure. The number of source nodes and destination nodes are both 50, R1 and R2 are link aggregation nodes, the active queue management algorithm is deployed on R1 and R2, the bottleneck link between R1 and R2 uses a P2P link, the link rate is 250kbps, and the link transmission delay is 2ms. The link between the source node and R1 and the link between the destination node and R2 uses a P2P link, the link rate is 10Mbps, and the transmission delay is set to 2ms.
[0153] (2) Network load design
[0154] 1. Business flow sending rules: S1 sends data to D1, S2 sends data to D2, ..., S 50 To D 50 Send data.
[0155] 2. Service flow model: Based on the ON / OFF traffic model, three service flows, fax, video, and voice, are designed. The size of the fax service data packet is a random number within (1000, 1099). The ON / OFF traffic model uses ns3::ParetoRandomVariable[Scale=0.1|Shape=1.5] to define the time interval between ON and OFF. The duration of the ON and OFF states follows the Pareto distribution, where Scale is the position parameter and Shape is the shape parameter. The size of the video service data packet is a random number within (1000, 1099). The ON / OFF traffic model uses ns3::ParetoRandomVariable[Scale=0.1|Shape=1.2] to define the time interval between ON and OFF. The duration of the ON and OFF states follows the Pareto distribution. The size of the data packet sent for voice services uses a random number within (500,699). The ON / OFF traffic model uses ns3::ExponentialRandomVariable[Mean=0.001|Bound=1.0] to define the time intervals between ON and OFF. The duration of the ON and OFF states follows an exponential distribution, where Mean is the average duration and Bound is the upper bound.
[0156] 3. Simulation duration: The NS3 simulation duration is set to 60s. The service flow starts to be sent from the 20th second, of which the fax service is continuously sent from 20 to 50s, the video service is continuously sent from 30 to 50s, and the voice service is continuously sent from 40 to 50s. The total sending duration is 30s.
[0157] The simulation energy comparison of the present invention is as follows:
[0158] (1) Environmental parameter settings
[0159] Set the initial value of cache capacity B = 20KB, the lower limit of cache capacity , the upper bound of cache capacity , ideal queue delay .
[0160] (2) Model training parameter setting
[0161] Learning Rate , discount factor , Adam optimizer is used to optimize network parameters.
[0162] (3) Comparison of algorithm selection and parameter setting
[0163] The FIFO algorithm, RED algorithm, CoDel algorithm, and Fq-CoDel algorithm provided in NS3 were selected for simulation verification, where the cache capacity of the comparison model was set to a fixed value of 50 packets.
[0164] (4) Model performance comparison
[0165] Average throughput performance comparison Figure 8 As shown, it can be seen that ARED has the highest average throughput performance, FIFO has the lowest average throughput performance, and the average throughput of the model of the present invention is 228.6 kbps, which is slightly higher than FIFO, CoDel, and Fq-CoDel, and second only to RED. The main reason is that the cache upper limit of the present invention is 45 KB. According to the maximum transmission unit of the data packet of 1500 bytes, the number of packets corresponding to the cache capacity of 45 KB is 30 packets. Therefore, the throughput performance comparison shows that the present invention can achieve a more objective throughput performance with a smaller cache capacity.
[0166] Average transmission delay performance comparison Figure 9 As shown, it can be seen that the average transmission delay of the model of the present invention is 2.1972s, which is lower than that of other comparison models, and is reduced by 27% compared with the average transmission delay of FIFO and 1.9% compared with the average transmission delay of CoDel.
[0167] Average delay jitter performance comparison Figure 10 As shown, it can be seen that the delay jitter of the model of the present invention is 0.31856s, which is lower than that of other comparison models, and is reduced by 45.6% compared with the average delay jitter of Fq-CoDel, and is reduced by 4.7% compared with the average transmission delay of CoDel.
[0168] Packet loss rate performance comparison Figure 11 As shown, it can be seen that the packet loss rate of Fq-CoDel is the lowest at 0.43623, the packet loss rate of ARED is the highest at 0.47629, and the packet loss rate of the model of the present invention is 0.47588, which is mainly caused by the reduction of cache capacity. However, overall, the packet loss rate is close to that of other models.
[0169] The above results show that the present invention proposes an active queue management method based on dynamic cache, while ensuring the throughput and packet loss rate, and achieving the performance improvement of average transmission delay and average delay jitter. In addition, the cache capacity of the present invention is lower than that of the comparison model, so it can further reduce the hardware cost of forwarding equipment such as routers, and achieve cost reduction and efficiency improvement.
[0170] Although the present invention has been described above with preferred embodiments, it is not intended to limit the present invention. A person skilled in the art of the present invention may make various modifications and improvements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the claims.
Claims
1. An active queue management method based on dynamic cache, characterized in that: The steps include: S1. Execute a dynamic cache strategy for the traffic queue: periodically adjust the cache capacity based on the initial cache capacity and the upper and lower bounds of the cache until the queue in the cache is emptied; specifically, the following sub-steps are included: S101, Cache capacity Buffer Initialization: Node cache capacity Buffer Set the initial value of in bytes; S102, cycle count count =0, the cycle count is used to implement periodic adjustment of cache capacity, and the cycle is set to T ; S103, get the current queue and add the queue to the list, the length of the list is L , represents the number of elements in the list; S104: Determine whether the list length exceeds L , then execute count++ , otherwise returns to step S103; S105, Comparison count and T The size of count = T Then execute step S106, count < T The oldest queue in the list is removed, and step S103 is executed; S106. Calculate the average queue length in the list Q avg , ,in Q (count) Indicates the queue length of a single count in the list, in bytes; S107, based on Q avg The size of the queue and the current queue length adjust the cache capacity Buffer ; S108, determine whether the queue in the cache is empty, if not, reset the cycle, clear the list, and execute step S102, if it is empty, end the cache update strategy; S2. Build a DQN environment. The DQN agent performs corresponding actions according to the state in the environment. Through the iterative interaction process with the environment, the DQN agent continuously updates the current state of the environment and the corresponding actions. Q The optimal packet loss strategy is learned. The state of the environment is: queue length, dequeue rate, queuing delay, and cache capacity. S3, build a DQN agent, define the current queue length, current queue rate, current queue delay, and current cache capacity in the environment as the state space, define the packet loss rate as the continuous action space of the agent, define the total reward function as the sum of the queue delay reward function and the throughput reward function, and use A strategy to choose actions that maximize the total reward function; S4. Build a deep deterministic policy gradient network consisting of a policy network and a value network; The policy network includes the current policy network and the target policy network with the same structure. It takes the state of the environment as input and obtains the packet loss probability under the current state. The value network includes the current value network and the target value network with the same structure. The value network takes the state of the environment and the action corresponding to the current state as input to obtain the value corresponding to the current state and action. Update the parameters of the current policy network and the current value network to the target policy network and the target value network; S5. Get the initial state of the environment, use the current policy network, generate actions according to the current state, execute the actions to give rewards and the next state, and use the experience replay mechanism to train the deep deterministic policy gradient network to obtain the active queue management model of dynamic cache. Using the active queue management model of dynamic cache, take the current traffic queue as input to obtain the traffic queue management strategy in the cache.
2. The method for active queue management based on dynamic cache according to claim 1, characterized in that: Step S107 is specifically: judging Q avg Is it greater than the current queue length: If Q avg If it is greater than the current queue length, then determine whether the current queue length is less than Buffer 0.9 times of Buffer= 0.9× Buffer , otherwise keep Buffer No change; further judgment Buffer Is it less than the cache lower bound? Buffer_min If so, then Buffer=Buffer_min , otherwise keep Buffer unchanged; if Q avg Is not greater than the current queue length, then Buffer Expand by 1.1 times, that is Buffer= 1.1× Buffer ; Further judgment Buffer Is it greater than the cache upper limit? Buffer_max If so, then Buffer=Buffer_max , otherwise keep Buffer constant.
3. The active queue management method based on dynamic cache according to claim 1, characterized in that: Step S2 is as follows: The DQN agent determines the state of the environment s t Perform the corresponding action a t , this action determines the probability of discarding or retaining the data packet in the cache, that is, the packet loss rate. The environment calculates the reward value for the current action according to the reward function r t , and update the next state s t+1 , the DQN agent is based on s t+1 and r t Perform new actions; Through the iterative interaction process with the environment, the DQN agent continuously updates the Q value and eventually learns the optimal packet loss strategy.
4. The method for active queue management based on dynamic cache according to claim 1, characterized in that: In step S3, The queue delay reward function is: (1) in, D desired Indicates the ideal queuing delay of the current queue in the cache. This variable is set manually. D current Indicates the actual queuing delay of the current queue. This variable is obtained through the GetSeconds() function in NS3; The throughput reward function is: (2) in, D max Indicates the maximum queuing delay under the current cache. R play represents the physical bandwidth of the bottleneck link, that is, the data rate, N enq Indicates the number of packets currently successfully queued. N dropped Indicates the number of packets currently discarded. B current Indicates the current cache capacity; The total reward function is: (3) w 1 , w 2 They are the weights of queuing delay reward and throughput reward respectively.
5. The method for active queue management based on dynamic cache according to claim 1, characterized in that: In step S3, use The strategy is to choose a reward function that r t ( s t , a t ) Maximizing action a t , The decision-making method of the strategy is: (4) in a t Indicates the current state s t The packet loss rate under the condition, where is a random number in (0,1), is the exploration rate, when When , choose the action with the largest expected value; when When a parameter adjustment action is randomly selected, the exploration rate is calculated using the formula Calculate, where is the number of training rounds.
6. The method for active queue management based on dynamic cache according to claim 1, characterized in that: In step S4, the policy network includes an input layer, a hidden layer, a fully connected layer, and an output layer, specifically: Input layer: includes four input units, corresponding to the state space The 4 variables in; L current Indicates the current queue length, R dequeue Indicates the current dequeue rate, D current Indicates the actual queuing delay of the current queue. B current Indicates the current cache capacity; Hidden layer: The number of neurons in the hidden layer is 128, and the ReLU activation function is used to achieve nonlinear transformation; Fully connected layer: The number of neurons in the fully connected layer is 128, and the ReLU activation function is used to achieve nonlinear transformation; Output layer: uses 1 output unit to output the packet loss probability in the current state.
7. The method for active queue management based on dynamic cache according to claim 6, characterized in that: The value network includes input layer, hidden layer, fully connected layer, and output layer, specifically: Input layer: includes 5 input units, corresponding to and current status s t The biggest move a t ,Right now( s t, a t ); Hidden layer: Set the number of neurons in the hidden layer to 128, and use the ReLU activation function to achieve nonlinear transformation; Fully connected layer: The number of neurons in the fully connected layer is set to 128, and the ReLU activation function is used to achieve nonlinear transformation; Output layer: includes 1 output unit, outputs the value corresponding to the current state and action .
8. The method for active queue management based on dynamic cache according to claim 1, characterized in that: Training a deep deterministic policy gradient network using the experience replay mechanism includes the following sub-steps: S401, Model initialization: Initialize the strategy network Parameters and value network Q Parameters ; Initialize the target policy network Parameters and target value network Parameters ; Initialize experience replay pool D ; S402, Agent Training: Obtaining the Initial State of the Environment s 1; Use the current policy network According to the current status s t Generate Action ; Execute action a t And observe the rewards given by the environment r t and the next state s t+1 ; Experience Stored in the experience replay pool D Medium; From the experience replay pool D Randomly sample small batches of experience Conduct training; S403, Experience Replay: Randomly sample a small batch of experience from the experience replay pool ; Calculate target value based on sampling experience : (5) Calculate the current state value ; Calculate the loss function of the value network: (6) in, N Represents the size of the small batch of experience drawn from the experience replay pool each time; Use Adam optimizer to minimize the loss function and update the parameters of the value network ; Calculate the loss function of the policy network: (7) Use Adam optimizer to minimize the loss function and update the parameters of the value network ; S404, soft update target network parameters and : Update the parameters of the current policy network and the current value network to the target policy network and the target value network (8)。
Citation Information
Patent Citations
Congestion control method and system based on deep reinforcement learning
CN110581808A
Data packet routing algorithm based on multi-agent deep reinforcement learning
CN112491712A
Shared cache management method and device
CN115297067A
Network congestion control method and system based on deep reinforcement learning, and related equipment
CN116232998A
Internet of Things intelligent congestion control method based on deep reinforcement learning
CN116471629A
