2
TCP\footnote{Transmission Control Protocol} becomes the de facto standard protocol
3
for the nowadays applications. Application protocols like HTTP, FTP, SSH are all
4
built upon TCP, because TCP provides enough functionality to create reliable applications.\\
5
TCP provides reliable connection whatever the the stack under the TCP is, connection
6
oriented communication, with flow control and congestion avoidance mechanisms.
7
All these services make TCP the most complicated layer in the current OSI model.
8
All these services are provided making use of error detection, multiplexing, retransmissions,
9
commulative acknowledgments, timers.\cite{topdown}
11
TCP is defined mainly in RFC 793, but as time goes on many other variants appeared
12
to tune TCP to different environments and to fix performance issues. Most of the
13
modifications came later addressed the congestion problem in networks.
15
\section{Flow Control}\label{TCP:Flow control}
16
This mechanism aims to not overwhelm the receiver with the data transferred. The sender maintain
17
the following variables the receive window, last byte acknowledged, last byte sent. Receive window guarantee that data received at the
18
receiver buffer and the data transferred along the connection will not be larger than the receiver buffer. The receive window
19
variable is updated in the sender from the receive window field in the acknowledgements. The field is calculated in the receiver
20
According to the following equation:
21
\begin{verbatim} RcvWindow=RcvBuffer-[LastByteRcvd - LastByteRead]\end{verbatim}
22
If the receiver do not have any acknowledgement to send the sender keeps a persist timer, so it sends a dummy small packet
23
the timer timeouts, so it can get an acknowledgement from the receiver which updates the
24
receive window variable. Which is important if it is equal to zero.
25
\section{Congestion Avoidance}\label{TCP:Congestion Avoidance}
26
Due to the limitations we have on real networks like finite buffer sizes, many practical
27
issues arise. Finite buffers will drop any further data received if they are full, those dropped
28
packets according to the reliable data transfer mechanism will be retransmitted again. Which make the
29
system in a deadlock situation! To solve such problem many mechanisms are applied. The following are the most
32
\item \textbf{Slow Start}
33
TCP starts in this mode.Slow Start begins with the congestion window, called
34
\verb+cwnd+ , containing one segment. After each acknowledgement
35
the cwnd increases by one, which result in doubling the \verb+cwnd+ size each Round
36
Trip Time (RTT), and it continues till \verb+cwnd+ reaches the minimum of the congestion window,
37
and the receive window. When a lost packet or acknowledgement detected by a timeout
38
occurring or the receipt of duplicate ACKs. The \verb+cwnd+ will be reset to 1 segment and ssthresh will set to the
39
half of the current \verb+cwnd+.
40
\item \textbf{Congestion Avoidance}
41
This mode declare a new variable called Slow Start Threshold \verb+ssthresh+ which maintains half of the \verb+cwnd+
42
size when the last congestion happened. When the current \verb+cwnd+ reaches the \verb+ssthresh+ the \verb+cwnd+ will
43
exit the slow start mode and enter the congestion avoidance mode which make the
44
increments of the \verb+cwnd+ occur in linear behavior instead of the exponential one.
45
\item \textbf{Fast Retransmit}
46
Instead of waiting the sender timer to timeout, duplicate acknowledgement is a strong
47
indication of a reordering or few lost packet, receiving three or more duplicate
48
acknowledgements means that it is not a reordering problem. Few lost packets does not
49
imply a strong congestion so a direct retransmission occur on the sender after receiving
50
duplicate acknowledgements. Fast retransmit utilizes the link throughput.
52
\item \textbf{Fast Recovery}
53
Fast retransmit implies the beginning of the congestion, so fast recovery mechanism
54
apply the congestion avoidance instead of slow start which reduces \verb+cwnd+. "It is an improvement that allows high
55
throughput under moderate congestion, especially for large windows"\cite{2001}.
59
\section{TCP Variants}\label{TCP:TCP Variants}
60
Due to the intensive research done on the TCP performance issues, many variants appeared, the following are
61
the most popular ones:
64
\item \textbf{TCP Tahoe}
65
is the original design. When a loss detected the \verb+cwnd+ will set to one segment and
66
TCP will enter the slow start mode.
67
\item \textbf{TCP Reno}
68
is the most implemented TCP, it uses the above mechanisms listed above: Slow Start
69
, Congestion Avoidance, Fast Retransmit, Fast Recovery.
70
\item \textbf{TCP Vegas}
71
uses AIMD\footnote{Additive Increases/Multiplicative Decreases} algorithm in the congestion window, the difference is
72
is that Tahoe detects the loss depending on the change in the RTT, which makes it
73
depending heavily on calculating the RTT in precise way.
74
\item \textbf{TCP newReno}
75
improves throughput during the fast recovery mode, by advancing the \verb+cwnd+ for each acknowledged
76
packet, which keeps the transmit window full.For every ACK that makes partial progress in the sequence space,
77
the sender assumes that the ACK points to a new hole, and the next packet beyond the ACKed sequence number is sent.
78
It seems like the SACK\footnote{Selective Acknowledgement} behaviour.