• No se han encontrado resultados

TCP/IP was designed to build over the simple network layer to provide a reliable in-order data delivery service to the application layer. We can summarize the main objectives of TCP/IP protocol by [Pos81, Bra89, Jac88, BA00, Ste97]:

• End-to-end flow control • Error control

• Congestion control

6.2.0.4 End-to-End Control

The end-to-end control guarantees that the sender does not inject into the network more data than the receiver can hold in its buffer. This is achieved by a window whose value is advertised during connection set-up and it is updated during the connection lifetime if the buffer space at the receiver changes.

6.2.0.5 Loss (or Error) Control

The loss control means that TCP/IP is responsible of information recovery in case of loss. This is done by the retransmission of the lost information. Loss detection in TCP/IP is based on sequence numbers and acknowledgments (ACKs). An ACK carries implicitly the sequence number of the last in-order packet received. The TCP/IP receiver acknowledges the reception of one data packet over two in general. This is called the delay mechanism and its objective is to reduce the volume of generated ACKs. The TCP/IP receiver transmits a duplicate ACK for every out of order packet. Upon the reception of three duplicate consecutive ACKs, the source realizes that a packet has been lost (this is called the Fast Retransmit algorithm). In fact, the Fast Retransmit algorithm was introduced to enhance the performance of TCP/IP. Before the loss detection was only possible via the retransmission timer called timeout. This timer is initialized before transmission and recalculated during the connection life time. The expiration of this timer before the reception on an ACK is a loss signal for the sender.

6.2.0.6 Congestion Control

The congestion control means that different sources adapt their transmission rates as a function of the network load. The objective is the good utilization of network re- sources with fairness between different flows. The congestion control algorithm adopted by TCP/IP is an additive-increase with multiplicative-decrease algorithm. The rate of TCP/IP source is controlled by a window-based approach. This window is called Con- gestion Window. The rate control in TCP/IP is achieved by changing the size of the congestion window. The rate on a TCP/IP connection can be approximated by the window size (Or the number of packets the source has in the network) divided by the round-trip time (RTT).

Chapter 6. TCP/IP Differential Analytical Modelling 104

The injection of an application’s traffic is dynamically governed in function of RTT, and effects of congestion in the network as reflected in timeouts and lost packets. RTT estimates are important performance parameters in a TCP/IP exchange, especially when considering a large transfer. If the RTT estimate is too low, packets are retransmitted unnecessarily; if too high, the connection can sit idle while the host waits to timeout. TCP/IP source uses ACKs to estimate the RTT of the connection and sets accordingly a timer when packets are sent. An Exponentially Weighted Moving Average algorithm is used to smooth the oscillations in the RTT.

The average transfer rate, also called the throughput, is the main performance mea- sure that indicates how well a bulk TCP/IP transfer is done.

6.2.1

Notations

All notations given here concern the TCP/IP NewReno version. We develop our model and do our simulations based on this version. However, the extension of our model to other versions can be done very easily.

All values unites are in Bytes. We denote:

• MSS (Maximum Segment Size): The maximum segment size (MSS) is the largest amount of data in one packet that can not be exceeded regardless how large the current window is.

• SEQ (Sequence): SEQ is the address of the next packet to send.

• ACK (Acknowledgment): The value of the last received ACK which corre- sponds to the address of the next packet to be sent.

• CWND (Congestion Window): This window corresponds to the maximum data volume present on the network between sender and receiver. It indicates the output rate per RTT.

• RWND (Receiver Window): This window corresponds to the maximum data volume that could be held in the receiver buffer.

• NDUP (Number of Duplicate ACKs): NDUP is a counter of the number of identical ACKs received by the sender.

• RTT (Round-Trip Time): The RTT is the time measure between the moment of sending a packet and the moment of the reception of its corresponding ACK. • RTO (Retransmit Time-Out): The RTO is the estimation of the maximum de-

lay allowed between the sending of one packet and the reception of its corresponding ACK.

• CREDIT The CREDIT is a calculated value representing the number of packets the source is allowed to transmit. It is given by the following equation:

Chapter 6. TCP/IP Differential Analytical Modelling 105

Figure 6.1: Sending Credit and Congestion Window

