# A Sketch-Based Fine-Grained Proportional Integral Queue Management Method
## 3 System Model
### Queue Management
\[m\_res=Query(key)\] (7) \[G_{k}=\frac{m\_res}{m\_count}\] (8) \[G_{Threshold}=\frac{\sum_{i=1}^{n}m\_res*G_{x}}{\sum_{i=1}^{n}m\_res}\] (9)```
1:for each arriving packet \(pkt\)do
2:if queue is full then
3: drop \(pkt\);
4:elseif\(del\_cur\) < \(del\_ref/3\)then
5: drop \(pkt\) with \(p\);
6: Enqueue(\(pkt\)) with \(1\)-\(p\);
7: Sketch -\(>\)Insert(\(pkt\));
8:\(m\_count\)++;
9:else
10:\(m\_res\) = Sketch-\(>\)Query(\(pkt\));
11:\(G_{k}\) = \(m\_res/m\_count\);
12:if\(G_{k}\) < \(G_{threshold}\)then
13: drop \(pkt\);
14:else
15: Enqueue(\(pkt\));
16: Sketch -\(>\)Insert(\(pkt\));
17:\(m\_count\)++;
```

**Algorithm 1** DoDequeue for S-PIE

## 4 Experimental Evaluation

The experimental operating platform is the NS-3.27 network simulation platform and uses Ubuntu16.04. NS-3.27 is an open computer network simulation environment based on a discrete-event simulation that supports a wide range of network technologies, including wired and wireless networks, protocol stacks, routing, traffic control, congestion control, network topologies, etc., making it possible to simulate a variety of network scenarios and applications [34]. ### Simulation Scenario Setup

#### 4.1.1 Network Topology

The experiments in this study used the NS-3 simulation platform with a dumbbell topology model, and the network topology is shown in Figure 3. \(S_{1}\) to \(S_{n}\) represent a certain number of packet senders and \(R_{1}\) to \(R_{n}\) represent a certain number of packet receivers. Routing nodes Router1 and Router2 form a bottleneck link. The sender sends messages using an ON/OFF model. In the experiments, the TCP protocol congestion control algorithm NewReno was deployed uniformly on the sender side, and the AQM algorithm was implemented in the router Router1 queue. In the specific simulation experiments, this paper mainly uses two simulation scenarios, Scenario 1 makes a clear distinction between sending packets on the sender side, with half of the senders delivering a large amount of data to simulate a \"large flow\" and half of the senders delivering a small amount of data to simulate a \"small flow\". Scenario 2 does not differentiate between senders but sends random packets to simulate a general scenario. The detailed parameters are listed in Table 1.

Scenario 1: Set 100 nodes on the sender side, the packet rate of \(S_{1}\) to \(S_{n}\) (\(1\leq n\leq 50\)) is set to 1 Mbps, and the packet rate of \(S_{1}\) to \(S_{n}\) (\(51\leq n\leq 100\)) is set to 50 Mbps. This scenario is implemented to simulate a scenario where the data flows from \(S_{1}\) to \(S_{n}\) (\(1\leq n\leq 50\)) are \"small flow\" and the data flows from \(S_{1}\) to \(S_{n}\) (\(51\leq n\leq 100\)) are \"large flow\". Scenario 2: Set 100 nodes on the sender side, and the packet rate of \(S_{1}\)-\(S_{n}\) is set to 10 Mbps. This scenario implements a simulation of random data flow deployment. #### 4.1.2 Evaluation Metrics

* **Average queue length:** this is a crucial indicator to determine how well network congestion is addressed. The degree of queue fullness and the likelihood of network congestion increase with the average queue-length value. Network congestion is significantly decreased if the AQM algorithm is used for early packet drops. \[m=m_{-}ptc*(nTime-sTime)\] (10) \[del\_cur=\frac{q\_len}{dq\_rate\_avg}\]0 (11) where \(m\_ptc\) represents the packet time constant, \(nTime\) represents the current time, \(sTime\) represents the start time of the idle period, \(new\_qAvg\) and \(old\_qAvg\) represent the average queue length, \(qW\) represents the queue weight of the current queue sample, and \(nPkt\) represents the number of packets entering the queue within a period of time. * **RTT:** RTT (round-trip time) indicates the time elapsed from the time a packet is sent by the sender to the time an ACK of that packet is received, and the time measured by RTT includes the transmission time, queuing time, and processing time.