# Enhanced Multistream Fast TCP: Rapid Bandwidth Utilization after Fast-Recovery Phase
## 3 Enhanced Multistream Fast TCP (EMFast TCP)
### Congestion Control after Fast-Recovery Algorithm (CCaFR)  
CCaFR algorithm becomes active after the fast-recovery phase until the protocol consumes the available network bandwidth. The CCAFR algorithm inherits default Fast TCP design. Therefore, the default parameters of Fast TCP are used in the development of this algorithm. CCAFR changes the congestion window on receipt of each ACK until the available bandwidth of network link is filled and IPD becomes consistent. Figure 4: Inter-packet delay jitter during and after fast-retransmit and -recovery phase of MFast TCP. CCaFR computes the congestion window using Equation (1) and is denoted as \(\text{cwnd}_{\text{new}}\) and the congestion window before this computation is referred to as \(\text{cwnd}_{\text{old}}\) (congestion window computed on receipt of last acknowledgment). Gapflag is a pointer which becomes true as the first gap between the series of acknowledgment is detected. The formula to compute the congestion window on receipt of each ACK is shown in Equation (2):  
\[cwnd\ \leftarrow\ \left\{ \begin{array}{l}cwnd_{temp}=cwnd_{\text{old}}+ \left(\frac{1}{cwnd_{\text{old}}}\right)\\ if(gapflag=true)\ cwnd_{new}\\ else\ cwnd_{temp}\end{array} \right\}. \tag{2}\]  
The CCaFR algorithm is described in Algorithm 1. Congestion control algorithm sets the value of isAFRmode (is after fast-recovery mode) true while leaving the fast-recovery mode. If the value of isAFRmode flag is true, it means that the fast-recovery mode has just finished, and the protocol has to increase its cwnd to consume the vacant network bandwidth. ```
Input: (AckPacket,rtt) Output:cwnd\(\_\)
1 IF isAFRmode = trueTHEN
2 IF avgIPD = IPD and avgRTT = rttTHEN
3 isAFRmode \(\leftarrow\) false
4 gapflag \(\leftarrow\) false
5 ENDIF gapflag = trueTHEN
6 fast_cc_affr(rtt,old_pf) V change cwnd as per its default delay-based scheme ELSE
7 cwnd\(\_\) = cwnd\(\_\) + 1/cwnd\(\_\)
8 ENDIF avgIPD = IPDTHEN
9 gurflag \(\leftarrow\) true;
10 ENDIF
11 ELSE fast_cc(rtt,old_pf) V change cwnd as per its default delay-based scheme after each RTT
12 ENDIF returncwnd\(\_\)
```  
**Algorithm 1** Growth of congestion window on receipt of each ACK in CCaFR. Line by line description of the algorithm is as follows:  
1. Did the protocol just exit from the fast-recovery mode? If so, then introduce new segments in the network to increase the congestion window. 2. If the average inter-packet delay is equal to the inter-packet delay of the received segment and the average round-trip-time is equal to the round-trip-time of the received segment, it means the protocol has consumed all the available bandwidth of the network link. Therefore, it is appropriate to quit isAFRmode and let the protocol operate in normal mode. 3. Set the value of isAFRmode to false so that on receipt of the next segment, the protocol does not execute the CCaFR algorithm. 4. Gapflag is the pointer to detect the gap between the series of segments, being received on the sender's end. 5. If the first series of the segment has already been received and the protocol is now receiving the second series of segments, then use the protocol's default formula to compute the cwnd based on the information of received segment's RTT and old packets inflight. The function fast_cc_afr is used to compute the congestion window on receipt of each acknowledgment. If the first series of the segments are being received by the sender, then increase its congestion window using additive-increase formula. This technique is used here to provide sufficient time to the network to clear its congestion. 7. If the average inter-packet delay is equal to the inter-packet delay of the received segment, then the gapflag value is set to true so that the protocol could increase its congestion window by using its delay-based formula. 8. Body of if condition given at line 1 ends here. 9. Now, the protocol is in normal congestion avoidance phase. Therefore, it is calling fast_cc function that is a part of Fast TCP implementation.