home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_n_r / draft-pjd-stdguide-00.txt < prev    next >
Internet Message Format  |  1995-11-23  |  21KB

  1. Received: from CNRI.Reston.VA.US by IETF.CNRI.Reston.VA.US id aa21028;
  2.           22 Nov 95 15:49 EST
  3. Received: from midnight.midnight.com by CNRI.Reston.VA.US id aa16928;
  4.           22 Nov 95 15:49 EST
  5. Received: by midnight.midnight.com (4.1/SMI-4.1)
  6.     id AA02219; Wed, 22 Nov 95 15:47:34 EST
  7. Date: Wed, 22 Nov 95 15:47:34 EST
  8. From: Peter Desnoyers <pjd@midnight.com>
  9. Message-Id: <9511222047.AA02219@midnight.midnight.com>
  10. To: internet-drafts@CNRI.Reston.VA.US
  11. Subject: draft submission
  12. Reply-To: Peter Desnoyers 617/890-1001 <pjd@midnight.com>
  13.  
  14. I didn't get the request for a file name in until earlier today, so
  15. I'm guessing at "draft-pjd-stdguide-00.txt".  I apologize for this
  16. mixup, and hope it doesn't cause any confusion.
  17.  
  18. Thanks,
  19. ...............................................................................
  20.   Peter Desnoyers  : Midnight Networks Inc. 200 Fifth Avenue Waltham MA 02154 
  21.   pjd@midnight.com : Ph. 617/890-1001 Fax -0028  The Best in Network Software
  22.  
  23.  --- draft follows ---
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. STDGUIDE Working Group                         P. Desnoyers & A. Mellor
  31. Internet Draft                                 Midnight Networks Inc.
  32.                                                November 22, 1995
  33.  
  34.                   Guide for Internet Standards Writers
  35.                       <draft-pjd-stdguide-00.txt>
  36.  
  37. Status of this Document
  38.  
  39.    This document is an Internet-Draft.  Internet-Drafts are working
  40.    documents of the Internet Engineering Task Force (IETF), its areas,
  41.    and its working groups.  Note that other groups may also distribute
  42.    working documents as Internet-Drafts.
  43.  
  44.    Internet-Drafts are draft documents valid for a maximum of six months
  45.    and may be updated, replaced, or obsoleted by other documents at any
  46.    time.  It is inappropriate to use Internet-Drafts as reference
  47.    material or to cite them other than as ``work in progress.''
  48.  
  49.    To learn the current status of any Internet-Draft, please check the
  50.    ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
  51.    Directories on ds.internic.net (US East Coast), nic.nordu.net
  52.    (Europe), ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific
  53.    Rim).
  54.  
  55.    Distribution of this document is unlimited. Please send comments to
  56.    stdguide@midnight.com or to the author.
  57.  
  58.    This Internet Draft expires May 22, 1996.
  59.  
  60. Abstract
  61.  
  62.    This document is a guide to Internet standards writers.  It is
  63.    intended to capture some of those characteristics which have made
  64.    certain standards clear, easy to interpret, and unambiguous.  At the
  65.    same time, it singles out other usages which are believed to have led
  66.    to unclear specifications and varying interpretations in the past.
  67.  
  68.    This version of the document is a rough draft which is intended as a
  69.    starting point for further discussion and addition by the working
  70.    group.
  71.  
  72. 1. Introduction
  73.  
  74.    This document is a guide for Internet standards writers.  It offers
  75.    guidelines which can be used to improve a protocol specification,
  76.    from the point of view of clarity, explanatory power, precision, and
  77.    completeness.  Some of these guidelines are based on prior examples
  78.  
  79.  
  80.  
  81. Desnoyers & Mellor                                              [Page 1]
  82.  
  83. Internet Draft    Guide for Internet Standards Writers     November 1995
  84.  
  85.  
  86.    of specifications which have been exceedingly clear or precise, while
  87.    others are based on negative examples of specifications which have
  88.    been difficult to understand or prone to differing and non-
  89.    interoperable interpretations.  Note that these are hints, rather
  90.    than specifications or requirements, and that some of them may be
  91.    more applicable in certain situations than others.
  92.  
  93.    The goal of these guidelines is to allow specifications to be created
  94.    which are more understandable and less ambiguous, thus increasing the
  95.    interoperability of implementations created from these
  96.    specifications.  Clearly, guidelines such as these are only part of
  97.    the solution: although the lack of clear specifications may be a
  98.    strong barrier to the creation of interoperable implementations of a
  99.    protocol, a quality specification is certainly not sufficient to
  100.    achieve this goal.
  101.  
  102.    There are a number of reasons for writing this document.  The
  103.    authors' motivations come from their experience in protocol testing,
  104.    where it is necessary to understand specifications to the point of
  105.    deriving unambiguous testable statements.  In addition there are many
  106.    people - both readers and implementors of Internet standards - who
  107.    are new to the Internet world, and are not necessarily "plugged in"
  108.    to the IETF process and history.  Guidelines such as these should
  109.    help make specifications more accessible to these people.
  110.  
  111. 2. More Understandable Specifications
  112.  
  113.    The first set of recommendations in this document center on improving
  114.    the understandability of protocol specifications.  To this end,
  115.    information is identified which should be included in a protocol
  116.    specification so as to provide the reader with all that is necessary
  117.    to understand what is being described.
  118.  
  119. 2.1 Document approach
  120.  
  121.    Specifications should include the a description of the purpose or
  122.    context of a protocol's use.  Although the author of a protocol spec
  123.    will have a great deal of knowledge as to the purpose of a protocol,
  124.    the person reading the specification (even when implementing or
  125.    testing the protocol) is often only generally skilled in networking
  126.    software, rather than in the particular protocol at hand.  Without an
  127.    explanation of the purpose behind a protocol it is far more difficult
  128.    to interpret a description of the protocol, and a reader is more
  129.    prone to error.
  130.  
  131.    Along these lines, the author should not expect that the reader is an
  132.    expert in the problem domain of the protocol or the algorithms it
  133.    makes use of.  In this case, as in the previous case, a specification
  134.  
  135.  
  136.  
  137. Desnoyers & Mellor                                              [Page 2]
  138.  
  139. Internet Draft    Guide for Internet Standards Writers     November 1995
  140.  
  141.  
  142.    should either take the time to describe the algorithm or problem at
  143.    hand, or refer to materials which describe it in more detail.
  144.  
  145. 2.2 Glossary
  146.  
  147.    The following terms are often used in Internet specifications.
  148.    Suggested definitions when used in standards are given below.
  149.  
  150.    [TBD.  Terms will include MUST, SHOULD, "Silently Discard", others.]
  151.  
  152. 2.3 Packet Diagrams
  153.  
  154.    When describing packets that can be divided into fields, such as
  155.    those found in most link, network, and transport layer protocols,
  156.    packet diagrams are very helpful to the reader.  It is recommended
  157.    that diagrams be included except in cases where they are not applica-
  158.    ble. (e.g. in a case where messages are encoded as ASCII strings or
  159.    ASN.1 sequences.)  In general the preferred form for packet diagrams
  160.    is as a sequence of long words in network byte order, with each word
  161.    horizontal on the page and bit numbering at the top, as e.g.:
  162.  
  163.  
  164.        0                   1                   2                   3
  165.       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  166.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  167.      |Version| Prio. |                   Flow Label                  |
  168.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193. Desnoyers & Mellor                                              [Page 3]
  194.  
  195. Internet Draft    Guide for Internet Standards Writers     November 1995
  196.  
  197.  
  198.    In cases where a packet is strongly byte-aligned rather than word-
  199.    aligned (e.g. when byte-boundary variable-length fields are used) it
  200.    may be preferable to display packet diagrams in a byte-wide format,
  201.    with different-height boxes for short and long words, and broken
  202.    boxes for variable-length fields.  E.g.:
  203.  
  204.  
  205.                               0 1 2 3 4 5 6 7
  206.                              +-+-+-+-+-+-+-+-+
  207.                              |    Length N   |
  208.                              +-+-+-+-+-+-+-+-+
  209.                              |               |
  210.                              +    Address    +
  211.                                     ...
  212.                              +   (N bytes)   +
  213.                              |               |
  214.                              +-+-+-+-+-+-+-+-+
  215.                              |               |
  216.                              +  2-byte field +
  217.                              |               |
  218.                              +-+-+-+-+-+-+-+-+
  219.  
  220.  
  221. 2.4 Explanatory information
  222.  
  223.    When writing a protocol specification, there is a tradeoff between
  224.    conciseness and verbosity.  Concise descriptions reduce the chance
  225.    for conflict between different portions of the specification, and
  226.    make it easier to decide the answer to questions of the form ``does
  227.    the specification require/forbid X''.  A longer description may be
  228.    necessary, however, for explanatory reasons when describing e.g.
  229.    purpose or background.
  230.  
  231.    The needs of both purposes are often best served by dividing a
  232.    specification into two types of sections; one set of sections forming
  233.    the specification proper, while the other sections are explanatory
  234.    only.  An example of this technique can be found in the Router
  235.    Requirements specification. [RREQ]
  236.  
  237.    This technique has a number of advantages over combining the
  238.    specification and explanatory text together.  It allows the subject
  239.    matter of the specification to be explained at sufficient depth by
  240.    providing a designated space for this.  It allows the specification
  241.    of the protocol itself to be concise, and avoids burying it within
  242.    the bulk of the explanatory text.  Finally, it avoids ambiguity which
  243.    may arise due to errors in multiple descriptions of the same
  244.    mechanism, by designating one as normative rather than leaving the
  245.    choice up to the reader or implementor.
  246.  
  247.  
  248.  
  249. Desnoyers & Mellor                                              [Page 4]
  250.  
  251. Internet Draft    Guide for Internet Standards Writers     November 1995
  252.  
  253.  
  254.    In other cases where the opportunity comes up to describe the same
  255.    protocol mechanism more than once (e.g. a state/event table vs.
  256.    textual descriptions of individual states and events) it is again
  257.    recommended that the multiple descriptions be included in a
  258.    specification if they contribute to the understandability of the
  259.    spec.  However, if multiple such descriptions of a protocol mechanism
  260.    are included, one of them must be specified as "binding" in the case
  261.    of unintended inconsistencies.
  262.  
  263. 2.5 Other Information to Include
  264.  
  265.    If a standard is specifying a new version of an existing protocol,
  266.    then the differences between the previous version and the new version
  267.    should be summarized in the new document.  A description of the
  268.    reasons for these differences would be very helpful, as well.
  269.  
  270.    In some cases where a difficult choice had to be made when agreeing
  271.    on the document, the same disagreements are likely to recur later
  272.    when the original parties are dispersed.  Recording a bit of the
  273.    history and reasoning behind such choices in the document, or
  274.    including a reference to some other source where this information can
  275.    be found, may help in ensuring that such issues stay settled.  In the
  276.    case where the alternative not taken may be simpler or easier,
  277.    including the logic behind the choice may be necessary to persuade
  278.    future implementors to avoid taking non-standard shortcuts.
  279.  
  280. 2.6 Sample Document Outline
  281.  
  282.    The following is a sample outline for a protocol specification,
  283.    including the information described above.
  284.  
  285.       1. Description of purpose and reason for protocol
  286.       2. High level "flow" or algorithm
  287.       3. Description of packets and fields, or equivalent
  288.       4. Detailed description of protocol operation / rules
  289.       5. Example situation walk-throughs: typical and complex
  290.       6. Implementation hints or issues
  291.  
  292.  
  293.    In most protocols the actual statements of specification will be
  294.    clustered in sections 3 (packets and fields) and 4 (protocol operation),
  295.    and possibly any appendices expanding on those sections.  It is not
  296.    recommended that sections 1 (purpose and reason), 5 (example scenarios),
  297.    or 6 (implementation hints / issues) contain any statements of
  298.    specification, as by nature they are explanatory in nature.
  299.  
  300. 3. Less Ambiguous Specifications
  301.  
  302.  
  303.  
  304.  
  305. Desnoyers & Mellor                                              [Page 5]
  306.  
  307. Internet Draft    Guide for Internet Standards Writers     November 1995
  308.  
  309.  
  310.    In addition to clarity, so that each reader can reach an understanding
  311.    of a document, it is important that protocol specifications be
  312.    unambiguous, so that multiple readers and implementors will reach the
  313.    same understanding of the document.  The following guidelines are
  314.    intended to assist in the production of more unambiguous
  315.    specifications, by specifying desirable levels of completeness and
  316.    guidelines for specification of optional features.
  317.  
  318. 3.1 Specifications Should Cover All Cases
  319.  
  320.    This is a general design principle which applies in a number of
  321.    different areas.
  322.  
  323.    Specifications should take care to describe responses to behavior
  324.    which is explicitly forbidden in the spec, as this is an area where
  325.    implementors often differ in opinion as the the appropriate behavior.
  326.    In what cases should packets be accepted as legal; in what cases
  327.    should they be discarded, and in what case should protocol
  328.    error-handling mechanisms be invoked?
  329.  
  330.    The specification should consider behavior in the face of negative
  331.    cases such as bad lengths, bad field values, out of sequence packets,
  332.    overflow conditions (e.g. routing tables), etc.  As in the above case,
  333.    it needs to be specified how these cases should be handled, whether by
  334.    dropping, or invoking error-handling protocol mechanisms.  In both
  335.    this case and the previous case it may be necessary to further
  336.    describe the disposition of dropped frames - for instance, are they
  337.    treated as if they were never received, or do they reset any existing
  338.    state such as a connection or adjacency?
  339.  
  340.    Finally, resource and performance scaling issues should be considered.
  341.    This does not mean that serious analysis need be done in the case of
  342.    every protocol.  However, it does mean  that in cases where it is
  343.    clear that operations may fail to succeed during operation
  344.    (e.g. routing table overflow) it is desirable to specify consistent
  345.    behavior between implementations when an operation hits such a limit.
  346.  
  347. 3.2 The Liberal/Conservative Rule
  348.  
  349.    The rule to be conservative in what you do, and be liberal in what you
  350.    accept [Postel 81] is well-known.  To the extent which it is feasible,
  351.    this approach should be explicitly taken by a protocol specification,
  352.    rather than by the implementation.  This serves to eliminate ambiguity
  353.    as to just how "liberal" an implementation should be.
  354.  
  355.    This means that the specification should take care to specify send and
  356.    receive behavior separately, so that restrictions may be placed on
  357.    transmit behavior which do not apply on reception.
  358.  
  359.  
  360.  
  361. Desnoyers & Mellor                                              [Page 6]
  362.  
  363. Internet Draft    Guide for Internet Standards Writers     November 1995
  364.  
  365.  
  366.    In addition, it is often necessary to draw a line between cases where
  367.    an implementation should accept packets as being essentially correct,
  368.    and where it should instead merely tolerate those packets without
  369.    failure.  (although perhaps e.g. ignoring their contents or invoking
  370.    error procedures) This dividing line should be specified as clearly as
  371.    is practical in a specification, identifying those packets which
  372.    should not be accepted by any implementation.
  373.  
  374.    It is worth noting that the most descriptive explanation of the
  375.    liberal/conservative dictum, the Router Requirements [RREQ 95], takes
  376.    a more conservative interpretation of "be liberal in what you accept
  377.    from others" than the interpretation used by many developers:
  378.  
  379.  
  380.         Software should be written to deal with every conceivable
  381.         error, no matter how unlikely.  Eventually a packet will
  382.         come in with that particular combination of errors and
  383.         attributes, and unless the software is prepared, chaos can
  384.         ensue.  It is best to assume that the network is filled
  385.         with malevolent entities that will send packets designed to
  386.         have the worst possible effect.  This assumption will lead
  387.         to suitably protective design.  The most serious problems
  388.         in the Internet have been caused by unforeseen mechanisms
  389.         triggered by low probability events; mere human malice
  390.         would never have taken so devious a course!
  391.  
  392.    Under this interpretation of the liberal/conservative rule, the
  393.    implementor should take care that the implementation can accept
  394.    any packet from the network without failure or malfunction.
  395.    However, in many cases the decision as to which packets should
  396.    be accepted for processing needs to be laid out in the protocol
  397.    specification.
  398.  
  399.    An example of this is the case of a routing protocol, where
  400.    acceptance of flawed information can cause network failure.  For
  401.    protocols such as this which much guard against the acceptance
  402.    of flawed information, at a minimum the specification should
  403.    identify packets which could have differing interpretations and
  404.    mandate that they be ignored.  (for example, routing updates
  405.    which contain more data than the tuple count indicates)
  406.  
  407. 3.3 Handling of Protocol Options
  408.  
  409.    [this may be a contentious recommendation]
  410.  
  411.    The most prevalent current practice in the specification of
  412.    Internet standards is to identify mandatory protocol features by
  413.    the term 'MUST', and optional features by 'MAY' or 'SHOULD'.  In
  414.  
  415.  
  416.  
  417. Desnoyers & Mellor                                              [Page 7]
  418.  
  419. Internet Draft    Guide for Internet Standards Writers     November 1995
  420.  
  421.  
  422.    the presence of a large number of optional features, a combina-
  423.    torial explosion of options which may or may  not (or should but
  424.    might not) be implemented occurs.  This leads to difficulty in
  425.    testing an implementation against the protocol specification,
  426.    and in the most severe case can lead to the possibility of some
  427.    (possibly un-analyzed) combination of options resulting in two
  428.    valid implementations of the standard being unable to intero-
  429.    perate with each other.
  430.  
  431.    In order to impose some order on this complexity, it is proposed
  432.    that specifications incorporating large numbers of optional
  433.    features attempt to divide these options into classes, where an
  434.    implementation is required to implement either all of the
  435.    options in an option class or none at all.  By reducing a large
  436.    number of optional features into a small number of optional con-
  437.    formance classes, a sharp reduction can be achieved in the
  438.    number of option combinations which must be analyzed when the
  439.    protocol is first specified, or tested and maintained when it is
  440.    implemented.
  441.  
  442. 4.0 Document Checklist
  443.  
  444.    The following is a checklist based on these suggestions which
  445.    can be applied to a document:
  446.  
  447.    o Does it explain the purpose of the protocol?
  448.    o Does it reference or explain the algorithms used in the protocol?
  449.    o Does it give packet diagrams in recommended form, if applicable?
  450.    o Does it use the recommended meaning for any of the terms defined in
  451.      the glossary above?
  452.    o Does it separate explanatory portions of the document from
  453.      requirements?
  454.    o Does it describe differences from previous versions, if applicable?
  455.    o Does it give examples of protocol operation?
  456.    o Does it specify behavior in the face of incorrect operation by other
  457.      implementations?
  458.    o Does it delineate which packets should be accepted for processing
  459.      and which should be ignored?
  460.    o Does it consider performance and scaling issues?
  461.    o How many optional features (MAY, SHOULD) does it specify?  If more
  462.      than [X], does it separate them into option classes?
  463.    o Have all combinations of options or option classes been examined for
  464.      incompatibility?
  465.    o If multiple descriptions of a requirement are given, does it
  466.      identify one as binding?
  467.  
  468. 5. Authors' Addresses
  469.  
  470.  
  471.  
  472.  
  473. Desnoyers & Mellor                                              [Page 8]
  474.  
  475. Internet Draft    Guide for Internet Standards Writers     November 1995
  476.  
  477.  
  478.    Peter Desnoyers
  479.    Art Mellor
  480.    Midnight Networks Inc.
  481.    200 Fifth Ave.
  482.    Waltham, MA 02154
  483.  
  484.    Phone:  (617) 890-1001
  485.    Fax:    (617) 890-0028
  486.    EMail:  pjd@midnight.com
  487.            art@midnight.com
  488.  
  489. 6. References
  490.  
  491.    References are to be supplied.
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529. Desnoyers & Mellor                                              [Page 9]
  530.