Tieu luan qo s

14
SLOW START & CONGESTION AVOIDANCE TRONG GIAO THỨC TCP/IP GVHD: TS. Hà Hoàng Kha HV: Trần Trường Sơn - 7140072 Lưu Quang Quyết - 7140450

Transcript of Tieu luan qo s

Page 1: Tieu luan qo s

SLOW START & CONGESTION AVOIDANCE

TRONG GIAO THỨC TCP/IP

GVHD: TS. Hà Hoàng KhaHV: Trần Trường Sơn - 7140072

Lưu Quang Quyết - 7140450

Page 2: Tieu luan qo s

•Problem – Slow Start

1

•Procedure – Slow Start

2

•Problem - Congestions

3

•Procedure – Congestion Avoidance

4

•Simulations

5

Overview

Page 3: Tieu luan qo s

Problem – Slow Start• Previous versions of TCP start a

connection with the sender injecting multiple segments into the network, up to the windows size advertised by the receiver.

• This is ok when the hosts are placed on the same LAN. But if there are routers and slower links between the sender and the receiver different problems can arise. Some intermediate router must queue the packets and it is possible for the router to run out of space in the queue. The algorithm to avoid this is called slow start.

Page 4: Tieu luan qo s

Problem – Slow Start

• Beginning transmission into a network with unknown conditions requires TCP to slowly probe the network to determine the available capacity, in order to avoid congesting the network with an in appropriate large burst of data.

• Slow start adds another window to the sender’s TCP: the congestion window, called cwnd. When a new connection is established with a host on another network, the congestion window is initialized to one segment (typically 536 bytes or 512 bytes).

Page 5: Tieu luan qo s

Procedure – Slow Start• The sender starts by transmitting

one segment and waiting for its ACK. When that ACK is received, the congestion window is increased from one to two, and two segments can be sent. When each of those two segments is acknowledged, the congestion window is increased to four. This provides an exponential growth, although it is not exactly exponential because the receiver may delay its ACK’s. The sender can transmit up to the minimum of the congestion window and the advertised window.

Page 6: Tieu luan qo s

Problem – Congestion Avoidance

• At some point, the capacity of the internet can be reached and an intermediate router will start discarding packets. This tells the sender that its congestion window has gotten too large.

• Congestion avoidance is a way to deal with lost packets. Congestion can occur when data arrives on a big pipe (a fast LAN) and outputs on a smaller pipe (a slower WAN).

• Congestion can also occur when multiple input streams arrive at a router whose output capacity is less than the sum of the inputs.

Page 7: Tieu luan qo s

Problem – Congestion Avoidance

• There are two indications of packet loss at a sender: a timeout occurring and the receipt of duplicate ACK’s . However, the overall assumption of the algorithm is that packet loss caused by damage is very small (much less than 1%), therefore the loss of a packet signals congestion somewhere in the network between the source and destination.

• Although congestion avoidance and slow start are independent algorithms with different objectives, in practice they are implemented together.

Page 8: Tieu luan qo s

Problem – Congestion Avoidance

• When congestion occurs TCP must slow down its transmission rate of packets into the network, and then slow start to avoid things going again.

• The combined congestion avoidance and slow start algorithms require that two variables are maintained for each connection: – A congestion window (cwnd). – A slow start threshold size (ssthresh)

Page 9: Tieu luan qo s

Procedure – Congestion Avoidance

Page 10: Tieu luan qo s

Procedure – Congestion Avoidance• Initialization: give connection

sets cwnd to one segment and sstresh to 65535 bytes. The initial value of cwnd must be less than 2*SMSS bytes and must not be more than 2 segments. (SMSS: Sender Maximum Segment Size)

• When congestion occurs: reduce one-half of the current window. If the congestion is indicated by a timeout, cwnd is set to one segment.

Page 11: Tieu luan qo s

Procedure – Congestion Avoidance• When new data is acknowledged

by the other end, increase cwnd. The way in which cwnd is increased depends on whether TCP is performing slow start or congestion avoidance.

• If cwnd is less than or equal to ssthresh , TCP is in slow start, otherwise TCP is performing congestion avoidance. Slow start continues until TCP is halfway to where it was when congestion occurred, and then congestion avoidance takes over. This is done due to the recorded half of the window size that caused the problem.

Page 12: Tieu luan qo s

Tahoe and Reno

• Tahoe detect congestion only by setting a timer for receiving a related ACK. Tahoe sets the slow start threshold to half of the current congestion window, reduces the congestion window to 1 MSS, and resets to slow-start state.

• Reno: If three duplicate ACKs are received, it will halve the congestion window, set the slow start threshold equal to the new congestion window, skipping slow-start and going directly to Congestion Avoidance algorithm

Page 13: Tieu luan qo s

Simulations

Page 14: Tieu luan qo s

THANK YOU!