Network Layer

Addressing in Computer Network

Congestion Detection Algorithm:

If the congestion occurs it is required to decrease the congestion window size. there are two condition in which congestion may occurs:

  1.  the connection time out.
  2. the reception of three ACK .

in both the cases, the threshold size can be reduce to to 1/2 (one half) of the previous window size.

 

Congestion Window:

  • Congestion window is a TCP state variable, that limits the amount of data the TCP can send into the network, before receiving an acknowledgment (ACK)
  • The 2 variables are used to regulate data flow in TCP connections, minimize congestion and improve network performance. 
  • TCP uses a congestion window(cwdn) in the sender side to do congestion Avoidance.
  • The congestion window indicates the maximum amount of data that can be send out on a connection without being acknowledged.
  • The inherent assumption in this mechanism is that lack of  acknowledgement is due to network congestion.

Congestion Avoidance :

In slow Start algorithm the size of congestion window increase exponentially, to avoid congestion before it happens, it is necessary to slow down the exponential growth.

The congestion avoidance algorithm; works the addictive increase instead of the exponential growth. In this algorithm after receiving each ACK receipt (for one round) the window size of the congestion window can be increase by one.

Example start with congestion window =1

by adding 1, congestion window = 1+1=2

 

TCP Fast Retransmit / fast recovery:

  • TCP sends an affirmation (ACK ) solely after getting a parcel.
  • if a sender receive several acknowledge for the same packet this is due to a gap in received packet at the receiver
  • however the receiver got all packet up to the gap and is actually receiving packets
    therefore packet loss is due to congestion continue with current congestion window( so not use slow start)
  • The slow start algorithm is based on the idea that the size of the congestion window starts with one maximum segment size but it is increased on maximum segment size s and acknowledgement arrive.

Fast Retransmit:

 

causes for fast retransmission:

  • Fast retransmission occurs when the sender retransmits a packet before the expiration of the acknowledgment timer.
  • Sender received some packets that sequence number are bigger than the acknowledged packets.
  • Sender should fast retransmit upon a received of three duplicate ACKs.

 

 fast retransmit:

  •  
  •  TCP might create a Immediate ACK (a copy ACK) when a out of order segment is gotten.
  • This copy ACK ought not be deferred.
  • TCP may generate an immediate acknowledgment (a duplicate ACK) when an out-of-order segment is received.
  • This copy ACK ought not be Delayed.
  •  The reason for this copy ACK is to tell the opposite end that a fragment was gotten messed up, and to tell it what grouping number is expected.
  • since TCP doesn’t know whether a copy ACK is brought about by a lost fragment or simply a reordering of sections, it hangs tight for few copy ACKs to be gotten.
  • It is assumed that if there is just a reordering or segments, there will be only one or two duplicate ACKs before the reordered segment is processed, which will then generate new ACK.

fast retransmission representation:

below here is a representation, the sender sends the data to the receiver, the first packet is received but the second packet is not received by the receiver. at the same time sender sends the third packet. Now the receiver. sends their acknowledgment 1 for the first packet(segment 1) then consecutively, the receiver sends the three duplicate(ACK) acknowledgments.

 now the sender notes that the receiver has not received the second packet so with the help of that fast retransmission the second packet is transmitted by the sender to the receiver once again this is indicated in this diagram.

Fast Retransmit

 

 

Fast Retransmission representation:

Fast retransmission representation with the help of the congestion window size.

Fast Retransmit

In the initial stage the congestion window  is one in the sender side so the sender sends one segment to the receiver as soon as the segment one reaches the receiver. the receiver sends that acknowledgment one to the sender meantime the congestion window is true for the sender.

 now the sender senders  two segments to the receiver that is segment 2 segment 3 is received. these two segments reaches the receiver the receiver since acknowledged 2 acknowledged 3 to the sender.

Now the congestion window size is increased to 4 therefore 4 segments is being send by the sender meantime segment 4 is not reached the receiver but Segment 5 Segment 6 segment 7 has reached, the receiver so three acknowledgments is being send by the receiver to the sender and that is duplicate ACK case.

 Now the sender notice that segment  four is not reached the receiver so once again the segment four is sent by the sender to the receiver. 

Fast Retransmit

this indicated in this diagram here is a representation of congestion window versus time graph

 

In this graph we have slow start fast, retransmit timeout, congestion avoidance indication available in this graph.

If three or more duplicate a ACK’s are received in a row it is a strong indication that segment has been lost. 

TCP then plays out a retransmission of what appears of being missing fragment without trusting that a retransmission clock will lapse.

Fast Recovery:

After first retransmit sender the missing segment, congestion avoidance, but not slow start this is performed.

 Fast Recovery Algorithm:

  •  it is an improvement that allows high throughput and moderate congestion. especially for large windows.
  • the reason for not performing slow start in this case is that the rest of the duplicate ACK stills TCP more than just a packet has been lost.
  •  since the receiver can only generate the duplicate ACK when another segment is received that segment has left to the network and in the receivers buffer.
  • that is, there is still data flowing between the two ends and TCP  does not want to reduce the flow abruptly by going into slow starter.
The fast Retransmission and Fast recovery algorithm implement in the following way: 
 
  • when the third duplicate ACK in a row is received, set ssthresh to 1/2 the congestion window, (cwnd), but no less than two segments.
  • Retransmit the missing segment.
  • set threshold plus 3 times the segment size.
  • This blows up the clog window by the quantity of fragments that have left the organization and which the opposite end has reserved.
  • Each time other duplicate ACK arise increment congestion window by the segment size.
  • This expands the blockage window for the extra fragment that has left the organization. 
  •  transmit a packet if allowed by the new value cwnd(congestion Window).
  • when the next ACK arrives that acknowledges new data set congestion window to aathresh (the value is set 1 in step 1)
  • this ACK should be the acknowledgement of the retransmission from step 1, one round-trip time after a retransmission.

additionally this ACK should acknowledge all the intermediate segments sent between the loss packet and the receipt of the first duplicate ACK.

 this Steps is congestion avoidance sends TCP is down to one half, it was at when the packet was lost.

Fast Transmssion

 here is a graph that indicates window size versus time representation.

 in this graph we have slow start, congestion avoidance, fast retransmit, fast recovery and the slow start indication.