# Performance Analysis of a Novel TCP Protocol Algorithm Adapted to Wireless Networks
## 2 Materials and Methods
### Mathematical Analysis  
We start the analysis from a mathematical modeling of the Generic TCP behavior in order to develop an adaptation for corrupted packets retransmission without the CWND size reduction (i.e., the TCP-NACK performance idea) [16]. For this purpose, Slow Start and Congestion Avoidance algorithms were used for modeling the Generic TCP protocol in their Reno and Westwood version. At the TCP layer, we use the maximum packet size (MSS) of \(N_{TCP}\) bits. The sender releases packets into a limited FIFO buffer that can hold up \(B\) packets. The packets are then sent over a single bottleneck link with a speed of \(R_{p}=R_{b}/N_{TCP}\) packets per second, where \(R_{b}\) is the bit rate of the TCP layer. Figure 1 shows the \(\omega\)-th cycle evolution of the congestion window between two indications of acknowledgements (ACKs). If \(W_{0}\) is the initial congestion window, the first burst contains exactly \(W_{0}\) packets, the second \(W_{0}+1\) packets and so on. The congestion window is increased by one at the end of each burst. The index of the first packet lost in the cycle is denoted by \(n_{l}\). If \(x\) is the burst where the lost one occurs, in the burst \(x+1\) the congestion window is reduced for \(W_{0(\omega+1)}\) and this value depends on the estimate bandwidth for TCP Reno or TCP Westwood [5]. We considered that the congestion window is increased by one at the end of each burst. Therefore, the congestion window for the x-th burst is given by  
\[W_{x}=W_{0}+x. \tag{1}\]  
Figure 1: Evolution of CWND. When the congestion does not exist, the congestion window has a linear increase for every round-trip times (\(RTT\)) seconds, given by  
\[RTT=\frac{1}{R_{p}}+\tau_{p}, \tag{2}\]  
where \(\tau_{p}\) is the propagation time. During a cycle, ACKs in the same burst arrive \(1/R_{p}\) seconds apart while consecutive bursts arrive \(RTT\) second apart, until the pipe capacity, \(W_{C}=R_{p}RTT\), is reached and \(c=W_{C}-W_{o}\). After this point, ACKs arrive continuously every \(1/\mathrm{R_{p}}\) seconds. Since a packet loss would occur one the buffer is full, the maximum window size a connection can achieve is given by  
\[W_{max}=W_{C}+B, \tag{3}\]  
for \(x=W_{C}-W_{0}+B\). Let \(n_{x}\) the index of the first packet in the x-th burst, given by  
\[n_{x}=1+\sum_{j=0}^{x+1}W_{j}\ =\ 1+xW_{0}+\frac{x(x-1)}{2}, \tag{4}\]  
The index of the packet dropped due to buffer overflow is denoted by \(n_{of}\) and is given by:  
\[n_{of}=n_{cb}+2(W_{C}+B) \tag{5}\]  
where \(n_{cb}\) is the first packet in the burst \(x=c+B\), for the maximum window size \(W_{max}\). Let \(x_{n}\) be the number of burst that contain the packet number \(n\) and \(r_{x_{n}}\) the offset of the packet in the burst \(x_{n}\). These parameters for \(1\leq n\leq n_{of}\) are expressed as  
\[x_{n}=\left\{-W_{0}+\frac{1}{2}+\sqrt{W_{0}^{2}-W_{0}-\frac{7}{4}+2n}\right\} \tag{6}\]  
and  
\[r_{x_{n}}=n-n_{x_{n}} \tag{7}\]  
The instant in which the \(n\)-th ACK is received is given by  
\[\Delta t(W_{0},n)=\left\{ \begin{array}{ll}RTT(x_{n}-1)+\frac{r_{x_{n}}}{R_{ p}}&\quad n\leq n_{c},\\ RTT(c+1)+\frac{n-n_{c}}{R_{p}}&\quad n>n_{c},\end{array} \right. \tag{8}\]  
where \(c=W_{C}\)-\(W_{0}\)x\({}^{\diamond}\) is the burst where the pipe capacity occurs. For the TCP Reno at the beginning of a generic cycle \(\omega\), the start threshold according to the value of the estimate bandwidth at the end of the previous cycle for congestion avoidance is given by  
\[ \begin{array}{ll}W_{0(\omega)}&=f_{c}\Big{(}W_{0(\omega-1)},n_{l(\omega-1) }\Big{)}\\ &=\max\Big{\{}2,\left\lfloor\frac{W_{0(\omega-1)}+x_{n_{l}}(\omega-1)}{2} \right\rfloor\Big{\}},\end{array}  \tag{9}\]  
where \(n_{l}\) is the ACK missed at the end of the cycle \(\omega-1\).