Solved

Tcp, congestion control and slow start

Posted on 1998-11-10
3
533 Views
Last Modified: 2010-05-18
I have 2 linux machines connected over the serial port using an external wireless modem. I'm using ppp. I was trying to inject noise in to the channel and observe how tcp performs. My understanding of congestion control algorithms is that if there is packet loss tcp reduces its window size to avoid congestion. I'm using tcpdump to study packet loss and tcp headers. I can see that packets are getting lost and tcp is retransmitting. But the window sizes are not changing. Initially when I'm setting up the link the window size starts at 512 and then from the next transmission on is 32000.      

So I'm not seeing either slow start or congestion control algorithms. Am i missing something. Please help me if anyone knows whats going on.

Thanks
indu
0
Comment
Question by:peddibhotla
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
tfabian earned 200 total points
Comment Utility
I pulled this from a draft IETF paper..

note:

  To view the entire list of current Internet-Drafts, please check the
    "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow
    Directories on ftp.is.co.za (Africa), ftp.nordu.net (Northern
    Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au (Pacific
    Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast).


3.1 Slow Start and Congestion Avoidance

    The slow start and congestion avoidance algorithms MUST be used by a
    TCP sender to control the amount of outstanding data being injected
    into the network.  To implement these algorithms, two variables are
    added to the TCP per-connection state.  The congestion window (cwnd)
    is a sender-side limit on the amount of data the sender can transmit
    into the network before receiving an acknowledgment (ACK), while the
    receiver's advertised window (rwnd) is a receiver-side limit on the
    amount of outstanding data.  The minimum of cwnd and rwnd governs
    data transmission.

    Another state variable, the slow start threshold (ssthresh), is used
    to determine whether the slow start or congestion avoidance
    algorithm is used to control data transmission, as discussed below.

    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
    inappropriately large burst of data.  The slow start algorithm is
    used for this purpose at the beginning of a transfer, or after
    repairing loss detected by the retransmission timer.

    IW, the initial value of cwnd, MUST be less than or equal to MSS
    bytes.

    We note that a non-standard, experimental TCP extension allows that
    a TCP MAY use a larger initial window (IW), as defined in equation 1
    [AFP98]:

               IW = min (4*MSS, max (2*MSS, 4380 bytes))             (1)

    With this extension, a TCP sender MAY use a 2 segment initial
    window, regardless of the segment size, and 3 and 4 segment initial
    windows MAY be used, provided the combined size of the segments does
    not exceed 4380 bytes.  We do NOT allow this change as part of the
    standard defined by this document.  However, we include discussion
    of (1) in the remainder of this document as a guideline for those
    experimenting with the change, rather than conforming to the present
    standards for TCP congestion control.

    The initial value of ssthresh MAY be arbitrarily high (for example,
    some implementations use the size of the advertised window), but it
    may be reduced in response to congestion.  The slow start algorithm
    is used when cwnd < ssthresh, while the congestion avoidance
    algorithm is used when cwnd > ssthresh.  When cwnd and ssthresh are
    equal the sender may use either slow start or congestion avoidance.

    During slow start, a TCP increments cwnd by at most MSS bytes for
    each ACK received that acknowledges new data.  Slow start ends when
    cwnd exceeds ssthresh (or, optionally, when it reaches it, as noted
    above); or when cwnd reaches rwnd; or when congestion is observed.

    During congestion avoidance, cwnd is incremented by 1 full-sized
    segment per round-trip time (RTT).  Congestion avoidance continues
    until cwnd reaches the receiver's advertised window or congestion is
    detected.  One formula commonly used to update cwnd during
    congestion avoidance is given in equation 2:

                          cwnd += MSS*MSS/cwnd                       (2)

    This adjustment is executed on every incoming non-duplicate ACK.
    Equation (2) provides an acceptable approximation to the underlying
    principle of increasing cwnd by 1 full-sized segment per RTT.  (Note
    that for a connection in which the receiver acknowledges every data
    segment, (2) proves slightly more aggressive than 1 segment per RTT,
    and for a receiver acknowledging every-other packet, (2) is less
    aggressive.)

    Implementation Note: Since integer arithmetic is usually used in TCP
    implementations, the formula given in equation 2 can fail to
    increase cwnd when the congestion window is very large (larger than
    MSS*MSS).  If the above formula yields 0, the result SHOULD be
    rounded up to 1 byte.

    Implementation Note: older implementations have an additional
    additive constant on the right-hand side of (2).  This is incorrect
    and can actually lead to diminished performance [PAD+98].

    Another acceptable way to increase cwnd during congestion avoidance
    is to count the number of bytes that have been acknowledged by ACKs
    for new data.  (A drawback of this implementation is that it
    requires maintaining an additional state variable.)  When the number
    of bytes acknowledged reaches cwnd, then cwnd can be incremented by
    up to MSS bytes.  Note that during congestion avoidance, cwnd MUST
    NOT be increased by more than the larger of either 1 full-sized
    segment per RTT, or the value computed using equation 2.

    Implementation Note: some implementations maintain cwnd in units of
    bytes, while others in units of full-sized segments.  The latter
    will find equation (2) difficult to use, and may prefer to use the
    counting approach discussed in the previous paragraph.

    When a TCP sender detects segment loss using the retransmission
    timer, the value of ssthresh MUST be set to no more than the value
    given in equation 3:

                   ssthresh = max (FlightSize / 2, 2*MSS)             (3)
           
    As discussed above, FlightSize is the amount of outstanding data in
    the network.

    Implementation Note: an easy mistake to make is to simply use cwnd,
    rather than FlightSize, which in some implementations may
    incidentally increase well beyond rwnd.

    Furthermore, upon a timeout cwnd MUST be set to no more than the
    loss window, LW, which equals 1 full-sized segment (regardless of
    the value of IW).  Therefore, after retransmitting the dropped
    segment the TCP sender uses the slow start algorithm to increase the
    window from 1 full-sized segment to the new value of ssthresh, at
    which point congestion avoidance again takes over in a fashion
    identical to that for a connection's initial slow start.



0
 

Author Comment

by:peddibhotla
Comment Utility
Hi.

Thanks for replying. I have one more question though. Is there any way you could observe the Congestion window changes, other than by the reduction in the throughput?

Thank you,
indu
0
 
LVL 5

Expert Comment

by:tfabian
Comment Utility
there are a host of papers on the subject at url

   http://tcpsat.lerc.nasa.gov/tcpsat/papers.html


0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now