CREDIT = ACK + min(CW ND, RW ND) − SEQ + NDUP ∗ MSS (6.1) The establishment of a TCP/IP connection starts always by the transmission of a SYN packet and the reception of the corresponding ACK. This gives the source a credit of two packets to start the transmission of data. Equation (6.1) governs the evolution of the credit on the sender side. To understand the evolution of the credit Figure 6.1 illustrates the credit equation (without considering RWND or NDUP).

The reception of one ACK increases the sending credit while the transmission of one segment decreases the credit. TCP/IP algorithm uses the reception rate of ACKs to control its sending rate by changing the sending credit and the congestion window accordingly. When the receiver gets a packet, SEQ gives the address of data in the receiver buffer. On the receiver side ACK value is calculated based on the data volume contained in the received packet and the SEQ value.

However, upon packet reception the data could not be processed in the following cases:

• The address of the end of data (SEQ+packet size) is less than ACK at receiver. • The address of the beginning of received data is bigger than (ACK+RWND) at

receiver.

Otherwise, data is placed into the receiver buffer and a new ACK value is calculated. In all cases the next ACK to be sent contains the address of the beginning of next data to be received.

We develop in the following sections the operation modes of TCP/IP. This behavioural description is important to understand the differential analytical model of TCP/IP.

Chapter 6. TCP/IP Differential Analytical Modelling 106

Figure 6.2: Simplified TCP/IP State Transitions

6.2.2

Operation Modes

TCP/IP has three principal operation modes: Slow Start, Congestion Avoidance and Fast Retransmit. The state machine of TCP/IP operation is depicted on Figure 6.2. In the following sections we explain the operation of each mode as well as the events causing the transition from one state to another.

6.2.2.1 Slow Start

When a new connection is established, the congestion window is initialized to one seg- ment. Each time an ACK is received, the congestion window is increased by one segment. The sender starts by transmitting one segment and waiting for its ACK. When that ACK is received, the congestion window is incremented from one to two, and two segments can be sent. When each of these two segments is acknowledged, the congestion window is increased to four and so forth, providing an exponential growth. Indeed, it is not exactly exponential because the receiver may delay its ACKs. Typically, the receiver sends one ACK for every two segments. The delayed ACK parameter is called b and its value is 2 in general.

During Slow Start TCP/IP sender transmits packets by bursts. The size of bursts is function of the delayed ACK parameter. For each b packets received one ACK is sent from the receiver to the sender. The number of packets sent in one burst follows approximately a geometric series of b+1b reason. Indeed, the exponential behaviour of packet rate during Slow Start mode of TCP/IP is due to this evolution. However, this exponential behaviour is only an approximation because the actual packet rate is controlled by the service rate of the slowest router on the packets path denoted µmin. ACKs arrive to the sender at this

maximum rate and the increase of the Congestion Window CWND is exponential until the reception rate of ACKs reaches this value where it becomes linear not exponential.

Chapter 6. TCP/IP Differential Analytical Modelling 107

6.2.2.2 Congestion Avoidance

Congestion Avoidance is implemented to deal with lost packets. There are two indica- tions of packet loss: a timeout event and the reception of three duplicate ACKs. Al- though Congestion Avoidance and Slow Start are independent algorithms with different objectives, they are implemented together and use two variables for each connection: a congestion window (CWND), and a Slow Start threshold size (SSTHRESH).

If CWND is less than or equal to SSTHRESH, TCP/IP is in Slow Start, otherwise TCP/IP is performing Congestion Avoidance. When congestion occurs (indicated by a timeout or the reception of duplicate ACKs), one-half of the current window size is saved in SSTHRESH. Additionally, if the congestion is indicated by a timeout, CWND is set to one segment (i.e., Slow Start).

Congestion Avoidance increments CWND by b+1

CW N D segment each time an ACK is

received. This is a linear growth of CWND, compared to Slow Start’s exponential growth. CWND is increased by one segment at most each RTT.

6.2.2.3 Fast Retransmit

The detection of one loss turns TCP/IP into the Fast Retransmit mode. The sender must retransmit all lost packet at the rhythm of one packet per RTT. This mode turns over when all lost packets are retransmitted. The Fast Recovery function is coupled with the Fast Retransmit mode to enhance the performance of TCP/IP. After the TCP/IP sender finishes retransmitting all lost packets, it does not resume in the Slow Start mode. Instead, it turns into the Congestion Avoidance mode with a CWND half its value before loss detection. Figure 6.3 summarizes the TCP/IP operation modes.