home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 900s / rfc970.txt < prev    next >
Text File  |  1992-09-22  |  24KB  |  514 lines

  1.  
  2.  
  3. Network Working Group                                         John Nagle
  4. Request for Comments: 970                                 FACC Palo Alto
  5.                                                            December 1985
  6.  
  7.                 On Packet Switches With Infinite Storage
  8.  
  9.  
  10. Status of this Memo
  11.  
  12.    The purpose of this RFC is to focus discussion on particular problems
  13.    in the ARPA-Internet and possible methods of solution.  No proposed
  14.    solutions in this document are intended as standards for the
  15.    ARPA-Internet at this time.  Rather, it is hoped that a general
  16.    consensus will emerge as to the appropriate solution to such
  17.    problems, leading eventually to the adoption of standards.
  18.    Distribution of this memo is unlimited.
  19.  
  20. Abstract
  21.  
  22.    Most prior work on congestion in datagram systems focuses on buffer
  23.    management.  We find it illuminating to consider the case of a packet
  24.    switch with infinite storage.  Such a packet switch can never run out
  25.    of buffers. It can, however, still become congested.  The meaning of
  26.    congestion in an infinite-storage system is explored.  We demonstrate
  27.    the unexpected result that a datagram network with infinite storage,
  28.    first-in-first-out queuing, at least two packet switches, and a
  29.    finite packet lifetime will, under overload, drop all packets.  By
  30.    attacking the problem of congestion for the infinite-storage case, we
  31.    discover new solutions applicable to switches with finite storage.
  32.  
  33. Introduction
  34.  
  35.    Packet switching was first introduced in an era when computer data
  36.    storage was several orders of magnitude more expensive than it is
  37.    today.  Strenuous efforts were made in the early days to build packet
  38.    switches with the absolute minimum of storage required for operation.
  39.    The problem of congestion control was generally considered to be one
  40.    of avoiding buffer exhaustion in the packet switches.  We take a
  41.    different view here.  We choose to begin our analysis by assuming the
  42.    availablity of infinite memory. This forces us to look at congestion
  43.    from a fresh perspective.  We no longer worry about when to block or
  44.    which packets to discard; instead, we must think about how we want
  45.    the system to perform.
  46.  
  47.    Pure datagram systems are especially prone to congestion problems.
  48.    The blocking mechanisms provided by virtual circuit systems are
  49.    absent.  No fully effective solutions to congestion in pure datagram
  50.    systems are known.  Most existing datagram systems behave badly under
  51.    overload.  We will show that substantial progress can be made on the
  52.  
  53.  
  54.  
  55.  
  56. Nagle                                                           [Page 1]
  57.  
  58.  
  59.  
  60. RFC 970                                                    December 1985
  61. On Packet Switches With Infinite Storage
  62.  
  63.  
  64.    congestion control problem even for pure datagram systems when the
  65.    problem is defined as determining the order of packet transmission,
  66.    rather than the allocation of buffer space.
  67.  
  68. A Packet Switch with Infinite Storage
  69.  
  70.    Let us begin by describing a simple packet switch with infinite
  71.    storage.  A switch has incoming and outgoing links.  Each link has a
  72.    fixed data transfer rate.  Not all links need have the same data
  73.    rate. Packets arrive on incoming links and are immediately assigned
  74.    an outgoing link by some routing mechanism not examined here.  Each
  75.    outgoing link has a queue.  Packets are removed from that queue and
  76.    sent on its outgoing link at the data rate for that link.  Initially,
  77.    we will assume that queues are managed in a first in, first out
  78.    manner.
  79.  
  80.    We assume that packets have a finite lifetime.  In the DoD IP
  81.    protocol, packets have a time-to-live field, which is the number of
  82.    seconds remaining until the packet must be discarded as
  83.    uninteresting. As the packet travels through the network, this field
  84.    is decremented; if it becomes zero, the packet must be discarded.
  85.    The initial value for this field is fixed; in the DoD IP protocol,
  86.    this value is by default 15.
  87.  
  88.    The time-to-live mechanism prevents queues from growing without
  89.    bound; when the queues become sufficiently long, packets will time
  90.    out before being sent.  This places an upper bound on the total size
  91.    of all queues; this bound is determined by the total data rate for
  92.    all incoming links and the upper limit on the time-to-live.
  93.  
  94.    However, this does not eliminate congestion.  Let us see why.
  95.  
  96.    Consider a simple node, with one incoming link and one outgoing link.
  97.    Assume that the packet arrival rate at a node exceeds the departure
  98.    rate.  The queue length for the outgoing link will then grow until
  99.    the transit time through the queue exceeds the time-to-live of the
  100.    incoming packets.  At this point, as the process serving the outgoing
  101.    link removes packets from the queue, it will sometimes find a packet
  102.    whose time-to-live field has been decremented to zero.  In such a
  103.    case, it will discard that packet and will try again with the next
  104.    packet on the queue.  Packets with nonzero time-to-live fields will
  105.    be transmitted on the outgoing link.
  106.  
  107.    The packets that do get transmitted have nonzero time-to- live
  108.    values. But once the steady state under overload has been reached,
  109.    these values will be small, since the packet will have been on the
  110.    queue for slightly less than the maximum time-to-live.  In fact, if
  111.  
  112.  
  113. Nagle                                                           [Page 2]
  114.  
  115.  
  116.  
  117. RFC 970                                                    December 1985
  118. On Packet Switches With Infinite Storage
  119.  
  120.  
  121.    the departure rate is greater than one per time-to-live unit, the
  122.    time-to-live of any forwarded packet will be exactly one.  This
  123.    follows from the observation that if more than one packet is sent per
  124.    time-to-live unit, consecutive packets on the queue will have
  125.    time-to-live values that differ by no more than 1.  Thus, as the
  126.    component of the packet switch that removes packets from the queue
  127.    and either sends them or discards them as expired operates, it will
  128.    either find packets with negative or zero time to live values (which
  129.    it will discard) or packets with values of 1, which it will send.
  130.  
  131.    So, clearly enough, at the next node of the packet switching system,
  132.    the arriving packets will all have time-to-live values of 1.  Since
  133.    we always decrement the time-to-live value by at least 1 in each
  134.    node, to guarantee that the time-to-live value decreases as the
  135.    packet travels through the network, we will in this case decrement it
  136.    to zero for each incoming packet and will then discard that packet.
  137.  
  138.    We have thus shown that a datagram network with infinite storage,
  139.    first-in-first-out queuing, and a finite packet lifetime will, under
  140.    overload, drop all packets.  This is a rather unexpected result.  But
  141.    it is quite real.  It is not an artifact of the infinite-buffer
  142.    assumption.  The problem still occurs in networks with finite
  143.    storage, but the effects are less clearly seen.  Datagram networks
  144.    are known to behave badly under overload, but analysis of this
  145.    behavior has been lacking.  In the infinite-buffer case, the analysis
  146.    is quite simple, as we have shown, and we obtain considerable insight
  147.    into the problem.
  148.  
  149.    One would expect this phenomenon to have been discovered previously.
  150.    But previous work on congestion control in packet switching systems
  151.    almost invariably focuses on buffer management.  Analysis of the
  152.    infinite buffer case is apparently unique with this writer.
  153.  
  154.    This result is directly applicable to networks with finite resources.
  155.    The storage required to implement a switch that can never run out of
  156.    buffers turns out to be quite reasonable.  Let us consider a pure
  157.    datagram switch for an ARPANET-like network.  For the case of a
  158.    packet switch with four 56Kb links, and an upper bound on the
  159.    time-to-live of 15 seconds, the maximum buffer space that could ever
  160.    be required is 420K bytes <1>.  A switch provided with this rather
  161.    modest amount of memory need never drop a packet due to buffer
  162.    exhaustion.
  163.  
  164.    This problem is not just theoretical.  We have demonstrated it
  165.    experimentally on our own network, using a supermini with several
  166.    megabytes of memory as a switch.  We now have experimental evidence
  167.    that the phenomenon described above occurs in practice.  Our first
  168.  
  169.  
  170. Nagle                                                           [Page 3]
  171.  
  172.  
  173.  
  174. RFC 970                                                    December 1985
  175. On Packet Switches With Infinite Storage
  176.  
  177.  
  178.    experiment, using an Ethernet on one side of the switch and a 9600
  179.    baud line on the other, resulted in 916 IP datagrams queued in the
  180.    switch at peak.  However, we were applying the load over a TCP
  181.    transport connection, and the transport connection timed out due to
  182.    excessive round trip time before the queue reached the time to live
  183.    limit, so we did not actually reach the stable state with the queue
  184.    at the maximum length as predicted by our analysis above.  It is
  185.    interesting that we can force this condition from the position of a
  186.    user application atop the transport layer (TCP), and this deserves
  187.    further analysis.
  188.  
  189. Interaction with Transport Protocols
  190.  
  191.    We have thus far assumed packet sources that emit packets at a fixed
  192.    rate.  This is a valid model for certain sources such as packet voice
  193.    systems.  Systems that use transport protocols of the ISO TP4 or DoD
  194.    TCP class, however, ought to be better behaved.  The key point is
  195.    that transport protocols used in datagram systems should behave in
  196.    such a way as to not overload the network, even where the network has
  197.    no means of keeping them from doing so.  This is quite possible.  In
  198.    a previous paper by this writer [1], the behavior of the TCP
  199.    transport protocol over a congested network is explored.  We have
  200.    shown that a badly behaved transport protocol implementation can
  201.    cause serious harm to a datagram network, and discussed how such an
  202.    implementation ought to behave.  In that paper we offered some
  203.    specific guidance on how to implement a well-behaved TCP, and
  204.    demonstrated that proper behavior could in some cases reduce network
  205.    load by an order of magnitude.  In summary, the conclusions of that
  206.    paper are that a transport protocol, to be well behaved, should not
  207.    have a retransmit time shorter than the current round trip time
  208.    between the hosts involved, and that when informed by the network of
  209.    congestion, the transport protocol should take steps to reduce the
  210.    number of packets outstanding on the connection.
  211.  
  212.    We reference our earlier work here to show that the network load
  213.    imposed by a transport protocol is not necessarily fixed by the
  214.    protocol specification.  Some existing implementations of transport
  215.    protocols are well-behaved.  Others are not. We have observed a wide
  216.    variability among existing TCP implementations.  We have reason to
  217.    suspect that ISO TP4 implementations will be more uniform, given the
  218.    greater rigidity of the specification, but we see enough open space
  219.    in the TP4 standard to allow for considerable variability.  We
  220.    suspect that there will be marginal TP4 implementations, from a
  221.    network viewpoint, just as there are marginal TCP implementations
  222.    today. These implementations will typically work quite well until
  223.    asked to operate over a heavily loaded network with significant
  224.    delays.  Then we find out which ones are well-behaved.
  225.  
  226.  
  227. Nagle                                                           [Page 4]
  228.  
  229.  
  230.  
  231. RFC 970                                                    December 1985
  232. On Packet Switches With Infinite Storage
  233.  
  234.  
  235.    Even if all hosts are moderately well-behaved, there is potential for
  236.    trouble.  Each host can normally obtain more network bandwidth by
  237.    transmitting more packets per unit time, since the first in, first
  238.    out strategy gives the most resources to the sender of the most
  239.    packets. But collectively, as the hosts overload the network, total
  240.    throughput drops.  As shown above, throughput may drop to zero.
  241.    Thus, the optimal strategy for each host is strongly suboptimal for
  242.    the network as a whole.
  243.  
  244. Game Theoretic Aspects of Network Congestion
  245.  
  246.    This game-theory view of datagram networks leads us to a digression
  247.    on the stability of multi-player games.  Systems in which the optimal
  248.    strategy for each player is suboptimal for all players are known to
  249.    tend towards the suboptimal state.  The well-known prisoner's dilemma
  250.    problem in game theory is an example of a system with this property.
  251.    But a closer analogue is the tragedy of the commons problem in
  252.    economics.  Where each individual can improve their own position by
  253.    using more of a free resource, but the total amount of the resource
  254.    degrades as the number of users increases, self-interest leads to
  255.    overload of the resource and collapse.  Historically this analysis
  256.    was applied to the use of common grazing lands; it also applies to
  257.    such diverse resources as air quality and time-sharing systems.  In
  258.    general, experience indicates that many-player systems with this type
  259.    of instability tend to get into serious trouble.
  260.  
  261.    Solutions to the tragedy of the commons problem fall into three
  262.    classes: cooperative, authoritarian, and market solutions.
  263.    Cooperative solutions, where everyone agrees to be well-behaved, are
  264.    adequate for small numbers of players, but tend to break down as the
  265.    number of players increases.  Authoritarian solutions are effective
  266.    when behavior can be easily monitored, but tend to fail if the
  267.    definition of good behavior is subtle.  A market solution is possible
  268.    only if the rules of the game can be changed so that the optimal
  269.    strategy for players results in a situation that is optimal for all.
  270.    Where this is possible, market solutions can be quite effective.
  271.  
  272.    The above analysis is generally valid for human players.  In the
  273.    network case, we have the interesting situation that the player is a
  274.    computer executing a preprogrammed strategy.  But this alone does not
  275.    insure good behavior; the strategy in the computer may be programmed
  276.    to optimize performance for that computer, regardless of network
  277.    considerations.  A similar situation exists with automatic redialing
  278.    devices in telephony, where the user's equipment attempts to improve
  279.    performance over an overloaded network by rapidly redialing failed
  280.    calls.  Since call-setup facilities are scarce resources in telephone
  281.    systems, this can seriously impact the network; there are countries
  282.  
  283.  
  284. Nagle                                                           [Page 5]
  285.  
  286.  
  287.  
  288. RFC 970                                                    December 1985
  289. On Packet Switches With Infinite Storage
  290.  
  291.  
  292.    that have been forced to prohibit such devices.  (Brazil, for one).
  293.    This solution by administrative fiat is sometimes effective and
  294.    sometimes not, depending on the relative power of the administrative
  295.    authority and the users.
  296.  
  297.    As transport protocols become more commercialized and competing
  298.    systems are available, we should expect to see attempts to tune the
  299.    protocols in ways that may be optimal from the point of view of a
  300.    single host but suboptimal from the point of view of the entire
  301.    network.  We already see signs of this in the transport protocol
  302.    implementation of one popular workstation manufacturer.
  303.  
  304.    So, to return to our analysis of a pure datagram internetwork, an
  305.    authoritarian solution would order all hosts to be "well-behaved" by
  306.    fiat; this might be difficult since the definition of a well-behaved
  307.    host in terms of its externally observed behavior is subtle.  A
  308.    cooperative solution faces the same problem, along with the difficult
  309.    additional problem of applying the requisite social pressures in a
  310.    distributed system.  A market solution requires that we make it pay
  311.    to be well-behaved.  To do this, we will have to change the rules of
  312.    the game.
  313.  
  314. Fairness in Packet Switching Systems
  315.  
  316.    We would like to protect the network from hosts that are not
  317.    well-behaved.  More specifically, we would like, in the presence of
  318.    both well-behaved and badly-behaved hosts, to insure that
  319.    well-behaved hosts receive better service than badly-behaved hosts.
  320.    We have devised a means of achieving this.
  321.  
  322.    Let us consider a network that consists of high-bandwidth
  323.    pure-datagram local area networks without flow control (Ethernet and
  324.    most IEEE 802.x datagram systems are of this class, whether based on
  325.    carrier sensing or token passing), hosts connected to these local
  326.    area networks, and an interconnected wide area network composed of
  327.    packet switches and long-haul links.  The wide area network may have
  328.    internal flow control, but has no way of imposing mandatory flow
  329.    control on the source hosts.  The DoD Internet, Xerox Network Systems
  330.    internetworks, and the networks derived from them fit this model.
  331.  
  332.    If any host on a local area network generates packets routed to the
  333.    wide area network at a rate greater than the wide area network can
  334.    absorb them, congestion will result in the packet switch connecting
  335.    the local and wide area networks.  If the packet switches queue on a
  336.    strictly first in, first out basis, the badly behaved host will
  337.    interfere with the transmission of data by other, better-behaved
  338.    hosts.
  339.  
  340.  
  341. Nagle                                                           [Page 6]
  342.  
  343.  
  344.  
  345. RFC 970                                                    December 1985
  346. On Packet Switches With Infinite Storage
  347.  
  348.  
  349.    We introduce the concept of fairness.  We would like to make our
  350.    packet switches fair; in other words, each source host should be able
  351.    to obtain an equal fraction of the resources of each packet switch.
  352.    We can do this by replacing the single first in, first out queue
  353.    associated with each outgoing link with multiple queues, one for each
  354.    source host in the entire network. We service these queues in a
  355.    round- robin fashion, taking one packet from each non-empty queue in
  356.    turn and transmitting the packets with positive time to live values
  357.    on the associated outgoing link, while dropping the expired packets.
  358.    Empty queues are skipped over and lose their turn.
  359.  
  360.    This mechanism is fair; outgoing link bandwidth is parcelled out
  361.    equally amongst source hosts.  Each source host with packets queued
  362.    in the switch for the specified outgoing link gets exactly one packet
  363.    sent on the outgoing link each time the round robin algorithm cycles.
  364.    So we have implemented a form of load-balancing.
  365.  
  366.    We have also improved the system from a game theory point of view.
  367.    The optimal strategy for a given host is no longer to send as many
  368.    packets as possible.  The optimal strategy is now to send packets at
  369.    a rate that keeps exactly one packet waiting to be sent in each
  370.    packet switch, since in this way the host will be serviced each time
  371.    the round-robin algorithm cycles, and the host's packets will
  372.    experience the minimum transit delay.  This strategy is quite
  373.    acceptable from the network's point of view, since the length of each
  374.    queue will in general be between 1 and 2.
  375.  
  376.    The hosts need advisory information from the network to optimize
  377.    their strategies.  The existing Source Quench mechanism in DoD IP,
  378.    while minimal, is sufficient to provide this.  The packet switches
  379.    should send a Source Quench message to a source host whenever the
  380.    number of packets in the queue for that source host exceeds some
  381.    small value, probably 2.  If the hosts act to keep their traffic just
  382.    below the point at which Source Quench messages are received, the
  383.    network should run with mean queue lengths below 2 for each host.
  384.  
  385.    Badly-behaved hosts can send all the datagrams they want, but will
  386.    not thereby increase their share of the network resources.  All that
  387.    will happen is that packets from such hosts will experience long
  388.    transit times through the network.  A sufficiently badly-behaved host
  389.    can send enough datagrams to push its own transit times up to the
  390.    time to live limit, in which case none of its datagrams will get
  391.    through.  This effect will happen sooner with fair queuing than with
  392.    first in, first out queuing, because the badly- behaved host will
  393.    only obtain a share of the bandwidth inversely proportional to the
  394.    number of hosts using the packet switch at the moment.  This is much
  395.  
  396.  
  397.  
  398. Nagle                                                           [Page 7]
  399.  
  400.  
  401.  
  402. RFC 970                                                    December 1985
  403. On Packet Switches With Infinite Storage
  404.  
  405.  
  406.    less than the share it would have under the old system, where more
  407.    verbose hosts obtained more bandwidth.  This provides a strong
  408.    incentive for badly-behaved hosts to improve their behavior.
  409.  
  410.    It is worth noting that malicious, as opposed to merely
  411.    badly-behaved, hosts, can overload the network by using many
  412.    different source addresses in their datagrams, thereby impersonating
  413.    a large number of different hosts and obtaining a larger share of the
  414.    network bandwidth. This is an attack on the network; it is not likely
  415.    to happen by accident. It is thus a network security problem, and
  416.    will not be discussed further here.
  417.  
  418.    Although we have made the packet switches fair, we have not thereby
  419.    made the network as a whole fair.  This is a weakness of our
  420.    approach. The strategy outlined here is most applicable to a packet
  421.    switch at a choke point in a network, such as an entry node of a wide
  422.    area network or an internetwork gateway.  As a strategy applicable to
  423.    an intermediate node of a large packet switching network, where the
  424.    packets from many hosts at different locations pass through the
  425.    switch, it is less applicable.  The writer does not claim that the
  426.    approach described here is a complete solution to the problem of
  427.    congestion in datagram networks.  However, it presents a solution to
  428.    a serious problem and a direction for future work on the general
  429.    case.
  430.  
  431. Implementation
  432.  
  433.    The problem of maintaining a separate queue for each source host for
  434.    each outgoing link in each packet switch seems at first to add
  435.    considerably to the complexity of the queuing mechanism in the packet
  436.    switches.  There is some complexity involved, but the manipulations
  437.    are simpler than those required with, say, balanced binary trees.
  438.    One simple implementation involves providing space for pointers as
  439.    part of the header of each datagram buffer.  The queue for each
  440.    source host need only be singly linked, and the queue heads (which
  441.    are the first buffer of each queue) need to be doubly linked so that
  442.    we can delete an entire queue when it is empty.  Thus, we need three
  443.    pointers in each buffer.  More elaborate strategies can be devised to
  444.    speed up the process when the queues are long.  But the additional
  445.    complexity is probably not justified in practice.
  446.  
  447.    Given a finite buffer supply, we may someday be faced with buffer
  448.    exhaustion.  In such a case, we should drop the packet at the end of
  449.    the longest queue, since it is the one that would be transmitted
  450.    last. This, of course, is unfavorable to the host with the most
  451.    datagrams in the network, which is in keeping with our goal of
  452.    fairness.
  453.  
  454.  
  455. Nagle                                                           [Page 8]
  456.  
  457.  
  458.  
  459. RFC 970                                                    December 1985
  460. On Packet Switches With Infinite Storage
  461.  
  462.  
  463. Conclusion
  464.  
  465.    By breaking away from packet switching's historical fixation on
  466.    buffer management, we have achieved some new insights into congestion
  467.    control in datagram systems and developed solutions for some known
  468.    problems in real systems. We hope that others, given this new
  469.    insight, will go on to make some real progress on the general
  470.    datagram congestion problem.
  471.  
  472. References
  473.  
  474.    [1]  Nagle, J. "Congestion Control in IP/TCP Internetworks", ACM
  475.         Computer Communications Review, October 1984.
  476.  
  477. Editor's Notes
  478.  
  479.    <1>  The buffer space required for just one 10Mb Ethernet with an
  480.         upper bound on the time-to-live of 255 is 318 million bytes.
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512. Nagle                                                           [Page 9]
  513.  
  514.