home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit 2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Texts / Rfc / RFC1171.TXT < prev    next >
Encoding:
Text File  |  1999-11-04  |  87.4 KB  |  2,908 lines

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