# Congestion Control Mechanism Based on Backpressure Feedback in Data Center Networks
## 4 Bfcc
### Rate Reduction Module
#### 4.2.2 Egress Control  
Because of the introduction of the scheduling strategy, the sending of congested flows is reduced, but the non-congested flows in the high-priority queue grab the bandwidth and forward at high speeds, which does not alleviate the downstream congestion problem. Therefore, on top of scheduling, we introduce a new control module before the packets are sent out of the port.  
The control module of the egress pipeline decides whether packets are forwarded downstream or not and monitors the packets that are scheduled to be forwarded at the ingress pipeline. The egress control module monitors the \"state\" field in the packet and triggers the egress control policy if it is set to \"True\". With flexible programmability, switches can be customized and extended to achieve specific forwarding, filtering, processing, and management functions.  
Unlike PFC, which directly pauses queue transmission, there is no equivalent operation in programmable switches. With the help of the idea of sender-side rate reduction in congestion control, a rate reduction strategy is designed between the switches. The rate reduction module is depicted in Figure 8. We define a register in the egress pipeline to record the real packets forwarded downstream; when the set threshold is reached, a copy of the packet (referred to as the \"fake packet\") is cloned and continues to be forwarded instead of the original while the original packet is retransmitted into the ingress pipeline. Since the \"fake packet\" does not exist in the original flow, it is forwarded downstream and discarded. By inserting fake packets, we can achieve the effect of rate reduction while making full use of the bandwidth.  
**Recirculation.** The switch has a dedicated internal link for recirculating, which does not affect the queue length on the egress port. For example, if 1% of the packets need to be cloned, the recirculation increases the bandwidth only by 1%; if each packet is cloned, the volume of packets processed at the ingress is doubled.  
Figure 8: Egress control at the data plane. This scheme achieves a second speed reduction.  
Programmable switches can process a large number of packets per second. By harnessing the robust computational capabilities of the PDP, the function of rate reduction can be delegated to switches. After conducting extensive testing on this module, we reach the following conclusions.  
During mild congestion downstream, the upstream rate threshold is set to 9. This means that for every 10 packets sent through the egress pipeline, 1 \"fake packet\" is inserted, and the speed is reduced to 9/10 of the original. For moderate congestion, the threshold is set to 3; the speed is reduced to 3/4 of the original. In the case of severe congestion, the speed quickly converged to half of the original. And, when the sender receives a congestion feedback packet from the switch, the reduced sending rate is the same as that of the switch. The algorithm for the egress pipeline is shown in Algorithm 2.  
```
1:Packet p, Backpressure\(-\)Feedback\(-\)Packet bfp, Rate\(-\)Threshold RT, \(T_{min}\), \(T_{max}\), CONGESTION THRESHOLD;
2:None
3:// Detect congestion
4:ifen_dg_depth \(>\) CONGESTION THRESHOLD then
5:ifdeq_timedelta \(<=T_{min}\)then
6: Set \(mild\_\)degree;
7:elseifdeq_timedelta \(>T_{min}\)anddeq_timedelta \(<=T_{max}\)then
8: Set \(moderate\_\)degree;
9:else
10: Set \(severe\_\)degree;
11:endif
12:// Congested flow identification
13: Compute Max(queue_occupancy)
14:endif
15:Generate bfp;
16:// Secondary deceleration in upstream switch
17:ifp_state is True then
18:ifdequeued_packets \(>\) RT then
19: Clone;
20: Recirculate(p);
21:endif
22:endif
```  
**Algorithm 2** Pseudo-code of the BFCC algorithm implemented at the egress pipeline of the PDP.