home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 1000s / rfc1016.txt < prev    next >
Text File  |  1987-07-17  |  47KB  |  1,011 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                            W. Prue
  8. Request for Comments:  1016                                    J. Postel
  9.                                                                      ISI
  10.                                                                July 1987
  11.  
  12.              Something a Host Could Do with Source Quench:
  13.  
  14.                The Source Quench Introduced Delay (SQuID)
  15.  
  16. Status of this Memo
  17.  
  18.    This memo is intended to explore the issue of what a host could do
  19.    with a source quench.  The proposal is for each source host IP module
  20.    to introduce some delay between datagrams sent to the same
  21.    destination host.  This is an "crazy idea paper" and discussion is
  22.    essential.  Distribution of this memo is unlimited.
  23.  
  24. Introduction
  25.  
  26.    A gateway may discard Internet datagrams if it does not have the
  27.    buffer space needed to queue the datagrams for output to the next
  28.    network on the route to the destination network.  If a gateway
  29.    discards a datagram, it may send a source quench message to the
  30.    Internet source host of the datagram.  A destination host may also
  31.    send a source quench message if datagrams arrive too fast to be
  32.    processed.  The source quench message is a request to the host to cut
  33.    back the rate at which it is sending traffic to the Internet
  34.    destination.  The gateway may send a source quench message for every
  35.    message that it discards.  On receipt of a source quench message, the
  36.    source host should cut back the rate at which it is sending traffic
  37.    to the specified destination until it no longer receives source
  38.    quench messages from the gateway.  The source host can then gradually
  39.    increase the rate at which it sends traffic to the destination until
  40.    it again receives source quench messages [1,2].
  41.  
  42.    The gateway or host may send the source quench message when it
  43.    approaches its capacity limit rather than waiting until the capacity
  44.    is exceeded.  This means that the data datagram which triggered the
  45.    source quench message may be delivered.
  46.  
  47. The SQuID Concept
  48.  
  49.    Suppose the IP module at the datagram source has a queue of datagrams
  50.    to send, and the IP module has a parameter "D".  D is the introduced
  51.    delay between sending datagrams from the queue to the network.  That
  52.    is, when the IP module discovers a datagram waiting to be sent to the
  53.    network, it sends it to the network then waits time D before even
  54.    looking at the datagram queue again.  Normally, the value of D is
  55.  
  56.  
  57.  
  58. Prue & Postel                                                   [Page 1]
  59.  
  60. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  61.  
  62.  
  63.    zero.
  64.  
  65.    Imagine that when a source quench is received (or any other signal is
  66.    received that the host should slow down its transmissions to the
  67.    network), the value of D is increased.  As time goes by, the value of
  68.    D is decreased.
  69.  
  70. The SQuID Algorithm
  71.  
  72.           on increase event:
  73.  
  74.                D <-- maximum (D + K, I)
  75.                                         (where K = .020 second,
  76.                                                I = .075 second)
  77.  
  78.           on decrease event:
  79.  
  80.                D <-- maximum (D - J, 0)
  81.                                         (where J = .001 second)
  82.  
  83.    An increase event is receipt of one or more source quenches in a
  84.    event period E, (where E is 2.000 seconds).
  85.  
  86.    A decrease event is when S time has passed since D was decreased and
  87.    there is a datagram to send (where S is 1.000 seconds).
  88.  
  89.    A cache of D's is kept for the last M hosts communicated with.
  90.  
  91.    Note that when no datagrams are sent to a destination for some time
  92.    the D for that destination is not decreased, but, if a destination is
  93.    not used for a long time that D for that destination may fall out of
  94.    the cache.
  95.  
  96. Possible Refinements
  97.  
  98.    Keep a separate outgoing queue of datagrams for each destination
  99.    host, local subnet, or network.
  100.  
  101.    Keep the cache of D's per network or local subnet, instead of per
  102.    host.
  103.  
  104.    "I" could be based upon the basic speed of the slowest intervening
  105.    network (see Appendix A).
  106.  
  107.    "D" could be limited to never go below "I" if the above refinement
  108.    were implemented.
  109.  
  110.    "S" could be based upon the round trip time.
  111.  
  112.  
  113.  
  114. Prue & Postel                                                   [Page 2]
  115.  
  116. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  117.  
  118.  
  119.    "D" could be adjusted datagram by datagram based upon the length of
  120.    the datagrams.  Wait longer after a long datagram.
  121.  
  122.    The delay algorithm could be implemented such that if a source
  123.    doesn't send a datagram when it is next allowed (the introduced delay
  124.    interval) or for N such intervals that the source gets a credit for
  125.    one and only one free (no delay) datagram.
  126.  
  127. Implementation Ideas
  128.  
  129.    Since IP does not normally keep much state information about things,
  130.    we want the default or idle IP to have no state about these D values.
  131.    Since the default D value is zero, let us propose that the IP will
  132.    keep a list of only those destinations with non zero D's.
  133.  
  134.    When the IP wants to send a datagram, it searches the D-list to see
  135.    if the destination is noted.  If it is not, the D value is zero, so
  136.    the IP sends the datagram at once.  If the destination is listed, the
  137.    IP must wait D time indicated before sending that particular
  138.    datagram.  It could look at a datagram addressed to a different
  139.    destination, and possibly send it in the mean time.
  140.  
  141.    When the IP receives a source quench, it checks to see if the
  142.    destination in the datagram that caused the source quench is on the
  143.    list.  If so, it adds K to the D value.  If not, it appends the
  144.    destination to the list with the D value set to "I".
  145.  
  146. A Closer Look At the Problem
  147.  
  148.    Some implementations of IP send one SQ for every N datagrams they
  149.    discard (for example, N=20) so the SQ messages will not make the
  150.    congestion problem much worse [3].  In such situations any of the
  151.    sources of the 20 datagrams may get the SQ not necessarily the one
  152.    causing the most traffic.  However if a host continues to send
  153.    datagrams at a high rate it has a high probability of receiving a SQ
  154.    message sooner or later.  It is much like a speeder on a highway.
  155.    Not all speeders get speeding tickets but the ones who speed most
  156.    often or most excessively are most likely to be ticketed.  In this
  157.    case they will get a ticket and their car may be destroyed.
  158.  
  159.    With memory becoming so inexpensive many IP nodes put an artificially
  160.    low limit on the size of their queues so that through node delay will
  161.    not be excessive [4].  For example, if one megabyte of data is
  162.    buffered to be sent over a 56 kb/s line the last datagram will wait
  163.    over 2 minutes before being sent.
  164.  
  165.    One problem with SQ is that the IP or ICMP specification does not
  166.    have a well defined event to indicate receipt of SQ to higher level
  167.  
  168.  
  169.  
  170. Prue & Postel                                                   [Page 3]
  171.  
  172. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  173.  
  174.  
  175.    protocols.  Therefore many TCP implementations do not get notified
  176.    about SQ events and thus do not react to SQ.  TCP is not the only
  177.    source of IP datagrams either.  Other protocols should also respond
  178.    to SQ events in some appropriate way.  TCP and other protocols at
  179.    that level should do something about a source quench, however,
  180.    discussion of their behavior is beyond the scope of this memo.  Note
  181.    that implementation of SQ processing at one level of protocol should
  182.    not interfere with the behavior of higher level protocols.  This
  183.    however, is difficult to do.
  184.  
  185.    For protocols using IP which are trying to transfer large amounts of
  186.    data the data flow is most typically very bursty.  TCP for example,
  187.    might send 5-10 segments into a window of 5-10 K bytes then wait for
  188.    the acknowledgment of the data which opens the window again.  NETBLT
  189.    as defined by RFC-998 is a rate based protocol which has parameters
  190.    for burst size and burst rate.
  191.  
  192.    One purpose of the bursts is to allow the source computer to generate
  193.    several datagrams at once to provide more efficient scheduling.  An
  194.    other reason is to keep the network busy accepting data to maximize
  195.    effective throughput in spite of a potentially large network round
  196.    trip delay.  To send a datagram then wait for an acknowledgment is a
  197.    simple but not efficient protocol on a large wide area network.
  198.  
  199.    The reasons for efficiencies obtained at the source node by
  200.    generating many datagrams at once are not as applicable in an
  201.    intermediate IP node.  Since each datagram is potentially from a
  202.    different node they must all be treated individually.  Datagrams
  203.    received in a burst may also overload the queue of an intermediate
  204.    node losing datagrams and causing SQs to be generated.  If the queue
  205.    is near a threshold and a burst comes, possibly all of the datagrams
  206.    will be lost.  When datagrams arrive evenly spaced, less datagrams
  207.    are likely to be lost because the inter-arrival time allows the queue
  208.    a little time to empty out.  Therefore datagrams spaced with some
  209.    delay between them may be better for intermediate IP nodes.
  210.  
  211.    Congestion is most likely to occur at IP nodes which are gateways
  212.    between a slower network and a faster one.  The congestion will be in
  213.    the send queue from the slow network to the fast network.  An SQ
  214.    being returned to the sender will return on the faster network.  (See
  215.    diagram below.)
  216.  
  217. A Gateway Source Quench Concept
  218.  
  219.    In order for the SQuID algorithm to work we rely upon the gateways to
  220.    send SQs to us to tell us how we are doing.  Because the loss of a
  221.    single datagram affects data flow so much (see lost datagram
  222.    discussion in Observed Results below) it would be much better for the
  223.  
  224.  
  225.  
  226. Prue & Postel                                                   [Page 4]
  227.  
  228. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  229.  
  230.  
  231.    source IP node if it got a warning before datagrams were discarded.
  232.  
  233.    We propose gateway IP nodes start SQing before the node is flooded at
  234.    a level we call SQ Keep (SQK) but forward the datagram.  If the queue
  235.    level reaches a critical level, SQ Toss level (SQT), the gateway
  236.    should toss datagrams to resolve the problem unless the datagram is
  237.    an ICMP message.  Even ICMP messages will be tossed if the MaxQ level
  238.    is reached.  Once the gateway starts sending SQs it should continue
  239.    to do so until the queue level goes below a low water mark level
  240.    (SQLW) as shown below.  This is analogous to methods some operating
  241.    systems use to handle memory space management.
  242.  
  243.    The gateway should try to send SQ to as many of the contributors of
  244.    the congestion as possible but only once per contributor per second
  245.    or two.
  246.  
  247.    Source Quench Queue Levels
  248.  
  249.          +--------------+ MaxQ level
  250.          |              |> datagrams tossed & SQed (but not ICMP msgs.)
  251.          +--------------+ SQT level (95%)
  252.          |              |\
  253.          |              | > datagrams SQed but forwarded
  254.          |              |/
  255.          +--------------+ SQK level (70%)
  256.          |              |\
  257.          |              | \ datagrams SQed but forwarded if SQK level
  258.          |              | / exceeded & SQLW or lower not yet reached
  259.          |              |/
  260.          +--------------+ SQLW level (50%)
  261.          |              |\
  262.          |              | \
  263.          |              |  \
  264.          |              |   \ datagrams forwarded
  265.          |              |   /
  266.          |              |  /
  267.          |              | /
  268.          |              |/
  269.          +--------------+
  270.  
  271. Description of the Test Model
  272.  
  273.    We needed some way of testing our algorithm and its various
  274.    parameters.  It was important to check the interaction between IP
  275.    with the SQuID algorithm and TCP.  We also wanted to try various
  276.    combinations of retransmission strategy and source quench strategy
  277.    which required control of the entire test network.  We therefore
  278.    decided to build an Internet model.
  279.  
  280.  
  281.  
  282. Prue & Postel                                                   [Page 5]
  283.  
  284. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  285.  
  286.  
  287.    Using this example configuration for illustration:
  288.  
  289.  _______    LAN       _______     WAN      _______     LAN      _______
  290. |   1   |            |   2   |            |   3   |            |   4   |
  291. |TCP/IP |---10 Mb/s--|  IP   |---56 kb/s--|  IP   |---10 Mb/s--|TCP/IP |
  292. |_______|            |_______|            |_______|            |_______|
  293.  
  294.    A program was written in C which created queues and structures to put
  295.    on the queues representing datagrams carrying data, acknowledgments
  296.    and SQs.  The program moved datagrams from one queue to the next
  297.    based upon rules defined below
  298.  
  299.    A client fed the TCP in node 1 data at the rate it would accept.  The
  300.    TCP function in node 1 would chop the data up into fixed 512 byte
  301.    datagrams for transmission to the IP in node 1.  When the datagrams
  302.    were given to IP for transmission, a timestamp was put on it and a
  303.    copy of it was put on a TCP ack-wait queue (data sent but not yet
  304.    acknowledged).  In particular TCP assumed that once it handed data to
  305.    IP, the data was sent immediately for purposes of retransmission
  306.    timeouts even though our algorithm has IP add delay before
  307.    transmission.
  308.  
  309.    Each IP node had one queue in each direction (left and right).  For
  310.    each IP in the model IP would forward datagrams at the rate of the
  311.    communications line going to the next node.  Thus the fifth datagram
  312.    on IP 2's queue going right would take 5 X 73 msec or 365 msec before
  313.    it would appear at the end of IP 3's queue.  The time to process each
  314.    datagram was considered to be less than the time it took for the data
  315.    to be sent over the 56 kb/s lines and therefore done during those
  316.    transmission times and not included in the model.  For the LAN
  317.    communications this is not the case but since they were not at the
  318.    bottleneck of the path this processing time was ignored.  However
  319.    because LAN communications are typically shared band width, the LAN
  320.    band width available to each IP instance was considered to be 1 Mb/s,
  321.    a crude approximation.
  322.  
  323.    When the data arrived at node 4 the data was immediately given to the
  324.    TCP receive function which validated the sequence number.  If the
  325.    datagram was in sequence the datagram was turned into an ack datagram
  326.    and sent back to the source.  An ack datagram carries no data and
  327.    will move the right edge of the window, the window size past the just
  328.    acked data sequence number.  The ack datagram is assumed to be 1/8 of
  329.    the length of a data datagram and thus can be transmitted from one
  330.    node to the next 8 times faster.  If the sequence number is less than
  331.    expected (a retransmission due to a missed ack) then it too is turned
  332.    into an ack.  A larger sequence number datagram is queued
  333.    indefinitely until the missing datagrams are received.
  334.  
  335.  
  336.  
  337.  
  338. Prue & Postel                                                   [Page 6]
  339.  
  340. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  341.  
  342.  
  343.    We also modeled the gateway source quench algorithm.  When a datagram
  344.    was put on an IP queue the number on the queue was compared to an SQ
  345.    keep level (SQK).  If it was greater, an SQ was generated and
  346.    returned to the sender. If it was larger than the SQ toss (SQT) level
  347.    it was also discarded.  Once SQs were generated they would continue
  348.    to be sent until the queue level went below SQ Low Water (SQLW) level
  349.    which was below the original SQK level.  These percentages were
  350.    modifiable as were many parameters.  An SQ could be lost if it
  351.    exceeded the maximum queue size (MaxQ), but a source quench was never
  352.    sent about tossing a source quench.
  353.  
  354.    Upon each transition from one node to the next, the datagram was
  355.    vulnerable to datagram loss due to errors.  The loss rate could be
  356.    set as M losses out of N datagrams sent, thus the model allowed for
  357.    multi-datagram loss bursts or single datagram losses.  We used a
  358.    single datagram loss rate of 1 lost datagram per 300 datagrams sent
  359.    for much of our testing.  While this may seem low for Internet
  360.    simulation, remember it does not include losses due to congestion.
  361.  
  362.    Some network parameters we used were a maximum queue length of 15
  363.    datagrams per IP direction left and right.  We started sending SQ if
  364.    the queue was 70% full, SQK level, tossed data datagrams, but not SQ
  365.    datagrams, if 95% of the queue was reached, SQT level, and stopped
  366.    SQing when a 50% SQLW level was reached (see above).
  367.  
  368.    We ignored additional SQs for 2 seconds after receipt of one SQ.
  369.    This was done because some Internet nodes only send one SQ for every
  370.    20 datagrams they discard even though our model sent SQs for every
  371.    datagram discarded.  Other IP node may send one SQ per discarded
  372.    packet. The SQuID algorithm needed a way to handle both types of SQ
  373.    generation.  We therefore treated one or a burst of SQs as a single
  374.    event and incremented our D by a larger amount than would be
  375.    appropriate for responding individually to the multiple SQs of the
  376.    verbose nodes.
  377.  
  378.    The simulation did not do any fragmenting of datagrams.  Silly window
  379.    syndrome was avoided.  The model did not implement nor simulate the
  380.    TTL (time-to-live) function.
  381.  
  382.    The model allowed for a flexible topology definition with many TCP
  383.    source/destination pairs on host IP nodes or gateway IP nodes with
  384.    various windows allowed.  An IP node could have any number of TCPs
  385.    assigned to it.  Each line could have an individually set speed.  Any
  386.    TCP could send to any other TCP.  The routing from one location to
  387.    another was fixed.  Therefore datagrams did not arrive out of
  388.    sequence.  However, datagrams arrived in ascending order, but not
  389.    consecutively, on a regular basis because of datagram losses.
  390.    Datagrams going "left" through a node did not affect the queue size,
  391.  
  392.  
  393.  
  394. Prue & Postel                                                   [Page 7]
  395.  
  396. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  397.  
  398.  
  399.    or SQ chances, of data going "right" through the node.
  400.  
  401.    The TCP retransmission timer algorithm used an Alpha of .15 and a
  402.    Beta of 1.5.  The test was run without the benefit of the more
  403.    sophisticated retransmission timer algorithm proposed by Van Jacobson
  404.    [5].
  405.  
  406.    The program would display either the queue sizes of the various IP
  407.    nodes and the TCP under test as time passed or do a crude plot of
  408.    various parameters of interest including SRTT, perceived round trip
  409.    time, throughput, and the critical queue size.
  410.  
  411.    As we observed the effects of various algorithms for responding to SQ
  412.    we adapted our model to better react to SQ.  Initial tests showed if
  413.    we incremented slowly and decremented quickly we observed
  414.    oscillations around the correct value but more of the time was spent
  415.    over driving the network, thus losing datagrams, than at a value
  416.    which helped the congestion situation.
  417.  
  418.    A significant problem is the delay between when some intermediate
  419.    node starts dropping datagrams and sending source quenches to the
  420.    time when the source quenches arrive at the source host and can begin
  421.    to effect the behavior at the data source.  Because of this and the
  422.    possibility that a IP might send only one SQ for each 20 datagrams
  423.    lost, we decided that the increase in D per source quench should be
  424.    substantial (for example, D should increase by 20 msec for every
  425.    source quench), and the decrease with time should be very slow (for
  426.    example, D should decrease 1 msec every second).  Note that this is
  427.    the opposite behavior than suggested in an early draft by one of the
  428.    authors.
  429.  
  430.    However, when many source quenches are received (for example, when a
  431.    source quench is received for every datagram dropped) in a short time
  432.    period the D value is increased excessively.  To prevent D from
  433.    growing too large, we decided to ignore subsequent source quenches
  434.    for a time (for example, 2 seconds) once we had increased D.
  435.  
  436.    Tests were run with only one TCP sending data to learn as much as
  437.    possible how an unperturbed session might run.  Other test runs would
  438.    introduce and eliminate competing traffic dynamically between other
  439.    TCP instances on the various nodes to see how the algorithms reacted
  440.    to changes in network load.  A potential flaw in the model is that
  441.    the defined TCPs with open windows always tried to forward data.
  442.    Their clients feeding them data never paused to think what they were
  443.    going to type nor got swapped out in favor of other applications nor
  444.    turned the session around logically to listen to the other end for
  445.    more user commands.  In other words all of the simulated TCP sessions
  446.    were doing file transfers.
  447.  
  448.  
  449.  
  450. Prue & Postel                                                   [Page 8]
  451.  
  452. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  453.  
  454.  
  455.    The model was defined to allow many mixes of competing algorithms for
  456.    responding to SQ.  It allowed comparing effective throughput between
  457.    TCPs with small windows and large windows and those whose IP would
  458.    introduce inter-datagram delays and those who totally ignored SQ.  It
  459.    also allowed comparisons with various inter-datagram increment
  460.    amounts and decrement amounts.  Because of the number of possible
  461.    configurations and parameter combinations only a few combinations of
  462.    parameters were tested. It is hoped they were the most appropriate
  463.    ones upon which to concentrate.
  464.  
  465. Observed Results
  466.  
  467.    All of our algorithms oscillate, some worse than others.
  468.  
  469.    If we put in just the right amount of introduced delay we seem to get
  470.    the best throughput.  But finding the right amount is not easy.
  471.  
  472.    Throughput is adversely affected, heavily, by a single lost datagram
  473.    at least for the short time.  Examine what happens when a window is
  474.    35 datagrams wide with an average round trip delay of 2500 msec using
  475.    512 byte datagrams when a single datagram is lost at the beginning.
  476.    Thirty five datagrams are given by TCP to IP and a timer is started
  477.    on the first datagram.  Since the first datagram is missing, the
  478.    receiving TCP will not sent an acknowledgment but will buffer all 34
  479.    of the out-of-sequence datagrams.  After 1.5 X 2500 msec, or 3750
  480.    msec, have elapsed the datagram times out and is resent.  It arrives
  481.    and is acked, along with the other 34, 2500 msec later.  Before the
  482.    lost datagram we might have been sending at the average rate a 56
  483.    kb/s line could accept, about one every 75 msec.  After loss of the
  484.    datagram we send at the rate of one in 6250 msec over 83 times
  485.    slower.
  486.  
  487.    If the lost datagram in the above example is other than the first
  488.    datagram the situation becomes the same when all of the datagrams
  489.    before the lost datagram are acknowledged.  The example holds true
  490.    then for any single lost datagram in the window.
  491.  
  492.    When SQ doesn't always cause datagram loss the sender continues to
  493.    send too fast (queue size oscillates a lot).  It is important for the
  494.    SQ to cause feed-back into the sending system as soon as possible,
  495.    therefore when the source host IP receives an SQ it must make
  496.    adjustments to the send rate for the datagrams still on the send
  497.    queue not just datagrams IP is requested to send after the SQ.
  498.  
  499.    Through network delay goes up as the network queue lengths go up.
  500.  
  501.    Window size affect the chance of getting SQed.  Look at our model
  502.    above using a queue level of 15 for node 2 before SQs are generated
  503.  
  504.  
  505.  
  506. Prue & Postel                                                   [Page 9]
  507.  
  508. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  509.  
  510.  
  511.    and a window size of 20 datagrams.  We assumed that we could send
  512.    data over the LAN at a sustained average rate of 1 Mb/s or about 18
  513.    times as fast as over the WAN.  When TCP sends a burst of 20
  514.    datagrams to node 1 they make it to node 2 in 81 msec.  The
  515.    transition time from node 2 to node 3 is 73 msec, therefore, in 81
  516.    msec, only one datagram is forwarded to node 3.  Thus the 17th, 18th,
  517.    19th, and 20th datagram are lost every time we send a whole window.
  518.    More are lost when the queue is not empty.  If a sequence of acks
  519.    come back in response to the sent data, the acks tend to return at
  520.    the rate at which data can traverse the net thus pacing new send data
  521.    by opening the window at the rate which the network can accept it.
  522.    However as soon as one datagram is lost all of the subsequent acks
  523.    are deferred and batched until receipt of the missing data block
  524.    which acks all of the datagrams and opens the window to 20 again.
  525.    This causes the max queue size to be exceeded again.
  526.  
  527.    If we assume a window smaller than the max queue size in the
  528.    bottleneck node, any time we send a window's worth of data, it is
  529.    done independently of the current size of the queue.  The larger the
  530.    send window, the larger a percentage of the stressed queue we send.
  531.    If we send 50% of the stressed queue size any time that queue is more
  532.    than 50% we threaten to overflow the queue.  Evenly spaced single
  533.    datagram bursts have the least chance of overflowing the queue since
  534.    they represent the minimum percentage of the max queue one may send.
  535.  
  536.    When a big window opens up (that is, a missing datagram at the head
  537.    of a 40 datagram send queue gets retransmitted and acked), the
  538.    perceived round trip time for datagrams subsequently sent hits a
  539.    minimum value then goes up linearly.  The SRTT goes down then back up
  540.    in a nice smooth curve.  This is caused by the fact IP will not add
  541.    delay if the queue is empty and IP has not sent any datagrams to the
  542.    destination for our introduced delay time.  But as many datagrams are
  543.    added to the IP pre-staged send queue in bursts all have the same
  544.    send time as far as TCP is concerned.  IP will delay each datagram on
  545.    the head of the queue by the introduced delay amount.  The first may
  546.    be undelayed as just described but all of the others are delayed by
  547.    their ordinal number on the queue times the introduced delay amount.
  548.  
  549.    It seems as though in a race between a TCP session which delays
  550.    sending to IP and one who does not, the delayer will get better
  551.    throughput because less datagrams are lost.  The send window may also
  552.    be increased to keep the pipeline full.  If however the non delayer
  553.    uses windowing to reduce the chance of SQ datagram loss his
  554.    throughput may possibly be better because no fair queuing algorithm
  555.    is in place.
  556.  
  557.    If gateways send SQs early and don't toss data until its critical and
  558.    keep sending SQs until a low water mark is hit, effective throughput
  559.  
  560.  
  561.  
  562. Prue & Postel                                                  [Page 10]
  563.  
  564. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  565.  
  566.  
  567.    seems to go up.
  568.  
  569.    At the startup of our tests throughput was very high, then dropped
  570.    off quickly as the last of the window got clobbered.  Our model
  571.    should have used a slow start up algorithm to minimize the startup
  572.    shock.  However the learning curve to estimate the proper value for D
  573.    was probably quicker.
  574.  
  575.    A large part of the perceived RTT is due to the delay getting off the
  576.    TCP2IP (TCP transitional) queue when we used large windows.  If IP
  577.    would invoke some back-pressure to TCP in a real implementation this
  578.    can be significantly reduced.  Reducing the window would do this for
  579.    us at the expense of throughput.
  580.  
  581.    After an SQ burst which tosses datagrams the sender gets in a mode
  582.    where TCP may only send one or two datagrams per RTT until the queued
  583.    but not acked segments fall into sequence and are acked.  This
  584.    assumes only the head of the retransmission queue is retransmitted on
  585.    a timeout.  We can send one datagram upon timeout.  When the ack for
  586.    the retransmission is received the window opens allowing sending a
  587.    second.  We then wait for the next lost datagram to time out.
  588.  
  589.    If we stop sending data for a while but allow D to be decreased, our
  590.    algorithm causes the introduced delay to dwindle away.  We would thus
  591.    go through a new startup learning curve and network oscillation
  592.    sequence.
  593.  
  594.    One thing not observed often was TCP timing out a segment before the
  595.    source IP even sent the datagram the first time.  As discussed above
  596.    the first datagram on the queue of a large burst is delayed minimally
  597.    and succeeding datagrams have linearly increasing delays.  The
  598.    smoothed round trip delay algorithm has a chance to adapt to the
  599.    perceived increasing round trip times.
  600.  
  601. Unstructured Thoughts and Comments
  602.  
  603.    The further down a route a datagram traverses before being clobbered
  604.    the greater the waste of network resources.  SQs which do not destroy
  605.    the datagram referred to are better than ones that do if return path
  606.    resources are available.
  607.  
  608.    Any fix must be implementable piecemeal.  A fix can not be installed
  609.    in all or most nodes at one time.  The SQuID algorithm fulfills this
  610.    requirement.  It could be implemented, installed in one location, and
  611.    used effectively.
  612.  
  613.    If it can be shown that by using the new algorithm effective
  614.    throughput can be increased over implementations which do not
  615.  
  616.  
  617.  
  618. Prue & Postel                                                  [Page 11]
  619.  
  620. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  621.  
  622.  
  623.    implement it that may well be effective impetus to get vendors to
  624.    implement it.
  625.  
  626.    Once a source host has an established average minimum inter-datagram
  627.    delay to a destination (see Appendix A), this information should be
  628.    stored across system restarts.  This value might be used each time
  629.    data is sent to the given host as a minimum inter-datagram delay
  630.    value.
  631.  
  632.    Window closing algorithms reduce the average inter-datagram delay and
  633.    the burst size but do not affect the minimum inter-datagram spacing
  634.    by TCP.
  635.  
  636.    Currently an IP gateway node can know if it is in a critical path
  637.    because its queues stay high or keep building up.  Its optimum queue
  638.    size is one because it always has something to do and the through
  639.    node delay is at a minimum.  It is very important that the gateway at
  640.    the critical path not so discourage data flow that its queue size
  641.    drops to zero.  If the gateway tosses datagrams this stops data flow
  642.    for TCP for a while (as described in Observed Results above).  This
  643.    argues for the gateway algorithm described above which SQs but does
  644.    not toss datagrams unless necessary.  Optimally we should try to have
  645.    a queue size somewhat larger than 1 but less than say 50% of the max
  646.    queue size.  Large queues lead to large delay.
  647.  
  648.    TCP's SRTT is made artificially large by introducing delay at IP but
  649.    the perceived round trip time variance is probably smaller allowing a
  650.    smaller Beta value for the timeout value.
  651.  
  652.    So that a decrease timer is not needed for the "D" decrease function,
  653.    upon the next sent datagram to a delayed destination just decrease
  654.    the delay by the amount of time since we last did this divided by the
  655.    decrease timer interval.  An alternate algorithm would be to decrease
  656.    it by only one decrease unit amount if more than the timer interval
  657.    has gone by.  This eliminates the problem caused by the delay, "D",
  658.    dwindling away if we stop sending for a while.  The longer we send
  659.    using this "D", the more likely it is that it is too large a delay
  660.    and the more we should decrease it.
  661.  
  662.    It is better for the network and the sender for our introduced delay
  663.    to be a little on the high side.  It minimizes the chances of getting
  664.    a datagram clobbered by sending it into a congested gateway.  A lost
  665.    datagram scenario described above showed that one lost datagram can
  666.    reduce our effective delay by one to two orders of magnitude
  667.    temporarily.  Also if the delay is a little high, the net is less
  668.    stressed and the queues get smaller, reducing through network delay.
  669.  
  670.    The RTT experienced at a given time verses the minimum RTT possible
  671.  
  672.  
  673.  
  674. Prue & Postel                                                  [Page 12]
  675.  
  676. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  677.  
  678.  
  679.    for the given route does give a good measure of congestion.  If we
  680.    ever get congestion control working RTT may have little to do with
  681.    the amount of congestion.  Effective throughput when compared with
  682.    the possible throughput (or some other measure) is the only real
  683.    measure of congestion.
  684.  
  685.    Slow startup of TCP is a good thing and should be encouraged as an
  686.    additional mechanism for alleviating network overload.
  687.  
  688.    The network dynamics tends to bunch datagrams.  If we properly space
  689.    data instead of bunching it like windowing techniques to control
  690.    overflow of queues then greater throughput is accomplished because
  691.    the absolute rate we can send is pacing our sending not the RTT.  We
  692.    eliminate "stochastic bunching" [6].
  693.  
  694.    The longer the RTT the more network resources the data takes to
  695.    traverse the net.
  696.  
  697.    Should "fair queuing" say that a longer route data transfer should
  698.    get less band width than a shorter one (since it consumes more of the
  699.    net)?  Being fair locally on each node may be unfair overall to
  700.    datagrams traversing many nodes.
  701.  
  702.    If we solve congestion problems today, we will start loading up the
  703.    net with more data tomorrow.  When this causes congestion in a year
  704.    will that type of congestion be harder to solve than todays or is it
  705.    not our problem?  John Nagle suggests "In a large net, we may well
  706.    try to force congestion out to the fringes and keep the interior of
  707.    the net uncongested by controlling entry to the net.  The IMP-based
  708.    systems work that way, or at least used to.  This has the effect of
  709.    concentrating congestion at the entrance to the long-haul system.
  710.    That's where we want it; the Source Quench / congestion window / fair
  711.    queuing set of strategies are able to handle congestion at the LAN to
  712.    WAN bottleneck [7].  Our algorithm should try to push the network
  713.    congestion out to the extremities and keep the interior network
  714.    congestion free.
  715.  
  716.    Use of the algorithm is aesthetically appealing because the data is
  717.    sitting in our local queue instead of consuming resources inside the
  718.    net.  We give data to the network only when it is ready to accept it.
  719.  
  720.    An averaged minimum inter-datagram arrival value will give a measure
  721.    of the network bottleneck speed at the receiver.  If the receiver
  722.    does not defer or batch together acks the same would be learned from
  723.    the inter-datagram arrival time of the acks.  A problem is that IP
  724.    doesn't have knowledge of the datagram contents.  However IP does
  725.    know from which host a datagram comes.
  726.  
  727.  
  728.  
  729.  
  730. Prue & Postel                                                  [Page 13]
  731.  
  732. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  733.  
  734.  
  735.    If SQuID limits the size of its pre-net buffering properly (causes
  736.    back-pressure to TCP) then artificially high RTT measurements would
  737.    not occur.
  738.  
  739.    TCP might, in the future, get a way to query IP for the current
  740.    introduced delay, D, for a given destination and if the value is too
  741.    excessive abort or not start a session.
  742.  
  743.    With the new algorithm TCP could have an arbitrarily large window to
  744.    send into without fear of over running queue sizes in intermediate
  745.    nodes (not that any TCP ever considered having this fear before).
  746.    Thus it could have a window size which would allow it to always be
  747.    sending; keeping the pipe full and seldom getting in the stop-and-
  748.    wait mode of sending.  This presupposes that the local IP is able to
  749.    cause some sort of back pressure so that the local IPs queues are not
  750.    over run.  TCP would still be operating in the burst mode of sending
  751.    but the local IP would be sending a datagram for the TCP as often as
  752.    the network could accept it keeping the data flow continuous though
  753.    potentially slow.
  754.  
  755.    Experience implementing protocols suggests avoiding timers in
  756.    protocols whenever possible.  IP, as currently defined, does not use
  757.    timers. The SQuID algorithm uses two at the IP level.  A way to
  758.    eliminate the introduced delay decrease timer is to decrease the D
  759.    value when we check the send queue for data to send.  We would
  760.    decrease "D" by one "J" unit if "S" time, or more, has elapsed.  The
  761.    other timer is not so easily eliminated.  If the IP implementation is
  762.    periodically awakened to check for work to do, it could check the
  763.    time stamps of the head of the queues to see if any datagrams have
  764.    waited long enough.  This would mean we would necessarily wait too
  765.    long before sending, but it may not be too large of a variance from
  766.    our desired rates.  The additional delay would help congestion and
  767.    reduce our chances of SQ.  Another option is setting a real timer
  768.    which is say 25-50% too large and hope that our periodic work in IP
  769.    will allow us to notice a datagram is delayed enough, and send it.
  770.    Upon sending the datagram we would cancel the timer, avoiding the
  771.    timer interrupt and environment swap.  In other implementations the
  772.    communications interface or the link level protocol may be able to
  773.    provide the timing needed without interrupts to the main processor.
  774.  
  775.    Background tasks like some file transfers could query IP for the
  776.    latest delay characteristics for a given destination to determine if
  777.    it is appropriate to consume network resources now or if it would be
  778.    better to wait until later.
  779.  
  780.    We should consider what would happen if IP, using the SQuID
  781.    algorithm, and TCP both introduced delay between the datagrams.  If
  782.    TCPs delay was greater than IP's, then when IP got the datagrams it
  783.  
  784.  
  785.  
  786. Prue & Postel                                                  [Page 14]
  787.  
  788. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  789.  
  790.  
  791.    would forward them immediately as described in the algorithm above.
  792.    This is because when the IP send queue is empty and it has been at
  793.    least as long as IP wants the higher level protocol, TCP, gets one
  794.    free (no delay) send.  Note also that IP will be decreasing the
  795.    amount of delay it wants introduced because of the successful
  796.    transmissions without SQs.  This would affect other protocols who
  797.    might also send to the same destination.  If TCP sends too quickly
  798.    then IP will protect the network from its indiscretion as described
  799.    in the basic algorithm however TCPs round trip time estimates will be
  800.    much closer to reality.  A lost datagram will thus be detected more
  801.    quickly.  If TCP also uses windowing to limit its sending rate, it
  802.    might, because of its success with a smaller window, increase the
  803.    window size increasing TCPs efficiency.
  804.  
  805.    As this algorithm is implemented everywhere, the SQ Keep (SQK) and SQ
  806.    Low Water (SQLW) queue level percentages should be dropped to reduce
  807.    queue sizes and thus the through net delay.  The percentage we lower
  808.    SQK and SQLW to should be adjusted based upon the percentage of time
  809.    the queue is empty.  The more the queue is empty the more likely it
  810.    is that the node is discouraging data flow too much.  The more time
  811.    the queue is not empty but not too full, the more likely it is the
  812.    node is not excessively discouraging data flow.  How uniform the
  813.    queue size is, is a measure of how well the network citizens are
  814.    behaved.
  815.  
  816.    As the congestion is pushed to the sources, gateways which are
  817.    bottlenecks can more easily detect someone not playing by the rules
  818.    (sending datagrams in bursts) and deal with the offender.
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842. Prue & Postel                                                  [Page 15]
  843.  
  844. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  845.  
  846.  
  847. Appendix A -- Determination of the Value for the Parameter "I"
  848.  
  849.    To get to the correct value for the delay needed quickly, when an
  850.    event occurred and the currently used delay was minimal, the
  851.    transmission time for an average sized datagram across the slowest
  852.    communications link was used for a first value.  How a real IP node
  853.    is to guess this value is discussed below.  In our example the
  854.    transition between node 2 and node 3 is the bottleneck. Using the 56
  855.    kb/s line, a 512 byte datagram would take 73 msec with no queuing or
  856.    processing time is considered.  This value is defined to be the
  857.    minimum inter-datagram arrival time (MIAT).  Assuming a perfect
  858.    network, ignoring factors other than transmission speed, this is the
  859.    minimum time one could expect between receipt of datagrams at the
  860.    destination, because of the slowed data rate through the bottleneck.
  861.    This won't hold true if the datagrams do not follow the same path.
  862.  
  863.    The MIAT, minimum inter-datagram arrival time, may be guessed at by
  864.    comparing the arrival timestamps of consecutive datagrams from a
  865.    source of data.  Each value to be considered needs to be adjusted up
  866.    or down based upon the size between the second datagram received and
  867.    the typical datagram size.  More simply stated, a datagram which is
  868.    half the size of the average datagram can be transmitted across a
  869.    line in half the time.  Therefore, double its IAT before considering
  870.    it for an MIAT.  If the timestamp of a datagrams is taken based upon
  871.    an event caused by the start of the datagram arriving, not the
  872.    completion of the datagram arriving, then the first datagram's size
  873.    is the limiting length and should be used to adjust its IAT.  In
  874.    order to keep the algorithm simple, arrival times for short datagram
  875.    could be ignored as could IATs which were orders of magnitude too
  876.    large (see below).
  877.  
  878.    Once a minimal value is found based upon looking for small values
  879.    over a minute or more, the value might be time averaged with a value
  880.    kept like TCP's SRTT in order to reduce the effects of a false MIAT.
  881.    We could assume the limiting facility would be a 9.6 kb/s line, a
  882.    56-64 kb/s line, or a 1.5 Mb/s line.  These facilities would provide
  883.    a MIAT of 427 msec, 73-64 msec, or 3 msec respectively, for a
  884.    datagram 512 bytes long.  These are almost orders of magnitude in
  885.    differences.  If the MIAT a node measures is not in this range but
  886.    close, the value it is closest to may be used for its MIAT from that
  887.    source.
  888.  
  889.    One of the good things about this measurement is that it is an
  890.    entirely passive measurement.  No additional traffic is needed to
  891.    measure it.  If a source is not sending data continuously then the
  892.    longer measured values won't be validated as minimal values.  The
  893.    assumption is that at least sometimes the source will send multiple
  894.    datagrams at a time.
  895.  
  896.  
  897.  
  898. Prue & Postel                                                  [Page 16]
  899.  
  900. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  901.  
  902.  
  903.    The MIAT measurement is totally unaffected by satellite delay
  904.    characteristics of any intervening facilities.  The chance of getting
  905.    a valid minimal reading is affected by the number of nodes traversed,
  906.    but the value measured if it is valid will not be affected by the
  907.    number of nodes traversed.  Stated another way, when a pair of
  908.    datagrams traverse from one node to the next the datagrams are
  909.    susceptible to being separated by a datagram from another source.
  910.    Both of these factors affect SRTT. The value obtained requires no
  911.    topological knowledge of the route.
  912.  
  913.    A potential problem with the measurement is, it will not be the
  914.    proper value for some forms of alternate routes.  If a T1 link is the
  915.    bottleneck route some times and other times it is a 56 kb/s link our
  916.    first guess for inter-datagram delay would be too small for the 56
  917.    kb/s line route.  Another problem is that if one datagram goes via
  918.    one route and the next goes via another, their inter-datagram arrival
  919.    difference could lead to a small false measurement.  If intervening
  920.    networks fragment datagrams then the measured IAT between segments
  921.    could be misleading.  A solution to this problem is to ignore
  922.    fragmented datagram IATs.
  923.  
  924.    This number represents the minimum inter-datagram delay the sending
  925.    IP should use to send to us, the measuring site, for the given
  926.    datagram size.  If we assume that the return path will be through the
  927.    same facilities or the same type, then as described above this value
  928.    can be the first guess for inter-datagram introduced delay, "D" (in
  929.    the algorithm).  It represents the "I" parameter.
  930.  
  931.    These MIATs may be cached on a host, subnet, or network basis.  The
  932.    last "n" hosts MIATs could be kept.  For infrequent destinations an
  933.    entry per destination network would be applicable to many
  934.    destinations.  If the local net is in fact a subnet, then the other
  935.    local subnet MIATs could be kept.
  936.  
  937.    If a good algorithm is found for MIAT, comparing it to the average
  938.    IAT (during data transfer) would give a good measure of the amount of
  939.    network traffic load.  Since IP has no idea when the source of data
  940.    is sending as fast as possible, to get a valid average, upper layer
  941.    protocols would have to figure this out for themselves.  IP could
  942.    however provide an interface to get the current MIAT for a given
  943.    destination.
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954. Prue & Postel                                                  [Page 17]
  955.  
  956. RFC 1016        Source Quench Introduced Delay -- SQuID        July 1987
  957.  
  958.  
  959. References
  960.  
  961.    [1]  Postel, Jon, "Internet Protocol - DARPA Internet Program
  962.    Protocol Specification", RFC 791, ISI, September 1981.
  963.  
  964.    [2]  Postel, Jon, "Internet Control Message Protocol - DARPA Internet
  965.    Program Protocol Specification", RFC 792, ISI, September 1981.
  966.  
  967.    [3]  Karels, M., "Re: Source Quench", electronic mail message to J.
  968.    Postel and INENG-INTEREST, Tue, 24 Feb 87.
  969.  
  970.    [4] Nagle, John B., "On Packet Switches With Infinite Storage", RFC
  971.    970, FACC Palo Alto, December 1985.
  972.  
  973.    [5] Jacobson, Van, "Re: interpacket arrival variance and mean",
  974.    electronic mail message to TCP-IP,  Mon, 15 Jun 87 06:08:01 PDT
  975.  
  976.    [6] Jacobson, Van, "Re: Appropriate measures of gateway performance"
  977.    electronic mail message to J. Noel Chiappa  and INENG-INTEREST, Sun,
  978.    22 Mar 87 15:04:44 PST.
  979.  
  980.    [7] Nagle, John B., "Source quench, and congestion generally",
  981.    electronic mail message to B. Braden and INENG-INTEREST, Thu, 5 Mar
  982.    87 11:08:49 PST.
  983.  
  984.    [8] Nagle, John B., "Congestion Control in IP/TCP Internetworks", RFC
  985.    896, FACC Palo Alto, 6 January 1984.
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010. Prue & Postel                                                  [Page 18]
  1011.