home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 1100s / rfc1171.txt < prev    next >
Text File  |  1990-07-23  |  89KB  |  2,860 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                         D. Perkins
  8. Request for Comments: 1171                                           CMU
  9. Obsoletes: RFC 1134                                            July 1990
  10.  
  11.  
  12.  
  13.                       The Point-to-Point Protocol
  14.                                 for the
  15.    Transmission of Multi-Protocol Datagrams Over Point-to-Point Links
  16.  
  17.  
  18. Status of this Memo
  19.  
  20.    This RFC specifies an IAB standards track protocol for the Internet
  21.    community.
  22.  
  23.    Please refer to the current edition of the "IAB Official Protocol
  24.    Standards" for the standardization state and status of this protocol.
  25.  
  26.    This proposal is the product of the Point-to-Point Protocol Working
  27.    Group of the Internet Engineering Task Force (IETF). Comments on this
  28.    memo should be submitted to the IETF Point-to-Point Protocol Working
  29.    Group chair.
  30.  
  31.    Distribution of this memo is unlimited.
  32.  
  33. Abstract
  34.  
  35.    The Point-to-Point Protocol (PPP) provides a method for transmitting
  36.    datagrams over serial point-to-point links.  PPP is composed of three
  37.    parts:
  38.  
  39.       1. A method for encapsulating datagrams over serial links.
  40.  
  41.       2. An extensible Link Control Protocol (LCP).
  42.  
  43.       3. A family of Network Control Protocols (NCP) for establishing
  44.          and configuring different network-layer protocols.
  45.  
  46.    This document defines the encapsulation scheme, the basic LCP, and an
  47.    NCP for establishing and configuring the Internet Protocol (IP)
  48.    (called the IP Control Protocol, IPCP).
  49.  
  50.    The options and facilities used by the LCP and the IPCP are defined
  51.    in separate documents.  Control protocols for configuring and
  52.    utilizing other network-layer protocols besides IP (e.g., DECNET,
  53.    OSI) are expected to be developed as needed.
  54.  
  55.  
  56.  
  57.  
  58. Perkins                                                         [Page i]
  59.  
  60. RFC 1171                Point-to-Point Protocol                July 1990
  61.  
  62.  
  63.                            Table of Contents
  64.  
  65.  
  66.      1.     Introduction ..........................................    1
  67.         1.1       Motivation ......................................    1
  68.         1.2       Overview of PPP .................................    1
  69.         1.3       Organization of the document ....................    2
  70.  
  71.      2.     Physical Layer Requirements ...........................    3
  72.  
  73.      3.     The Data Link Layer ...................................    4
  74.         3.1       Frame Format ....................................    5
  75.  
  76.      4.     The PPP Link Control Protocol (LCP) ...................    9
  77.         4.1       The LCP Automaton ...............................   11
  78.            4.1.1  Overview ........................................   11
  79.            4.1.2  State Diagram ...................................   11
  80.            4.1.3  State Transition Table ..........................   13
  81.            4.1.4  Events ..........................................   13
  82.            4.1.5  Actions .........................................   16
  83.            4.1.6  States ..........................................   17
  84.         4.2       Loop Avoidance ..................................   20
  85.         4.3       Timers and Counters .............................   20
  86.         4.4       Packet Format ...................................   21
  87.            4.4.1  Configure-Request ...............................   23
  88.            4.4.2  Configure-Ack ...................................   24
  89.            4.4.3  Configure-Nak ...................................   25
  90.            4.4.4  Configure-Reject ................................   27
  91.            4.4.5  Terminate-Request and Terminate-Ack .............   29
  92.            4.4.6  Code-Reject .....................................   31
  93.            4.4.7  Protocol-Reject .................................   32
  94.            4.4.8  Echo-Request and Echo-Reply .....................   34
  95.            4.4.9  Discard-Request .................................   36
  96.         4.5       Configuration Options ...........................   38
  97.            4.5.1  Format ..........................................   39
  98.  
  99.      5.     A PPP Network Control Protocol (NCP) for IP ...........   40
  100.         5.1       Sending IP Datagrams ............................   40
  101.  
  102.      APPENDICES ...................................................   42
  103.  
  104.      A.     Asynchronous HDLC .....................................   42
  105.  
  106.      B.     Fast Frame Check Sequence (FCS) Implementation ........   44
  107.         B.1       FCS Computation Method ..........................   44
  108.         B.2       Fast FCS table generator ........................   46
  109.  
  110.      REFERENCES ...................................................   47
  111.  
  112.  
  113.  
  114. Perkins                                                        [Page ii]
  115.  
  116. RFC 1171                Point-to-Point Protocol                July 1990
  117.  
  118.  
  119.      SECURITY CONSIDERATIONS ......................................   48
  120.  
  121.      CHAIRMAN'S ADDRESS ...........................................   48
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Perkins                                                       [Page iii]
  171.  
  172. RFC 1171                Point-to-Point Protocol                July 1990
  173.  
  174.  
  175. 1.  Introduction
  176.  
  177. 1.1.  Motivation
  178.  
  179.    In the last few years, the Internet has seen explosive growth in the
  180.    number of hosts supporting TCP/IP.  The vast majority of these hosts
  181.    are connected to Local Area Networks (LANs) of various types,
  182.    Ethernet being the most common.  Most of the other hosts are
  183.    connected through Wide Area Networks (WANs) such as X.25 style Public
  184.    Data Networks (PDNs).  Relatively few of these hosts are connected
  185.    with simple point-to-point (i.e., serial) links.  Yet, point-to-point
  186.    links are among the oldest methods of data communications and almost
  187.    every host supports point-to-point connections.  For example,
  188.    asynchronous RS-232-C [1] interfaces are essentially ubiquitous.
  189.  
  190.    One reason for the small number of point-to-point IP links is the
  191.    lack of a standard encapsulation protocol.  There are plenty of non-
  192.    standard (and at least one defacto standard) encapsulation protocols
  193.    available, but there is not one which has been agreed upon as an
  194.    Internet Standard.  By contrast, standard encapsulation schemes do
  195.    exist for the transmission of datagrams over most popular LANs.
  196.  
  197.    One purpose of this memo is to remedy this problem. But even more
  198.    importantly, the Point-to-Point Protocol proposes more than just an
  199.    encapsulation scheme.  Point-to-Point links tend to exacerbate many
  200.    problems with the current family of network protocols.  For instance,
  201.    assignment and management of IP addresses, which is a problem even in
  202.    LAN environments, is especially difficult over circuit switched
  203.    point-to-point circuits (e.g., dialups).
  204.  
  205.    Some additional issues addressed by this specification of PPP include
  206.    asynchronous (start/stop) and bit-oriented synchronous encapsulation,
  207.    network protocol multiplexing, link configuration, link quality
  208.    testing, error detection, and option negotiation for such
  209.    capabilities as network-layer address negotiation and data
  210.    compression negotiation.
  211.  
  212.    PPP addresses these issues by providing an extensible Link Control
  213.    Protocol (LCP) and a family of Network Control Protocols (NCP) to
  214.    negotiate optional configuration parameters and facilities.
  215.  
  216. 1.2.  Overview of PPP
  217.  
  218.    PPP has three main components:
  219.  
  220.       1. A method for encapsulating datagrams over serial links.  PPP
  221.          uses HDLC as a basis for encapsulating datagrams over point-
  222.          to-point links.  At this time, PPP specifies the use of
  223.  
  224.  
  225.  
  226. Perkins                                                         [Page 1]
  227.  
  228. RFC 1171                Point-to-Point Protocol                July 1990
  229.  
  230.  
  231.          asynchronous or synchronous duplex circuits, either dedicated
  232.          or circuit switched.
  233.  
  234.       2. An extensible Link Control Protocol (LCP) to establish,
  235.          configure, and test the data-link connection.
  236.  
  237.       3. A family of Network Control Protocols (NCP) for establishing
  238.          and configuring different network-layer protocols.  PPP is
  239.          designed to allow the simultaneous use of multiple network-
  240.          layer protocols.
  241.  
  242.    In order to establish communications over a point-to-point link, the
  243.    originating PPP would first send LCP packets to configure and test
  244.    the data link.  After the link has been establish and optional
  245.    facilities have been negotiated as needed by the LCP, the originating
  246.    PPP would send NCP packets to choose and configure one or more
  247.    network-layer protocols.  Once each of the chosen network-layer
  248.    protocols has been configured, datagrams from each network-layer
  249.    protocol can be sent over the link.
  250.  
  251.    The link will remain configured for communications until explicit LCP
  252.    or NCP packets close the link down, or until some external event
  253.    occurs (e.g., inactivity timer expires or user intervention).
  254.  
  255.  
  256. 1.3.  Organization of the document
  257.  
  258.    This memo is divided into several sections.  Section 2 discusses the
  259.    physical-layer requirements of PPP.  Section 3 describes the Data
  260.    Link Layer including the PPP frame format and data link encapsulation
  261.    scheme.  Section 4 specifies the LCP including the connection
  262.    establishment and option negotiation procedures.  Section 5 specifies
  263.    the IP Control Protocol (IPCP), which is the NCP for the Internet
  264.    Protocol, and describes the encapsulation of IP datagrams within PPP
  265.    packets.  Appendix A summarizes important features of asynchronous
  266.    HDLC, and Appendix B describes an efficient table-lookup algorithm
  267.    for fast Frame Check Sequence (FCS) computation.
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Perkins                                                         [Page 2]
  283.  
  284. RFC 1171                Point-to-Point Protocol                July 1990
  285.  
  286.  
  287. 2.  Physical Layer Requirements
  288.  
  289.    The Point-to-Point Protocol is capable of operating across any
  290.    DTE/DCE interface (e.g., EIA RS-232-C, EIA RS-422, EIA RS-423 and
  291.    CCITT V.35).  The only absolute requirement imposed by PPP is the
  292.    provision of a duplex circuit, either dedicated or circuit switched,
  293.    which can operate in either an asynchronous (start/stop) or
  294.    synchronous bit-serial mode, transparent to PPP Data Link Layer
  295.    frames.  PPP does not impose any restrictions regarding transmission
  296.    rate, other than those imposed by the particular DTE/DCE interface in
  297.    use.
  298.  
  299.    PPP does not require the use of modem control signals, such as
  300.    Request To Send (RTS), Clear To Send (CTS), Data Carrier Detect
  301.    (DCD), and Data Terminal Ready (DTR).  However, using such signals
  302.    when available can allow greater functionality and performance.
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Perkins                                                         [Page 3]
  339.  
  340. RFC 1171                Point-to-Point Protocol                July 1990
  341.  
  342.  
  343. 3.  The Data Link Layer
  344.  
  345.    The Point-to-Point Protocol uses the principles, terminology, and
  346.    frame structure of the International Organization For
  347.    Standardization's (ISO) High-level Data Link Control (HDLC)
  348.    procedures (ISO 3309-1979 [2]), as modified by ISO 3309:1984/PDAD1
  349.    "Addendum 1: Start/stop transmission" [5].  ISO 3309-1979 specifies
  350.    the HDLC frame structure for use in synchronous environments. ISO
  351.    3309:1984/PDAD1 specifies proposed modifications to ISO 3309-1979 to
  352.    allow its use in asynchronous environments.
  353.  
  354.    The PPP control procedures use the definitions and Control field
  355.    encodings standardized in ISO 4335-1979 [3] and ISO 4335-
  356.    1979/Addendum 1-1979 [4].  The PPP frame structure is also consistent
  357.    with CCITT Recommendation X.25 LAPB [6], since that too is based on
  358.    HDLC.
  359.  
  360.       Note: ISO 3309:1984/PDAD1 is a Proposed Draft standard.  At
  361.       present, it seems that ISO 3309:1984/PDAD1 is stable and likely to
  362.       become an International Standard.  Therefore, we feel comfortable
  363.       about using it before it becomes an International Standard.  The
  364.       progress of this proposal should be tracked and encouraged by the
  365.       Internet community.
  366.  
  367.    The purpose of this memo is not to document what is already
  368.    standardized in ISO 3309. We assume that the reader is already
  369.    familiar with HDLC, or has access to a copy of [2] or [6]. Instead,
  370.    this paper attempts to give a concise summary and point out specific
  371.    options and features used by PPP. Since "Addendum 1: Start/stop
  372.    transmission", is not yet standardized and widely available, it is
  373.    summarized in Appendix A.
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Perkins                                                         [Page 4]
  395.  
  396. RFC 1171                Point-to-Point Protocol                July 1990
  397.  
  398.  
  399. 3.1.  Frame Format
  400.  
  401.    A summary of the standard PPP frame structure is shown below. The
  402.    fields are transmitted from left to right.
  403.  
  404.            +----------+----------+----------+----------+------------
  405.            |   Flag   | Address  | Control  | Protocol | Information
  406.            | 01111110 | 11111111 | 00000011 | 16 bits  |      *
  407.            +----------+----------+----------+----------+------------
  408.                    ---+---------+----------+
  409.                       |   FCS   |   Flag   |
  410.                       | 16 bits | 01111110 |
  411.                    ---+---------+----------+
  412.  
  413.    This figure does not include start/stop bits (for asynchronous links)
  414.    or any bits or octets inserted for transparency.  When asynchronous
  415.    links are used, all octets are transmitted with one start bit, eight
  416.    bits of data, and one stop bit.  There is no provision in either PPP
  417.    or ISO 3309:1984/PDAD1 for seven bit asynchronous links.
  418.  
  419.    To remain consistent with standard Internet practice, and avoid
  420.    confusion for people used to reading RFCs, all binary numbers in the
  421.    following descriptions are in Most Significant Bit to Least
  422.    Significant Bit order, reading from left to right, unless otherwise
  423.    indicated.  Note that this is contrary to standard ISO and CCITT
  424.    practice which orders bits as transmitted (i.e., network bit order).
  425.    Keep this in mind when comparing this document with the international
  426.    standards documents.
  427.  
  428.    Flag Sequence
  429.  
  430.       The Flag Sequence is a single octet and indicates the beginning or
  431.       end of a frame.  The Flag Sequence consists of the binary sequence
  432.       01111110 (hexadecimal 0x7e).
  433.  
  434.    Address Field
  435.  
  436.       The Address field is a single octet and contains the binary
  437.       sequence 11111111 (hexadecimal 0xff), the All-Stations address.
  438.       PPP does not assign individual station addresses.  The All-
  439.       Stations address should always be recognized and received.  The
  440.       use of other address lengths and values may be defined at a later
  441.       time, or by prior agreement.  Frames with unrecognized Addresses
  442.       should be reported through the normal network management facility.
  443.  
  444.    Control Field
  445.  
  446.       The Control field is a single octet and contains the binary
  447.  
  448.  
  449.  
  450. Perkins                                                         [Page 5]
  451.  
  452. RFC 1171                Point-to-Point Protocol                July 1990
  453.  
  454.  
  455.       sequence 00000011 (hexadecimal 0x03), the Unnumbered Information
  456.       (UI) command with the P/F bit set to zero.  Frames with other
  457.       Control field values should be silently discarded.
  458.  
  459.    Protocol Field
  460.  
  461.       The Protocol field is two octets and its value identifies the
  462.       protocol encapsulated in the Information field of the frame.  The
  463.       most up-to-date values of the Protocol field are specified in the
  464.       most recent "Assigned Numbers" RFC [12]. Initial values are also
  465.       listed below.
  466.  
  467.       Protocol field values in the "cxxx" range identify datagrams as
  468.       belonging to the Link Control Protocol (LCP) or associated
  469.       protocols. Values in the "8xxx" range identify datagrams belonging
  470.       to the family of Network Control Protocols (NCP).  Values in the
  471.       "0xxx" range identify the network protocol of specific datagrams.
  472.  
  473.       This Protocol field is defined by PPP and is not a field defined
  474.       by HDLC.  However, the Protocol field is consistent with the ISO
  475.       3309 extension mechanism for Address fields. All Protocols MUST be
  476.       odd; the least significant bit of the least significant octet MUST
  477.       equal "1".  Also, all Protocols MUST be assigned such that the
  478.       least significant bit of the most significant octet equals "0".
  479.       Frames received which don't comply with these rules should be
  480.       considered as having an unrecognized Protocol, and should be
  481.       handled as specified by the LCP.  The Protocol field is
  482.       transmitted and received most significant octet first.
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. Perkins                                                         [Page 6]
  507.  
  508. RFC 1171                Point-to-Point Protocol                July 1990
  509.  
  510.  
  511.       The Protocol field is initially assigned as follows:
  512.  
  513.          Value (in hex)          Protocol
  514.  
  515.          0001 to 001f            reserved (transparency inefficient)
  516.          0021                    Internet Protocol
  517.          0023                  * OSI Network Layer
  518.          0025                  * Xerox NS IDP
  519.          0027                  * DECnet Phase IV
  520.          0029                  * Appletalk
  521.          002b                  * Novell IPX
  522.          002d                  * Van Jacobson Compressed TCP/IP 1
  523.          002f                  * Van Jacobson Compressed TCP/IP 2
  524.  
  525.          8021                    Internet Protocol Control Protocol
  526.          8023                  * OSI Network Layer Control Protocol
  527.          8025                  * Xerox NS IDP Control Protocol
  528.          8027                  * DECnet Phase IV Control Protocol
  529.          8029                  * Appletalk Control Protocol
  530.          802b                  * Novell IPX Control Protocol
  531.          802d                  * Reserved
  532.          802f                  * Reserved
  533.  
  534.          c021                    Link Control Protocol
  535.          c023                  * User/Password Authentication Protocol
  536.  
  537.             * Reserved for future use; not described in this document.
  538.  
  539.    Information Field
  540.  
  541.       The Information field is zero or more octets.  The Information
  542.       field contains the datagram for the protocol specified in the
  543.       Protocol field.  The end of the Information field is found by
  544.       locating the closing Flag Sequence and allowing two octets for the
  545.       Frame Check Sequence field.  The default maximum length of the
  546.       Information field is 1500 octets.  By prior agreement, consenting
  547.       PPP implementations may use other values for the maximum
  548.       Information field length.
  549.  
  550.       On transmission, the Information field may be padded with an
  551.       arbitrary number of octets up to the maximum length.  It is the
  552.       responsibility of each protocol to disambiguate padding octets
  553.       from real information.
  554.  
  555.    Frame Check Sequence (FCS) Field
  556.  
  557.       The Frame Check Sequence field is normally 16 bits (two octets).
  558.       By prior agreement, consenting PPP implementations may use a 32-
  559.  
  560.  
  561.  
  562. Perkins                                                         [Page 7]
  563.  
  564. RFC 1171                Point-to-Point Protocol                July 1990
  565.  
  566.  
  567.       bit (four-octet) FCS for improved error detection.
  568.  
  569.       The FCS field is calculated over all bits of the Address, Control,
  570.       Protocol and Information fields not including any start and stop
  571.       bits (asynchronous) and any bits (synchronous) or octets
  572.       (asynchronous) inserted for transparency.  This does not include
  573.       the Flag Sequences or FCS field.  The FCS is transmitted with the
  574.       coefficient of the highest term first.
  575.  
  576.       For more information on the specification of the FCS, see ISO 3309
  577.       or CCITT X.25.
  578.  
  579.          Note: A fast, table-driven implementation of the 16-bit FCS
  580.          algorithm is shown in Appendix B.  This implementation is based
  581.          on [7], [8], and [9].
  582.  
  583.    Modifications to the Basic Frame Format
  584.  
  585.       The Link Control Protocol can negotiate modifications to the
  586.       standard PPP frame structure.  However, modified frames will
  587.       always be clearly distinguishable from standard frames.
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618. Perkins                                                         [Page 8]
  619.  
  620. RFC 1171                Point-to-Point Protocol                July 1990
  621.  
  622.  
  623. 4.  The PPP Link Control Protocol (LCP)
  624.  
  625.    The Link Control Protocol (LCP) provides a method of establishing,
  626.    configuring, maintaining and terminating the point-to-point
  627.    connection.  LCP goes through four distinct phases:
  628.  
  629.    Phase 1: Link Establishment and Configuration Negotiation
  630.  
  631.       Before any network-layer datagrams (e.g., IP) may be exchanged,
  632.       LCP must first open the connection through an exchange of
  633.       Configure packets.  This exchange is complete, and the Open state
  634.       entered, once a Configure-Ack packet (described below) has been
  635.       both sent and received.  Any non-LCP packets received before this
  636.       exchange is complete are silently discarded.
  637.  
  638.       It is important to note that LCP handles configuration only of the
  639.       link; LCP does not handle configuration of individual network-
  640.       layer protocols.  In particular, all Configuration Parameters
  641.       which are independent of particular network-layer protocols are
  642.       configured by LCP.  All Configuration Options are assumed to be at
  643.       default values unless altered by the configuration exchange.
  644.  
  645.    Phase 2: Link Quality Determination
  646.  
  647.       LCP allows an optional Link Quality Determination phase following
  648.       transition to the LCP Open state.  In this phase, the link is
  649.       tested to determine if the link quality is sufficient to bring up
  650.       network-layer protocols.  This phase is completely optional.  LCP
  651.       may delay transmission of network-layer protocol information until
  652.       this phase is completed.
  653.  
  654.       The procedure for Link Quality Determination is unspecified and
  655.       may vary from implementation to implementation, or because of
  656.       user-configured parameters, but only so long as the procedure
  657.       doesn't violate other aspects of LCP.  One suggested method is to
  658.       use LCP Echo-Request and Echo-Reply packets.
  659.  
  660.       What is important is that this phase may persist for any length of
  661.       time.  Therefore, implementations should avoid fixed timeouts when
  662.       waiting for their peers to advance to phase 3.
  663.  
  664.    Phase 3: Network-Layer Protocol Configuration Negotiation
  665.  
  666.       Once LCP has finished the Link Quality Determination phase,
  667.       network-layer protocols may be separately configured by the
  668.       appropriate Network Control Protocols (NCP), and may be brought up
  669.       and taken down at any time.  If LCP closes the link, it informs
  670.       the network-layer protocols so that they may take appropriate
  671.  
  672.  
  673.  
  674. Perkins                                                         [Page 9]
  675.  
  676. RFC 1171                Point-to-Point Protocol                July 1990
  677.  
  678.  
  679.       action.
  680.  
  681.    Phase 4: Link Termination
  682.  
  683.       LCP may terminate the link at any time.  This will usually be done
  684.       at the request of a human user, but may happen because of a
  685.       physical event such as the loss of carrier, or the expiration of
  686.       an idle-period timer.
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. Perkins                                                        [Page 10]
  731.  
  732. RFC 1171                Point-to-Point Protocol                July 1990
  733.  
  734.  
  735. 4.1.  The LCP Automaton
  736.  
  737. 4.1.1.  Overview
  738.  
  739.    LCP is specified by a number of packet formats and a finite-state
  740.    automaton.  This section presents an overview of the LCP automaton,
  741.    followed by a representation of it as both a state diagram and a
  742.    state transition table.
  743.  
  744.    There are three classes of LCP packets:
  745.  
  746.       1. Link Establishment packets used to establish and configure a
  747.          link, (e.g., Configure-Request, Configure-Ack, Configure-Nak
  748.          and Configure-Reject)
  749.  
  750.       2. Link Termination packets used to terminate a link, (e.g.,
  751.          Terminate-Request and Terminate-Ack)
  752.  
  753.       3. Link Maintenance packets used to manage and debug a link,
  754.          (e.g., Code-Reject, Protocol-Reject, Echo-Request, Echo-Reply
  755.          and Discard-Request)
  756.  
  757.    The finite-state automaton is defined by events, state transitions
  758.    and actions.  Events include receipt of external commands such as
  759.    Open and Close, expiration of the Restart timer, and receipt of
  760.    packets from a LCP peer.  Actions include the starting of the Restart
  761.    timer and transmission of packets.
  762.  
  763.  
  764. 4.1.2.  State Diagram
  765.  
  766.    The state diagram which follows describes the sequence of events for
  767.    reaching agreement on Configuration Options (opening the PPP
  768.    connection) and for later closing of the connection.  The state
  769.    machine is initially in the Closed state (1).  Once the Open state
  770.    (6) has been reached, both ends of the link have met the requirement
  771.    of having both sent and received a Configure-Ack packet.
  772.  
  773.    In the state diagram, events are shown above horizontal lines.
  774.    Actions are shown below horizontal lines.  Two types of LCP packets -
  775.    Configure-Naks and Configure-Rejects - are not differentiated in the
  776.    state diagram.  As will be described later, these packets do indeed
  777.    serve different, though similar, functions.  However, at the level of
  778.    detail of this state diagram, they always cause the same transition.
  779.  
  780.    Since a more detailed specification of the LCP automaton is given in
  781.    a state transition table in the following section, implementation
  782.    should be done by consulting it rather than this state diagram.
  783.  
  784.  
  785.  
  786. Perkins                                                        [Page 11]
  787.  
  788. RFC 1171                Point-to-Point Protocol                July 1990
  789.  
  790.  
  791.                                     +------------------------------+
  792.                                     |                              |
  793.                                     V                              |
  794.         +---2---+           PO +---1---+        RTA +---7---+      |
  795.         |       |<-------------|       |<-----------|       |      |
  796.         |Listen |              |Closed |            |Closing|      |
  797.     RCR |       | C            |       | PLD        |       |      |
  798.    +----|       |----->+------>|       |<---Any     |       |<--+  |
  799.    |scr +-------+      ^       +-------+    State   +-------+   |  |
  800.    |                   |     AO  |   ^                    | TO  |  |
  801.    |       +-----------+     --- |   |                    +---->+  |
  802.    |       |                 SCR |   |                      str ^  |
  803.    |   C   |   RCN/TO            |   | C                        |  |
  804.    |   --- | +-------->+<--------+   | ---                      |  |
  805.    |       | | scr     |             |                          |  |
  806.    |    +---3---+      V   TO  +---4---+            +-------+   |  |
  807.    |    |       |<-----+<------|       |<-----------|       |   |  |
  808.    |    | Req-  |          scr | Ack-  |        scn | Good  |   |  |
  809.    |    | Sent  | RCA          | Rcvd  | RCR        | Req?  |   |  |
  810.    |    |       |------------->|       |----------->|       |   |  |
  811.    |    +-------+              +-------+            +-------+   |  |
  812.    |       | ^                                         |        |  |
  813.    |   RCR | +<--------+                               |        |  |
  814.    |   --- | |         |     TO        RCN         --- |        |  |
  815.    |       | | ---     +---------+   +-----+       sca |        |  |
  816.    |       V | scn           scr |   | scr |           V        |  |
  817.    |    +-------+              +---5---+   |        +---6---+ C |  |
  818.    +--->|       |------------->|       |<--+        |       |---+  |
  819.         | Good  | sca          | Ack-  |            | Open  | str  |
  820.         | Req?  |          RCR | Sent  | RCA        |       |      |
  821.         |       |<-------------|       |----------->|       |      |
  822.         +-------+              +-------+            +-------+      |
  823.               ^                                       |   |        |
  824.               |                                   RCR |   | RTR    |
  825.               +---------------------------------------+   +--------+
  826.                                                   scr       sta
  827.  
  828.    Events                                  Actions
  829.  
  830.    RCR - Receive-Configure-Request         scr - Send Configure-Request
  831.    RCA - Receive-Configure-Ack             sca - Send Configure-Ack
  832.    RCN - Receive-Configure-Nak or Reject   scn - Send Configure-Nak
  833.    RTR - Receive-Terminate-Req                    or Reject
  834.    RTA - Receive-Terminate-Ack             str - Send Terminate-Req
  835.    AO  - Active-Open                       sta - Sent Terminate-Ack
  836.    PO  - Passive-Open
  837.    C   - Close
  838.    TO  - Timeout
  839.  
  840.  
  841.  
  842. Perkins                                                        [Page 12]
  843.  
  844. RFC 1171                Point-to-Point Protocol                July 1990
  845.  
  846.  
  847.    PLD - Physical-Layer-Down
  848.  
  849. 4.1.3.  State Transition Table
  850.  
  851.    The complete state transition table follows.   States  are  indicated
  852.    horizontally,  and events are read vertically.  State transitions and
  853.    actions are represented in the form  action/new-state.   Two  actions
  854.    caused by the same event are represented as action1&action2.
  855.  
  856.          | State
  857.          |   1       2        3        4        5        6        7
  858.    Events| Closed  Listen  Req-Sent Ack-Rcvd Ack-Sent  Open    Closing
  859.    ------+-------------------------------------------------------------
  860.      AO  | scr/3   scr/3      3        4        5        6      scr/3
  861.      PO  |   2       2        2*       4        5        6      sta/3*
  862.      C   |   1       1        1*       1      str/7    str/7      7
  863.      TO  |   1       2      scr/3    scr/3    scr/3      6      str/7*
  864.     PLD  |   1       1        1        1        1        1        1
  865.     RCR+ | sta/1 scr&sca/5  sca/5    sca/6    sca/5  scr&sca/5    7
  866.     RCR- | sta/1 scr&scn/3  scn/3    scn/4    scn/3  scr&scn/3    7
  867.     RCA  | sta/1   sta/2      4      scr/3      6      scr/3      7
  868.     RCN  | sta/1   sta/2    scr/3    scr/3    scr/5    scr/3      7
  869.     RTR  | sta/1   sta/2    sta/3    sta/3    sta/3    sta/1    sta/7
  870.     RTA  |   1       2        3        3        3        1        1
  871.     RCJ  |   1       2        1        1        1        1        1
  872.     RUC  | scj/1   scj/2    scj/1    scj/1    scj/1    scj/1  1 scj/7
  873.     RER  | sta/1   sta/2      3        4        5      ser/6      7
  874.  
  875.    Notes:
  876.        RCR+ - Receive-Configure-Request (Good)
  877.        RCR- - Receive-Configure-Request (Bad)
  878.        RCJ  - Receive-Code-Reject
  879.        RUC  - Receive-Unknown-Code
  880.        RER  - Receive-Echo-Request
  881.        scj  - Send-Code-Reject
  882.        ser  - Send-Echo-Reply
  883.         *   - Special attention necessary, see detailed text
  884.  
  885.  
  886. 4.1.4.  Events
  887.  
  888.    Transitions and actions in the LCP state machine are caused by
  889.    events.  Some events are caused by commands executed at the local end
  890.    (e.g., Active-Open, Passive-Open, and Close), others are caused by
  891.    the receipt of packets from the remote end (e.g., Receive-
  892.    Configure-Request, Receive-Configure-Ack, Receive-Configure-Nak,
  893.    Receive- Terminate-Request and Receive-Terminate-Ack), and still
  894.    others are caused by the expiration of the Restart timer started as
  895.  
  896.  
  897.  
  898. Perkins                                                        [Page 13]
  899.  
  900. RFC 1171                Point-to-Point Protocol                July 1990
  901.  
  902.  
  903.    the result of other events (e.g., Timeout).
  904.  
  905.    Following is a list of LCP events.
  906.  
  907.    Active-Open (AO)
  908.  
  909.       The Active-Open event indicates the local execution of an Active-
  910.       Open command by the network administrator (human or program).
  911.       When this event occurs, LCP should immediately attempt to open the
  912.       connection by exchanging configuration packets with the LCP peer.
  913.  
  914.    Passive-Open (PO)
  915.  
  916.       The Passive-Open event is similar to the Active-Open event.
  917.       However, instead of immediately exchanging configuration packets,
  918.       LCP should wait for the peer to send the first packet.  This will
  919.       only happen after an Active-Open event in the LCP peer.
  920.  
  921.    Close (C)
  922.  
  923.       The Close event indicates the local execution of a Close command.
  924.       When this event occurs, LCP should immediately attempt to close
  925.       the connection.
  926.  
  927.    Timeout (TO)
  928.  
  929.       The Timeout event indicates the expiration of the LCP Restart
  930.       timer.  The LCP Restart timer is started as the result of other
  931.       LCP events.
  932.  
  933.       The Restart timer is used to time out transmissions of Configure-
  934.       Request and Terminate-Request packets.  Expiration of the Restart
  935.       timer causes a Timeout event, which triggers the corresponding
  936.       Configure-Request or Terminate-Request packet to be retransmitted.
  937.       The Restart timer MUST be configurable, but should default to
  938.       three (3) seconds.
  939.  
  940.    Receive-Configure-Request (RCR)
  941.  
  942.       The Receive-Configure-Request event occurs when a Configure-
  943.       Request packet is received from the LCP peer.  The Configure-
  944.       Request packet indicates the desire to open a LCP connection and
  945.       may specify Configuration Options.  The Configure-Request packet
  946.       is more fully described in a later section.
  947.  
  948.    Receive-Configure-Ack (RCA)
  949.  
  950.       The Receive-Configure-Ack event occurs when a valid Configure-Ack
  951.  
  952.  
  953.  
  954. Perkins                                                        [Page 14]
  955.  
  956. RFC 1171                Point-to-Point Protocol                July 1990
  957.  
  958.  
  959.       packet is received from the LCP peer.  The Configure-Ack packet is
  960.       a positive response to a Configure-Request packet.
  961.  
  962.    Receive-Configure-Nak (RCN)
  963.  
  964.       The Receive-Configure-Nak event occurs when a valid Configure-Nak
  965.       or Configure-Reject packet is received from the LCP peer.  The
  966.       Configure-Nak and Configure-Reject packets are negative responses
  967.       to a Configure-Request packet.
  968.  
  969.    Receive-Terminate-Request (RTR)
  970.  
  971.       The Receive-Terminate-Request event occurs when a Terminate-
  972.       Request packet is received from the LCP peer.  The Terminate-
  973.       Request packet indicates the desire to close the LCP connection.
  974.  
  975.    Receive-Terminate-Ack (RTA)
  976.  
  977.       The Receive-Terminate-Ack event occurs when a Terminate-Ack packet
  978.       is received from the LCP peer.  The Terminate-Ack packet is a
  979.       response to a Terminate-Request packet.
  980.  
  981.    Receive-Code-Reject (RCJ)
  982.  
  983.       The Receive-Code-Reject event occurs when a Code-Reject packet is
  984.       received from the LCP peer.  The Code-Reject packet communicates
  985.       an error that immediately closes the connection.
  986.  
  987.    Receive-Unknown-Code (RUC)
  988.  
  989.       The Receive-Unknown-Code event occurs when an un-interpretable
  990.       packet is received from the LCP peer.  The Code-Reject packet is a
  991.       response to an unknown packet.
  992.  
  993.    Receive-Echo-Request (RER)
  994.  
  995.       The Receive-Echo-Request event occurs when a Echo-Request, Echo-
  996.       Reply, or Discard-Request packet is received from the LCP peer.
  997.       The Echo-Reply packet is a response to a Echo-Request packet.
  998.       There is no reply to a Discard-Request.
  999.  
  1000.    Physical-Layer-Down (PLD)
  1001.  
  1002.       The Physical-Layer-Down event occurs when the Physical Layer
  1003.       indicates that it is down.
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010. Perkins                                                        [Page 15]
  1011.  
  1012. RFC 1171                Point-to-Point Protocol                July 1990
  1013.  
  1014.  
  1015. 4.1.5.  Actions
  1016.  
  1017.    Actions in the LCP state machine are caused by events and typically
  1018.    indicate the transmission of packets and/or the starting or stopping
  1019.    of the Restart timer.  Following is a list of LCP actions.
  1020.  
  1021.    Send-Configure-Request (scr)
  1022.  
  1023.       The Send-Configure-Request action transmits a Configure-Request
  1024.       packet.  This indicates the desire to open a LCP connection with a
  1025.       specified set of Configuration Options.  The Restart timer is
  1026.       started after the Configure-Request packet is transmitted, to
  1027.       guard against packet loss.
  1028.  
  1029.    Send-Configure-Ack (sca)
  1030.  
  1031.       The Send-Configure-Ack action transmits a Configure-Ack packet.
  1032.       This acknowledges the receipt of a Configure-Request packet with
  1033.       an acceptable set of Configuration Options.
  1034.  
  1035.    Send-Configure-Nak (scn)
  1036.  
  1037.       The Send-Configure-Nak action transmits a Configure-Nak or
  1038.       Configure-Reject packet, as appropriate.  This negative response
  1039.       reports the receipt of a Configure-Request packet with an
  1040.       unacceptable set of Configuration Options.  Configure-Nak packets
  1041.       are used to refuse a Configuration Option value, and to suggest a
  1042.       new, acceptable value.  Configure-Reject packets are used to
  1043.       refuse all negotiation about a Configuration Option, typically
  1044.       because it is not recognized or implemented.  The use of
  1045.       Configure-Nak vs. Configure-Reject is more fully described in the
  1046.       section on LCP Packet Formats.
  1047.  
  1048.    Send-Terminate-Req (str)
  1049.  
  1050.       The Send-Terminate-Request action transmits a Terminate-Request
  1051.       packet.  This indicates the desire to close a LCP connection.  The
  1052.       Restart timer is started after the Terminate-Request packet is
  1053.       transmitted, to guard against packet loss.
  1054.  
  1055.    Send-Terminate-Ack (sta)
  1056.  
  1057.       The Send-Terminate-Request action transmits a Terminate-Ack
  1058.       packet.  This acknowledges the receipt of a Terminate-Request
  1059.       packet or otherwise confirms the belief that a LCP connection is
  1060.       Closed.
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066. Perkins                                                        [Page 16]
  1067.  
  1068. RFC 1171                Point-to-Point Protocol                July 1990
  1069.  
  1070.  
  1071.    Send-Code-Reject (scj)
  1072.  
  1073.       The Send-Code-Reject action transmits a Code-Reject packet.  This
  1074.       indicates the receipt of an unknown type of packet.  This is an
  1075.       unrecoverable error which causes immediate transitions to the
  1076.       Closed state on both ends of the link.
  1077.  
  1078.    Send-Echo-Reply (ser)
  1079.  
  1080.       The Send-Echo-Reply action transmits an Echo-Reply packet.  This
  1081.       acknowledges the receipt of an Echo-Request packet.
  1082.  
  1083. 4.1.6.  States
  1084.  
  1085.    Following is a more detailed description of each LCP state.
  1086.  
  1087.    Closed (1)
  1088.  
  1089.       The initial and final state is the Closed state.  In the Closed
  1090.       state the connection is down and there is no attempt to open it;
  1091.       all connection requests from peers are rejected.  Physical-Layer-
  1092.       Down events always cause an immediate transition to the Closed
  1093.       state.
  1094.  
  1095.       There are two events which cause a transition out of the Closed
  1096.       state, Active-Open and Passive-Open.  Upon an Active-Open event, a
  1097.       Configure-Request is transmitted, the Restart timer is started,
  1098.       and the Request-Sent state is entered.  Upon a Passive-Open event,
  1099.       the Listen state is entered immediately.  Upon receipt of any
  1100.       packet, with the exception of a Terminate-Ack, a Terminate-Ack is
  1101.       sent.  Terminate-Acks are silently discarded to avoid creating a
  1102.       loop.
  1103.  
  1104.       The Restart timer is not running in the Closed state.
  1105.  
  1106.       The Physical Layer connection may be disconnected at any time when
  1107.       in the LCP Closed state.
  1108.  
  1109.    Listen (2)
  1110.  
  1111.       The Listen state is similar to the Closed state in that the
  1112.       connection is down and there is no attempt to open it.  However,
  1113.       peer connection requests are no longer rejected.
  1114.  
  1115.       Upon receipt of a Configure-Request, a Configure-Request is
  1116.       immediately transmitted and the Restart timer is started.  The
  1117.       received Configuration Options are examined and the proper
  1118.       response is sent.  If a Configure-Ack is sent, the Ack-Sent state
  1119.  
  1120.  
  1121.  
  1122. Perkins                                                        [Page 17]
  1123.  
  1124. RFC 1171                Point-to-Point Protocol                July 1990
  1125.  
  1126.  
  1127.       is entered.  Otherwise, if a Configure-Nak or Configure-Reject is
  1128.       sent, the Request-Sent state is entered.  In either case, LCP
  1129.       exits its passive state, and begins to actively open the
  1130.       connection.  Terminate-Ack packets are sent in response to either
  1131.       Configure-Ack or Configure-Nak packets,
  1132.  
  1133.       The Restart timer is not running in the Listen state.
  1134.  
  1135.    Request-Sent (3)
  1136.  
  1137.       In the Request-Sent state an active attempt is made to open the
  1138.       connection.  A Configure-Request has been sent and the Restart
  1139.       timer is running, but a Configure-Ack has not yet been received
  1140.       nor has one been sent.
  1141.  
  1142.       Upon receipt of a Configure-Ack, the Ack-Received state is
  1143.       immediately entered.  Upon receipt of a Configure-Nak or
  1144.       Configure-Reject, the Configure-Request Configuration Options are
  1145.       adjusted appropriately, a new Configure-Request is transmitted,
  1146.       and the Restart timer is restarted.  Similarly, upon the
  1147.       expiration of the Restart timer, a new Configure-Request is
  1148.       transmitted and the Restart timer is restarted.  Upon receipt of a
  1149.       Configure-Request, the Configuration Options are examined and if
  1150.       acceptable, a Configure-Ack is sent and the Ack-Sent state is
  1151.       entered.  If the Configuration Options are unacceptable, a
  1152.       Configure-Nak or Configure-Reject is sent as appropriate.
  1153.  
  1154.       Since there is an outstanding Configure-Request in the Request-
  1155.       Sent state, special care must be taken to implement the Passive-
  1156.       Open and Close events; otherwise, it is possible for the LCP peer
  1157.       to think the connection is open.  Processing of either event
  1158.       should be postponed until there is reasonable assurance that the
  1159.       peer is not open.  In particular, the Restart timer should be
  1160.       allowed to expire.
  1161.  
  1162.    Ack-Received (4)
  1163.  
  1164.       In the Ack-Received state, a Configure-Request has been sent and a
  1165.       Configure-Ack has been received.  The Restart timer is still
  1166.       running since a Configure-Ack has not yet been transmitted.
  1167.  
  1168.       Upon receipt of a Configure-Request with acceptable Configuration
  1169.       Options, a Configure-Ack is transmitted, the Restart timer is
  1170.       stopped and the Open state is entered.  If the Configuration
  1171.       Options are unacceptable, a Configure-Nak or Configure-Reject is
  1172.       sent as appropriate.  Upon the expiration of the Restart timer, a
  1173.       new Configure-Request is transmitted, the Restart timer is
  1174.       restarted, and the state machine returns to the Request-Sent
  1175.  
  1176.  
  1177.  
  1178. Perkins                                                        [Page 18]
  1179.  
  1180. RFC 1171                Point-to-Point Protocol                July 1990
  1181.  
  1182.  
  1183.       state.
  1184.  
  1185.    Ack-Sent (5)
  1186.  
  1187.       In the Ack-Sent state, a Configure-Ack and a Configure-Request
  1188.       have been sent but a Configure-Ack has not yet been received.  The
  1189.       Restart timer is always running in the Ack-Sent state.
  1190.  
  1191.       Upon receipt of a Configure-Ack, the Restart timer is stopped and
  1192.       the Open state is entered.  Upon receipt of a Configure-Nak or
  1193.       Configure-Reject, the Configure-Request Configuration Options are
  1194.       adjusted appropriately, a new Configure-Request is transmitted,
  1195.       and the Restart timer is restarted.  Upon the expiration of the
  1196.       Restart timer, a new Configure-Request is transmitted, the Restart
  1197.       timer is restarted, and the state machine returns to the Request-
  1198.       Sent state.
  1199.  
  1200.    Open (6)
  1201.  
  1202.       In the Open state, a connection exists and data may be
  1203.       communicated over the link.  The Restart timer is not running in
  1204.       the Open state.
  1205.  
  1206.       In normal operation, only two events cause transitions out of the
  1207.       Open state.  Upon receipt of a Close command, a Terminate-Request
  1208.       is transmitted, the Restart timer is started, and the Closing
  1209.       state is entered.  Upon receipt of a Terminate-Request, a
  1210.       Terminate-Ack is transmitted and the Closed state is entered.
  1211.       Upon receipt of an Echo-Request, an Echo-Reply is transmitted.
  1212.       Similarly, Echo-Reply and Discard-Request packets are silently
  1213.       discarded or processed as expected.  All other events cause
  1214.       immediate transitions out of the Open state and should be handled
  1215.       as if the state machine were in the Listen state.
  1216.  
  1217.    Closing (7)
  1218.  
  1219.       In the Closing state, an active attempt is made to close the
  1220.       connection.  A Terminate-Request has been sent and the Restart
  1221.       timer is running, but a Terminate-Ack has not yet been received.
  1222.  
  1223.       Upon receipt of a Terminate-Ack, the Closed state is immediately
  1224.       entered.  Upon the expiration of the Restart timer, a new
  1225.       Terminate-Request is transmitted and the Restart timer is
  1226.       restarted.  After the Restart timer has expired Max-Restart times,
  1227.       this action may be skipped, and the Closed state may be entered.
  1228.       Max-Restart MUST be a configurable parameter.
  1229.  
  1230.       Since there is an outstanding Terminate-Request in the Closing
  1231.  
  1232.  
  1233.  
  1234. Perkins                                                        [Page 19]
  1235.  
  1236. RFC 1171                Point-to-Point Protocol                July 1990
  1237.  
  1238.  
  1239.       state, special care must be taken to implement the Passive-Open
  1240.       event; otherwise, it is possible for the LCP peer to think the
  1241.       connection is open.  Processing of the Passive-Open event should
  1242.       be postponed until there is reasonable assurance that the peer is
  1243.       not open.  In particular, the implementation should wait until the
  1244.       state machine would normally transition to the Closed state
  1245.       because of a Receive-Terminate-Ack event or Max-Restart Timeout
  1246.       events.
  1247.  
  1248. 4.2.  Loop Avoidance
  1249.  
  1250.    Note that the protocol makes a reasonable attempt at avoiding
  1251.    Configuration Option negotiation loops.  However, the protocol does
  1252.    NOT guarantee that loops will not happen.  As with any negotiation,
  1253.    it is possible to configure two PPP implementations with conflicting
  1254.    policies that will never converge.  It is also possible to configure
  1255.    policies which do converge, but which take significant time to do so.
  1256.    Implementors should keep this in mind and should implement loop
  1257.    detection mechanisms or higher level timeouts.  If a timeout is
  1258.    implemented, it MUST be configurable.
  1259.  
  1260. 4.3.  Timers and Counters
  1261.  
  1262.    There is one special timer used by LCP, the Restart timer.  The
  1263.    Restart timer is used to time out transmissions of Configure-Request
  1264.    and Terminate-Request packets.  Expiration of the Restart timer
  1265.    causes a Timeout event, and the corresponding Configure-Request or
  1266.    Terminate-Request packet retransmission.  The Restart timer MUST be
  1267.    configurable, but should default to three (3) seconds.
  1268.  
  1269.    There is one additional restart parameter, Max-Restarts.  Max-
  1270.    Restarts indicates the number of packet retransmissions that are
  1271.    required before there is reasonable assurance that the link closed.
  1272.    Max-Restarts MUST also be configurable, but should default to ten
  1273.    (10) retransmissions.
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Perkins                                                        [Page 20]
  1291.  
  1292. RFC 1171                Point-to-Point Protocol                July 1990
  1293.  
  1294.  
  1295. 4.4.  Packet Format
  1296.  
  1297.    Exactly one Link Control Protocol packet is encapsulated in the
  1298.    Information field of PPP Data Link Layer frames where the Protocol
  1299.    field indicates type hex c021 (Link Control Protocol).
  1300.  
  1301.    A summary of the Link Control Protocol packet format is shown below.
  1302.    The fields are transmitted from left to right.
  1303.  
  1304.     0                   1                   2                   3
  1305.     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
  1306.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1307.    |     Code      |  Identifier   |            Length             |
  1308.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1309.    |    Data ...
  1310.    +-+-+-+-+
  1311.  
  1312.    Code
  1313.  
  1314.       The Code field is one octet and identifies the kind of LCP packet.
  1315.       LCP Codes are assigned as follows:
  1316.  
  1317.          1       Configure-Request
  1318.          2       Configure-Ack
  1319.          3       Configure-Nak
  1320.          4       Configure-Reject
  1321.          5       Terminate-Request
  1322.          6       Terminate-Ack
  1323.          7       Code-Reject
  1324.          8       Protocol-Reject
  1325.          9       Echo-Request
  1326.          10      Echo-Reply
  1327.          11      Discard-Request
  1328.  
  1329.    Identifier
  1330.  
  1331.       The Identifier field is one octet and aids in matching requests
  1332.       and replies.
  1333.  
  1334.    Length
  1335.  
  1336.       The Length field is two octets and indicates the length of the LCP
  1337.       packet including the Code, Identifier, Length and Data fields.
  1338.       Octets outside the range of the Length field should be treated as
  1339.       Data Link Layer padding and should be ignored on reception.
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346. Perkins                                                        [Page 21]
  1347.  
  1348. RFC 1171                Point-to-Point Protocol                July 1990
  1349.  
  1350.  
  1351.    Data
  1352.  
  1353.       The Data field is zero or more octets as indicated by the Length
  1354.       field.  The format of the Data field is determined by the Code
  1355.       field.
  1356.  
  1357.    Regardless of which Configuration Options are enabled, all LCP
  1358.    packets are always sent in the full, standard form, as if no
  1359.    Configuration Options were enabled.  This ensures that LCP
  1360.    Configure-Request packets are always recognizable even when one end
  1361.    of the link mistakenly believes the link to be Open.
  1362.  
  1363.    This document describes Version 1 of the Link Control Protocol.  In
  1364.    the interest of simplicity, there is no version field in the LCP
  1365.    packet.  If a new version of LCP is necessary in the future, the
  1366.    intention is that a new Data Link Layer Protocol field value should
  1367.    be used to differentiate Version 1 LCP from all other versions.  A
  1368.    correctly functioning Version 1 LCP implementation will always
  1369.    respond to unknown Protocols (including other versions) with an
  1370.    easily recognizable Version 1 packet, thus providing a deterministic
  1371.    fallback mechanism for implementations of other versions.
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402. Perkins                                                        [Page 22]
  1403.  
  1404. RFC 1171                Point-to-Point Protocol                July 1990
  1405.  
  1406.  
  1407. 4.4.1.  Configure-Request
  1408.  
  1409.  
  1410.    Description
  1411.  
  1412.       A LCP implementation wishing to open a connection MUST transmit a
  1413.       LCP packet with the Code field set to 1 (Configure-Request) and
  1414.       the Options field filled with any desired changes to the default
  1415.       link Configuration Options.
  1416.  
  1417.       Upon reception of a Configure-Request, an appropriate reply MUST
  1418.       be transmitted.
  1419.  
  1420.    A summary of the Configure-Request packet format is shown below.  The
  1421.    fields are transmitted from left to right.
  1422.  
  1423.     0                   1                   2                   3
  1424.     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
  1425.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1426.    |     Code      |  Identifier   |            Length             |
  1427.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1428.    | Options ...
  1429.    +-+-+-+-+
  1430.  
  1431.    Code
  1432.  
  1433.       1 for Configure-Request.
  1434.  
  1435.    Identifier
  1436.  
  1437.       The Identifier field should be changed on each transmission.  On
  1438.       reception, the Identifier field should be copied into the
  1439.       Identifier field of the appropriate reply packet.
  1440.  
  1441.    Options
  1442.  
  1443.       The options field is variable in length and contains the list of
  1444.       zero or more Configuration Options that the sender desires to
  1445.       negotiate.  All Configuration Options are always negotiated
  1446.       simultaneously.  The format of Configuration Options is further
  1447.       described in a later section.
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458. Perkins                                                        [Page 23]
  1459.  
  1460. RFC 1171                Point-to-Point Protocol                July 1990
  1461.  
  1462.  
  1463. 4.4.2.  Configure-Ack
  1464.  
  1465.  
  1466.    Description
  1467.  
  1468.       If every Configuration Option received in a Configure-Request is
  1469.       both recognizable and acceptable, then a LCP implementation should
  1470.       transmit a LCP packet with the Code field set to 2 (Configure-
  1471.       Ack), the Identifier field copied from the received Configure-
  1472.       Request, and the Options field copied from the received
  1473.       Configure-Request.  The acknowledged Configuration Options MUST
  1474.       NOT be reordered or modified in any way.
  1475.  
  1476.       On reception of a Configure-Ack, the Identifier field must match
  1477.       that of the last transmitted Configure-Request, or the packet is
  1478.       invalid.  Additionally, the Configuration Options in a Configure-
  1479.       Ack must match those of the last transmitted Configure-Request, or
  1480.       the packet is invalid.  Invalid packets should be silently
  1481.       discarded.
  1482.  
  1483.       Reception of a valid Configure-Ack indicates that all
  1484.       Configuration Options sent in the last Configure-Request are
  1485.       acceptable.
  1486.  
  1487.    A summary of the Configure-Ack packet format is shown below.  The
  1488.    fields are transmitted from left to right.
  1489.  
  1490.     0                   1                   2                   3
  1491.     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
  1492.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1493.    |     Code      |  Identifier   |            Length             |
  1494.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1495.    | Options ...
  1496.    +-+-+-+-+
  1497.  
  1498.    Code
  1499.  
  1500.       2 for Configure-Ack.
  1501.  
  1502.    Identifier
  1503.  
  1504.       The Identifier field is a copy of the Identifier field of the
  1505.       Configure-Request which caused this Configure-Ack.
  1506.  
  1507.    Options
  1508.  
  1509.       The Options field is variable in length and contains the list of
  1510.       zero or more Configuration Options that the sender is
  1511.  
  1512.  
  1513.  
  1514. Perkins                                                        [Page 24]
  1515.  
  1516. RFC 1171                Point-to-Point Protocol                July 1990
  1517.  
  1518.  
  1519.       acknowledging.  All Configuration Options are always acknowledged
  1520.       simultaneously.
  1521.  
  1522. 4.4.3.  Configure-Nak
  1523.  
  1524.  
  1525.    Description
  1526.  
  1527.       If every element of the received Configuration Options is
  1528.       recognizable but some are not acceptable, then a LCP
  1529.       implementation should transmit a LCP packet with the Code field
  1530.       set to 3 (Configure-Nak), the Identifier field copied from the
  1531.       received Configure-Request, and the Options field filled with only
  1532.       the unacceptable Configuration Options from the Configure-Request.
  1533.       All acceptable Configuration Options should be filtered out of the
  1534.       Configure-Nak, but otherwise the Configuration Options from the
  1535.       Configure-Request MUST NOT be reordered.  Each of the nak'd
  1536.       Configuration Options MUST be modified to a value acceptable to
  1537.       the Configure-Nak sender.  Finally, an implementation may be
  1538.       configured to require the negotiation of a specific option.  If
  1539.       that option is not listed, then that option may be appended to the
  1540.       list of nak'd Configuration Options in order to request the remote
  1541.       end to list that option in its next Configure-Request packet.  The
  1542.       appended option must include a value acceptable to the Configure-
  1543.       Nak sender.
  1544.  
  1545.       On reception of a Configure-Nak, the Identifier field must match
  1546.       that of the last transmitted Configure-Request, or the packet is
  1547.       invalid and should be silently discarded.
  1548.  
  1549.       Reception of a valid Configure-Nak indicates that a new
  1550.       Configure-Request should be sent with the Configuration Options
  1551.       modified as specified in the Configure-Nak.
  1552.  
  1553.    A summary of the Configure-Nak packet format is shown below.  The
  1554.    fields are transmitted from left to right.
  1555.  
  1556.     0                   1                   2                   3
  1557.     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
  1558.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1559.    |     Code      |  Identifier   |            Length             |
  1560.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1561.    | Options ...
  1562.    +-+-+-+-+
  1563.  
  1564.    Code
  1565.  
  1566.       3 for Configure-Nak.
  1567.  
  1568.  
  1569.  
  1570. Perkins                                                        [Page 25]
  1571.  
  1572. RFC 1171                Point-to-Point Protocol                July 1990
  1573.  
  1574.  
  1575.    Identifier
  1576.  
  1577.       The Identifier field is a copy of the Identifier field of the
  1578.       Configure-Request which caused this Configure-Nak.
  1579.  
  1580.    Options
  1581.  
  1582.       The Options field is variable in length and contains the list of
  1583.       zero or more Configuration Options that the sender is nak'ing.
  1584.       All Configuration Options are always nak'd simultaneously.
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626. Perkins                                                        [Page 26]
  1627.  
  1628. RFC 1171                Point-to-Point Protocol                July 1990
  1629.  
  1630.  
  1631. 4.4.4.  Configure-Reject
  1632.  
  1633.  
  1634.    Description
  1635.  
  1636.       If some Configuration Options received in a Configure-Request are
  1637.       not recognizable or are not acceptable for negotiation (as
  1638.       configured by a network manager), then a LCP implementation should
  1639.       transmit a LCP packet with the Code field set to 4 (Configure-
  1640.       Reject), the Identifier field copied from the received Configure-
  1641.       Request, and the Options field filled with only the unrecognized
  1642.       Configuration Options from the Configure-Request.  All
  1643.       recognizable and negotiable Configuration Options must be filtered
  1644.       out of the Configure-Reject, but otherwise the Configuration
  1645.       Options MUST not be reordered.
  1646.  
  1647.       On reception of a Configure-Reject, the Identifier field must
  1648.       match that of the last transmitted Configure-Request, or the
  1649.       packet is invalid.  Additionally, the Configuration Options in a
  1650.       Configure-Reject must be a proper subset of those in the last
  1651.       transmitted Configure-Request, or the packet is invalid.  Invalid
  1652.       packets should be silently discarded.
  1653.  
  1654.       Reception of a Configure-Reject indicates that a new Configure-
  1655.       Request should be sent which does not include any of the
  1656.       Configuration Options listed in the Configure-Reject.
  1657.  
  1658.    A summary of the Configure-Reject packet format is shown below.  The
  1659.    fields are transmitted from left to right.
  1660.  
  1661.     0                   1                   2                   3
  1662.     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
  1663.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1664.    |     Code      |  Identifier   |            Length             |
  1665.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1666.    | Options ...
  1667.    +-+-+-+-+
  1668.  
  1669.    Code
  1670.  
  1671.       4 for Configure-Reject.
  1672.  
  1673.    Identifier
  1674.  
  1675.       The Identifier field is a copy of the Identifier field of the
  1676.       Configure-Request which caused this Configure-Reject.
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682. Perkins                                                        [Page 27]
  1683.  
  1684. RFC 1171                Point-to-Point Protocol                July 1990
  1685.  
  1686.  
  1687.    Options
  1688.  
  1689.       The Options field is variable in length and contains the list of
  1690.       zero or more Configuration Options that the sender is rejecting.
  1691.       All Configuration Options are always rejected simultaneously.
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738. Perkins                                                        [Page 28]
  1739.  
  1740. RFC 1171                Point-to-Point Protocol                July 1990
  1741.  
  1742.  
  1743. 4.4.5.  Terminate-Request and Terminate-Ack
  1744.  
  1745.  
  1746.    Description
  1747.  
  1748.       LCP includes Terminate-Request and Terminate-Ack Codes in order to
  1749.       provide a mechanism for closing a connection.
  1750.  
  1751.       A LCP implementation wishing to close a connection should transmit
  1752.       a LCP packet with the Code field set to 5 (Terminate-Request) and
  1753.       the Data field filled with any desired data.  Terminate-Request
  1754.       packets should continue to be sent until Terminate-Ack is
  1755.       received, the Physical Layer indicates that it has gone down, or a
  1756.       sufficiently large number have been transmitted such that the
  1757.       remote end is down with reasonable certainty.
  1758.  
  1759.       Upon reception of a Terminate-Request, a LCP packet MUST be
  1760.       transmitted with the Code field set to 6 (Terminate-Ack), the
  1761.       Identifier field copied from the Terminate-Request packet, and the
  1762.       Data field filled with any desired data.
  1763.  
  1764.       Reception of an unelicited Terminate-Ack indicates that the
  1765.       connection has been closed.
  1766.  
  1767.    A summary of the Terminate-Request and Terminate-Ack packet formats
  1768.    is shown below.  The fields are transmitted from left to right.
  1769.  
  1770.     0                   1                   2                   3
  1771.     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
  1772.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1773.    |     Code      |  Identifier   |            Length             |
  1774.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1775.    |    Data ...
  1776.    +-+-+-+-+
  1777.  
  1778.    Code
  1779.  
  1780.       5 for Terminate-Request;
  1781.  
  1782.       6 for Terminate-Ack.
  1783.  
  1784.    Identifier
  1785.  
  1786.       The Identifier field is one octet and aids in matching requests
  1787.       and replies.
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794. Perkins                                                        [Page 29]
  1795.  
  1796. RFC 1171                Point-to-Point Protocol                July 1990
  1797.  
  1798.  
  1799.    Data
  1800.  
  1801.       The Data field is zero or more octets and contains uninterpreted
  1802.       data for use by the sender.  The data may consist of any binary
  1803.       value and may be of any length from zero to the established
  1804.       maximum Information field length minus four.
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850. Perkins                                                        [Page 30]
  1851.  
  1852. RFC 1171                Point-to-Point Protocol                July 1990
  1853.  
  1854.  
  1855. 4.4.6.  Code-Reject
  1856.  
  1857.  
  1858.    Description
  1859.  
  1860.       Reception of a LCP packet with an unknown Code indicates that one
  1861.       of the communicating LCP implementations is faulty or incomplete.
  1862.       This error MUST be reported back to the sender of the unknown Code
  1863.       by transmitting a LCP packet with the Code field set to 7 (Code-
  1864.       Reject), and the inducing packet copied to the Rejected-Packet
  1865.       field.
  1866.  
  1867.       Upon reception of a Code-Reject, a LCP implementation should make
  1868.       an immediate transition to the Closed state, and should report the
  1869.       error, since it is unlikely that the situation can be rectified
  1870.       automatically.
  1871.  
  1872.    A summary of the Code-Reject packet format is shown below.  The
  1873.    fields are transmitted from left to right.
  1874.  
  1875.     0                   1                   2                   3
  1876.     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
  1877.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1878.    |     Code      |  Identifier   |            Length             |
  1879.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1880.    | Rejected-Packet ...
  1881.    +-+-+-+-+-+-+-+-+
  1882.  
  1883.    Code
  1884.  
  1885.       7 for Code-Reject.
  1886.  
  1887.    Identifier
  1888.  
  1889.       The Identifier field is one octet and is for use by the
  1890.       transmitter.
  1891.  
  1892.    Rejected-Packet
  1893.  
  1894.       The Rejected-Packet field contains a copy of the LCP packet which
  1895.       is being rejected.  It begins with the rejected Code field; it
  1896.       does not include any PPP Data Link Layer headers.  The Rejected-
  1897.       Packet should be truncated to comply with the established maximum
  1898.       Information field length.
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906. Perkins                                                        [Page 31]
  1907.  
  1908. RFC 1171                Point-to-Point Protocol                July 1990
  1909.  
  1910.  
  1911. 4.4.7.  Protocol-Reject
  1912.  
  1913.  
  1914.    Description
  1915.  
  1916.       Reception of a PPP frame with an unknown Data Link Layer Protocol
  1917.       indicates that the remote end is attempting to use a protocol
  1918.       which is unsupported at the local end.  This typically occurs when
  1919.       the remote end attempts to configure a new, but unsupported
  1920.       protocol.  If the LCP state machine is in the Open state, then
  1921.       this error MUST be reported back to the sender of the unknown
  1922.       protocol by transmitting a LCP packet with the Code field set to 8
  1923.       (Protocol-Reject), the Rejected-Protocol field set to the received
  1924.       Protocol, and the Data field filled with any desired data.
  1925.  
  1926.       Upon reception of a Protocol-Reject, a LCP implementation should
  1927.       stop transmitting frames of the indicated protocol.
  1928.  
  1929.       Protocol-Reject packets may only be sent in the LCP Open state.
  1930.       Protocol-Reject packets received in any state other than the LCP
  1931.       Open state should be discarded and no further action should be
  1932.       taken.
  1933.  
  1934.    A summary of the Protocol-Reject packet format is shown below.  The
  1935.    fields are transmitted from left to right.
  1936.  
  1937.     0                   1                   2                   3
  1938.     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
  1939.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1940.    |     Code      |  Identifier   |            Length             |
  1941.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1942.    |       Rejected-Protocol       |      Rejected-Information ...
  1943.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1944.  
  1945.    Code
  1946.  
  1947.       8 for Protocol-Reject.
  1948.  
  1949.    Identifier
  1950.  
  1951.       The Identifier field is one octet and is for use by the
  1952.       transmitter.
  1953.  
  1954.    Rejected-Protocol
  1955.  
  1956.       The Rejected-Protocol field is two octets and contains the
  1957.       Protocol of the Data Link Layer frame which is being rejected.
  1958.  
  1959.  
  1960.  
  1961.  
  1962. Perkins                                                        [Page 32]
  1963.  
  1964. RFC 1171                Point-to-Point Protocol                July 1990
  1965.  
  1966.  
  1967.    Rejected-Information
  1968.  
  1969.       The Rejected-Information field contains a copy from the frame
  1970.       which is being rejected.  It begins with the Information field,
  1971.       and does not include any PPP Data Link Layer headers or the FCS.
  1972.       The Rejected-Information field should be truncated to comply with
  1973.       the established maximum Information field length.
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018. Perkins                                                        [Page 33]
  2019.  
  2020. RFC 1171                Point-to-Point Protocol                July 1990
  2021.  
  2022.  
  2023. 4.4.8.  Echo-Request and Echo-Reply
  2024.  
  2025.  
  2026.    Description
  2027.  
  2028.       LCP includes Echo-Request and Echo-Reply Codes in order to provide
  2029.       a Data Link Layer loopback mechanism for use in exercising both
  2030.       directions of the link.  This is useful as an aid in debugging,
  2031.       link quality determination, performance testing, and for numerous
  2032.       other functions.
  2033.  
  2034.       An Echo-Request sender transmits a LCP packet with the Code field
  2035.       set to 9 (Echo-Request) and the Data field filled with any desired
  2036.       data, up to but not exceeding the receiver's established maximum
  2037.       Information field length minus eight.
  2038.  
  2039.       Upon reception of an Echo-Request, a LCP packet MUST be
  2040.       transmitted with the Code field set to 10 (Echo-Reply), the
  2041.       Identifier field copied from the received Echo-Request, and the
  2042.       Data field copied from the Echo-Request, truncating as necessary
  2043.       to avoid exceeding the peer's established maximum Information
  2044.       field length.
  2045.  
  2046.       Echo-Request and Echo-Reply packets may only be sent in the LCP
  2047.       Open state.  Echo-Request and Echo-Reply packets received in any
  2048.       state other than the LCP Open state should be discarded and no
  2049.       further action should be taken.
  2050.  
  2051.    A summary of the Echo-Request and Echo-Reply packet formats is shown
  2052.    below.  The fields are transmitted from left to right.
  2053.  
  2054.     0                   1                   2                   3
  2055.     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
  2056.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2057.    |     Code      |  Identifier   |            Length             |
  2058.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2059.    |                         Magic-Number                          |
  2060.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2061.    |    Data ...
  2062.    +-+-+-+-+
  2063.  
  2064.    Code
  2065.  
  2066.       9 for Echo-Request;
  2067.  
  2068.       10 for Echo-Reply.
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074. Perkins                                                        [Page 34]
  2075.  
  2076. RFC 1171                Point-to-Point Protocol                July 1990
  2077.  
  2078.  
  2079.    Identifier
  2080.  
  2081.       The Identifier field is one octet and aids in matching Echo-
  2082.       Requests and Echo-Replies.
  2083.  
  2084.    Magic-Number
  2085.  
  2086.       The Magic-Number field is four octets and aids in detecting
  2087.       loopbacked links.  Unless modified by a Configuration Option, the
  2088.       Magic-Number MUST always be transmitted as zero and MUST always be
  2089.       ignored on reception.  Further use of the Magic-Number is beyond
  2090.       the scope of this discussion.
  2091.  
  2092.    Data
  2093.  
  2094.       The Data field is zero or more octets and contains uninterpreted
  2095.       data for use by the sender.  The data may consist of any binary
  2096.       value and may be of any length from zero to the established
  2097.       maximum Information field length minus eight.
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130. Perkins                                                        [Page 35]
  2131.  
  2132. RFC 1171                Point-to-Point Protocol                July 1990
  2133.  
  2134.  
  2135. 4.4.9.  Discard-Request
  2136.  
  2137.    Description
  2138.  
  2139.       LCP includes a Discard-Request Code in order to provide a Data
  2140.       Link Layer data sink mechanism for use in exercising the local to
  2141.       remote direction of the link.  This is useful as an aid in
  2142.       debugging, performance testing, and and for numerous other
  2143.       functions.
  2144.  
  2145.       A discard sender transmits a LCP packet with the Code field set to
  2146.       11 (Discard-Request) and the Data field filled with any desired
  2147.       data, up to but not exceeding the receiver's established maximum
  2148.       Information field length minus eight.
  2149.  
  2150.       A discard receiver MUST simply throw away an Discard-Request that
  2151.       it receives.
  2152.  
  2153.       Discard-Request packets may only be sent in the LCP Open state.
  2154.  
  2155.    A summary of the Discard-Request packet formats is shown below.  The
  2156.    fields are transmitted from left to right.
  2157.  
  2158.     0                   1                   2                   3
  2159.     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
  2160.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2161.    |     Code      |  Identifier   |            Length             |
  2162.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2163.    |                         Magic-Number                          |
  2164.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2165.    |    Data ...
  2166.    +-+-+-+-+
  2167.  
  2168.    Code
  2169.  
  2170.       11 for Discard-Request.
  2171.  
  2172.    Identifier
  2173.  
  2174.       The Identifier field is one octet and is for use by the Discard-
  2175.       Request transmitter.
  2176.  
  2177.    Magic-Number
  2178.  
  2179.       The Magic-Number field is four octets and aids in detecting
  2180.       loopbacked links.  Unless modified by a configuration option, the
  2181.       Magic-Number MUST always be transmitted as zero and MUST always be
  2182.       ignored on reception.  Further use of the Magic-Number is beyond
  2183.  
  2184.  
  2185.  
  2186. Perkins                                                        [Page 36]
  2187.  
  2188. RFC 1171                Point-to-Point Protocol                July 1990
  2189.  
  2190.  
  2191.       the scope of this discussion.
  2192.  
  2193.    Data
  2194.  
  2195.       The Data field is zero or more octets and contains uninterpreted
  2196.       data for use by the sender.  The data may consist of any binary
  2197.       value and may be of any length from zero to the established
  2198.       maximum Information field length minus four.
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242. Perkins                                                        [Page 37]
  2243.  
  2244. RFC 1171                Point-to-Point Protocol                July 1990
  2245.  
  2246.  
  2247. 4.5.  Configuration Options
  2248.  
  2249.    LCP Configuration Options allow modifications to the standard
  2250.    characteristics of a point-to-point link to be negotiated.
  2251.    Negotiable modifications include such things as the maximum receive
  2252.    unit, async control character mapping, the link authentication
  2253.    method, etc.  The Configuration Options themselves are described in
  2254.    separate documents.  If a Configuration Option is not included in a
  2255.    Configure-Request packet, the default value for that Configuration
  2256.    Option is assumed.
  2257.  
  2258.    The end of the list of Configuration Options is indicated by the end
  2259.    of the LCP packet.
  2260.  
  2261.    Unless otherwise specified, a specific Configuration Option should be
  2262.    listed no more than once in a Configuration Options list.  Specific
  2263.    Configuration Options may override this general rule and may be
  2264.    listed more than once.  The effect of this is Configuration Option
  2265.    specific and is specified by each such Configuration Option.
  2266.  
  2267.    Also unless otherwise specified, all Configuration Options apply in a
  2268.    half-duplex fashion.  When negotiated, they apply to only one
  2269.    direction of the link, typically in the receive direction when
  2270.    interpreted from the point of view of the Configure-Request sender.
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298. Perkins                                                        [Page 38]
  2299.  
  2300. RFC 1171                Point-to-Point Protocol                July 1990
  2301.  
  2302.  
  2303. 4.5.1.  Format
  2304.  
  2305.    A summary of the Configuration Option format is shown below.  The
  2306.    fields are transmitted from left to right.
  2307.  
  2308.     0                   1
  2309.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
  2310.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2311.    |     Type      |    Length     |    Data ...
  2312.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2313.  
  2314.    Type
  2315.  
  2316.       The Type field is one octet and indicates the type of
  2317.       Configuration Option.  The most up-to-date values of the Type
  2318.       field are specified in the most recent "Assigned Numbers" RFC
  2319.       [12].
  2320.  
  2321.    Length
  2322.  
  2323.       The Length field is one octet and indicates the length of this
  2324.       Configuration Option including the Type, Length and Data fields.
  2325.       If a negotiable Configuration Option is received in a Configure-
  2326.       Request but with an invalid Length, a Configure-Nak should be
  2327.       transmitted which includes the desired Configuration Option with
  2328.       an appropriate Length and Data.
  2329.  
  2330.    Data
  2331.  
  2332.       The Data field is zero or more octets and indicates the value or
  2333.       other information for this Configuration Option.  The format and
  2334.       length of the Data field is determined by the Type and Length
  2335.       fields.
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354. Perkins                                                        [Page 39]
  2355.  
  2356. RFC 1171                Point-to-Point Protocol                July 1990
  2357.  
  2358.  
  2359. 5.  A PPP Network Control Protocol (NCP) for IP
  2360.  
  2361.    The IP Control Protocol (IPCP) is responsible for configuring,
  2362.    enabling, and disabling the IP protocol modules on both ends of the
  2363.    point-to-point link.  As with the Link Control Protocol, this is
  2364.    accomplished through an exchange of packets.  IPCP packets may not be
  2365.    exchanged until LCP has reached the Network-Layer Protocol
  2366.    Configuration Negotiation phase.  IPCP packets received before this
  2367.    phase is reached should be silently discarded.  Likewise, IP
  2368.    datagrams may not be exchanged until IPCP has first opened the
  2369.    connection (reached the Open state).
  2370.  
  2371.    The IP Control Protocol is exactly the same as the Link Control
  2372.    Protocol with the following exceptions:
  2373.  
  2374.    Data Link Layer Protocol Field
  2375.  
  2376.       Exactly one IP Control Protocol packet is encapsulated in the
  2377.       Information field of PPP Data Link Layer frames where the Protocol
  2378.       field indicates type hex 8021 (IP Control Protocol).
  2379.  
  2380.    Code field
  2381.  
  2382.       Only Codes 1 through 7 (Configure-Request, Configure-Ack,
  2383.       Configure-Nak, Configure-Reject, Terminate-Request, Terminate-Ack
  2384.       and Code-Reject) are used.  Other Codes should be treated as
  2385.       unrecognized and should result in Code-Rejects.
  2386.  
  2387.    Timeouts
  2388.  
  2389.       IPCP packets may not be exchanged until the Link Control Protocol
  2390.       has reached the network-layer Protocol Configuration Negotiation
  2391.       phase.  An implementation should be prepared to wait for Link
  2392.       Quality testing to finish before timing out waiting for a
  2393.       Configure-Ack or other response.  It is suggested that an
  2394.       implementation give up only after user intervention or a
  2395.       configurable amount of time.
  2396.  
  2397.    Configuration Option Types
  2398.  
  2399.       The IPCP has a separate set of Configuration Options.  The most
  2400.       up-to-date values of the type field are specified in the most
  2401.       recent "Assigned Numbers" RFC [12].
  2402.  
  2403. 5.1.  Sending IP Datagrams
  2404.  
  2405.    Before any IP packets may be communicated, both the Link Control
  2406.    Protocol and the IP Control Protocol must reach the Open state.
  2407.  
  2408.  
  2409.  
  2410. Perkins                                                        [Page 40]
  2411.  
  2412. RFC 1171                Point-to-Point Protocol                July 1990
  2413.  
  2414.  
  2415.    Exactly one IP packet is encapsulated in the Information field of PPP
  2416.    Data Link Layer frames where the Protocol field indicates type hex
  2417.    0021 (Internet Protocol).
  2418.  
  2419.    The maximum length of an IP packet transmitted over a PPP link is the
  2420.    same as the maximum length of the Information field of a PPP data
  2421.    link layer frame.  Larger IP datagrams must be fragmented as
  2422.    necessary.  If a system wishes to avoid fragmentation and reassembly,
  2423.    it should use the TCP Maximum Segment Size option [13], or a similar
  2424.    mechanism, to discourage others from sending large datagrams.
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466. Perkins                                                        [Page 41]
  2467.  
  2468. RFC 1171                Point-to-Point Protocol                July 1990
  2469.  
  2470.  
  2471. A.  Asynchronous HDLC
  2472.  
  2473.    This appendix summarizes the modifications to ISO 3309-1979 proposed
  2474.    in ISO 3309:1984/PDAD1.  These modifications allow HDLC to be used
  2475.    with 8-bit asynchronous links.
  2476.  
  2477.    Transmission Considerations
  2478.  
  2479.       Each octet is delimited by a start and a stop element.
  2480.  
  2481.    Flag Sequence
  2482.  
  2483.       The Flag Sequence is a single octet and indicates the beginning or
  2484.       end of a frame.  The Flag Sequence consists of the binary sequence
  2485.       01111110 (hexadecimal 0x7e).
  2486.  
  2487.    Transparency
  2488.  
  2489.       On asynchronous links, a character stuffing procedure is used.
  2490.       The Control Escape octet is defined as binary 01111101
  2491.       (hexadecimal 0x7d) where the bit positions are numbered 87654321
  2492.       (not 76543210, BEWARE).
  2493.  
  2494.       After FCS computation, the transmitter examines the entire frame
  2495.       between the two Flag Sequences.  Each Flag Sequence, Control
  2496.       Escape octet and octet with value less than hexadecimal 0x20 is
  2497.       replaced by a two octet sequence consisting of the Control Escape
  2498.       octet and the original octet with bit 6 complemented (i.e.,
  2499.       exclusive-or'd with hexadecimal 0x20).
  2500.  
  2501.       Prior to FCS computation, the receiver examines the entire frame
  2502.       between the two Flag Sequences.  Each octet with value less than
  2503.       hexadecimal 0x20 is simply removed (it may have been inserted by
  2504.       intervening data communications equipment).  For each Control
  2505.       Escape octet, that octet is also removed, but bit 6 of the
  2506.       following octet is complemented.  A Control Escape octet
  2507.       immediately preceding the closing Flag Sequence indicates an
  2508.       invalid frame.
  2509.  
  2510.          Note: The inclusion of all octets less than hexadecimal 0x20
  2511.          allows all ASCII control characters [10] excluding DEL (Delete)
  2512.          to be transparently communicated through almost all known data
  2513.          communications equipment.
  2514.  
  2515.       A few examples may make this more clear.  Packet data is
  2516.       transmitted on the link as follows:
  2517.  
  2518.          0x7e is encoded as 0x7d, 0x5e.
  2519.  
  2520.  
  2521.  
  2522. Perkins                                                        [Page 42]
  2523.  
  2524. RFC 1171                Point-to-Point Protocol                July 1990
  2525.  
  2526.  
  2527.          0x7d is encoded as 0x7d, 0x5d.
  2528.          0x01 is encoded as 0x7d, 0x21.
  2529.  
  2530.    Aborting a Transmission
  2531.  
  2532.       On asynchronous links, frames may be aborted by transmitting a "0"
  2533.       stop bit where a "1" bit is expected (framing error) or by
  2534.       transmitting a Control Escape octet followed immediately by a
  2535.       closing Flag Sequence.
  2536.  
  2537.    Inter-frame Time Fill
  2538.  
  2539.       On asynchronous links, inter-octet and inter-frame time fill
  2540.       should be accomplished by transmitting continuous "1" bits (mark-
  2541.       hold state).
  2542.  
  2543.          Note: On asynchronous links, inter-frame time fill can be
  2544.          viewed as extended inter-octet time fill.  Doing so can save
  2545.          one octet for every frame, decreasing delay and increasing
  2546.          bandwidth.  This is possible since a Flag Sequence may serve as
  2547.          both a frame close and a frame begin.  After having received
  2548.          any frame, an idle receiver will always be in a frame begin
  2549.          state.
  2550.  
  2551.          Robust transmitters should avoid using this trick over-
  2552.          zealously since the price for decreased delay is decreased
  2553.          reliability.  Noisy links may cause the receiver to receive
  2554.          garbage characters and interpret them as part of an incoming
  2555.          frame.  If the transmitter does not transmit a new opening Flag
  2556.          Sequence before sending the next frame, then that frame will be
  2557.          appended to the noise characters causing an invalid frame (with
  2558.          high reliability).  Transmitters should avoid this by
  2559.          transmitting an open Flag Sequence whenever "appreciable time"
  2560.          has elapsed since the prior closing Flag Sequence.  It is
  2561.          suggested that implementations will achieve the best results by
  2562.          always sending an opening Flag Sequence if the new frame is not
  2563.          back-to-back with the last.  The maximum value for "appreciable
  2564.          time" is likely to be no greater than the typing rate of a slow
  2565.          to average typist, say 1 second.
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578. Perkins                                                        [Page 43]
  2579.  
  2580. RFC 1171                Point-to-Point Protocol                July 1990
  2581.  
  2582.  
  2583. B.  Fast Frame Check Sequence (FCS) Implementation
  2584.  
  2585. B.1.  FCS Computation Method
  2586.  
  2587.    The following code provides a table lookup computation for
  2588.    calculating the Frame Check Sequence as data arrives at the
  2589.    interface.  The table is created by the code in section 2.
  2590.  
  2591.    /*
  2592.     * u16 represents an unsigned 16-bit number.  Adjust the typedef for
  2593.     * your hardware.
  2594.     */
  2595.    typedef unsigned short u16;
  2596.  
  2597.  
  2598.    /*
  2599.     * FCS lookup table as calculated by the table generator in section 2.
  2600.     */
  2601.    static u16 fcstab[256] = {
  2602.       0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
  2603.       0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
  2604.       0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
  2605.       0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
  2606.       0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
  2607.       0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
  2608.       0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
  2609.       0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
  2610.       0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
  2611.       0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
  2612.       0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
  2613.       0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
  2614.       0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
  2615.       0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
  2616.       0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
  2617.       0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
  2618.       0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
  2619.       0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
  2620.       0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
  2621.       0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
  2622.       0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
  2623.       0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
  2624.       0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
  2625.       0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
  2626.       0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
  2627.       0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
  2628.       0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
  2629.       0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
  2630.       0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
  2631.  
  2632.  
  2633.  
  2634. Perkins                                                        [Page 44]
  2635.  
  2636. RFC 1171                Point-to-Point Protocol                July 1990
  2637.  
  2638.  
  2639.       0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
  2640.       0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
  2641.       0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
  2642.    };
  2643.  
  2644.    #define PPPINITFCS      0xffff  /* Initial FCS value */
  2645.    #define PPPGOODFCS      0xf0b8  /* Good final FCS value */
  2646.  
  2647.    /*
  2648.     * Calculate a new fcs given the current fcs and the new data.
  2649.     */
  2650.    u16 pppfcs(fcs, cp, len)
  2651.        register u16 fcs;
  2652.        register unsigned char *cp;
  2653.        register int len;
  2654.    {
  2655.        ASSERT(sizeof (u16) == 2);
  2656.        ASSERT(((u16) -1) > 0);
  2657.        while (len--)
  2658.            fcs = (fcs >> 8) ^ fcstab[(fcs ^ *cp++) & 0xff];
  2659.  
  2660.        return (fcs);
  2661.    }
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690. Perkins                                                        [Page 45]
  2691.  
  2692. RFC 1171                Point-to-Point Protocol                July 1990
  2693.  
  2694.  
  2695. B.2.  Fast FCS table generator
  2696.  
  2697.    The following code creates the lookup table used to calculate the
  2698.    FCS.
  2699.  
  2700.    /*
  2701.     * Generate a FCS table for the HDLC FCS.
  2702.     *
  2703.     * Drew D. Perkins at Carnegie Mellon University.
  2704.     *
  2705.     * Code liberally borrowed from Mohsen Banan and D. Hugh Redelmeier.
  2706.     */
  2707.  
  2708.    /*
  2709.     * The HDLC polynomial: x**0 + x**5 + x**12 + x**16 (0x8408).
  2710.     */
  2711.    #define P       0x8408
  2712.  
  2713.  
  2714.    main()
  2715.    {
  2716.        register unsigned int b, v;
  2717.        register int i;
  2718.  
  2719.        printf("typedef unsigned short u16;\n");
  2720.        printf("static u16 fcstab[256] = {");
  2721.        for (b = 0; ; ) {
  2722.            if (b % 8 == 0)
  2723.                printf("\n");
  2724.  
  2725.            v = b;
  2726.            for (i = 8; i--; )
  2727.                v = v & 1 ? (v >> 1) ^ P : v >> 1;
  2728.  
  2729.            printf("0x%04x", v & 0xFFFF);
  2730.            if (++b == 256)
  2731.                break;
  2732.            printf(",");
  2733.        }
  2734.        printf("\n};\n");
  2735.    }
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746. Perkins                                                        [Page 46]
  2747.  
  2748. RFC 1171                Point-to-Point Protocol                July 1990
  2749.  
  2750.  
  2751. References
  2752.  
  2753.    [1]   Electronic Industries Association, EIA Standard RS-232-C,
  2754.          "Interface Between Data Terminal Equipment and Data
  2755.          Communications Equipment Employing Serial Binary Data
  2756.          Interchange", August 1969.
  2757.  
  2758.    [2]   International Organization For Standardization, ISO Standard
  2759.          3309-1979, "Data communication - High-level data link control
  2760.          procedures - Frame structure", 1979.
  2761.  
  2762.    [3]   International Organization For Standardization, ISO Standard
  2763.          4335-1979, "Data communication - High-level data link control
  2764.          procedures - Elements of procedures", 1979.
  2765.  
  2766.    [4]   International Organization For Standardization, ISO Standard
  2767.          4335-1979/Addendum 1, "Data communication - High-level data
  2768.          link control procedures - Elements of procedures - Addendum 1",
  2769.          1979.
  2770.  
  2771.    [5]   International Organization For Standardization, Proposed Draft
  2772.          International Standard ISO 3309:1983/PDAD1, "Information
  2773.          processing systems - Data communication - High-level data link
  2774.          control procedures - Frame structure - Addendum 1: Start/stop
  2775.          transmission", 1984.
  2776.  
  2777.    [6]   International Telecommunication Union, CCITT Recommendation
  2778.          X.25, "Interface Between Data Terminal Equipment (DTE) and Data
  2779.          Circuit Terminating Equipment (DCE) for Terminals Operating in
  2780.          the Packet Mode on Public Data Networks", CCITT Red Book,
  2781.          Volume VIII, Fascicle VIII.3, Rec. X.25., October 1984.
  2782.  
  2783.    [7]   Perez, "Byte-wise CRC Calculations", IEEE Micro, June, 1983.
  2784.  
  2785.    [8]   Morse, G., "Calculating CRC's by Bits and Bytes", Byte,
  2786.          September 1986.
  2787.  
  2788.    [9]   LeVan, J., "A Fast CRC", Byte, November 1987.
  2789.  
  2790.    [10]  American National Standards Institute, ANSI X3.4-1977,
  2791.          "American National Standard Code for Information Interchange",
  2792.          1977.
  2793.  
  2794.    [11]  Postel, J., "Internet Protocol", RFC 791, USC/Information
  2795.          Sciences Institute, September 1981.
  2796.  
  2797.    [12]  Reynolds, J., and J. Postel, "Assigned Numbers", RFC 1060,
  2798.          USC/Information Sciences Institute, March 1990.
  2799.  
  2800.  
  2801.  
  2802. Perkins                                                        [Page 47]
  2803.  
  2804. RFC 1171                Point-to-Point Protocol                July 1990
  2805.  
  2806.  
  2807.    [13]  Postel, J., "The TCP Maximum Segment Size Option and Related
  2808.          Topics", RFC 879, USC/Information Sciences Institute, November
  2809.          1983.
  2810.  
  2811. Security Considerations
  2812.  
  2813.    Security issues are not discussed in this memo.
  2814.  
  2815. Chairman's Address
  2816.  
  2817. This proposal is the product of the Point-to-Point Protocol Working
  2818. Group of the Internet Engineering Task Force (IETF). The working group
  2819. can be contacted via the chair:
  2820.  
  2821.    Russ Hobby
  2822.    UC Davis
  2823.    Computing Services
  2824.    Davis, CA 95616
  2825.  
  2826.    Phone: (916) 752-0236
  2827.  
  2828.    EMail: rdhobby@ucdavis.edu
  2829.  
  2830. Author's Address
  2831.  
  2832.    Questions about this memo can also be directed to the author:
  2833.  
  2834.       Drew D. Perkins
  2835.       Carnegie Mellon University
  2836.       Networking and Communications
  2837.       Pittsburgh, PA 15213
  2838.  
  2839.       Phone: (412) 268-8576
  2840.  
  2841.       EMail: ddp@andrew.cmu.edu
  2842.  
  2843. Acknowledgments
  2844.  
  2845.    Many people spent significant time helping to develop the Point-to-
  2846.    Point Protocol.  The complete list of people is too numerous to list,
  2847.    but the following people deserve special thanks: Ken Adelman (TGV),
  2848.    Craig Fox (NSC), Phill Gross (NRI), Russ Hobby (UC Davis), David
  2849.    Kaufman (Proteon), John LoVerso (Xylogics), Bill Melohn (Sun
  2850.    Microsystems), Mike Patton (MIT), Drew Perkins (CMU), Greg Satz
  2851.    (cisco systems) and Asher Waldfogel (Wellfleet).
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858. Perkins                                                        [Page 48]
  2859.  
  2860.