home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_j_p / draft-ietf-pppext-l2tp-01.txt < prev    next >
Text File  |  1996-12-24  |  207KB  |  4,946 lines

  1.  
  2. PPP Working Group                                             Kory Hamzeh
  3. INTERNET-DRAFT                                      Ascend Communications
  4. Category: Internet Draft                                        Tim Kolar
  5. Title: draft-ietf-pppext-l2tp-01.txt                        Cisco Systems
  6. Date: December 1996                                     Morgan Littlewood
  7.                                                             Cisco Systems
  8.                                                        Gurdeep Singh Pall
  9.                                                     Microsoft Corporation
  10.                                                               Jeff Taarud
  11.                                              formerly of 3COM Corporation
  12.                                                        Andrew J. Valencia
  13.                                                             Cisco Systems
  14.                                                          William Verthein
  15.                                                             U.S. Robotics
  16.  
  17.  
  18.                   Layer Two Tunneling Protocol "L2TP"
  19.  
  20.  
  21. Status of this Memo
  22.  
  23.    This document is an Internet-Draft.  Internet-Drafts are working doc-
  24.    uments of the Internet Engineering Task Force (IETF), its areas, and
  25.    its working groups.  Note that other groups may also distribute work-
  26.    ing documents as Internet-Drafts.
  27.  
  28.    Internet-Drafts are draft documents valid for a maximum of six
  29.    months.  Internet-Drafts may be updated, replaced, or obsoleted by
  30.    other documents at any time.  It is not appropriate to use Internet-
  31.    Drafts as reference material or to cite them other than as a ``work-
  32.    ing draft'' or ``work in progress.''
  33.  
  34.    To learn the current status of any Internet-Draft, please check the
  35.    1id-abstracts.txt listing contained in the Internet-Drafts Shadow
  36.    Directories on ds.internic.net, nic.nordu.net, ftp.nisc.sri.com, or
  37.    munnari.oz.au.
  38.  
  39. Abstract
  40.  
  41.    Virtual dial-up allows many separate and autonomous protocol domains
  42.    to share common access infrastructure including modems, Access
  43.    Servers, and ISDN routers.  RFC1661 specifies multiprotocol dial-up
  44.    via PPP [1].  This document describes the Layer Two Tunneling Proto-
  45.    col (L2TP) which permits the tunneling of the link layer (i.e., HDLC,
  46.    async HDLC) of PPP.  Using such tunnels, it is possible to divorce
  47.    the location of the initial dial-up server from the location at which
  48.    the dial-up protocol connection is terminated and access to the net-
  49.    work provided.
  50.  
  51. Table of Contents
  52.  
  53.    1.0 Introduction
  54.    1.1 Conventions
  55.    1.2 Terminology
  56.  
  57.  
  58.  
  59. Valencia                    expires May 1997                     [Page 1]
  60.  
  61.  
  62.  
  63.  
  64.  
  65. INTERNET DRAFT                                             December 1996
  66.  
  67.  
  68.    2.0 Problem Space Overview
  69.    2.1 Initial Assumptions
  70.    2.2 Topology
  71.    2.3 Providing Virtual Dial-up Services--a walk-through
  72.    3.0 Service Model Issues
  73.    3.1 Security
  74.    3.2 Address Allocation
  75.    3.3 Authentication
  76.    3.4 Accounting
  77.    4.0 Protocol Overview
  78.    4.1 Control Message Overview
  79.    4.2 Payload Packet Overview
  80.    5.0 Message Format and Protocol Extensibility
  81.    5.1 AVP
  82.    5.2 Control Message Format
  83.    5.3 Payload Message Format
  84.    5.4 Control Message Types
  85.    5.5 General Error Codes
  86.    6.0 Control Connection Protocol Specification
  87.    6.1 Start-Control-Connection-Request
  88.    6.2 Start-Control-Connection-Reply
  89.    6.3 Start-Control-Connection-Connected
  90.    6.4 Stop-Control-Connection-Request
  91.    6.5 Stop-Control-Connection-Reply
  92.    6.6 Hello
  93.    6.7 (deleted)
  94.    6.8 Outgoing-Call-Request
  95.    6.9 Outgoing-Call-Reply
  96.    6.10 Outgoing-Call-Connected
  97.    6.11 Incoming-Call-Request
  98.    6.12 Incoming-Call-Reply
  99.    6.13 Incoming-Call-Connected
  100.    6.14 Call-Clear-Request
  101.    6.15 Call-Disconnect-Notify
  102.    6.16 WAN-Error-Notify
  103.    6.17 Set-Link-Info
  104.    7.0 Control Connection State Machines
  105.    7.1 Control Connection Protocol Operation
  106.    7.2 Control Connection States
  107.    7.2.1 Control Connection Originator
  108.    7.2.2 Control connection Receiver
  109.    7.3 Timing considerations
  110.    7.4 Incoming Calls
  111.    7.4.1 LAC Incoming Call States
  112.    7.4.2 LNS Incoming Call States
  113.    7.5 Outgoing calls
  114.    7.5.1 LAC Outgoing Call States
  115.    7.5.2 LNS Outgoing Call States
  116.    8.0 L2TP Over Specific Media
  117.    8.1 IP/UDP
  118.    8.2 IP
  119.    9.0 Security Considerations
  120.    9.1 Tunnel Endpoint Security
  121.    9.2 Client Security
  122.  
  123.  
  124.  
  125. Valencia                    expires May 1997                     [Page 2]
  126.  
  127.  
  128.  
  129.  
  130.  
  131. INTERNET DRAFT                                             December 1996
  132.  
  133.  
  134.    10.0 Acknowledgments
  135.    11.0 Contacts
  136.    12.0 References
  137.    Appendix A: Acknowledgment Time-Outs
  138.    Appendix B: Acknowledgment Time-Out and Window Adjustment
  139.    Appendix C: Handling of out-of-order packets
  140.    Appendix D: Transport Layer Adaptive Time-Outs and Window Adjustment
  141.  
  142. 1.0 Introduction
  143.  
  144.    The traditional dial-up network service on the Internet is for regis-
  145.    tered IP addresses only.  A new class of virtual dial-up application
  146.    which allows multiple protocols and unregistered IP addresses is also
  147.    desired on the Internet.  Examples of this class of network applica-
  148.    tion are support for privately addressed IP, IPX, and AppleTalk dial-
  149.    up via PPP across existing Internet infrastructure.
  150.  
  151.    The support of these multiprotocol virtual dial-up applications is of
  152.    significant benefit to end users, enterprises, and Internet Service
  153.    providers as it allows the sharing of very large investments in
  154.    access and core infrastructure and allows local calls to be used.  It
  155.    also allows existing investments in non-IP protocol applications to
  156.    be supported in a secure manner while still leveraging the access
  157.    infrastructure of the Internet.
  158.  
  159.    It is the purpose of this draft to identify the issues encountered in
  160.    integrating multiprotocol dial-up services into an existing Internet
  161.    Service Provider's Point of Presence (hereafter referred to as ISP
  162.    and POP, respectively), and to describe the L2TP protocol which per-
  163.    mits the leveraging of existing access protocols.
  164.  
  165.    This protocol may also be used to solve the "multilink hunt-group
  166.    splitting" problem. Multilink PPP, often used to aggregate ISDN B
  167.    channels, requires that all channels composing a multilink bundle be
  168.    grouped at a single NAS.  Because L2TP makes a PPP session appear at
  169.    a location other than the physical point at which the session was
  170.    physically received, it can be used to make all channels appear at a
  171.    single NAS, allowing multilink operation even when the physical calls
  172.    are spread across distinct physical NAS's.
  173.  
  174. 1.1 Conventions
  175.  
  176.    The following language conventions are used in the items of specifi-
  177.    cation in this document:
  178.  
  179.       o   MUST, SHALL, or MANDATORY -- This item is an absolute
  180.          requirement of the specification.
  181.  
  182.       o   SHOULD or RECOMMEND -- This item should generally be followed
  183.          for all but exceptional circumstances.
  184.  
  185.       o   MAY or OPTIONAL -- This item is truly optional and may be
  186.          followed or ignored according to the needs of the implementor.
  187.  
  188.  
  189.  
  190.  
  191. Valencia                    expires May 1997                     [Page 3]
  192.  
  193.  
  194.  
  195.  
  196.  
  197. INTERNET DRAFT                                             December 1996
  198.  
  199.  
  200. 1.2 Terminology
  201.  
  202.    Analog Channel
  203.  
  204.       A circuit-switched communication path which is intended to carry
  205.       3.1 Khz audio in each direction.
  206.  
  207.    Digital Channel
  208.  
  209.       A circuit-switched communication path which is intended to carry
  210.       digital information in each direction.
  211.  
  212.    Call
  213.  
  214.       A connection or attempted connection between two terminal end-
  215.       points on a PSTN or ISDN--for example, a telephone call between
  216.       two modems.
  217.  
  218.    CHAP
  219.  
  220.       Challenge Authentication Protocol, a PPP cryptographic chal-
  221.       lenge/response authentication protocol in which the cleartext
  222.       password is not passed in the clear over the line.
  223.  
  224.    CLID
  225.  
  226.       Calling Line ID, an indication to the receiver of a call as to the
  227.       phone number of the caller.
  228.  
  229.    Control Messages
  230.       Control messages are exchanged between LAC, LNS pairs, and operate
  231.       in-band within the tunnel protocol.  Control messages govern
  232.       aspects of the tunnel and sessions within the tunnel.
  233.  
  234.    Dial User
  235.  
  236.       An end-system or router attached to an on-demand PSTN or ISDN
  237.       which is either the initiator or recipient of a call.
  238.  
  239.    DNIS
  240.  
  241.       Dialed Number Information String, an indication to the receiver of
  242.       a call as to what phone number the caller used to reach it.
  243.  
  244.    EAP
  245.  
  246.       Extensible Authentication Protocol, a framework for a family of
  247.       PPP authentication protocols, including cleartext, chal-
  248.       lenge/response, and arbitrary dialog sequences.
  249.  
  250.    L2TP Access Concentrator (LAC)
  251.  
  252.       A device attached to one or more PSTN or ISDN lines capable of PPP
  253.       operation and of handling the L2TP protocol.  The LAC needs only
  254.  
  255.  
  256.  
  257. Valencia                    expires May 1997                     [Page 4]
  258.  
  259.  
  260.  
  261.  
  262.  
  263. INTERNET DRAFT                                             December 1996
  264.  
  265.  
  266.       implement the media over which L2TP is to operate to pass traffic
  267.       to one or more LNS's.  It may tunnel any protocol carried within
  268.       PPP.
  269.  
  270.    L2TP Network Server (LNS)
  271.  
  272.       An LNS operates on any platform capable of PPP termination.  The
  273.       LNS handles the server side of the L2TP protocol.  Since L2TP
  274.       relies only on the single media over which L2TP tunnels arrive,
  275.       the LNS may have only a single LAN or WAN interface, yet still be
  276.       able to terminate calls arriving at any LAC's full range of PPP
  277.       interfaces (async, synchronous ISDN, V.120, etc.).
  278.  
  279.    Network Access Server (NAS)
  280.  
  281.       A device providing temporary, on-demand network access to users.
  282.       This access is point-to-point using PSTN or ISDN lines.
  283.  
  284.    PAP
  285.  
  286.       Password Authentication Protocol, a simple PPP authentication
  287.       mechanism in which a cleartext username and password are transmit-
  288.       ted to prove identity.
  289.  
  290.    Session
  291.  
  292.       L2TP is connection-oriented.  The LNS and LAC maintain state for
  293.       each user that is attached to an LAC.  A session is created when
  294.       an end-to-end PPP connection is attempted between a dial user and
  295.       the LNS, or when a outbound call is initiated.  The datagrams
  296.       related to a session are sent over the tunnel between the LAC and
  297.       LNS.
  298.  
  299.    Quality of Service (QOS)
  300.  
  301.       A given Quality of Service level is sometimes required for a given
  302.       user being tunneled between an LNS-LAC pair.  For this scenario, a
  303.       unique L2TP tunnel is created (generally on top of a new SVC) and
  304.       encapsulated directly on top of the media providing the indicated
  305.       QOS.
  306.  
  307.    Switched Virtual Circuit (SVC)
  308.  
  309.       An L2TP-compatible media on top of which L2TP is directly encapsu-
  310.       lated.  SVC's are dynamically created, permitting tunnel media to
  311.       be created dynamically in response to desired LNS-LAC connectivity
  312.       requirements.
  313.  
  314.    Tunnel
  315.  
  316.       A tunnel is defined by an LNS-LAC pair.  The tunnel carries PPP
  317.       datagrams between the LAC and the LNS; many sessions can be multi-
  318.       plexed over a single tunnel.  A control connection operating in-
  319.       band over the same tunnel controls the establishment, release, and
  320.  
  321.  
  322.  
  323. Valencia                    expires May 1997                     [Page 5]
  324.  
  325.  
  326.  
  327.  
  328.  
  329. INTERNET DRAFT                                             December 1996
  330.  
  331.  
  332.       maintenance of sessions and of the tunnel itself.
  333.  
  334. 2.0 Problem Space Overview
  335.  
  336.    In this section we describe in high level terms the scope of the
  337.    problem that will be explored in more detail in later sections.
  338.  
  339. 2.1 Initial Assumptions
  340.  
  341.    We begin by assuming that Internet access is provided by an ISP and
  342.    that the ISP wishes to offer services other than traditional regis-
  343.    tered IP address based services to dial-up users of the network.
  344.  
  345.    We also assume that the user of such a service wants all of the secu-
  346.    rity facilities that are available to him in a dedicated dial-up con-
  347.    figuration.  In particular, the end user requires:
  348.  
  349.    +  End System transparency: Neither the remote end system nor his
  350.    home site hosts should require any special software to use this ser-
  351.    vice in a secure manner.
  352.  
  353.    +  Authentication as provided via dial-up PPP CHAP, PAP, EAP, or
  354.    through other dialogs, for instance, a textual exchange on V.120
  355.    before starting PPP.  This will include TACACS+ [7] and RADIUS [8]
  356.    solutions as well as support for smart cards and one-time passwords.
  357.    The authentication should be manageable by the user independently of
  358.    the ISP.
  359.  
  360.    +  Addressing should be as manageable as dedicated dial-up solutions.
  361.    The address should be assigned by the home site and not the ISP.
  362.  
  363.    +  Authorization should be managed by the home site as it would in a
  364.    direct dial-up solution.
  365.  
  366.    +  Accounting should be performed both by the ISP (for billing pur-
  367.    poses) and by the user (for charge-back and auditing).
  368.  
  369. 2.2 Topology
  370.  
  371.    Shown below is a generic Internet with Public switched Telephone Net-
  372.    work (PSTN) access (i.e., async PPP via modems) and Integrated Ser-
  373.    vices Digital Network (ISDN) access (i.e., synchronous PPP access).
  374.    Remote users (either async or ISDN PPP) will access the Home LAN as
  375.    if they were dialed into the L2TP Network Server (LNS), although
  376.    their physical dial-up is via the ISP Network Access Server.
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389. Valencia                    expires May 1997                     [Page 6]
  390.  
  391.  
  392.  
  393.  
  394.  
  395. INTERNET DRAFT                                             December 1996
  396.  
  397.  
  398.            ...----[L]----+---[L]-----...
  399.                          |
  400.                          |
  401.                         [H]
  402.                          |
  403.                  ________|________________________
  404.                  |                                |
  405.          ________|__                        ______|________
  406.          |         |                        |             |
  407.          |  PSTN  [R]                      [R]  ISDN      |
  408.          |  Cloud  |                        |   Cloud    [N]__[U]
  409.          |         |             Internet   |             |
  410.          |         |                       [R]            |
  411.          [N]______[R]                       |_____________|
  412.           |      |                                |
  413.           |      |                                |
  414.          [U]     |________________________________|
  415.  
  416.  
  417.       [H] = LNS
  418.       [L] = Home LAN(s)
  419.       [R] = Router
  420.       [U] = Remote User
  421.       [N] = ISP Network Access Server
  422.  
  423.  
  424. 2.3 Providing Virtual dial-up Services--a walk-through
  425.  
  426.    To motivate the following discussion, this section walks through an
  427.    example of what might happen when a Virtual dial-up client initiates
  428.    access.
  429.  
  430.    The remote user initiates a PPP connection to an ISP via either the
  431.    PSTN or ISDN.  The Network Access Server (NAS) accepts the connection
  432.    and the PPP link is established (L2TP also permits the NAS to check
  433.    with an LNS after call indication prior to accepting the call--this
  434.    is useful where DNIS or CLID information is available in the incoming
  435.    call notification).
  436.  
  437.    The ISP may now undertake a partial authentication of the end sys-
  438.    tem/user.  Only the username field would be interpreted to determine
  439.    whether the user requires a Virtual dial-up service.  It is
  440.    expected--but not required--that usernames will be structured (e.g.
  441.    username@company.com).  Alternatively, the ISP may maintain a
  442.    database mapping users to services.  In the case of Virtual dial-up,
  443.    the mapping will name a specific endpoint, the LNS.
  444.  
  445.    Alternatively, the ISP may have already determined the target LNS
  446.    from DNIS.  If the LNS is willing to accept tunnel creation without
  447.    any authentication of the caller, the NAS may tunnel the PPP connec-
  448.    tion without ever having communicated with the remote user.
  449.  
  450.    If a virtual dial-up service is not required, standard access to the
  451.    Internet may be provided.
  452.  
  453.  
  454.  
  455. Valencia                    expires May 1997                     [Page 7]
  456.  
  457.  
  458.  
  459.  
  460.  
  461. INTERNET DRAFT                                             December 1996
  462.  
  463.  
  464.    If no tunnel connection currently exists to the desired LNS, one is
  465.    initiated.  L2TP is designed to be largely insulated from the details
  466.    of the media over which the tunnel is established; L2TP requires only
  467.    that the tunnel media provide packet oriented point-to-point connec-
  468.    tivity.  Obvious examples of such media are UDP, Frame Relay PVC's,
  469.    or X.25 VC's.
  470.  
  471.    Once the tunnel exists, an unused slot within the tunnel, a "Call
  472.    ID", is allocated, and a connect indication is sent to notify the LNS
  473.    of this new dial-up session.  The LNS either accepts the connection,
  474.    or rejects it.  Rejection may include a reason indication, which may
  475.    be displayed to the dial-up user, after which the call should be dis-
  476.    connected.
  477.  
  478.    The initial setup notification may include the authentication infor-
  479.    mation required to allow the LNS to authenticate the user and decide
  480.    to accept or decline the connection.  In the case of CHAP, the set-up
  481.    packet includes the challenge, username and raw response.  For PAP or
  482.    text dialog, it includes username and clear text password.  The LNS
  483.    may choose to use this information to complete its authentication,
  484.    avoiding an additional cycle of authentication.
  485.  
  486.    If the LAC negotiated PPP LCP before initiating the tunnel, the ini-
  487.    tial setup notification may also include a copy of the LCP CONFACKs
  488.    sent in each direction which completed LCP negotiation.  The LNS may
  489.    use this information to initialize its own PPP state (thus avoiding
  490.    an additional LCP negotiation), or it may choose to initiate a new
  491.    LCP CONFREQ exchange.
  492.  
  493.    If the LNS accepts the connection, it creates a "virtual interface"
  494.    for PPP in a manner analogous to what it would use for a direct-
  495.    dialed connection.  With this "virtual interface" in place, link
  496.    layer frames may now pass over this tunnel in both directions.
  497.    Frames from the remote user are received at the POP, stripped of any
  498.    link framing or transparency bytes, encapsulated in L2TP, and for-
  499.    warded over the appropriate tunnel.
  500.  
  501.    The LNS accepts these frames, strips L2TP, and processes them as nor-
  502.    mal incoming frames for the appropriate interface and protocol.  The
  503.    "virtual interface" behaves very much like a hardware interface, with
  504.    the exception that the hardware in this case is physically located at
  505.    the ISP POP.  The other direction behaves analogously, with the LNS
  506.    encapsulating the packet in L2TP, and the NAS stripping L2TP before
  507.    transmitting it out the physical interface to the remote user.  For
  508.    the remainder of this document, a NAS operating as a peer to an LNS
  509.    will be referred to as an L2TP Access Concentrator, or "LAC".
  510.  
  511.    At this point, the connectivity is a point-to-point PPP session whose
  512.    endpoints are the remote user's networking application on one end and
  513.    the termination of this connectivity into the LNS's PPP support on
  514.    the other.  Because the remote user has become simply another dial-up
  515.    client of the LNS, client connectivity can now be managed using tra-
  516.    ditional mechanisms with respect to further authorization, protocol
  517.    access, and packet filtering.
  518.  
  519.  
  520.  
  521. Valencia                    expires May 1997                     [Page 8]
  522.  
  523.  
  524.  
  525.  
  526.  
  527. INTERNET DRAFT                                             December 1996
  528.  
  529.  
  530.    Accounting can be performed at both the LAC as well as the LNS.  This
  531.    document illustrates some Accounting techniques which are possible
  532.    using L2TP, but the policies surrounding such Accounting are outside
  533.    the scope of this specification.
  534.  
  535.    L2TP offers optional facilities which maximize compatibility with
  536.    legacy client requirements; L2TP connect notifications for PPP
  537.    clients can contain sufficient information for an LNS to authenticate
  538.    and initialize its LCP state machine.  With these facilities, the
  539.    remote user need not be queried a second time for PPP authentication,
  540.    nor undergo multiple rounds of LCP negotiation and convergence.
  541.    These techniques are intended to optimize connection setup, and are
  542.    not intended to deprecate any functions required by the PPP specifi-
  543.    cation.
  544.  
  545. 3.0 Service Model Issues
  546.  
  547.    There are several significant differences between the standard Inter-
  548.    net access service and the Virtual dial-up service with respect to
  549.    authentication, address allocation, authorization and accounting.
  550.    The details of the differences between these services and the prob-
  551.    lems presented by these differences are described below.  The mecha-
  552.    nisms used for Virtual Dial-up service are intended to coexist with
  553.    more traditional mechanisms; it is intended that an ISP's POP can
  554.    simultaneously service ISP clients as well as Virtual dial-up
  555.    clients.
  556.  
  557. 3.1 Security
  558.  
  559.    For the Virtual dial-up service, the ISP pursues authentication only
  560.    to the extent required to discover the user's apparent identity (and
  561.    by implication, their desired LNS).  This may involve no more than
  562.    detecting DNIS information when a call arrives, or may involve full
  563.    LCP negotiation and initiation of PPP authentication.  As soon as the
  564.    apparent identity is determined, a connection to the LNS is initiated
  565.    with any authentication information gathered by the ISP.  The LNS
  566.    completes the authentication by either accepting the connection, or
  567.    rejecting it.
  568.  
  569.    The LNS may need to protect against attempts by third parties to
  570.    establish tunnels to the LNS.  Tunnel establishment can include
  571.    authentication to protect against such attacks.
  572.  
  573. 3.2 Address Allocation
  574.  
  575.    For an Internet service, the user accepts that the IP address may be
  576.    allocated dynamically from a pool of ISP addresses.  This model often
  577.    means that the remote user has little or no access to their home net-
  578.    work's resources, due to firewalls and other security policies
  579.    applied by the home network to accesses from external IP addresses.
  580.  
  581.    For the Virtual dial-up service, the LNS can exist behind the home
  582.    firewall, allocating addresses which are internal (and, in fact, can
  583.    be RFC1918 addresses, or non-IP addresses).  Because L2TP tunnels
  584.  
  585.  
  586.  
  587. Valencia                    expires May 1997                     [Page 9]
  588.  
  589.  
  590.  
  591.  
  592.  
  593. INTERNET DRAFT                                             December 1996
  594.  
  595.  
  596.    exclusively at the frame layer, the actual policies of such address
  597.    management are irrelevant to correct Virtual dial-up service; for all
  598.    purposes of PPP protocol handling, the dial-in user appears to have
  599.    connected at the LNS.
  600.  
  601. 3.3 Authentication
  602.  
  603.    The authentication of the user occurs in three phases; the first at
  604.    the ISP, and the second and optional third at the LNS.
  605.  
  606.    The ISP uses DNIS, CLID, or username to determine that a Virtual
  607.    dial-up service is required and initiates the tunnel connection to
  608.    the appropriate LNS.  Once a tunnel is established, The ISP NAS allo-
  609.    cates a new Call ID and initiates a session by forwarding the gath-
  610.    ered authentication information.
  611.  
  612.    The LNS undertakes the second phase by deciding whether or not to
  613.    accept the connection.  The connection indication may include CHAP,
  614.    PAP, EAP, or textual authentication information.  Based on this
  615.    information, the LNS may accept the connection, or may reject it (for
  616.    instance, it was a PAP request and the username/password are found to
  617.    be incorrect).
  618.  
  619.    Once the connection is accepted, the LNS is free to pursue a third
  620.    phase of authentication at the PPP layer.  These activities are out-
  621.    side the scope of this specification, but might include an additional
  622.    cycle of LCP authentication, proprietary PPP extensions, or textual
  623.    challenges carried via a TCP/IP telnet session.
  624.  
  625. 3.4 Accounting
  626.  
  627.    It is a requirement that both the LAC and the LNS be capable of pro-
  628.    viding accounting data and hence both may count packets, octets and
  629.    connection start and stop times.
  630.  
  631.    Since Virtual dial-up is an access service, accounting of connection
  632.    attempts (in particular, failed connection attempts) is of signifi-
  633.    cant interest.  The LNS can reject new connections based on the
  634.    authentication information gathered by the LAC, with corresponding
  635.    logging.  For cases where the LNS accepts the connection and then
  636.    continues with further authentication, the LNS might subsequently
  637.    disconnect the client.  For such scenarios, the disconnection indica-
  638.    tion back to the LAC may also include a reason.
  639.  
  640.    Because the LNS can decline a connection based on the authentication
  641.    information collected by the LAC, accounting can easily draw a dis-
  642.    tinction between a series of failed connection attempts and a series
  643.    of brief successful connections.  Lacking this facility, the LNS must
  644.    always accept connection requests, and would need to exchange a num-
  645.    ber of PPP packets with the remote system.  Note that the LNS could
  646.    use this information to decide to accept the connection (which pro-
  647.    tects against most invalid connection attempts) while still insisting
  648.    on running its own CHAP authentication (for instance, to protect
  649.    against CHAP replay attacks).
  650.  
  651.  
  652.  
  653. Valencia                    expires May 1997                    [Page 10]
  654.  
  655.  
  656.  
  657.  
  658.  
  659. INTERNET DRAFT                                             December 1996
  660.  
  661.  
  662. 4.0 Protocol Overview
  663.  
  664.    There are two parallel components of L2TP operating over a given tun-
  665.    nel: control messages between each LAC-LNS pair, and payload packets
  666.    between the same LAC-LNS pair.  The latter are used to transport L2TP
  667.    encapsulated PPP packets for user sessions between the pair.
  668.  
  669.    The Nr (Next Received) and Ns (Next Sent) fields are always present
  670.    in control messages, and are optionally present in payload messages.
  671.    Distinct sequence number state is maintained for control messages
  672.    related to the tunnel (Call ID is 0), and for each distinct user ses-
  673.    sion within the tunnel.  Sequence number state is also distinct for
  674.    control and for payload messages within a particular session.  Each
  675.    distinct state is initialized so the first packet is sent with an Ns
  676.    of 0.  Nr is sent reflecting one more than the last in-order received
  677.    packet; if sent before any packet is received it would be 0, indicat-
  678.    ing that it expects the next new Ns value received to be 0.
  679.  
  680.    The sequence number state is maintained and updated as packets are
  681.    sent.  A message (control or payload) with a zero-length body indi-
  682.    cates that the packet is only used to communicate Nr and Ns fields.
  683.    The Nr and Ns fields are filled in as above, but the sequence number
  684.    state remains the same.  For non-zero-length body messages, the
  685.    sequence number state is incremented (modulo 2**16) after it is
  686.    copied to the packet's Ns field.
  687.  
  688.    4.1 Control Message Overview
  689.  
  690.       Before PPP tunneling can occur between an LAC and LNS, control
  691.       messages must be exchanged between them.  Control messages are
  692.       exchanged over the same tunnel which will be used to forward pay-
  693.       load data once L2TP call control and management information have
  694.       been passed.  The control messages are responsible for establish-
  695.       ment, management, and release of sessions carried through the tun-
  696.       nel, as well as status on the tunnel itself.  It is the means by
  697.       which an LNS is notified of an incoming call at an associated LAC,
  698.       as well as the means by which an LAC is instructed to place an
  699.       outgoing dial call.
  700.  
  701.       A tunnel may be established by either an LAC (for incoming calls)
  702.       or an LNS (for outgoing calls).  Following the establishment of
  703.       the tunnel, the LNS and LAC configure the tunnel by exchanging
  704.       Start-Control-Connection-Request and -Reply messages.  These mes-
  705.       sages are also used to exchange information about basic operating
  706.       capabilities of the LAC and LNS.  Once the control message
  707.       exchange is complete, the LAC may initiate sessions by indicating
  708.       inbound requests, or the LNS by requesting outbound calls.  Con-
  709.       trol messages may indicate changes in operating characteristics of
  710.       an individual user session with a Set-Link-Info message.  Individ-
  711.       ual sessions may be released by either the LAC or LNS, also
  712.       through control messages.
  713.  
  714.       Independent Call ID values are established for each end of a user
  715.       session.  The sender of a packet associated with a particular
  716.  
  717.  
  718.  
  719. Valencia                    expires May 1997                    [Page 11]
  720.  
  721.  
  722.  
  723.  
  724.  
  725. INTERNET DRAFT                                             December 1996
  726.  
  727.  
  728.       session places the Call ID established by its peer in the Call ID
  729.       header field of all outgoing packets.  For the cases where a Call
  730.       ID has not yet been assigned from the peer (i.e., during call
  731.       establishment of a new session), the Call ID field is sent as 0,
  732.       and further fields within the message are used to identify the
  733.       session.
  734.  
  735.       Two mechanisms provide for detection of tunnel connectivity prob-
  736.       lems, one by the reliable transport layer of L2TP and another by
  737.       the higher layer.  The transport layer of L2TP performs control
  738.       message retransmission.  If the number of retransmission attempts
  739.       for a given control message exceeds a configured maximum value,
  740.       the tunnel is reset.  This retransmission mechanism exists in both
  741.       the LNS and LAC ends of the tunnel.  In addition, keepalive con-
  742.       trol echo messages are injected into the control stream by the
  743.       higher L2TP layer after a certain duration of inactivity on a
  744.       given tunnel is detected.  A response to the sent keepalive is
  745.       expected within a configured time interval.  If not received
  746.       within the allowed time interval, the tunnel is reset.  These two
  747.       mechanisms ensure that a connectivity failure between the LNS and
  748.       the LAC can be detected at either end of a tunnel in a timely man-
  749.       ner.
  750.  
  751.       It is intended that control messages will also carry management
  752.       related information in the future, such as a message allowing the
  753.       LNS to request the status of a given LAC; these message types are
  754.       not defined in this document.
  755.  
  756.    4.2 Payload Packet Overview
  757.  
  758.       Once a tunnel is established and control messages have completed
  759.       tunnel setup, the tunnel can be used to carry user session PPP
  760.       packets for sessions involving a given LNS-LAC pair.  The "Call
  761.       ID" field in the L2TP header indicates to which session a particu-
  762.       lar PPP packet belongs.  In this manner, PPP packets are multi-
  763.       plexed and demultiplexed over a single tunnel between a given LNS-
  764.       LAC pair.  The "Call ID" field value is established during the
  765.       exchange of call setup control messages.
  766.  
  767.       It is legal for multiple tunnels to exist between a given LNS-LAC
  768.       pair.  This is useful where each tunnel is used for a single user
  769.       session, and the tunnel media (an SVC, for instance) has specific
  770.       QOS attributes dedicated to a given user.  L2TP provides a tunnel
  771.       identifier so that individual tunnels can be identified, even when
  772.       arriving from a single source LAC or LNS.
  773.  
  774.       The L2TP header also contains optional acknowledgment and sequenc-
  775.       ing information that can be used to perform congestion control
  776.       over the tunnel.  Control messages are used to determine rate and
  777.       buffering parameters that are used to regulate the flow of PPP
  778.       packets for a particular session over the tunnel.  All implementa-
  779.       tions MUST implement flow control, but may indicate that flow con-
  780.       trol is not desired by omitting the Packet Window Size and Packet
  781.       Processing Delay AVP's during call setup.  L2TP does not specify
  782.  
  783.  
  784.  
  785. Valencia                    expires May 1997                    [Page 12]
  786.  
  787.  
  788.  
  789.  
  790.  
  791. INTERNET DRAFT                                             December 1996
  792.  
  793.  
  794.       the particular algorithms to use for congestion and flow control.
  795.       Suggested algorithms for the determination of adaptive time-outs
  796.       to recover from dropped data or acknowledgments on the tunnel are
  797.       included in Appendix A of this document.
  798.  
  799.       L2TP does not include a "Receive-Not-Ready" function.  It is
  800.       expected that the flow-control mechanism used will provide an ade-
  801.       quate "pacing" mechanism so that the sender does not overflow the
  802.       receiver's allotted receive window and receive buffers.  It is
  803.       permissible for the receiving peer to withhold Acks if it is
  804.       unable to accept more data for a connection.  Thus, unlike for the
  805.       Control Message session, the sending peer MUST NOT clear a session
  806.       (or the whole tunnel) as a result of not receiving timely acknowl-
  807.       edgments for transmitted packets.  The job of detecting a non-
  808.       functioning tunnel lies solely with the Control Message functions
  809.       of L2TP.
  810.  
  811. 5. Message Format and Protocol Extensibility
  812.  
  813.    L2TP defines a set of control messages sent in packets over the tun-
  814.    nel between an LNS and a given LAC.  The exact technique for initiat-
  815.    ing a tunnel between an LNS-LAC pair is specific to the tunnel media,
  816.    and specific media are described in section 8.0.
  817.  
  818.    Once media-level connectivity is reached, L2TP message formats define
  819.    the protocol for an LAC and LNS to manage the tunnel and its associ-
  820.    ated sessions.
  821.  
  822.    In each case where a field is optional, if the field is not present,
  823.    its space does not exist in the packet.  Existing fields are placed
  824.    back-to-back to form the packet.
  825.  
  826.    5.1 AVP
  827.  
  828.       To maximize extensibility while still permitting interoperability,
  829.       a uniform method for encoding message types and bodies is used
  830.       throughout L2TP.  This encoding will be termed an AVP (Attribute-
  831.       Value Pair) in the remainder of this document.  Each AVP is
  832.       encoded as:
  833.  
  834.        0                   1                   2                   3
  835.        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
  836.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  837.       |M|H|0|0|0|0|  Overall Length   |           Vendor ID           |
  838.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  839.       |          Attribute            | Value...                      |
  840.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  841.       | [until Overall Length is reached]...                          |
  842.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  843.  
  844.       The first four bits are a bit mask, describing the general
  845.       attributes of the AVP.  The M bit, known as the "mandatory" bit,
  846.       controls the behavior required of an implementation which receives
  847.       an AVP which it does not recognize.  If M is set, any session
  848.  
  849.  
  850.  
  851. Valencia                    expires May 1997                    [Page 13]
  852.  
  853.  
  854.  
  855.  
  856.  
  857. INTERNET DRAFT                                             December 1996
  858.  
  859.  
  860.       associated with this AVP MUST be terminated.  If the AVP is asso-
  861.       ciated with the overall tunnel, the entire tunnel (and all ses-
  862.       sions within) MUST be terminated.  If M is not set, an unrecog-
  863.       nized AVP should be ignored.
  864.  
  865.       The H bit, known as the "hidden" bit, controls the encryption of
  866.       the contents of the AVP.  This bit MUST only be set if tunnel
  867.       authentication was used and, therefore, a shared secret exists
  868.       between the peers on either end of the tunnel.  If the H bit is
  869.       set in an AVP, the following mechanism is applied to the contents
  870.       of the AVP, starting with the first byte beyond the Attribute
  871.       field:
  872.  
  873.          The contents is first padded at the end with nulls to a multi-
  874.          ple of 16 octets.  A one-way MD5 hash is calculated over a
  875.          stream of octets consisting of the shared secret followed by a
  876.          16 octet random vector, referred to as the Authenticator.  The
  877.          sender computes the random Authenticator and passes it in the
  878.          first 16 octets of the AVP value.  The MD5 hash value is XORed
  879.          with the first 16 octet segment of the password and placed in
  880.          the next 16 octets of the Value field of the Proxy-Authen AVP.
  881.  
  882.          If the password is longer than 16 characters, a second one-way
  883.          MD5 hash is calculated over a stream of octets consisting of
  884.          the shared secret followed by the result of the first XOR.
  885.          That hash is XORed with the second 16 octet segment of the
  886.          password and placed in the next 16 octets of the Value field of
  887.          the AVP.
  888.  
  889.          If necessary, this operation is repeated, with each XOR result
  890.          being used along with the shared secret to generate the next
  891.          hash to XOR the next segment of the password, to no more than
  892.          128 characters.
  893.  
  894.          On receipt, the Authenticator is taken from the first 16 octets
  895.          of the received AVP value field and the process is reversed to
  896.          yield the original password.  For more details on this hiding
  897.          method, consult the RADIUS [8] specification.
  898.  
  899.       Overall Length encodes the number of octets (including the Overall
  900.       Length field itself) contained in this AVP.  It is 10 bits, per-
  901.       mitting a maximum of 1024 bytes of data in a single AVP.
  902.  
  903.       Vendor ID is the IANA assigned "SMI Network Management Private
  904.       Enterprise Codes" value, encoded in network byte order.  The value
  905.       0, reserved in this table, corresponds to IETF adopted Attribute
  906.       values, defined within this document.  Any vendor wishing to
  907.       implement L2TP extensions can use their own Vendor ID along with
  908.       private Attribute values, guaranteeing that they will not collide
  909.       with any other vendor's extensions, nor with future IETF exten-
  910.       sions.
  911.  
  912.       Attribute is the actual attribute, a 16-bit value with a unique
  913.       interpretation across all AVP's defined under a given Vendor ID.
  914.  
  915.  
  916.  
  917. Valencia                    expires May 1997                    [Page 14]
  918.  
  919.  
  920.  
  921.  
  922.  
  923. INTERNET DRAFT                                             December 1996
  924.  
  925.  
  926.       Value follows immediately after the Attribute field, and runs for
  927.       the remaining octets indicated in the Overall Length (i.e., Over-
  928.       all Length minus six octets of header).
  929.  
  930.       AVP's should be kept compact; the combined AVP's within a control
  931.       message MUST NOT ever cause a control message's total length to
  932.       exceed 1500 bytes in length.
  933.  
  934.    5.2 Control Message Format
  935.  
  936.       Each L2TP control message begins with a 20 octet fixed header por-
  937.       tion followed by zero or more AVP's.  This fixed header is format-
  938.       ted:
  939.  
  940.        0                   1                   2                   3
  941.        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
  942.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  943.       |T|1|1|1|1|K|0|           | Ver |             Length            |
  944.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  945.       |           Tunnel ID           |            Call ID            |
  946.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  947.       |               Ns              |               Nr              |
  948.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  949.       |                            Key (opt)                          |
  950.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  951.       |                        Message Type AVP                       |
  952.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  953.  
  954.       The T bit MUST be 1, indicating a control message.  The next four
  955.       bits MUST be set to 1, making the header more compatible in encod-
  956.       ing with the payload message (defined in the next section).  The K
  957.       bit is optional, documented below.  The bit following the K bit
  958.       MUST be 0.
  959.  
  960.       Ver MUST be the value 002, indicating a version 1 L2TP message
  961.       (values 000 and 001 are reserved to permit detection of L2F [2]
  962.       and PPTP [3] packets if they arrive intermixed).
  963.  
  964.       Length is the overall length of the message, including header,
  965.       message type AVP, plus any additional AVP's associated with a
  966.       given control message type.
  967.  
  968.       Tunnel ID and Call ID identify the tunnel and user session within
  969.       the tunnel to which a control message applies.  If a control mes-
  970.       sage does not apply to a single user session within the tunnel
  971.       (for instance, a Stop-Control-Connection-Request message), Call ID
  972.       MUST be set to 0.  If an Assigned Tunnel ID has not yet been
  973.       received from the peer, Tunnel ID MUST be set to 0.
  974.  
  975.       Nr and Ns reflect the currently transmitted packet and latest
  976.       received packet respectively.  See section 4.0.
  977.  
  978.       If the K bit is set, the Key field is present.  The K bit MUST be
  979.       set if a Challenge value was received during tunnel setup, and the
  980.  
  981.  
  982.  
  983. Valencia                    expires May 1997                    [Page 15]
  984.  
  985.  
  986.  
  987.  
  988.  
  989. INTERNET DRAFT                                             December 1996
  990.  
  991.  
  992.       Key reflects the challenge response of this authentication, with
  993.       the resulting MD5 hash value broken into successive 32-bit fields
  994.       which are XOR'ed together and this value put in the Key field.
  995.  
  996.    5.3 Payload Message Format
  997.  
  998.       PPP payload packets tunneled within L2TP have a smaller encapsula-
  999.       tion than the L2TP control message header, reducing overhead of
  1000.       L2TP during the life of a tunneled PPP session.  The MTU for the
  1001.       user data packets encapsulated in L2TP is expected to be 1500
  1002.       octets, not including L2TP and media encapsulation.  The smallest
  1003.       L2TP encapsulation is 2 octets; the largest is 18 octets (plus
  1004.       padding bytes, if present).  See section 8.1 for further MTU con-
  1005.       siderations.
  1006.  
  1007.        0                   1                   2                   3
  1008.        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
  1009.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1010.       |T|L|I|C|F|K|O|           | Ver |          Length (opt)         |
  1011.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1012.       |        Tunnel ID (opt)        |         Call ID (opt)         |
  1013.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1014.       |             Ns (opt)          |               Nr (opt)        |
  1015.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1016.       |                            Key (opt)                          |
  1017.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1018.       |            Offset Size        |    Offset bytes of pad...     |
  1019.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1020.  
  1021.       The T bit MUST be 0, indicating payload.
  1022.  
  1023.       Ver MUST be 002, indicating version 1 of the L2TP protocol.
  1024.  
  1025.       If the L bit is set, the Length field is present, indicating the
  1026.       total length of the received packet.
  1027.  
  1028.       The I and C bits indicate the presence of Tunnel ID and Call ID,
  1029.       respectively.  The interpretation of these fields, if present, is
  1030.       described in section 5.2.
  1031.  
  1032.       If the F bit is set, both the Nr and Ns fields are present.  Ns
  1033.       indicates the sequence number of the packet being sent.  The cur-
  1034.       rent packet will be this sequence number if the payload size is
  1035.       non-zero, otherwise this packet is only an acknowledgment
  1036.       (sequence number does not advance).  Nr indicates the next packet
  1037.       sequence number to be received (if the last data packet had Ns set
  1038.       to 1, the Nr sent back would be 2).  Together, these fields can be
  1039.       used to handle out-of-order packets, and to provide flow control
  1040.       for the connection.
  1041.  
  1042.       If the K bit is set, the Key field is present.  Refer to the
  1043.       description in 5.2.
  1044.  
  1045.       The Offset Size field is present if the O bit is set in the header
  1046.  
  1047.  
  1048.  
  1049. Valencia                    expires May 1997                    [Page 16]
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055. INTERNET DRAFT                                             December 1996
  1056.  
  1057.  
  1058.       flags.  This field specifies the number of bytes past the L2TP
  1059.       header at which the payload data is expected to start.  It is rec-
  1060.       ommended that data thus skipped be initialized to 0's.  If Offset
  1061.       Size is 0, or the O bit is not set, the first byte following the
  1062.       last byte of L2TP header is the first byte of payload data.
  1063.  
  1064.    5.4 Control Message Types
  1065.  
  1066.       Control message types defined in this specification exist under
  1067.       Vendor ID 0, indicating IETF defined behavior.  The actual message
  1068.       semantics are defined in the next section.  The currently defined
  1069.       control messages types, grouped by function, are:
  1070.  
  1071.          Control Message                        Message Code
  1072.  
  1073.          (Control Connection Management)
  1074.  
  1075.          Start-Control-Connection-Request            1
  1076.          Start-Control-Connection-Reply              2
  1077.          Start-Control-Connection-Connected          17
  1078.          Stop-Control-Connection-Request             3
  1079.          Stop-Control-Connection-Reply               4
  1080.          Hello                                       5
  1081.          (deleted)                                   6
  1082.  
  1083.          (Call Management)
  1084.  
  1085.          Outgoing-Call-Request                       7
  1086.          Outgoing-Call-Reply                         8
  1087.          Outgoing-Call-Connected                    16
  1088.          Incoming-Call-Request                       9
  1089.          Incoming-Call-Reply                        10
  1090.          Incoming-Call-Connected                    11
  1091.          Call-Clear-Request                         12
  1092.          Call-Disconnect-Notify                     13
  1093.  
  1094.          (Error Reporting)
  1095.  
  1096.          WAN-Error-Notify                           14
  1097.  
  1098.          (PPP Session Control)
  1099.          Set-Link-Info                              15
  1100.  
  1101.  
  1102.    5.5 General Error Codes
  1103.  
  1104.       General error codes pertain to types of errors which are not spe-
  1105.       cific to any particular L2TP request, but rather to protocol or
  1106.       message format errors.  If an L2TP reply indicates in its Result
  1107.       Code that a general error occurred, the General Error value should
  1108.       be examined to determined what the error was.  The currently
  1109.       defined General Error codes and their meanings are:
  1110.  
  1111.          0 - No general error
  1112.  
  1113.  
  1114.  
  1115. Valencia                    expires May 1997                    [Page 17]
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121. INTERNET DRAFT                                             December 1996
  1122.  
  1123.  
  1124.          1 - No control connection exists yet for this LAC-LNS pair
  1125.          2 - Length is wrong
  1126.          3 - One of the field values was out of range or
  1127.              reserved field was non-zero
  1128.          4 - Insufficient resources to handle this operation now
  1129.          5 - The Call ID is invalid in this context
  1130.          6 - A generic vendor-specific error occurred in the LAC
  1131.          7 - Try another.  If LAC is aware of other possible LNS
  1132.              destinations, it should try one of them.  This can be
  1133.              used to guide an LAC based on LNS policy, for instance,
  1134.              the existence of multilink PPP bundles.
  1135.  
  1136.          Generally, when a value of 6 is used, a vendor-specific AVP
  1137.          will be present also, providing further detail for that vendor
  1138.          implementation.
  1139.  
  1140.          If the length of an AVP indicating a General Error specifies
  1141.          that the Value field is more than two bytes in length, the
  1142.          remaining bytes are an arbitrary string providing further (pos-
  1143.          sibly human readable) text associated with the condition.
  1144.  
  1145. 6.0 Control Connection Protocol Specification
  1146.  
  1147.    Control Connection messages are used to establish and clear user ses-
  1148.    sions.  The first set of Control Connection messages are used to
  1149.    maintain the control connection itself.  The control connection is
  1150.    initiated by an LAC or LNS after establishing the underlying tunnel-
  1151.    over-media connection.
  1152.  
  1153.    6.0.1 Control Connection Collision
  1154.  
  1155.       For the case where an LAC and LNS both initiate tunnels to each
  1156.       other concurrently, and where the LAC and LNS both determine that
  1157.       a single tunnel suffices (generally because of media characteris-
  1158.       tic considerations, for instance, whether individual tunnels are
  1159.       needed to gain QOS guarantees for each tunnel), a "tie breaker"
  1160.       may be undertaken.  The details of breaking a tie are documented
  1161.       with the tunnel establishment messages.
  1162.  
  1163.    6.0.2 Reliable Delivery of Control Messages
  1164.  
  1165.       Since L2TP may run across media where packets may be lost, an L2TP
  1166.       peer sending a control message will retransmit the control message
  1167.       after deciding that its remote peer has not received it.  The
  1168.       reliable transport mechanism built into L2TP is essentially a
  1169.       lower layer transport service; the Nr and Ns fields of the control
  1170.       message header belong to this transport layer.  The higher layer
  1171.       functions of L2TP are not concerned with retransmission or order-
  1172.       ing of control messages.
  1173.  
  1174.       Each tunnel maintains a queue of control messages to be transmit-
  1175.       ted to the peer.  The message at the front of the queue is sent
  1176.       with a given Ns value, and is held until a control message arrives
  1177.       from the peer in which the Nr field indicates receipt of this
  1178.  
  1179.  
  1180.  
  1181. Valencia                    expires May 1997                    [Page 18]
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187. INTERNET DRAFT                                             December 1996
  1188.  
  1189.  
  1190.       message.  After a fixed (recommended default is 1 second) or adap-
  1191.       tive (see Appendix D) timeout interval expires without receiving
  1192.       such an acknowledgment, the control message packet is retransmit-
  1193.       ted.  The retransmitted packet contains the same Ns value, but the
  1194.       Nr value MUST be updated to reflect any packets received in the
  1195.       interim.
  1196.  
  1197.       If no peer response is detected after several retransmissions (a
  1198.       recommended default is 5, but may be altered due to media consid-
  1199.       erations), the tunnel and all sessions within MUST be cleared.
  1200.  
  1201.       When a tunnel is being shut down for reasons other than loss of
  1202.       connectivity, the state and reliable delivery mechanisms MUST be
  1203.       maintained and operated for the full retransmission interval after
  1204.       the final message exchange has occurred.  This permits reliable
  1205.       delivery of closing messages in environments where these closing
  1206.       messages might be dropped.
  1207.  
  1208.       Unlike payload traffic, a peer MUST NOT withhold acknowledgment of
  1209.       packets as a technique for flow controlling control messages.  An
  1210.       L2TP implementation is expected to be able to keep up with incom-
  1211.       ing control messages, possible responding to some with errors
  1212.       reflecting an inability to honor the requested action.
  1213.  
  1214.       A sliding window mechanism is used, by default, for control mes-
  1215.       sage transmission.  The default is to permit four control message
  1216.       to be outstanding on a given tunnel.  If a peer specifies a con-
  1217.       trol message window in the Start-Control-Connection-Request and
  1218.       -Reply packets, up to the indicated number of control messages may
  1219.       be sent and held outstanding.  An implementation may only support
  1220.       a receive window of 1, but MUST accept at least a window of 4 from
  1221.       its peer.
  1222.  
  1223.       The transport layer at a receiving peer is responsible for making
  1224.       sure that control messages are delivered in order to the higher
  1225.       layer and that duplicate messages are not delivered to the higher
  1226.       layer.  Messages arriving out of order may be queued for in-order
  1227.       delivery when the missing messages are received or they may be
  1228.       discarded, requiring a retransmission.
  1229.  
  1230.    6.0.3 Control Message Format
  1231.  
  1232.       The following Control Connection messages are all sent as packets
  1233.       on the established tunnel connection between a given LNS-LAC pair.
  1234.       All data is sent in network order (high order octets first).  Any
  1235.       "reserved" or "empty" fields MUST be sent as 0 values to allow for
  1236.       protocol extensibility.
  1237.  
  1238.       Each control message has a header, specified in section 5.2,
  1239.       including an AVP indicating the type of control message, followed
  1240.       by zero or more AVP's appropriate for the given type of control
  1241.       message.  Each control message is described first at a block
  1242.       level, and then with details of each AVP.
  1243.  
  1244.  
  1245.  
  1246.  
  1247. Valencia                    expires May 1997                    [Page 19]
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253. INTERNET DRAFT                                             December 1996
  1254.  
  1255.  
  1256. 6.1 Start-Control-Connection-Request
  1257.  
  1258.    The Start-Control-Connection-Request is an L2TP control message used
  1259.    to initialize the tunnel between an LNS and an LAC.  The tunnel must
  1260.    be initialized through the exchange of these control messages before
  1261.    any other L2TP messages can be issued.  The establishment of the con-
  1262.    trol connection is started by the initiator of the underlying tunnel.
  1263.  
  1264.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1265.    |    L2TP Control Message Header      |
  1266.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1267.    |  Start-Control-Connection-Request   |
  1268.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1269.    | Protocol Version      |
  1270.    | Framing Capabilities  |
  1271.    | Bearer Capabilities   |
  1272.    | Tie Breaker           |
  1273.    | Firmware Revision     |
  1274.    | Host Name             |
  1275.    | Vendor Name           |
  1276.    | Assigned Tunnel ID    |
  1277.    | Control Message Window|
  1278.    | Challenge             |
  1279.    +-+-+-+-+-+-+-+-+-+-+-+-+
  1280.  
  1281.    Start-Control-Connection-Request AVP
  1282.  
  1283.        0                   1                   2                   3
  1284.        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
  1285.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1286.       |1|0|0|0|        6              |               0               |
  1287.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1288.       |                1              |
  1289.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1290.  
  1291.       The Attribute field is 1, indicating Start-Control-Connection-
  1292.       Request.  The Flags indicate a mandatory option.  Details associ-
  1293.       ated with this tunneled session follow in additional AVP's within
  1294.       the packet.
  1295.  
  1296.    Protocol Version
  1297.  
  1298.        0                   1                   2                   3
  1299.        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
  1300.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1301.       |1|0|0|0|        8              |               0               |
  1302.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1303.       |               101             |     0x01      |     0x00      |
  1304.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1305.  
  1306.       The Protocol Version AVP within a Start-Control-Connection-Request
  1307.       packet indicates the L2TP protocol version available.  The
  1308.       Attribute value is 101, indicating Protocol Version, and is marked
  1309.       mandatory.  This AVP MUST be present.  The Value field is a 16-bit
  1310.  
  1311.  
  1312.  
  1313. Valencia                    expires May 1997                    [Page 20]
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319. INTERNET DRAFT                                             December 1996
  1320.  
  1321.  
  1322.       hexadecimal value 0x100, indicating L2TP protocol version 1, revi-
  1323.       sion 0.
  1324.  
  1325.    Framing Capabilities
  1326.  
  1327.        0                   1                   2                   3
  1328.        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
  1329.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1330.       |1|0|0|0|       10              |               0               |
  1331.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1332.       |               102             |     0x00      |     0x00      |
  1333.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1334.       |     0x00      |0|0|0|0|0|0|S|A|
  1335.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1336.  
  1337.       The Framing Capabilities AVP within a Start-Control-Connection-
  1338.       Request indicates the type of framing that the sender of this mes-
  1339.       sage can provide.  The Attribute value is 102, indicating Framing
  1340.       Capabilities, and is marked mandatory.  This AVP MUST be present.
  1341.       The Value field is a 32-bit quantity, with two bits defined.  If
  1342.       bit A is set, asynchronous framing is supported.  If bit S is set,
  1343.       synchronous framing is supported.
  1344.  
  1345.    Bearer Capabilities
  1346.  
  1347.        0                   1                   2                   3
  1348.        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
  1349.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1350.       |1|0|0|0|       10              |               0               |
  1351.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1352.       |               103             |     0x00      |     0x00      |
  1353.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1354.       |     0x00      |0|0|0|0|0|0|D|A|
  1355.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1356.  
  1357.       The Bearer Capabilities AVP within a Start-Control-Connection-
  1358.       Request indicates the bearer capabilities that the sender of this
  1359.       message can provide.  The Attribute value is 103, indicating
  1360.       Bearer Capabilities, and is marked mandatory.  This AVP MUST be
  1361.       present.  The Value field is a 32-bit quantity with two bits
  1362.       defined.  If bit A is set, analog access is supported.  If bit D
  1363.       is set, digital access is supported.
  1364.  
  1365.    Tie Breaker
  1366.  
  1367.        0                   1                   2                   3
  1368.        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
  1369.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1370.       |0|0|0|0|       14              |               0               |
  1371.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1372.       |               104             | Tie Break Value...            |
  1373.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1374.       |                            Value...                           |
  1375.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1376.  
  1377.  
  1378.  
  1379. Valencia                    expires May 1997                    [Page 21]
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385. INTERNET DRAFT                                             December 1996
  1386.  
  1387.  
  1388.       |    ...(64 bits)               |
  1389.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1390.  
  1391.       The Tie Breaker AVP within a Start-Control-Connection-Request con-
  1392.       tains a 64-bit Value used to break ties in tunnel establishment
  1393.       between an LAC-LNS pair.  The Attribute value is 104, indicating
  1394.       Tie Breaker, and is marked optional.  This AVP itself is optional.
  1395.       The 8 byte Value is used as a 64-bit tie breaker value.
  1396.  
  1397.       If present, it indicates the sender wishes a single tunnel to
  1398.       exist between the given LAC-LNS pair, and this value will be used
  1399.       to choose a single tunnel where both LAC and LNS initiate a tunnel
  1400.       concurrently.  The recipient of a Start-Control-Connection-Request
  1401.       must check to see if a Start-Control-Connection-Request has been
  1402.       sent to the peer, and if so, must compare its Tie Breaker value
  1403.       with the received one.  The lower value "wins", and the "loser"
  1404.       MUST initiate a tunnel disconnect for their outstanding tunnel.
  1405.       In the case where a tie breaker is present on both sides, and the
  1406.       value is equal, both sides MUST initiate tunnel disconnects.
  1407.  
  1408.       If a tie breaker is received, and the outstanding Start-Control-
  1409.       Connection-Request had no tie breaker value, the initiator which
  1410.       included the Tie Breaker AVP "wins".
  1411.  
  1412.       It is recommended that the Value be set to the MAC address of a
  1413.       LAN interface on the sender.  If no MAC address is available, a
  1414.       64-bit random number should be used instead.
  1415.  
  1416.    Firmware Revision
  1417.  
  1418.        0                   1                   2                   3
  1419.        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
  1420.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1421.       |0|0|0|0|        8              |               0               |
  1422.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1423.       |               105             |    Max (H)    |   Max (L)     |
  1424.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1425.  
  1426.       The Firmware Revision AVP within a Start-Control-Connection-
  1427.       Request indicates the firmware revision of the issuing device.
  1428.       The Attribute value is 105, indicating Firmware Revision, and is
  1429.       marked optional.  This AVP itself is optional.  The Value field is
  1430.       a 16-bit integer encoded in a vendor specific format.  For devices
  1431.       which do not have a firmware revision (general purpose computers
  1432.       running L2TP software modules, for instance), the revision of the
  1433.       L2TP software module may be reported instead.
  1434.  
  1435.    Host Name
  1436.  
  1437.        0                   1                   2                   3
  1438.        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
  1439.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1440.       |0|0|0|0| 6 + Host name length  |               0               |
  1441.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1442.  
  1443.  
  1444.  
  1445. Valencia                    expires May 1997                    [Page 22]
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451. INTERNET DRAFT                                             December 1996
  1452.  
  1453.  
  1454.       |               106             |Host name...   |
  1455.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1456.  
  1457.       The Host Name AVP within a Start-Control-Connection-Request indi-
  1458.       cates the name of the issuing LAC or LNS.  The Attribute value is
  1459.       106, indicating Host Name, and is marked optional.  This AVP
  1460.       itself is optional.  This name should be as broadly unique as pos-
  1461.       sible; for hosts participating in DNS [4], a hostname with fully
  1462.       qualified domain would be appropriate.
  1463.  
  1464.    Vendor Name
  1465.  
  1466.        0                   1                   2                   3
  1467.        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
  1468.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1469.       |0|0|0|0|  6 + vendor name len  |               0               |
  1470.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1471.       |              107              |Vendor name... |
  1472.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1473.  
  1474.       The Vendor Name AVP within a Start-Control-Connection-Request con-
  1475.       tains a vendor specific string describing the type of LAC or LNS
  1476.       being used.  The Attribute value is 107, indicating Vendor Name,
  1477.       and is marked optional.  This AVP itself is optional.  The Value
  1478.       is the indicated number of bytes representing the vendor string.
  1479.  
  1480.    Assigned Tunnel ID
  1481.  
  1482.        0                   1                   2                   3
  1483.        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
  1484.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1485.       |1|0|0|0|        8              |               0               |
  1486.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1487.       |               108             |         Tunnel ID             |
  1488.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1489.  
  1490.       The Assigned Tunnel ID AVP within a Start-Control-Connection-
  1491.       Request specifies the Tunnel ID which the receiving peer MUST use
  1492.       in the Tunnel ID field of all subsequent packets.  The Attribute
  1493.       value is 108, indicating Assigned Tunnel ID, and is marked manda-
  1494.       tory.  This AVP MUST be present.  Before the Assigned Tunnel ID
  1495.       AVP is received, packets MUST be sent with a Tunnel ID value of 0.
  1496.       The Value is a 16-bit non-zero Tunnel ID value.
  1497.  
  1498.    Control Message Window
  1499.  
  1500.        0                   1                   2                   3
  1501.        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
  1502.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1503.       |1|0|0|0|        8              |               0               |
  1504.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1505.       |               109             |             Window            |
  1506.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1507.  
  1508.  
  1509.  
  1510.  
  1511. Valencia                    expires May 1997                    [Page 23]
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517. INTERNET DRAFT                                             December 1996
  1518.  
  1519.  
  1520.       The Control Message Window AVP within a Start-Control-Connection-
  1521.       Request specifies the receive window size being offered to the
  1522.       remote peer.  The Attribute value is 109, indicating Control Mes-
  1523.       sage Window, and is mandatory.  This AVP itself is optional.
  1524.       Value is a 16-bit word indicating the offered window size.  If
  1525.       absent, the peer must assume a value of 4 for its transmit window.
  1526.       The remote peer may send the specified number of control messages
  1527.       before it must wait for an acknowledgment.
  1528.  
  1529.    Challenge
  1530.  
  1531.        0                   1                   2                   3
  1532.        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
  1533.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1534.       |1|0|0|0| 6 + Challenge length  |               0               |
  1535.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1536.       |              110              | Challenge...  |
  1537.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1538.  
  1539.       The Challenge AVP within a Start-Control-Connection-Request indi-
  1540.       cates that the issuing peer wishes to authenticate the tunnel end-
  1541.       points.  The Attribute value is 110, indicating Challenge, and is
  1542.       marked mandatory.  This AVP is optional.  The Value is one or more
  1543.       octets of challenge value.
  1544.  
  1545. 6.2 Start-Control-Connection-Reply
  1546.  
  1547.    The Start-Control-Connection-Reply is an L2TP control message sent in
  1548.    reply to a received Start-Control-Connection-Request message.  This
  1549.    message contains a result code indicating the result of the control
  1550.    connection establishment attempt.
  1551.  
  1552.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1553.    |    L2TP Control Message Header      |
  1554.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1555.    |  Start-Control-Connection-Reply     |
  1556.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1557.    | Protocol Version      |
  1558.    | Result Code           |
  1559.    | Error Code            |
  1560.    | Framing Capabilities  |
  1561.    | Bearer Capabilities   |
  1562.    | Firmware Revision     |
  1563.    | Host Name             |
  1564.    | Vendor Name           |
  1565.    | Assigned Tunnel ID    |
  1566.    | Control Message Window|
  1567.    | Challenge             |
  1568.    | Response              |
  1569.    +-+-+-+-+-+-+-+-+-+-+-+-+
  1570.  
  1571.    Start-Control-Connection-Reply AVP
  1572.  
  1573.        0                   1                   2                   3
  1574.  
  1575.  
  1576.  
  1577. Valencia                    expires May 1997                    [Page 24]
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583. INTERNET DRAFT                                             December 1996
  1584.  
  1585.  
  1586.        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
  1587.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1588.       |1|0|0|0|        6              |               0               |
  1589.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1590.       |                2              |
  1591.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1592.  
  1593.       The Attribute field is 2, indicating Start-Control-Connection-
  1594.       Reply.  The Flags indicate a mandatory option.
  1595.  
  1596.    Protocol Version
  1597.  
  1598.        0                   1                   2                   3
  1599.        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
  1600.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1601.       |1|0|0|0|        8              |               0               |
  1602.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1603.       |               201             |     0x01      |     0x00      |
  1604.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1605.  
  1606.       The Protocol Version AVP within a Start-Control-Connection-Reply
  1607.       packet indicates the L2TP protocol version available.  The
  1608.       Attribute value is 201, indicating Protocol Version, and the Value
  1609.       field is a 16-bit hexadecimal value 0x100, indicating L2TP proto-
  1610.       col version 1, revision 0.  This AVP MUST be present.
  1611.  
  1612.    Framing Capabilities
  1613.  
  1614.        0                   1                   2                   3
  1615.        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
  1616.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1617.       |1|0|0|0|       10              |               0               |
  1618.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1619.       |               202             |     0x00      |     0x00      |
  1620.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1621.       |     0x00      |0|0|0|0|0|0|S|A|
  1622.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1623.  
  1624.       The Framing Capabilities AVP within a Start-Control-Connection-
  1625.       Reply indicates the type of framing that the sender of this mes-
  1626.       sage can provide.  The Attribute is 202, it is a mandatory AVP,
  1627.       the Value field is a 32-bit quantity, with two bits defined.  If
  1628.       bit A is set, asynchronous framing is supported.  If bit S is set,
  1629.       synchronous framing is supported.  This AVP MUST be present.
  1630.  
  1631.    Bearer Capabilities
  1632.  
  1633.        0                   1                   2                   3
  1634.        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
  1635.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1636.       |1|0|0|0|       10              |               0               |
  1637.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1638.       |               203             |     0x00      |     0x00      |
  1639.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1640.  
  1641.  
  1642.  
  1643. Valencia                    expires May 1997                    [Page 25]
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649. INTERNET DRAFT                                             December 1996
  1650.  
  1651.  
  1652.       |     0x00      |0|0|0|0|0|0|D|A|
  1653.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1654.  
  1655.       The Bearer Capabilities AVP within a Start-Control-Connection-
  1656.       Reply indicates the bearer capabilities that the sender of this
  1657.       message can provide.  The Attribute is 203, it is a mandatory AVP,
  1658.       the Value field is a 32-bit quantity with two bits defined.  If
  1659.       bit A is set, analog access is supported.  If bit D is set, digi-
  1660.       tal access is supported.  This AVP MUST be present.
  1661.  
  1662.    Firmware Revision
  1663.  
  1664.        0                   1                   2                   3
  1665.        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
  1666.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1667.       |0|0|0|0|        8              |               0               |
  1668.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1669.       |               204             |    Max (H)    |   Max (L)     |
  1670.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1671.  
  1672.       The Firmware Revision AVP within a Start-Control-Connection-Reply
  1673.       indicates the firmware revision of the issuing device.  The
  1674.       Attribute is 204, it is not a mandatory AVP, the Value field is a
  1675.       16-bit integer encoded in a vendor specific format.  For devices
  1676.       which do not have a firmware revision (general purposes computers
  1677.       running L2TP software modules, for instance), the revision of the
  1678.       L2TP software module may be reported instead.  This AVP is
  1679.       optional.
  1680.  
  1681.    Host Name
  1682.  
  1683.        0                   1                   2                   3
  1684.        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
  1685.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1686.       |0|0|0|0| 6 + Host name length  |               0               |
  1687.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1688.       |               205             |Host name...   |
  1689.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1690.  
  1691.       The Host Name AVP within a Start-Control-Connection-Reply indi-
  1692.       cates the name of the issuing LAC or LNS.  See the notes in sec-
  1693.       tion 6.1 concerning Host Name contents.  It is encoded as the
  1694.       Attribute 205, not mandatory, with the indicated number of bytes
  1695.       representing the host name string.  This AVP is optional.
  1696.  
  1697.    Vendor Name
  1698.  
  1699.        0                   1                   2                   3
  1700.        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
  1701.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1702.       |0|0|0|0| 6 + Vendor name len   |               0               |
  1703.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1704.       |               206             |Vendor name... |
  1705.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1706.  
  1707.  
  1708.  
  1709. Valencia                    expires May 1997                    [Page 26]
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715. INTERNET DRAFT                                             December 1996
  1716.  
  1717.  
  1718.       The Vendor Name AVP within a Start-Control-Connection-Reply con-
  1719.       tains a vendor specific string describing the type of LAC or LNS
  1720.       being used.  It is encoded as the Attribute 206, not mandatory,
  1721.       with the indicated number of bytes representing the vendor string.
  1722.       This AVP is optional.
  1723.  
  1724.    Assigned Tunnel ID
  1725.  
  1726.        0                   1                   2                   3
  1727.        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
  1728.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1729.       |1|0|0|0|    6 + length         |               0               |
  1730.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1731.       |               207             |               ID              |
  1732.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1733.  
  1734.       The Assigned Tunnel ID AVP within a Start-Control-Connection-Reply
  1735.       specifies the Tunnel ID which the receiving peer MUST use in all
  1736.       subsequent packets.  It is encoded as the Attribute 207, manda-
  1737.       tory, with a 16-bit non-zero Tunnel ID value.  This AVP MUST be
  1738.       present.
  1739.  
  1740.    Control Message Window
  1741.  
  1742.        0                   1                   2                   3
  1743.        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
  1744.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1745.       |0|0|0|0|        8              |               0               |
  1746.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1747.       |               208             |             Window            |
  1748.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1749.  
  1750.       The Control Message Window AVP within a Start-Control-Connection-
  1751.       Reply specifies the number of control messages which may be
  1752.       received without waiting for an acknowledgment.  It is encoded as
  1753.       the Attribute 208, not mandatory, with a 16-bit word indicating
  1754.       the number of such messages.  If absent, the peer MUST use a value
  1755.       of 4 for the Window.
  1756.  
  1757.    Result Code
  1758.  
  1759.        0                   1                   2                   3
  1760.        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
  1761.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1762.       |1|0|0|0|        8              |               0               |
  1763.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1764.       |               209             |             Code              |
  1765.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1766.  
  1767.       The Result Code AVP within a Start-Control-Connection-Reply packet
  1768.       indicates the result of the control channel establishment attempt.
  1769.       The Value field is 209, indicating a Result Code.  The code is a
  1770.       16-bit word, and this AVP is mandatory.  This AVP MUST be present.
  1771.       Result code values are:
  1772.  
  1773.  
  1774.  
  1775. Valencia                    expires May 1997                    [Page 27]
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781. INTERNET DRAFT                                             December 1996
  1782.  
  1783.  
  1784.          1 - Successful channel establishment
  1785.          2 - General error--Error Code indicates the problem
  1786.          3 - Control channel already exists
  1787.          4 - Requester is not authorized to establish a control channel
  1788.          5 - The protocol version of the requester is not supported
  1789.  
  1790.    Error Code
  1791.  
  1792.        0                   1                   2                   3
  1793.        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
  1794.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1795.       |1|0|0|0|        8              |               0               |
  1796.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1797.       |               210             |             Error             |
  1798.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1799.       | Optional Message...           |
  1800.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1801.  
  1802.       This AVP is present only if a "General Error" exists, in which
  1803.       case Result Code was set to 2 and this AVP encodes the general
  1804.       error value as documented in section 5.5.  It has a Value of 210,
  1805.       and is marked mandatory.
  1806.  
  1807.    Challenge
  1808.  
  1809.        0                   1                   2                   3
  1810.        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
  1811.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1812.       |1|0|0|0|     6 + length        |               0               |
  1813.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1814.       |              211              | Challenge...  |
  1815.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1816.  
  1817.       The Challenge AVP within a Start-Control-Connection-Reply indi-
  1818.       cates that the peer wishes to authenticate the tunnel initiator.
  1819.       It is encoded as the Attribute 211, mandatory, with at least one
  1820.       byte of challenge value embedded.  If this AVP is not present, it
  1821.       indicates to the receiving peer that the sender does not wish to
  1822.       authenticate that peer.
  1823.  
  1824.    Response
  1825.  
  1826.        0                   1                   2                   3
  1827.        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
  1828.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1829.       |1|0|0|0|       22              |               0               |
  1830.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1831.       |               212             |   Response...                 |
  1832.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1833.       | Response... (128 bits)        |
  1834.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1835.  
  1836.       The Response AVP within a Start-Control-Connection-Reply packet
  1837.       provides a response to a challenge received.  The Attribute value
  1838.  
  1839.  
  1840.  
  1841. Valencia                    expires May 1997                    [Page 28]
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847. INTERNET DRAFT                                             December 1996
  1848.  
  1849.  
  1850.       is 212, indicating Response, and the Value field is a 128-bit
  1851.       value reflecting the CHAP-style response to the challenge.  This
  1852.       AVP marked mandatory, and MUST be present if a challenge was
  1853.       received and this Start-Control-Connection-Reply indicates suc-
  1854.       cess.  For purposes of the ID value in the CHAP response calcula-
  1855.       tion, the low order byte of the Sequence number of the challenge
  1856.       is used.
  1857.  
  1858. 6.3 Start-Control-Connection-Connected
  1859.  
  1860.    The Start-Control-Connection-Connected message is an L2TP control
  1861.    message sent in reply to a received Start-Control-Connection-Reply
  1862.    message.  This message provides closure to the tunnel establishment
  1863.    process, and includes a challenge response if the peer sent a chal-
  1864.    lenge in the Start-Control-Connection-Reply message.
  1865.  
  1866.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1867.    |    L2TP Control Message Header      |
  1868.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1869.    |  Start-Control-Connection-Connected |
  1870.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1871.    | Response              |
  1872.    +-+-+-+-+-+-+-+-+-+-+-+-+
  1873.  
  1874.    Start-Control-Connection-Connected AVP
  1875.  
  1876.        0                   1                   2                   3
  1877.        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
  1878.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1879.       |1|0|0|0|        6              |               0               |
  1880.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1881.       |                17             |
  1882.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1883.  
  1884.       The Attribute field is 17, indicating Start-Control-Connection-
  1885.       Connected.  The Flags indicate a mandatory option.
  1886.  
  1887.    Response
  1888.  
  1889.        0                   1                   2                   3
  1890.        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
  1891.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1892.       |1|0|0|0|       22              |               0               |
  1893.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1894.       |              1701             |   Response...                 |
  1895.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1896.       | Response... (128 bits)        |
  1897.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1898.  
  1899.       The Response AVP within a Start-Control-Connection-Connected
  1900.       packet provides a response to a challenge received.  The Attribute
  1901.       value is 1701, indicating Response, and the Value field is a
  1902.       128-bit value reflecting the CHAP-style response to the challenge.
  1903.       This AVP is marked mandatory, and MUST be present if a challenge
  1904.  
  1905.  
  1906.  
  1907. Valencia                    expires May 1997                    [Page 29]
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913. INTERNET DRAFT                                             December 1996
  1914.  
  1915.  
  1916.       was received, otherwise MUST be omitted.  For purposes of the ID
  1917.       value in the CHAP response calculation, the low order byte of the
  1918.       Sequence number of the challenge are used.
  1919.  
  1920. 6.4 Stop-Control-Connection-Request
  1921.  
  1922.    The Stop-Control-Connection-Request is an L2TP control message sent
  1923.    by one peer of an LAC-LNS control connection to inform the other peer
  1924.    that the control connection should be closed.  In addition to closing
  1925.    the control connection, all active user calls are implicitly cleared.
  1926.    The reason for issuing this request is indicated in the Reason field.
  1927.  
  1928.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1929.    |    L2TP Control Message Header      |
  1930.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1931.    |  Stop-Control-Connection-Request    |
  1932.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1933.    | Assigned Tunnel ID    |
  1934.    | Reason                |
  1935.    +-+-+-+-+-+-+-+-+-+-+-+-+
  1936.  
  1937.    Stop-Control-Connection-Request AVP
  1938.  
  1939.        0                   1                   2                   3
  1940.        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
  1941.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1942.       |1|0|0|0|        6              |               0               |
  1943.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1944.       |                3              |
  1945.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1946.  
  1947.       The Attribute field is 3, indicating Stop-Control-Connection-
  1948.       Request.  The Flags indicate a mandatory option.  The Flags indi-
  1949.       cate a mandatory option.  The single Reason AVP MUST follow this.
  1950.  
  1951.    Assigned Tunnel ID
  1952.  
  1953.        0                   1                   2                   3
  1954.        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
  1955.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1956.       |1|0|0|0|        8              |               0               |
  1957.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1958.       |               301             |      Assigned Tunnel ID       |
  1959.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1960.  
  1961.       The Attribute value is 301, indicating Assigned Tunnel ID, and is
  1962.       marked mandatory.  This AVP MUST be present.  The Value MUST be
  1963.       the same Assigned Tunnel ID first sent to the receiving peer.
  1964.       This AVP permits the peer to identify the appropriate tunnel even
  1965.       if Stop-Control-Connection-Request must be sent before an Assigned
  1966.       Tunnel ID is received.
  1967.  
  1968.    Reason
  1969.  
  1970.  
  1971.  
  1972.  
  1973. Valencia                    expires May 1997                    [Page 30]
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979. INTERNET DRAFT                                             December 1996
  1980.  
  1981.  
  1982.        0                   1                   2                   3
  1983.        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
  1984.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1985.       |1|0|0|0|        8              |               0               |
  1986.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1987.       |               302             |             Reason            |
  1988.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1989.  
  1990.       The Attribute value is 302, indicating Reason, and is marked
  1991.       mandatory.  This AVP MUST be present.  The Value is a 16-bit word
  1992.       indicates the reason for the control connection closure.  Values
  1993.       are:
  1994.  
  1995.          1 - General request to clear control connection
  1996.          2 - Can't support peer's version of the protocol
  1997.          3 - Requester is being shut down
  1998.  
  1999. 6.5 Stop-Control-Connection-Reply
  2000.  
  2001.    The Stop-Control-Connection-Reply is an L2TP control message sent by
  2002.    one peer of an LAC-LNS control connection upon receipt of a Stop-
  2003.    Control-Connection-Request from the other peer.
  2004.  
  2005.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2006.    |    L2TP Control Message Header      |
  2007.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2008.    |    Stop-Control-Connection-Reply    |
  2009.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2010.    | Result Code           |
  2011.    | Error Code            |
  2012.    +-+-+-+-+-+-+-+-+-+-+-+-+
  2013.  
  2014.    Stop-Control-Connection-Reply AVP
  2015.  
  2016.        0                   1                   2                   3
  2017.        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
  2018.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2019.       |1|0|0|0|        8              |               0               |
  2020.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2021.       |                4              |
  2022.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2023.  
  2024.       The Attribute field is 4, indicating Stop-Control-Connection-
  2025.       Reply.  The Flags indicate a mandatory option.
  2026.  
  2027.    Result Code
  2028.  
  2029.        0                   1                   2                   3
  2030.        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
  2031.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2032.       |1|0|0|0|        8              |               0               |
  2033.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2034.       |               401             |            Result             |
  2035.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2036.  
  2037.  
  2038.  
  2039. Valencia                    expires May 1997                    [Page 31]
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045. INTERNET DRAFT                                             December 1996
  2046.  
  2047.  
  2048.       The Attribute value is 401, indicating Result Code, and is marked
  2049.       mandatory.  This AVP MUST be present.  The Value is a 16-bit word
  2050.       indicating the result of the attempt to close the control connec-
  2051.       tion.  Values are:
  2052.  
  2053.          1 - Control connection closed
  2054.          2 - Control connection not closed for reason indicated in Error Code
  2055.  
  2056.    Error Code
  2057.  
  2058.        0                   1                   2                   3
  2059.        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
  2060.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2061.       |1|0|0|0|        8              |               0               |
  2062.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2063.       |               402             |             Error             |
  2064.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2065.       | Optional Message...           |
  2066.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2067.  
  2068.       The Attribute value is 402, indicating Error Code, and is marked
  2069.       mandatory.  This AVP is present only if a "General Error" exists,
  2070.       in which case the Value encodes the general error value as docu-
  2071.       mented in section 5.5.
  2072.  
  2073. 6.6 Hello
  2074.  
  2075.    The Hello message is an L2TP control message sent by either peer of a
  2076.    LAC-LNS control connection.  This control message is used as a
  2077.    "keepalive" for the control connection.
  2078.  
  2079.    Keepalives should be implemented by sending a Hello once every 60
  2080.    seconds if 60 seconds have passed without sending a message to the
  2081.    peer.  When a Hello is received, it MUST be silently discarded (after
  2082.    updating any effects of the indicated Nr/Ns values).
  2083.  
  2084.    Because a Hello is a control message, and control messages are reli-
  2085.    ably sent by the lower level transport, this keepalive function oper-
  2086.    ates by causing the transport level to reliably deliver a message.
  2087.    If a media interruption has occurred, the reliable transport will be
  2088.    unable to deliver the Hello across, and will clean up the tunnel.
  2089.  
  2090.    Hello messages are global to the tunnel; the Call ID field of these
  2091.    control messages MUST be 0.
  2092.  
  2093.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2094.    |    L2TP Control Message Header      |
  2095.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2096.    |    Hello                            |
  2097.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2098.  
  2099.    Hello AVP
  2100.  
  2101.        0                   1                   2                   3
  2102.  
  2103.  
  2104.  
  2105. Valencia                    expires May 1997                    [Page 32]
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111. INTERNET DRAFT                                             December 1996
  2112.  
  2113.  
  2114.        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
  2115.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2116.       |0|0|0|0|        6              |               0               |
  2117.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2118.       |                5              |
  2119.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2120.  
  2121.       The The Attribute value is 5, indicating Hello, and is marked
  2122.       optional.
  2123.  
  2124. 6.7 (Deleted)
  2125.  
  2126.    This section has been deleted.
  2127.  
  2128. 6.8 Outgoing-Call-Request
  2129.  
  2130.    The Outgoing-Call-Request is an L2TP control message sent by the LNS
  2131.    to the LAC to indicate that an outbound call from the LNS is to be
  2132.    established.  This request provides the LAC with information required
  2133.    to make the call.  It also provides information to the LAC that is
  2134.    used to regulate the transmission of data to the LNS for this session
  2135.    once it is established.
  2136.  
  2137.    This message is the first in the "three-way handshake" used by L2TP
  2138.    for establishing outgoing calls.  The first message requests the
  2139.    call; the second indicates that the call was successfully initiated.
  2140.    The third and final message indicates that the call was established.
  2141.  
  2142.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2143.    |          L2TP Control Message Header        |
  2144.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2145.    |            Outgoing-Call-Request            |
  2146.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2147.    |     Assigned Call ID      |
  2148.    |    Call Serial Number     |
  2149.    |        Minimum BPS        |
  2150.    |        Maximum BPS        |
  2151.    |        Bearer Type        |
  2152.    |       Framing Type        |
  2153.    |  Packet Recv. Window      |
  2154.    |  Packet Processing Delay  |
  2155.    |        Phone Number       |
  2156.    |       Sub-Address         |
  2157.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2158.  
  2159.    Outgoing-Call-Request AVP
  2160.  
  2161.        0                   1                   2                   3
  2162.        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
  2163.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2164.       |1|0|0|0|   6                   |                0              |
  2165.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2166.       |           7                   |
  2167.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2168.  
  2169.  
  2170.  
  2171. Valencia                    expires May 1997                    [Page 33]
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177. INTERNET DRAFT                                             December 1996
  2178.  
  2179.  
  2180.       The Outgoing-Call-Request AVP encodes a request to an LAC to
  2181.       establish an outgoing call.  The flags indicate a mandatory
  2182.       option.
  2183.  
  2184.       Assigned Call ID AVP
  2185.  
  2186.        0                   1                   2                   3
  2187.        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
  2188.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2189.       |1|0|0|0|      8                |                0              |
  2190.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2191.       |             701               |             Call ID           |
  2192.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2193.  
  2194.       The Assigned Call ID AVP encodes the ID being assigned to this
  2195.       call by the LNS.  The Attribute value is 701, indicating Assigned
  2196.       Call ID, and is marked mandatory.  This AVP MUST be present.  The
  2197.       LAC places this value in the Call ID header field of all command
  2198.       and payload packets that it subsequently transmits over the tunnel
  2199.       that belong to this call.  The Call ID value is an identifier
  2200.       assigned by the LNS to this session.  It is used to multiplex and
  2201.       demultiplex data sent over that tunnel between the LNS and LAC.
  2202.  
  2203.       Call Serial Number
  2204.  
  2205.        0                   1                   2                   3
  2206.        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
  2207.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2208.       |1|0|0|0|   6 + length          |              0                |
  2209.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2210.       |             702               |   Number...   |
  2211.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2212.  
  2213.       Call Serial Number AVP encodes an identifier assigned by the LNS to
  2214.       this call.
  2215.       Attribute is 702, indicating Call Serial Number, and is marked mandatory.
  2216.       This AVP MUST be present.
  2217.       The Number value
  2218.       is an identifier used by the LNS and the LAC
  2219.       for identifying the call.  Unlike the Call ID, both the LNS and LAC
  2220.       associate the same Call Serial Number with a given call.  This AVP
  2221.       MUST be present, and the Number MUST be at least one octet in length.
  2222.  
  2223.       Minimum BPS
  2224.  
  2225.        0                   1                   2                   3
  2226.        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
  2227.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2228.       |1|0|0|0|   10                  |               0               |
  2229.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2230.       |            703                |           BPS (H)             |
  2231.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2232.       |            BPS (L)            |
  2233.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2234.  
  2235.  
  2236.  
  2237. Valencia                    expires May 1997                    [Page 34]
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243. INTERNET DRAFT                                             December 1996
  2244.  
  2245.  
  2246.       Minimum BPS AVP encodes the lowest acceptable line speed for this
  2247.       call.  Attribute is 703, Minimum BPS, and is marked mandatory.
  2248.       This AVP MUST be present.  The BPS value indicates the speed in
  2249.       bits/second.
  2250.  
  2251.       Maximum BPS
  2252.  
  2253.        0                   1                   2                   3
  2254.        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
  2255.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2256.       |1|0|0|0|   10                  |               0               |
  2257.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2258.       |             704               |           BPS (H)             |
  2259.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2260.       |            BPS (L)            |
  2261.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2262.  
  2263.       Maximum BPS AVP encodes the highest acceptable line speed for this
  2264.       call.  Attribute is 704, indicating Maximum BPS, and is marked
  2265.       mandatory.  This AVP MUST be present.  The BPS value indicates the
  2266.       speed in bits/second.
  2267.  
  2268.       Bearer Type AVP
  2269.  
  2270.        0                   1                   2                   3
  2271.        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
  2272.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2273.       |1|0|0|0|   10                  |                0              |
  2274.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2275.       |            705                |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|
  2276.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2277.       |0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|D|
  2278.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2279.  
  2280.       Bearer Type AVP encodes the bearer type for the requested call.
  2281.       The value bit field Attribute is 705, indicating Bearer Type, and
  2282.       is marked mandatory.  This AVP MUST be present.  The Value is a
  2283.       32-bit quantity indicating the bearer capability required for this
  2284.       outgoing call.  If set, bit A indicates that the call should be on
  2285.       an analog channel.  If set, bit D indicates that the call should
  2286.       be on a digital channel.  Both may be set, indicating that the
  2287.       call can be of either type.
  2288.  
  2289.       Framing Type AVP
  2290.  
  2291.        0                   1                   2                   3
  2292.        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
  2293.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2294.       |1|0|0|0|   10                  |              0                |
  2295.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2296.       |             706               |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|
  2297.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2298.       |0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|S|
  2299.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2300.  
  2301.  
  2302.  
  2303. Valencia                    expires May 1997                    [Page 35]
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309. INTERNET DRAFT                                             December 1996
  2310.  
  2311.  
  2312.       Framing Type AVP encodes the framing type for the requested call.
  2313.       Attribute is 706, indicating Framing Type, and is marked manda-
  2314.       tory.  This AVP MUST be present.  The 32-bit field indicates the
  2315.       type of PPP framing to be used for the outgoing call.  Bit A if
  2316.       set indicates that asynchronous framing should be used.  Bit S is
  2317.       set indicates that synchronous framing should be used.
  2318.  
  2319.       Packet Receive Window Size AVP
  2320.  
  2321.        0                   1                   2                   3
  2322.        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
  2323.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2324.       |1|0|0|0|      8                |              0                |
  2325.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2326.       |             707               |   Size (H)    |  Size (L)     |
  2327.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2328.  
  2329.       Packet Receive Window Size AVP encodes the window size being
  2330.       advertised by the LNS for this call.  Attribute is 707, indicating
  2331.       Packet Receive Window, and is marked mandatory.  This AVP is
  2332.       optional.  The Size value indicates the number of received data
  2333.       packets the LNS will buffer for this call, which is also the maxi-
  2334.       mum number of data packets the LAC should send before waiting for
  2335.       an acknowledgment.  The absence of this AVP indicates that
  2336.       Sequence and Acknowledgment Numbers are not to be used in the pay-
  2337.       load session for this call.
  2338.  
  2339.       Packet Processing Delay AVP
  2340.  
  2341.        0                   1                   2                   3
  2342.        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
  2343.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2344.       |1|0|0|0|    8                  |              0                |
  2345.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2346.       |           708                 |   Delay (H)   |    Delay (L)  |
  2347.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2348.  
  2349.       The Packet Processing Delay AVP encodes the delay LNS has for pro-
  2350.       cessing a window full of packets sent by the LAC.  Attribute is
  2351.       708, indicating Packet Processing Delay, and is marked mandatory.
  2352.       This AVP is optional.  The Delay value is specified in units of
  2353.       1/10 seconds.  Refer to Appendix A for a description of how this
  2354.       value is determined and used.
  2355.  
  2356.       Phone Number AVP
  2357.  
  2358.        0                   1                   2                   3
  2359.        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
  2360.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2361.       |1|0|0|0| 6 + Phone Number len  |              0                |
  2362.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2363.       |            709                | Phone Number..|
  2364.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2365.  
  2366.  
  2367.  
  2368.  
  2369. Valencia                    expires May 1997                    [Page 36]
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375. INTERNET DRAFT                                             December 1996
  2376.  
  2377.  
  2378.       Phone Number AVP encodes the phone number to be called.  Attribute
  2379.       is 709, indicating Phone Number, and is marked mandatory.  This
  2380.       AVP MUST be present.  The Phone Number value is an ASCII string.
  2381.  
  2382.       Sub-Address AVP
  2383.  
  2384.        0                   1                   2                   3
  2385.        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
  2386.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2387.       |1|0|0|0| 6 + Sub-Address len   |              0                |
  2388.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2389.       |             710               | Sub-Address ..|
  2390.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2391.  
  2392.       Sub-Address AVP encodes additional dialing information.  Attribute
  2393.       is 710, indicating Sub-Address, and is marked mandatory.  This AVP
  2394.       is optional.  The Sub-Address value is an ASCII string.
  2395.  
  2396. 6.9 Outgoing-Call-Reply
  2397.  
  2398.    The Outgoing-Call-Reply is an L2TP control message sent by the LAC to
  2399.    the LNS in response to a received Outgoing-Call-Request message. The
  2400.    reply indicates whether or not the LAC is able to attempt the out-
  2401.    bound call and also returns certain parameters regarding the call
  2402.    attempt.
  2403.  
  2404.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2405.    |          L2TP Control Message Header        |
  2406.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2407.    |             Outgoing-Call-Reply             |
  2408.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2409.    |     Assigned Call ID      |
  2410.    |        Result Code        |
  2411.    |        Error Code         |
  2412.    |      Connect Speed        |
  2413.    |    Physical Channel Id    |
  2414.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2415.  
  2416.    Outgoing-Call-Reply AVP
  2417.  
  2418.     0                   1                   2                   3
  2419.     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
  2420.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2421.    |1|0|0|0|      6                |                0              |
  2422.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2423.    |              8                |
  2424.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2425.  
  2426.    The Outgoing-Call-Reply AVP encodes an immediate result of attempting
  2427.    an outgoing call request.  The flags indicate a mandatory option.
  2428.  
  2429.    Assigned Call ID AVP
  2430.  
  2431.     0                   1                   2                   3
  2432.  
  2433.  
  2434.  
  2435. Valencia                    expires May 1997                    [Page 37]
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441. INTERNET DRAFT                                             December 1996
  2442.  
  2443.  
  2444.     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
  2445.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2446.    |1|0|0|0|       8               |                0              |
  2447.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2448.    |              801              |            Call ID            |
  2449.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2450.  
  2451.    The Assigned Call ID AVP encodes the ID being assigned to this call
  2452.    by the LAC.  Attribute is 801, indicating Assigned Call ID, and is
  2453.    marked mandatory.  This AVP MUST be present.  Call ID value is an
  2454.    identifier, unique within the tunnel, assigned by the sender to this
  2455.    session.  The remote peer MUST place this Call ID in the Call ID por-
  2456.    tion of all future packets it sends associated with this session.  It
  2457.    is used to multiplex and demultiplex data sent over that tunnel
  2458.    between the LNS and LAC.
  2459.  
  2460.    Result Code AVP
  2461.  
  2462.     0                   1                   2                   3
  2463.     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
  2464.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2465.    |1|0|0|0|     8                 |              0                |
  2466.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2467.    |            802                |         Result Code           |
  2468.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2469.  
  2470.    Result Code AVP encodes the result of the Outgoing-Call-Request.
  2471.    Attribute is 802, indicating Result Code, and is marked mandatory.
  2472.    This AVP MUST be present.  The Result Code is a 16-bit value indicat-
  2473.    ing:
  2474.  
  2475.       1 - Call attempt in progress
  2476.       2 - Outgoing Call not attempted for the reason indicated in Error Code
  2477.       3 - No appropriate facilities are available (temporary condition)
  2478.       4 - No appropriate facilities are available (permanent condition)
  2479.       5 - Invalid destination
  2480.       6 - Outgoing Call administratively prohibited
  2481.  
  2482.  
  2483.    Error Code AVP
  2484.  
  2485.     0                   1                   2                   3
  2486.     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
  2487.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2488.    |1|0|0|0|     8                 |              0                |
  2489.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2490.    |            803                |          Error Code           |
  2491.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2492.    | Optional Message...           |
  2493.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2494.  
  2495.    The Error Code AVP is used to encode a specific error code in case
  2496.    the result AVP indicates a General Error.  Attribute is 803, indicat-
  2497.    ing Error Code, and is marked mandatory.  This AVP is present only if
  2498.  
  2499.  
  2500.  
  2501. Valencia                    expires May 1997                    [Page 38]
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507. INTERNET DRAFT                                             December 1996
  2508.  
  2509.  
  2510.    the Result Code indicates a value of 2.  The value can be one of the
  2511.    general error IDs specified in Section 5.5.
  2512.  
  2513.    Connect Speed AVP
  2514.  
  2515.     0                   1                   2                   3
  2516.     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
  2517.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2518.    |1|0|0|0|     10                |               0               |
  2519.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2520.    |            804                |            BPS (H)            |
  2521.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2522.    |           BPS (L)             |
  2523.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2524.  
  2525.    Connect Speed BPS AVP encodes the speed for the connection.  The
  2526.    Attribute value is 804, indicating Connect Speed, and is marked
  2527.    mandatory.  This AVP MUST be present if the Result indicates a call
  2528.    is in progress.  The BPS is a 16-bit value indicating the speed in
  2529.    bits/second.
  2530.  
  2531.    Physical Channel ID AVP
  2532.  
  2533.     0                   1                   2                   3
  2534.     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
  2535.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2536.    |1|0|0|0|     10                |              0                |
  2537.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2538.    |             805               |            ID (H)             |
  2539.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2540.    |          ID (L)               |
  2541.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2542.  
  2543.    Physical Channel ID AVP encodes the vendor specific physical channel
  2544.    number used for the call.  The Attribute value is 805, indicating
  2545.    Physical Channel ID, and is marked optional.  This AVP itself is
  2546.    optional.  ID is a 32-bit value in network byte order.  The value is
  2547.    used for logging purposes only.
  2548.  
  2549. 6.10 Outgoing-Call-Connected
  2550.  
  2551.    Outgoing-Call-Connected is an L2TP control message sent by the LAC to
  2552.    the LNS to indicate the result of a requested outgoing call.  The LAC
  2553.    MUST send the corresponding Outgoing-Call-Reply to the LNS before
  2554.    sending this message.  This message provides information to the LNS
  2555.    about the particular parameters used for the call.  It provides
  2556.    information to allow the LNS to regulate the transmission of data to
  2557.    the LAC for this session.
  2558.  
  2559.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2560.    |          L2TP Control Message Header        |
  2561.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2562.    |            Outgoing-Call-Connected          |
  2563.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2564.  
  2565.  
  2566.  
  2567. Valencia                    expires May 1997                    [Page 39]
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573. INTERNET DRAFT                                             December 1996
  2574.  
  2575.  
  2576.    |        Result Code        |
  2577.    |        Error Code         |
  2578.    |        Cause Code         |
  2579.    |      Connect Speed        |
  2580.    |       Framing Type        |
  2581.    |  Packet Recv. Window      |
  2582.    |  Packet Processing Delay  |
  2583.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2584.  
  2585.    Outgoing-Call-Connected AVP
  2586.  
  2587.     0                   1                   2                   3
  2588.     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
  2589.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2590.    |1|0|0|0|      6                |                0              |
  2591.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2592.    |           16                  |
  2593.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2594.  
  2595.    The Outgoing-Call-Connected AVP encodes the final result of an outgo-
  2596.    ing call request.  The flags indicate a mandatory option.
  2597.  
  2598.    Result Code
  2599.  
  2600.        0                   1                   2                   3
  2601.        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
  2602.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2603.       |1|0|0|0|       8               |               0               |
  2604.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2605.       |              1601             |          Result Code          |
  2606.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2607.  
  2608.       The Result Code indicates the result of the call attempt.  The
  2609.       Attribute value is 1601, indicating Result Code, and is marked
  2610.       mandatory.  This AVP MUST be present.  The Result Code is a 16-bit
  2611.       value:
  2612.  
  2613.          1 - Call established with no errors
  2614.          2 - Outgoing Call not established for the reason indicated in Error Code
  2615.          3 - Outgoing Call failed due to no carrier detected
  2616.          4 - Outgoing Call failed due to detection of a busy signal
  2617.          5 - Outgoing Call failed due to lack of a dial tone
  2618.          6 - Outgoing Call was not established within time allotted by LAC
  2619.          7 - Outgoing Call was connected but no appropriate framing was detected
  2620.  
  2621.       Error Code AVP
  2622.  
  2623.        0                   1                   2                   3
  2624.        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
  2625.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2626.       |1|0|0|0|     8                 |              0                |
  2627.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2628.       |           1602                |          Error Code           |
  2629.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2630.  
  2631.  
  2632.  
  2633. Valencia                    expires May 1997                    [Page 40]
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639. INTERNET DRAFT                                             December 1996
  2640.  
  2641.  
  2642.       | Optional Message...           |
  2643.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2644.  
  2645.       The Error Code AVP is used to encode a specific error code.
  2646.       Attribute is 1602, indicating Error Code, and is marked mandatory.
  2647.       This AVP is present only if the Result Code indicates a value of
  2648.       2.  The value is encoded as specified in Section 5.5.
  2649.  
  2650.       Cause Code AVP
  2651.  
  2652.        0                   1                   2                   3
  2653.        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
  2654.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2655.       |0|0|0|0| 9 + Advisory Msg len  |              0                |
  2656.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2657.       |             1603              |          Cause Code           |
  2658.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2659.       |   Cause Msg   |        Advisory Msg ...       |
  2660.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2661.  
  2662.       The Cause Code AVP is used to give additional information in cases
  2663.       of call failure.  The Attribute value is 1603, indicating Cause
  2664.       Code, and is marked mandatory.  This AVP is optional.  It is only
  2665.       relevant when the LAC uses Q.931/DSS1 for the outbound call
  2666.       attempt.  Cause Code is the returned Q.931 Cause code and Cause
  2667.       Msg is the returned Q.931 message code (e.g., DISCONNECT) associ-
  2668.       ated with the Cause Code.  Both values are returned in their
  2669.       native ITU encodings.  An additional ASCII text Advisory Message
  2670.       may also be included (presence indicated by the AVP length) to
  2671.       further explain the call failure.
  2672.  
  2673.       Connect Speed AVP
  2674.  
  2675.        0                   1                   2                   3
  2676.        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
  2677.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2678.       |1|0|0|0|     10                |               0               |
  2679.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2680.       |            1604               |            BPS (H)            |
  2681.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2682.       |           BPS (L)             |
  2683.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2684.  
  2685.       Connect Speed BPS AVP encodes the final negotiated speed for the
  2686.       connection.  The Attribute value is 1604, indicating Connect
  2687.       Speed, and is marked mandatory.  This AVP MUST be present if the
  2688.       call attempt is successful.  The BPS value indicates the speed in
  2689.       bits/second.
  2690.  
  2691.       Framing Type AVP
  2692.  
  2693.        0                   1                   2                   3
  2694.        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
  2695.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2696.  
  2697.  
  2698.  
  2699. Valencia                    expires May 1997                    [Page 41]
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705. INTERNET DRAFT                                             December 1996
  2706.  
  2707.  
  2708.       |1|0|0|0|     10                |              0                |
  2709.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2710.       |            1605               |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|
  2711.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2712.       |0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|S|
  2713.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2714.  
  2715.       Framing Type AVP encodes the framing type for the call.  The
  2716.       Attribute value is 1605, indicating Framing Type, and is marked
  2717.       mandatory.  This AVP MUST be present if the call attempt is suc-
  2718.       cessful.  The value bit field indicates the type of PPP framing is
  2719.       used for the call.  If set, bit A indicates that asynchronous
  2720.       framing is being used.  If set, bit S indicates that synchronous
  2721.       framing is being used.
  2722.  
  2723.       Packet Receive Window Size AVP
  2724.  
  2725.        0                   1                   2                   3
  2726.        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
  2727.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2728.       |1|0|0|0|     8                 |              0                |
  2729.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2730.       |            1606               |             Size              |
  2731.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2732.  
  2733.       Packet Receive Window Size AVP encodes the window size being
  2734.       offered by the LNS for this call.  The Attribute value is 1606,
  2735.       indicating Packet Receive Window Size, and is marked mandatory.
  2736.       The Size is a 16-bit value indicating the number of received data
  2737.       packets the LAC will buffer for this call, which is also the maxi-
  2738.       mum number of data packets the LNS should send before waiting for
  2739.       an acknowledgment.  This AVP MUST be present if and only if
  2740.       Sequence and Acknowledgment Numbers are to be used in the payload
  2741.       session for this call.
  2742.  
  2743.       Packet Processing Delay AVP
  2744.  
  2745.        0                   1                   2                   3
  2746.        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
  2747.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2748.       |1|0|0|0|      8                |              0                |
  2749.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2750.       |             1607              |            Delay              |
  2751.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2752.  
  2753.       Packet Processing Delay AVP encodes the delay the LAC expects for processing
  2754.       a window full of packets sent by the LNS.
  2755.       The Attribute value
  2756.       is 1607, indicating Packet Processing Delay, and is marked mandatory.
  2757.       This AVP is optional.
  2758.       The Delay value is specified in units of 1/10
  2759.       seconds.  Refer to Appendix A to see a
  2760.       description of how this value is determined and used.
  2761.  
  2762.  
  2763.  
  2764.  
  2765. Valencia                    expires May 1997                    [Page 42]
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771. INTERNET DRAFT                                             December 1996
  2772.  
  2773.  
  2774. 6.11 Incoming-Call-Request
  2775.  
  2776.    Incoming-Call-Request is an L2TP control message sent by the LAC
  2777.    to the LNS to indicate that an inbound call is to be established from
  2778.    the LAC.  This request provides the LNS with parameter information
  2779.    for the incoming call.
  2780.  
  2781.    This message is the first in the "three-way handshake" used by L2TP
  2782.    for establishing incoming calls.  The LAC may defer answering the
  2783.    call until it has received an Incoming-Call-Reply from the LNS
  2784.    indicating that the call should be established.  This mechanism allows
  2785.    the LNS to obtain sufficient information about the call before it is
  2786.    answered to determine whether the call should be answered or not.
  2787.    Alternatively, the LAC may answer the call, negotiate LCP and
  2788.    PPP authentication, and use the information gained to choose the LNS.
  2789.    In this case, the call has already been answered by the time
  2790.    the Incoming-Call-Reply message is received; the LAC simply spoofs
  2791.    the "call indication/answer call" phase in this case.
  2792.  
  2793.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2794.    |          L2TP Control Message Header        |
  2795.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2796.    |             Incoming-Call-Request           |
  2797.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2798.    |     Assigned Call ID      |
  2799.    |    Call Serial Number     |
  2800.    |     Call Bearer Type      |
  2801.    |    Physical Channel Id    |
  2802.    |       Dialed Number       |
  2803.    |      Dialing Number       |
  2804.    |       Sub-Address         |
  2805.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2806.  
  2807.    Incoming-Call-Request AVP
  2808.  
  2809.     0                   1                   2                   3
  2810.     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
  2811.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2812.    |1|0|0|0|     7                 |                0              |
  2813.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2814.    |             9                 |
  2815.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2816.  
  2817.    The Incoming-Call-Request AVP encodes an incoming call being indi-
  2818.    cated by the LAC.  The flags indicate a mandatory option.
  2819.  
  2820.    Assigned Call ID AVP
  2821.  
  2822.     0                   1                   2                   3
  2823.     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
  2824.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2825.    |1|0|0|0|     8                 |                0              |
  2826.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2827.    |            901                |             Call ID           |
  2828.  
  2829.  
  2830.  
  2831. Valencia                    expires May 1997                    [Page 43]
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837. INTERNET DRAFT                                             December 1996
  2838.  
  2839.  
  2840.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2841.  
  2842.    The Assigned Call ID AVP encodes the Call ID being assigned to call
  2843.    by the LAC.  The Attribute value is 901, indicating Call ID, and is
  2844.    marked mandatory.  This AVP MUST be present.  The LNS places this
  2845.    value in the Call ID header field of all command and payload packets
  2846.    that it subsequently transmits over the tunnel that belong to this
  2847.    call.  The Call ID value is an identifier assigned by the LAC to this
  2848.    session.  It is used to multiplex and demultiplex data sent over that
  2849.    tunnel between the LNS and LAC.
  2850.  
  2851.    Call Serial Number AVP
  2852.  
  2853.     0                   1                   2                   3
  2854.     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
  2855.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2856.    |1|0|0|0| 6 + Number length     |              0                |
  2857.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2858.    |            902                |   Number...   |
  2859.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2860.  
  2861.    Call Serial Number AVP encodes an identifier assigned by the LAC to
  2862.    this call.  The Attribute value is 902, Call Serial Number, and is
  2863.    marked mandatory.  This AVP MUST be present.  The Number value is an
  2864.    identifier assigned by the LAC and used by the LNS and the LAC for
  2865.    identifying the call.  Unlike the Call ID, both the LNS and LAC asso-
  2866.    ciate the same Call Serial Number with a given call.
  2867.  
  2868.    Call Bearer Type AVP
  2869.  
  2870.     0                   1                   2                   3
  2871.     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
  2872.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2873.    |1|0|0|0|     10                |              0                |
  2874.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2875.    |            903                |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|
  2876.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2877.    |0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|D|
  2878.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2879.  
  2880.    Call Bearer Type AVP encodes the bearer type for the incoming call.
  2881.    The Attribute value is 903, Call Bearer Type, and is marked manda-
  2882.    tory.  This AVP MUST be present.  The Value is a 32-bit field indi-
  2883.    cating the bearer capability being used by the incoming call.  If
  2884.    set, bit A indicates that the call is on an analog channel.  If set,
  2885.    bit D indicates that the call is on a digital channel.
  2886.  
  2887.    Physical Channel ID AVP
  2888.  
  2889.     0                   1                   2                   3
  2890.     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
  2891.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2892.    |1|0|0|0|     10                |              0                |
  2893.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2894.  
  2895.  
  2896.  
  2897. Valencia                    expires May 1997                    [Page 44]
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903. INTERNET DRAFT                                             December 1996
  2904.  
  2905.  
  2906.    |            904                |            ID (H)             |
  2907.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2908.    |           ID (L)              |
  2909.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2910.  
  2911.    Physical Channel ID AVP encodes the vendor specific physical channel
  2912.    number used for the call.  The Attribute value is 904, Physical Chan-
  2913.    nel ID, and is marked mandatory.  The presence of this AVP is
  2914.    optional.  ID is a 32-bit value in network byte order.  The value is
  2915.    used for logging purposes only.
  2916.  
  2917.    Dialed Number AVP
  2918.  
  2919.     0                   1                   2                   3
  2920.     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
  2921.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2922.    |1|0|0|0|   6 + Number len      |              0                |
  2923.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2924.    |            905                |    Number...  |
  2925.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2926.  
  2927.    Dialed Number AVP encodes the dialed number for the incoming call,
  2928.    that is, DNIS.  The Attribute value is 905, Dialed Number, and is
  2929.    marked mandatory.  The presence of this AVP is optional.  The value
  2930.    is an ASCII string.
  2931.  
  2932.    Dialing Number AVP
  2933.  
  2934.     0                   1                   2                   3
  2935.     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
  2936.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2937.    |1|0|0|0|      6 + length       |              0                |
  2938.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2939.    |             906               |    Number...  |
  2940.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2941.  
  2942.    Dialing Number AVP encodes the originating number for the incoming
  2943.    call, that is, CLID.  The Attribute value is 906, Dialing Number, and
  2944.    is marked mandatory.  The presence of this AVP is optional.  The
  2945.    value is an ASCII string.
  2946.  
  2947.    Sub-Address AVP
  2948.  
  2949.     0                   1                   2                   3
  2950.     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
  2951.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2952.    |1|0|0|0|     6 + length        |               0               |
  2953.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2954.    |              907              | Sub-Address...|
  2955.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2956.  
  2957.    Sub-Address AVP encodes additional dialing information.  The
  2958.    Attribute value is 907, Sub-Address, and is marked mandatory.  The
  2959.    presence of this AVP is optional.  The Sub-Address value is an ASCII
  2960.  
  2961.  
  2962.  
  2963. Valencia                    expires May 1997                    [Page 45]
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969. INTERNET DRAFT                                             December 1996
  2970.  
  2971.  
  2972.    string.
  2973.  
  2974. 6.12 Incoming-Call-Reply
  2975.  
  2976.    The Incoming-Call-Reply is an L2TP control message sent by the LNS to
  2977.    the LAC in response to a received Incoming-Call-Request message.  The
  2978.    reply indicates the result of the incoming call attempt.  It also
  2979.    provides information to allow the LAC to regulate the transmission of
  2980.    data to the LNS for this session.
  2981.  
  2982.    This message is the second in the three-way handshake used by L2TP
  2983.    for establishing incoming calls.  It indicates to the LAC whether the
  2984.    call should be answered or not.
  2985.  
  2986.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2987.    |          L2TP Control Message Header        |
  2988.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2989.    |             Incoming-Call-Reply             |
  2990.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2991.    |        Assigned Call ID       |
  2992.    |           Result Code         |
  2993.    |          Error Code           |
  2994.    |    Packet Recv. Window Size   |
  2995.    |    Packet Processing Delay    |
  2996.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2997.  
  2998.    Incoming-Call-Reply AVP
  2999.  
  3000.     0                   1                   2                   3
  3001.     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
  3002.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3003.    |1|0|0|0|     6                 |                0              |
  3004.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3005.    |             10                |
  3006.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3007.  
  3008.    The Incoming-Call-Reply AVP encodes a response by the LNS to the
  3009.    incoming call indication given by the LAC.  The flags indicate a
  3010.    mandatory option.
  3011.  
  3012.    Assigned Call ID AVP
  3013.  
  3014.     0                   1                   2                   3
  3015.     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
  3016.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3017.    |1|0|0|0|     8                 |                0              |
  3018.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3019.    |           1001                |             Call ID           |
  3020.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3021.  
  3022.    The Assigned Call ID AVP encodes the ID being assigned to call by the
  3023.    LNS.  The Attribute value is 1001, Assigned Call ID, and is marked
  3024.    mandatory.  This AVP MUST be present.  The LAC places this value in
  3025.    the Call ID header field of all command and payload packets that it
  3026.  
  3027.  
  3028.  
  3029. Valencia                    expires May 1997                    [Page 46]
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035. INTERNET DRAFT                                             December 1996
  3036.  
  3037.  
  3038.    subsequently transmits over the tunnel that belong to this call.  The
  3039.    Call ID value is an identifier assigned by the LNS to this session.
  3040.    It is used to multiplex and demultiplex data sent over that tunnel
  3041.    between the LNS and LAC.
  3042.  
  3043.    Result Code AVP
  3044.  
  3045.     0                   1                   2                   3
  3046.     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
  3047.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3048.    |1|0|0|0|     8                 |              0                |
  3049.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3050.    |           1002                |         Result Code           |
  3051.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3052.  
  3053.    Result Code AVP encodes the result of the Incoming-Call-Request.  The
  3054.    Attribute value is 1002, Result Code, and is marked mandatory.  This
  3055.    AVP MUST be present.  The Result Code value is a 16-bit value:
  3056.  
  3057.       1 - The LAC should answer the incoming call
  3058.       2 - The Incoming Call should not be established due to the reason
  3059.          indicated in Error Code
  3060.       3 - The LAC should not accept the incoming call.  It should hang
  3061.          up or issue a busy indication
  3062.  
  3063.    Error Code AVP
  3064.  
  3065.     0                   1                   2                   3
  3066.     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
  3067.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3068.    |1|0|0|0|     8                 |              0                |
  3069.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3070.    |           1003                |          Error Code           |
  3071.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3072.    | Optional Message...           |
  3073.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3074.  
  3075.    This AVP is present only if a "General Error" exists, in which case
  3076.    Result Code was set to 2 and this AVP encodes the general error value
  3077.    as documented in section 5.5.  It has a Value of 1003, and is marked
  3078.    mandatory.
  3079.  
  3080.    Packet Receive Window Size AVP
  3081.  
  3082.     0                   1                   2                   3
  3083.     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
  3084.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3085.    |1|0|0|0|     8                 |              0                |
  3086.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3087.    |            1004               |    Size (H)   |  Size (L)     |
  3088.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3089.  
  3090.    Packet Receive Window Size AVP encodes the receive window size being
  3091.    offered by the LNS for this call.  The Attribute value is 1004,
  3092.  
  3093.  
  3094.  
  3095. Valencia                    expires May 1997                    [Page 47]
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101. INTERNET DRAFT                                             December 1996
  3102.  
  3103.  
  3104.    Packet Receive Window Size, and is marked mandatory.  The Size value
  3105.    indicates the number of received data packets the LNS will buffer for
  3106.    this call, which is also the maximum number of data packets the LAC
  3107.    should send before waiting for an acknowledgment.  This AVP is
  3108.    optional if Sequence and Acknowledgment Numbers are not to be used in
  3109.    the payload session for this call.
  3110.  
  3111.    Packet Processing Delay AVP
  3112.  
  3113.     0                   1                   2                   3
  3114.     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
  3115.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3116.    |1|0|0|0|      8                |              0                |
  3117.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3118.    |             1005              |   Delay (H)   |    Delay (L)  |
  3119.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3120.  
  3121.    Packet Processing Delay AVP encodes the delay the LNS expects for
  3122.    processing a window full of packets sent by the LAC.  The Attribute
  3123.    value is 1005, Packet Processing Delay AVP, and is marked mandatory.
  3124.    The presence of this AVP is optional.  The Delay value is specified
  3125.    in units of 1/10 seconds.  Refer to Appendix A to see a description
  3126.    of how this value is determined and used.
  3127.  
  3128. 6.13 Incoming-Call-Connected
  3129.  
  3130.    The Incoming-Call-Connected message is an L2TP control message sent
  3131.    by the LAC to the LNS in response to a received Incoming-Call-Reply.
  3132.    It provides information to the LNS about particular parameters used
  3133.    for the call.  It also provides information to allow the LNS to regu-
  3134.    late the transmission of data to the LAC for this session.
  3135.  
  3136.    This message is the third in the three-way handshake used by L2TP for
  3137.    establishing incoming calls.  It provides a mechanism for providing
  3138.    the LNS with additional information about the call that cannot, in
  3139.    general, be obtained at the time the Incoming-Call-Request is issued
  3140.    by the LAC.
  3141.  
  3142.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3143.    |          L2TP Control Message Header        |
  3144.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3145.    |             Incoming-Call-Connected         |
  3146.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3147.    |      Connect Speed        |
  3148.    |       Framing Type        |
  3149.    |  Packet Recv. Window      |
  3150.    |  Packet Processing Delay  |
  3151.    |  Initial LCP Conf         |
  3152.    |  Last Sent LCP Conf       |
  3153.    |  Last Received LCP Conf   |
  3154.    |  Proxy authen type        |
  3155.    |  Proxy authen name        |
  3156.    |  Proxy authen challenge   |
  3157.    |  Proxy authen ID          |
  3158.  
  3159.  
  3160.  
  3161. Valencia                    expires May 1997                    [Page 48]
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167. INTERNET DRAFT                                             December 1996
  3168.  
  3169.  
  3170.    |  Proxy authen response    |
  3171.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3172.  
  3173.    Incoming-Call-Connected AVP
  3174.  
  3175.     0                   1                   2                   3
  3176.     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
  3177.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3178.    |1|0|0|0|     6                 |                0              |
  3179.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3180.    |             11                |
  3181.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3182.  
  3183.    The Incoming-Call-Connected AVP encodes a response by the LAC to the
  3184.    Incoming-Call-Reply message sent by the LAC.  The flags indicate a
  3185.    mandatory option.
  3186.  
  3187.    Connect Speed AVP
  3188.  
  3189.     0                   1                   2                   3
  3190.     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
  3191.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3192.    |1|0|0|0|     10                |               0               |
  3193.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3194.    |            1101               |            BPS (H)            |
  3195.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3196.    |          BPS (L)              |
  3197.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3198.  
  3199.    Connect Speed BPS AVP encodes the speed for the connection.  The
  3200.    Attribute value is 1101, Connect Speed, and is marked mandatory.
  3201.    This AVP MUST be present if the call attempt is successful.  The
  3202.    value is a 32-bit quantity indicating the speed in bits/second.
  3203.  
  3204.    Framing Type AVP
  3205.  
  3206.     0                   1                   2                   3
  3207.     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
  3208.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3209.    |1|0|0|0|     10                |              0                |
  3210.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3211.    |            1102               |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|
  3212.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3213.    |0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|S|
  3214.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3215.  
  3216.    Framing Type AVP encodes the framing type for the call.  The
  3217.    Attribute value is 1102, Call Serial Number, and is marked mandatory.
  3218.    This AVP MUST be present if the call attempt is successful.  The
  3219.    value is a 32-bit bit field indicating the type of PPP framing used
  3220.    for the call.  If set, bit A indicates that asynchronous framing is
  3221.    being used.  If set, bit S indicates that synchronous framing is
  3222.    being used.
  3223.  
  3224.  
  3225.  
  3226.  
  3227. Valencia                    expires May 1997                    [Page 49]
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233. INTERNET DRAFT                                             December 1996
  3234.  
  3235.  
  3236.    Packet Receive Window Size AVP
  3237.  
  3238.     0                   1                   2                   3
  3239.     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
  3240.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3241.    |1|0|0|0|      8                |              0                |
  3242.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3243.    |            1103               |             Size              |
  3244.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3245.  
  3246.    Packet Receive Window Size AVP encodes the window size being offered
  3247.    by the LAC for this call.  The Attribute value is 1103, Packet
  3248.    Receive Window Size, and is marked mandatory.  This AVP is optional
  3249.    if Sequence and Acknowledgment Numbers are not to be used in the pay-
  3250.    load session for this call.  The 16-bit Size value indicates the num-
  3251.    ber of received data packets the LAC will buffer for this call, which
  3252.    is also the maximum number of data packets the LNS should send before
  3253.    waiting for an acknowledgment.
  3254.  
  3255.    Packet Processing Delay AVP
  3256.  
  3257.     0                   1                   2                   3
  3258.     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
  3259.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3260.    |1|0|0|0|      8                |              0                |
  3261.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3262.    |            1104               |            Delay              |
  3263.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3264.  
  3265.    Packet Processing Delay AVP encodes the delay the LAC expects for
  3266.    processing a window full of packets sent by the LNS.  The Attribute
  3267.    value is 1104, Packet Processing Delay, and is marked mandatory.  The
  3268.    presence of this AVP is optional.  The 16-bit Delay value is speci-
  3269.    fied in units of 1/10 seconds.  Refer to Appendix A to see a descrip-
  3270.    tion of how this value is determined and used.
  3271.  
  3272.    Initial LCP Conf
  3273.  
  3274.     0                   1                   2                   3
  3275.     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
  3276.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3277.    |0|0|0|0| 6 + LCP confreq len   |              0                |
  3278.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3279.    |            1105               | LCP confreq...|
  3280.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3281.  
  3282.    The LAC may have answered the phone call and negotiated LCP with the
  3283.    dial-in client in order to establish the client's apparent identity.
  3284.    In this case, this option may be included to indicate the link prop-
  3285.    erties the client requested in its initial LCP CONFREQ request.  The
  3286.    Attribute value is 1105, Initial LCP Conf, and is marked optional.
  3287.    The presence of this AVP is optional.  The Value field is a copy of
  3288.    the body of the initial CONFREQ received, starting at the first
  3289.    option within this packet's body.
  3290.  
  3291.  
  3292.  
  3293. Valencia                    expires May 1997                    [Page 50]
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299. INTERNET DRAFT                                             December 1996
  3300.  
  3301.  
  3302.    Last Sent LCP Conf
  3303.  
  3304.     0                   1                   2                   3
  3305.     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
  3306.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3307.    |0|0|0|0| 6 + LCP confreq len   |              0                |
  3308.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3309.    |             1106              | LCP confreq...|
  3310.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3311.  
  3312.    See Initial LCP Conf above for rationale.  The Attribute value is
  3313.    1106, Last Sent LCP Conf, and is marked optional.  The presence of
  3314.    this AVP is optional.  The Value field is a copy of the body of the
  3315.    final CONFREQ sent to the client to complete LCP negotiation, start-
  3316.    ing at the first option within this packet's body.
  3317.  
  3318.    Last Received LCP Conf
  3319.  
  3320.     0                   1                   2                   3
  3321.     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
  3322.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3323.    |0|0|0|0| 6 + LCP confreq len   |              0                |
  3324.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3325.    |           1107                | LCP confreq...|
  3326.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3327.  
  3328.    See Initial LCP Conf above for rationale.  The Attribute value is
  3329.    1107, Last Received LCP Conf, and is marked optional.  The presence
  3330.    of this AVP is optional.  The Value field is a copy of the body of
  3331.    the final CONFREQ received from the client to complete LCP negotia-
  3332.    tion, starting at the first option within this packet's body.
  3333.  
  3334.    Proxy Authen Type
  3335.  
  3336.     0                   1                   2                   3
  3337.     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
  3338.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3339.    |1|0|0|0|     8                 |              0                |
  3340.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3341.    |            1108               |            Type               |
  3342.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3343.  
  3344.    The Attribute value is 1108, Proxy Authen Type, and is marked manda-
  3345.    tory.  This AVP MUST be present.  The value Type is a 16-bit word,
  3346.    holding a value:
  3347.  
  3348.       1 - Textual username/password exchange
  3349.       2 - PPP CHAP
  3350.       3 - PPP PAP
  3351.       4 - None
  3352.  
  3353.    Associated AVP's for each type of authentication follow.
  3354.  
  3355.    Proxy Authen Name
  3356.  
  3357.  
  3358.  
  3359. Valencia                    expires May 1997                    [Page 51]
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365. INTERNET DRAFT                                             December 1996
  3366.  
  3367.  
  3368.     0                   1                   2                   3
  3369.     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
  3370.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3371.    |0|0|0|0|       6 + length      |              0                |
  3372.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3373.    |             1109              |     Name...   |
  3374.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3375.  
  3376.    The Attribute value is 1109, Proxy Authen Name, and is marked manda-
  3377.    tory.  This AVP MUST be present for Proxy Authen Type values 1, 2,
  3378.    and 3.  The Name field contains the name specified in the client's
  3379.    authentication response.  Note that the AVP H bit may be desirable
  3380.    for obscuring the cleartext name.
  3381.  
  3382.    Proxy Authen Challenge
  3383.  
  3384.     0                   1                   2                   3
  3385.     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
  3386.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3387.    |0|0|0|0|        6 + length     |              0                |
  3388.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3389.    |             1110              | Challenge...  |
  3390.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3391.  
  3392.    The Attribute value is 1110, Proxy Authen Challenge, and is marked
  3393.    mandatory.  The AVP itself MUST be present for Proxy authen type 2.
  3394.    The Challenge field contains the value presented to the client by the
  3395.    LAC.
  3396.  
  3397.    Proxy Authen ID
  3398.  
  3399.     0                   1                   2                   3
  3400.     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
  3401.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3402.    |0|0|0|0|       8               |              0                |
  3403.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3404.    |             1111              |             ID                |
  3405.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3406.  
  3407.    The Attribute value is 1111, Proxy Authen ID, and is marked manda-
  3408.    tory.  The AVP itself MUST be present for Proxy authen type 2.  The
  3409.    ID field contains the byte ID value presented to the client by the
  3410.    LAC in its associated CHAP challenge.  The most significant 8 bits of
  3411.    ID MUST be 0, and are reserved.
  3412.  
  3413.    Proxy Authen Response
  3414.  
  3415.     0                   1                   2                   3
  3416.     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
  3417.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3418.    |1|0|0|0|        6 + length     |              0                |
  3419.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3420.    |             1112              | Response...   |
  3421.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3422.  
  3423.  
  3424.  
  3425. Valencia                    expires May 1997                    [Page 52]
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431. INTERNET DRAFT                                             December 1996
  3432.  
  3433.  
  3434.    The Attribute value is 1112, Proxy Authen Response, and is marked
  3435.    mandatory.  The AVP itself MUST be present for Proxy authen types 1,
  3436.    2, and 3.  The Response field contains the client's response to the
  3437.    challenge.  For Proxy authen type 2, this field contains the response
  3438.    value received by the LAC.  For types 1 or 3, it contains the clear
  3439.    text password received from the client by the LAC.  In the case of
  3440.    cleartext passwords, use of the AVP H bit is recommended.
  3441.  
  3442. 6.14 Call-Clear-Request
  3443.  
  3444.    The Call-Clear-Request is an L2TP control message sent by the LNS to
  3445.    the LAC indicating that a particular call is to be disconnected.  The
  3446.    call being cleared can be either an incoming or outgoing call, in any
  3447.    state.  The LAC responds to this message with a Call-Disconnect-
  3448.    Notify message.
  3449.  
  3450.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3451.    |          L2TP Control Message Header        |
  3452.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3453.    |             Call-Clear-Request              |
  3454.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3455.    |   Assigned Call ID    |
  3456.    +-+-+-+-+-+-+-+-+-+-+-+-+
  3457.  
  3458.    Call-Clear-Request AVP
  3459.  
  3460.     0                   1                   2                   3
  3461.     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
  3462.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3463.    |1|0|0|0|       6               |                0              |
  3464.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3465.    |             12                |
  3466.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3467.  
  3468.    The Call-Clear-Request AVP encodes a request by the LNS to the LAC to
  3469.    disconnect the call.  The flags indicate a mandatory option.
  3470.  
  3471.    Assigned Call ID AVP
  3472.  
  3473.     0                   1                   2                   3
  3474.     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
  3475.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3476.    |1|0|0|0|     8                 |                0              |
  3477.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3478.    |           1201                |            Call ID            |
  3479.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3480.  
  3481.    This attribute is used to provide the LAC with the Call ID assigned
  3482.    by the LNS for the call to be cleared in the case where the LNS has
  3483.    not yet learned the LAC's Call ID for the call.  The Attribute value
  3484.    is 1201, Assigned Call ID, and is marked mandatory.  This AVP MUST be
  3485.    present.  The value Call ID MUST be the same value sent from the LNS
  3486.    to the LAC in the initial call setup exchange.
  3487.  
  3488.  
  3489.  
  3490.  
  3491. Valencia                    expires May 1997                    [Page 53]
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497. INTERNET DRAFT                                             December 1996
  3498.  
  3499.  
  3500. 6.15 Call-Disconnect-Notify
  3501.  
  3502.    The Call-Disconnect-Notify message is an L2TP control message sent by
  3503.    the LAC to the LNS.  It is issued whenever a call is disconnected,
  3504.    due to the receipt by the LAC of a Call-Clear-Request or for any
  3505.    other reason.  Its purpose is to inform the LNS of the disconnection
  3506.    and the reason why the disconnection occurred.
  3507.  
  3508.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3509.    |          L2TP Control Message Header        |
  3510.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3511.    |             Call-Disconnect-Notify          |
  3512.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3513.    |     Result Code         |
  3514.    |     Error Code          |
  3515.    |     Cause Code          |
  3516.    |     Assigned Call ID    |
  3517.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3518.  
  3519.    Call-Disconnect-Notify AVP
  3520.  
  3521.     0                   1                   2                   3
  3522.     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
  3523.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3524.    |1|0|0|0|     6                 |                0              |
  3525.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3526.    |             13                |
  3527.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3528.  
  3529.    The Call-Disconnect-Notify AVP encodes a disconnect indication from
  3530.    the LAC to the LNS.  The flags indicate a mandatory option.
  3531.  
  3532.    Result Code AVP
  3533.  
  3534.     0                   1                   2                   3
  3535.     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
  3536.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3537.    |1|0|0|0|     8                 |              0                |
  3538.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3539.    |           1301                |         Result Code           |
  3540.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3541.  
  3542.    Result Code AVP encodes the reason for disconnect.  The Attribute
  3543.    value is 1301, Result Code, and is marked mandatory.  This AVP MUST
  3544.    be present.  The Result Code value can be one of:
  3545.  
  3546.       1 (Lost Carrier) - Call disconnected due to loss of carrier
  3547.       2 (General Error) - Call disconnected for the reason indicated in
  3548.          Error Code.
  3549.       3 (Admin Shutdown) - Call disconnected for administrative reasons
  3550.       4 (Request) - Call disconnected due to received Call-Clear-Request
  3551.  
  3552.    Error Code AVP
  3553.  
  3554.  
  3555.  
  3556.  
  3557. Valencia                    expires May 1997                    [Page 54]
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563. INTERNET DRAFT                                             December 1996
  3564.  
  3565.  
  3566.     0                   1                   2                   3
  3567.     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
  3568.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3569.    |1|0|0|0|     8                 |              0                |
  3570.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3571.    |           1302                |         Error Code            |
  3572.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3573.    | Optional Message...           |
  3574.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3575.  
  3576.    This AVP is present only if a "General Error" exists, in which case
  3577.    Result Code was set to 2 and this AVP encodes the general error value
  3578.    as documented in section 5.5.  The Attribute value is 1302, Error
  3579.    Code, and is marked mandatory.  This AVP MUST be present if Result
  3580.    Code was 2.
  3581.  
  3582.    Cause Code AVP
  3583.  
  3584.     0                   1                   2                   3
  3585.     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
  3586.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3587.    |1|0|0|0|     8                 |              0                |
  3588.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3589.    |           1303                |          Cause Code           |
  3590.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3591.    | Optional message...           |
  3592.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3593.  
  3594.    The Cause Code AVP is used to give additional information in case of
  3595.    unsolicited call disconnection.  The Attribute value is 1303, Cause
  3596.    Code, and is marked mandatory.  The presence of this AVP is optional.
  3597.    The Cause Code AVP is used to give additional information about the
  3598.    reason for disconnecting.  It is only relevant when the LAC is using
  3599.    Q.931/DSS1 for the call.  This AVP is optional.  Cause  Code is the
  3600.    returned Q.931 Cause code and Cause Msg is the returned Q.931 message
  3601.    code (e.g., DISCONNECT) associated with the Cause Code.  Both values
  3602.    are returned in their native ITU encodings.  An additional Ascii text
  3603.    Advisory Message may also be included (presence indicated by the AVP
  3604.    length) to further explain the reason for disconnecting.
  3605.  
  3606.    Assigned Call ID AVP
  3607.  
  3608.     0                   1                   2                   3
  3609.     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
  3610.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3611.    |1|0|0|0|      8                |               0               |
  3612.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3613.    |            1304               |            Call ID            |
  3614.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3615.  
  3616.    The Assigned Call ID which was provided to the LNS from this LAC is
  3617.    included in the Call-Disconnect-Notify message.  This permits a con-
  3618.    nection to be terminated even before the LNS has provided its own
  3619.    Assigned Call ID to this LAC (the Call ID field in the control
  3620.  
  3621.  
  3622.  
  3623. Valencia                    expires May 1997                    [Page 55]
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629. INTERNET DRAFT                                             December 1996
  3630.  
  3631.  
  3632.    message header is 0).  The Attribute value is 1304, Assigned Call ID,
  3633.    and is marked mandatory.  This AVP MUST be present.
  3634.  
  3635. 6.16 WAN-Error-Notify
  3636.  
  3637.    The WAN-Error-Notify message is an L2TP control message sent by the
  3638.    LAC to the LNS to indicate WAN error conditions (conditions that
  3639.    occur on the interface supporting PPP).  The counters in this message
  3640.    are cumulative.  This message should only be sent when an error
  3641.    occurs, and not more than once every 60 seconds.  The counters are
  3642.    reset when a new call is established.
  3643.  
  3644.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3645.    |          L2TP Control Message Header        |
  3646.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3647.    |                   WAN-Error-Notify          |
  3648.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3649.    |      Call Errors          |
  3650.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3651.  
  3652.    WAN-Error-Notify AVP
  3653.  
  3654.     0                   1                   2                   3
  3655.     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
  3656.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3657.    |1|0|0|0|     6                 |                0              |
  3658.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3659.    |             14                |
  3660.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3661.  
  3662.    The WAN-Error-Notify AVP encodes line and other errors sent by the
  3663.    LAC to the LNS.  The flags indicate a mandatory option.
  3664.  
  3665.    Call Errors AVP
  3666.  
  3667.     0                    1                   2                   3
  3668.     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
  3669.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3670.    |1|0|0|0|     32                |              0                |
  3671.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3672.    |            1401               |           Reserved            |
  3673.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3674.    |                           CRC Errors                          |
  3675.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3676.    |                        Framing Errors                         |
  3677.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3678.    |                       Hardware Overruns                       |
  3679.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3680.    |                        Buffer Overruns                        |
  3681.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3682.    |                        Time-out Errors                        |
  3683.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3684.    |                       Alignment Errors                        |
  3685.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3686.  
  3687.  
  3688.  
  3689. Valencia                    expires May 1997                    [Page 56]
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695. INTERNET DRAFT                                             December 1996
  3696.  
  3697.  
  3698.    The Call Errors AVP is used by the LAC to send error information to
  3699.    the LNS.  The Attribute value is 1401, WAN-Error-Notify, and is
  3700.    marked mandatory.  This AVP MUST be present.  The value contains the
  3701.    following fields:
  3702.  
  3703.       Reserved - Not used, MUST be 0
  3704.       CRC Errors - Number of PPP frames received with CRC errors since
  3705.          session was established
  3706.       Framing Errors - Number of improperly framed PPP packets received
  3707.       Hardware Overruns - Number of receive buffer over-runs since ses-
  3708.          sion was established
  3709.       Buffer Overruns - Number of buffer over-runs detected since ses-
  3710.          sion was established
  3711.       Time-out Errors - Number of time-outs since call was established
  3712.       Alignment Errors - Number of alignment errors since call was
  3713.          established
  3714.  
  3715. 6.17 Set-Link-Info
  3716.  
  3717.    The Set-Link-Info message is an L2TP control message sent by the LNS
  3718.    to the LAC to set PPP-negotiated options.  Because these options can
  3719.    change at any time during the life of the call, the LAC MUST be able
  3720.    to update its internal call information dynamically and update its
  3721.    behavior on an active PPP session.
  3722.  
  3723.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3724.    |          L2TP Control Message Header        |
  3725.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3726.    |                   Set-Link-Info             |
  3727.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3728.    |        ACCM             |
  3729.    +-+-+-+-+-+-+-+-+-+-+-+-+-+
  3730.  
  3731.    Set-Link-Info AVP
  3732.  
  3733.     0                   1                   2                   3
  3734.     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
  3735.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3736.    |1|0|0|0|     6                 |                0              |
  3737.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3738.    |             15                |
  3739.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3740.  
  3741.    The Set-Link-Info AVP encodes ACCM information sent from the LNS to
  3742.    the LAC after it is negotiated in LCP.  The flags indicate a manda-
  3743.    tory option.
  3744.  
  3745.    ACCM AVP
  3746.  
  3747.     0                    1                   2                   3
  3748.     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
  3749.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3750.    |1|0|0|0|     32                |              0                |
  3751.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3752.  
  3753.  
  3754.  
  3755. Valencia                    expires May 1997                    [Page 57]
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761. INTERNET DRAFT                                             December 1996
  3762.  
  3763.  
  3764.    |            1501               |          Reserved             |
  3765.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3766.    |                           Send ACCM                           |
  3767.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3768.    |                          Receive ACCM                         |
  3769.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  3770.  
  3771.    The ACCM AVP is used by the LNS to inform LAC of the ACCM to the LNS.
  3772.    The Attribute value is 1501, ACCM, and is marked mandatory.  The
  3773.    presence of this AVP is optional.  The value contains Send ACCM and
  3774.    Receive ACCM fields.  The send ACCM value should be used by the LAC
  3775.    to process packets it is sends on the connection.  The receive ACCM
  3776.    value should be used by the LAC to process incoming packets on the
  3777.    connection.  The default values used by the LAC for both these fields
  3778.    are 0xFFFFFFFF.  The LAC should honor these fields unless it has spe-
  3779.    cific configuration information to indicate that the requested mask
  3780.    must be modified to permit operation.
  3781.  
  3782. 7.0 Control Connection State Machines
  3783.  
  3784. The control messages defined in section 6 are exchanged by way of state
  3785. tables defined in this section.  Tables are defined for incoming call
  3786. placement, outgoing call placement, as well as for initiation of the
  3787. tunnel itself.  The state tables do not encode timeout and retransmis-
  3788. sion behavior, as this is handled in the underlying semantics defined in
  3789. 6.0.2.
  3790.  
  3791. 7.1 Control Connection Protocol Operation
  3792.  
  3793.    This section describes the operation of various L2TP control connec-
  3794.    tion functions and the Control Connection messages which are used to
  3795.    support them.
  3796.  
  3797.    Receipt of an invalid or malformed Control Connection message should
  3798.    be logged appropriately, and the control connection should be closed
  3799.    and restarted to ensure recovery into a known state.
  3800.  
  3801. 7.2 Control Connection States
  3802.  
  3803.    Control messages are carried over the same media as the payload mes-
  3804.    sages which are carried following successful connection establish-
  3805.    ment.  The L2TP control connection protocol is not distinguishable
  3806.    between the LNS and LAC, but is distinguishable between the origina-
  3807.    tor and receiver.  The originating peer is the one which first estab-
  3808.    lishes the tunnel.  Since either LAC or LNS can be the originator, a
  3809.    collision can occur.  See Section 6.0.1 for a description of this and
  3810.    its resolution situation.
  3811.  
  3812. 7.2.1 Control Connection Originator
  3813.  
  3814.    State           Event             Action               New State
  3815.    -----           -----             ------               ---------
  3816.  
  3817.    idle            Open request      Send                 wait-ctl-reply
  3818.  
  3819.  
  3820.  
  3821. Valencia                    expires May 1997                    [Page 58]
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827. INTERNET DRAFT                                             December 1996
  3828.  
  3829.  
  3830.                                      Start-Control-
  3831.                                      Connection-Request
  3832.  
  3833.    wait-ctl-reply  Collision         If terminating,      idle
  3834.                                      clean-up.
  3835.  
  3836.    wait-ctl-reply  Collision         If not terminating,  wait-stop-reply
  3837.                          Send Stop-Control-
  3838.                          Connection-Request
  3839.  
  3840.    wait-ctl-reply  Receive           If version OK        established
  3841.                    Start-Control-    Send Start-Control-
  3842.                    Connection-Reply  Connection-Connected
  3843.  
  3844.    wait-ctl-reply  Receive           If version not OK    wait-stop-reply
  3845.                    Start-Control-    or bad auth, Send
  3846.                    Connection-Reply  Stop-Control-
  3847.                                      Connection-Request
  3848.  
  3849.    established     Local terminate   Send                 wait-stop-reply
  3850.                                      Stop-Control-
  3851.                                      Connection-Request
  3852.  
  3853.    established     Receive           Send                 idle
  3854.                    Stop-Control-     Stop-Control-
  3855.                    Connection-       Connection-Reply
  3856.              Request          and clean-up
  3857.  
  3858.    wait-stop-reply Receive           Clean-up             idle
  3859.                    Stop-Control-
  3860.                    Connection-Reply
  3861.  
  3862.    idle
  3863.       The control connection originator attempts to open a connection to
  3864.       the peer during idle state.  When the connection is open, the
  3865.       originator transmits a send Start-Control-Connection-Request and
  3866.       then enters the wait-ctl-reply state.
  3867.  
  3868.    wait-ctl-reply
  3869.       The originator checks to see if another connection has been
  3870.       requested from the same peer, and if so, handles the collision
  3871.       situation described in Section 6.0.1.
  3872.  
  3873.       When a Start-Control-Connection-Reply is received, it is examined
  3874.       for a compatible version.  If the version of the reply is lower
  3875.       than the version sent in the request, the older (lower) version
  3876.       should be used provided it is supported.  If the version in the
  3877.       reply is earlier and supported, the originator moves to the estab-
  3878.       lished state.  If the version is earlier and not supported, a
  3879.       Stop-Control-Connection-Request SHOULD be sent to the peer and the
  3880.       originator moves into the wait-stop-reply state.
  3881.  
  3882.    established
  3883.       An established connection may be terminated by either a local
  3884.  
  3885.  
  3886.  
  3887. Valencia                    expires May 1997                    [Page 59]
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893. INTERNET DRAFT                                             December 1996
  3894.  
  3895.  
  3896.       condition or the receipt of a Stop-Control-Connection-Request.  In
  3897.       the event of a local termination, the originator MUST send a Stop-
  3898.       Control-Connection-Request and enter the wait-stop-reply state.
  3899.  
  3900.       If the originator receives a Stop-Control-Connection-Request it
  3901.       SHOULD send a Stop-Control-Connection-Reply and close the connec-
  3902.       tion.
  3903.  
  3904.    wait-stop-reply
  3905.       If a Stop-Control-Connection-Reply is received, the connection
  3906.       SHOULD be closed and the control connection becomes idle.
  3907.  
  3908. 7.2.2 Control connection Receiver
  3909.  
  3910.    State           Event              Action                 New State
  3911.    -----           -----              ------                 ---------
  3912.    idle            Receive            If version not OK      idle
  3913.                    Start-Control-     send
  3914.                    Connection-Request Start-Control-
  3915.                                       Connection-Reply
  3916.                                       with error
  3917.  
  3918.    idle            Receive            Version OK, send       wait-ctl-reply
  3919.                    Start-Control-     Start-Control-
  3920.                    Connection-Request Connection-Reply
  3921.  
  3922.    wait-ctl-reply  Receive            Clean-up, send         idle
  3923.                    Stop-Control-      Stop-Control-
  3924.                    Connection-Request Connection-Reply
  3925.  
  3926.    wait-ctl-reply  Receive            If auth OK             established
  3927.                    Start-Control-
  3928.                    Connection-Connected
  3929.  
  3930.    wait-ctl-reply  Receive            If auth not OK         wait-stop-reply
  3931.                    Start-Control-     Send Stop-Control-
  3932.                    Connection-        Connection-Request
  3933.                    Connected
  3934.  
  3935.    established     Receive            Clean-up, send         idle
  3936.                    Stop-Control-      Stop-Control-
  3937.                    Connection-Request Connection-Reply
  3938.  
  3939.    established     Local terminate    Send                   wait-stop-reply
  3940.                                       Stop-Control-
  3941.                                       Connection-Request
  3942.  
  3943.    wait-stop-reply Receive            Clean-up               idle
  3944.                    Stop-Control-
  3945.                    Connection-Reply
  3946.  
  3947.    idle
  3948.       The control connection receiver waits for an incoming connection
  3949.       attempt.  When notified of a new connection, it should prepare to
  3950.  
  3951.  
  3952.  
  3953. Valencia                    expires May 1997                    [Page 60]
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959. INTERNET DRAFT                                             December 1996
  3960.  
  3961.  
  3962.       receive L2TP messages.  When a Start-Control-Connection-Request is
  3963.       received its version field MUST be examined.  If the version is
  3964.       earlier than the receiver's version and the earlier version can be
  3965.       supported by the receiver, the receiver SHOULD send a
  3966.       Start-Control-Connection-Reply.
  3967.  
  3968.       If the version is earlier than the receiver's
  3969.       version and the version cannot be supported, the receiver SHOULD send
  3970.       a Start-Connection-Reply message indicating this error and remain in
  3971.       the idle state.  If the receiver's version is the same as
  3972.       or earlier than the peer's, the receiver SHOULD send a
  3973.       Start-Control-Connection-Reply with the receiver's version and enter the
  3974.       wait-ctl-reply state.
  3975.  
  3976.    wait-ctl-reply
  3977.  
  3978.       The peer waits in this state after sending a Start-Control-Connection-Reply.
  3979.       If it receives a Start-Control-Connection-Reply, it checks to see if the
  3980.       message is properly authenticated and, if so, it enters the established
  3981.       state.
  3982.       If authentication fails, a Stop-Control-Connection-Request with the reason
  3983.       code set appropriately is sent and wait-stop-reply state is entered.
  3984.       if a Stop-Control-Connection-Request is received, a
  3985.       Stop-Control-Connection-Reply. is issued and idle state is entered.
  3986.  
  3987.    established
  3988.       An established connection may be terminated by either a local
  3989.       condition or the reception of a Stop-Control-Connection-Request.  In
  3990.       the event of a local termination, the originator MUST send a
  3991.       Stop-Control-Connection-Request
  3992.       and enter the wait-stop-reply state.
  3993.  
  3994.       If the originator receives a Stop-Control-Connection-Request it
  3995.       SHOULD send a Stop-Control-Connection-Reply and close the
  3996.       connection.
  3997.  
  3998.    wait-stop-reply
  3999.       If a Stop-Control-Connection-Reply is received, the connection
  4000.       SHOULD be closed and the control connection becomes idle.
  4001.  
  4002. 7.3 Timing considerations
  4003.  
  4004.    Because of the real-time nature of telephone signaling, both the LNS
  4005.    and LAC should be implemented with multi-threaded architectures such
  4006.    that messages related to multiple calls are not serialized and
  4007.    blocked.
  4008.    The call and connection state figures do not specify
  4009.    exceptions caused by timers.  These are addressed in Section 6.0.2.
  4010.  
  4011.    7.4 Incoming calls
  4012.  
  4013.    An Incoming-Call-Request message is generated by the LAC when an
  4014.    associated telephone line rings.  The LAC selects a Call ID and serial
  4015.    number and indicates the call bearer type.  Modems should always
  4016.  
  4017.  
  4018.  
  4019. Valencia                    expires May 1997                    [Page 61]
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025. INTERNET DRAFT                                             December 1996
  4026.  
  4027.  
  4028.    indicate analog call type.  ISDN calls should indicate digital when
  4029.    unrestricted digital service or rate adaption is used and analog if
  4030.    digital modems are involved.  CLID, DNIS, and
  4031.    subaddress may be included in the message if they are available from
  4032.    the telephone network.
  4033.  
  4034.    Once the LAC sends the Incoming-Call-Request, it waits for a response
  4035.    from the LNS but it does not necessarily answer the call from the
  4036.    telephone network yet.  The LNS may choose not to accept the call if:
  4037.  
  4038.       -  No resources are available to handle more sessions
  4039.       -  The dialed, dialing, or subaddress fields are not indicative of
  4040.          an authorized user
  4041.       -  The bearer service is not authorized or supported
  4042.  
  4043.    If the LNS chooses to accept the call, it responds with an
  4044.    Outgoing-Call-Reply
  4045.    which also indicates window sizes (see Appendix B).  When
  4046.    the LAC receives the Outgoing-Call-Reply, it attempts to connect the
  4047.    call, assuming the calling party has not hung up.  A final call
  4048.    connected message from the LAC to the LNS indicates that the call
  4049.    states for both the LAC and the LNS should enter the established
  4050.    state.
  4051.  
  4052.    When the dialed-in client hangs up, the call is cleared normally and
  4053.    the LAC sends a Call-Disconnect-Notify message.  If the LNS wishes to
  4054.    clear a call, it sends a Call-Clear-Request message and then waits
  4055.    for a Call-Disconnect-Notify.
  4056.  
  4057. 7.4.1 LAC Incoming Call States
  4058.  
  4059.    State       Event               Action                   New State
  4060.    -----       -----               ------                   ---------
  4061.    idle        Ring OR             Send                     wait-reply
  4062.                Ready to indicate   Incoming-Call-Request
  4063.                incoming conn.
  4064.  
  4065.    wait-reply  Receive             Clean-up                 idle
  4066.                Incoming-Call-Reply
  4067.                Not Accepting
  4068.  
  4069.    wait-reply  Receive             Answer call              established
  4070.                Incoming-Call-Reply Send
  4071.                Accepting           Incoming-Call-Connected
  4072.  
  4073.    wait-reply  Abort               Clean-up                 idle
  4074.                                    Send Call-Disconnect-
  4075.                                    Notify
  4076.  
  4077.    established Receive             Hang-up and send         idle
  4078.                Call-Clear-Request  Call-Disconnect-Notify
  4079.  
  4080.    established telco line drop     Send                     idle
  4081.                                    Call-Disconnect-Notify
  4082.  
  4083.  
  4084.  
  4085. Valencia                    expires May 1997                    [Page 62]
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091. INTERNET DRAFT                                             December 1996
  4092.  
  4093.  
  4094.    established local disconnect    Send                     idle
  4095.                                    Call-Disconnect-Notify
  4096.  
  4097. The states associated with the LAC for incoming calls are:
  4098.  
  4099. idle
  4100.  
  4101.    The LAC detects an incoming call on one of its telco interfaces.
  4102.    Typically this means an analog line is ringing or an ISDN TE has
  4103.    detected an incoming Q.931 SETUP message.  The LAC sends an Incoming-
  4104.    Call-Request message and moves to the wait-reply state.
  4105.  
  4106. wait-reply
  4107.  
  4108.    The LAC receives an Incoming-Call-Reply message indicating non- will-
  4109.    ingness to accept the call (general error or don't accept) and moves
  4110.    back into the idle state.  If the reply message indicates that the
  4111.    call is accepted, the LAC sends an Incoming-Call-Connected message
  4112.    and enters the established state.
  4113.  
  4114. established
  4115.  
  4116.    Data is exchanged over the tunnel.  The call may be cleared follow-
  4117.    ing:
  4118.       An event on the telco connection.  The LAC sends a Call-
  4119.          Disconnect-Notify message
  4120.       Receipt of a Call-Clear-Request.  The LAC sends a Call-Disconnect-
  4121.          Notify message
  4122.       A local reason.  The LAC sends a Call-Disconnect-Notify message.
  4123.  
  4124.  
  4125. 7.4.2 LNS Incoming Call States
  4126.  
  4127.    State        Event                  Action                New State
  4128.    -----        -----                  ------                ---------
  4129.    idle         Receive                If not accepting      idle
  4130.                 Incoming-Call-Request  Send
  4131.                                        Incoming-Call-Reply
  4132.                                        with Error
  4133.  
  4134.    idle         Receive                If accepting          wait-connect
  4135.                 Incoming-Call-Request  Send
  4136.                                        Incoming-Call-Reply
  4137.  
  4138.    wait-connect Receive                Clean-up              idle
  4139.                 Call-Disconnect-Notify
  4140.  
  4141.    wait-connect Receive                Get ready for data    established
  4142.                 Incoming-Call-Connect
  4143.  
  4144.    established  Receive                Clean-up              idle
  4145.                 Call-Disconnect-Notify
  4146.  
  4147.    established  Local terminate        Send                  wait-
  4148.  
  4149.  
  4150.  
  4151. Valencia                    expires May 1997                    [Page 63]
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157. INTERNET DRAFT                                             December 1996
  4158.  
  4159.  
  4160.                                        Call-Clear-Request    disconnect
  4161.  
  4162.    wait-        Receive                Clean-up              idle
  4163.    disconnect   Call-Disconnect-Notify
  4164.  
  4165.    The states associated with the LNS for incoming calls are:
  4166.  
  4167.    idle
  4168.  
  4169.       An Incoming-Call-Request message is received.  If the request is
  4170.       not acceptable, an Incoming-Call-Reply is sent back to the LAC and
  4171.       the LNS remains in the idle state.  If the Incoming-Call-Request
  4172.       message is acceptable, an Incoming-Call-Reply is sent indicating
  4173.       accept in the result code.  The session moves to the wait-connect
  4174.       state.
  4175.  
  4176.    wait-connect
  4177.  
  4178.       If the session is still connected on the LAC, the LAC sends an
  4179.       incoming call connect message to the LNS which then moves into
  4180.       established state.  The LAC may send a Call-Disconnect-Notify to
  4181.       indicate that the incoming caller could not be connected.  This
  4182.       could happen, for example, if a telephone user accidentally places
  4183.       a standard voice call to an LAC resulting in a handshake failure
  4184.       on the called modem.
  4185.  
  4186.    established
  4187.  
  4188.       The session is terminated either by receipt of a Call-Disconnect-
  4189.       Notify message from the LAC or by sending a Call-Clear-Request.
  4190.       Once a Call-Clear-Request has been sent, the session enters the
  4191.       wait-disconnect state.
  4192.  
  4193.    wait-disconnect
  4194.  
  4195.       Once a Call-Disconnect-Notify is received the session moves back
  4196.       to the idle state.
  4197.  
  4198. 7.5 Outgoing calls
  4199.  
  4200. Outgoing calls are initiated by an LNS and instruct an LAC to place a
  4201. call on a telco interface.  There are three messages for outgoing calls:
  4202. Outgoing-Call-Request, Outgoing-Call-Reply, and Outgoing-Call-Connected.
  4203. The LNS sends an Outgoing-Call-Request specifying the dialed party phone
  4204. number and subaddress as well as speed and window parameters.  The LAC
  4205. MUST respond to the Outgoing-Call-Request message with an Outgoing-Call-
  4206. Reply message once the LAC determines that the proper facilities exist
  4207. to place the call and the call is administratively authorized.  For
  4208. example, is this LNS allowed to dial an international call?  Once the
  4209. outbound call is connected the LAC sends an Outgoing-Call-Connected mes-
  4210. sage to the LNS indicating the final result of the call attempt:
  4211.  
  4212. 7.5.1 LAC Outgoing Call States
  4213.  
  4214.  
  4215.  
  4216.  
  4217. Valencia                    expires May 1997                    [Page 64]
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223. INTERNET DRAFT                                             December 1996
  4224.  
  4225.  
  4226.    State       Event              Action                        New State
  4227.    -----       -----              ------                        ---------
  4228.    idle        Receive            If cannot service,            idle
  4229.                Outgoing-Call-     send Outgoing-Call-Reply
  4230.                Request            with Error
  4231.  
  4232.    idle        Receive            If can service,               wait-cs-ans
  4233.                Outgoing-Call-     send
  4234.                Request            Outgoing-Call-Reply
  4235.  
  4236.    wait-cs-ans Telco answer       Send                          established
  4237.                and framing        Outgoing-Call-Connected
  4238.                detected
  4239.  
  4240.    wait-cs-ans Call failure       Send
  4241.                                   Outgoing-Call-Connected       idle
  4242.                                   with Error
  4243.  
  4244.    wait-cs-ans Receive            Hang-up, send                 idle
  4245.                Call-Clear-Request Call-Disconnect-Notify
  4246.  
  4247.    established Receive            Hang-up, send                 idle
  4248.                Call-Clear-Request Call-Disconnect-Notify
  4249.                or detect call
  4250.                disconnected
  4251.  
  4252.    The states associated with the LAC for outgoing calls are:
  4253.  
  4254.    idle
  4255.  
  4256.       Received Outgoing-Call-Request.  If this is received in error,
  4257.       respond with an Outgoing-Call-Reply with error condition set.
  4258.       Otherwise, allocate physical channel to dial on and send an Outgo-
  4259.       ing-Call-Reply.  Place the outbound call and move to the wait-cs-
  4260.       ans state.
  4261.  
  4262.    wait-cs-ans
  4263.  
  4264.       If the call is not completed or a timer expires waiting for the
  4265.       call to complete, send an Outgoing-Call-Connected with the appro-
  4266.       priate error condition set and go to idle state.  If a circuit
  4267.       switched connection is established and framing is detected, send
  4268.       an Outgoing-Call-Reply indicating success and go to established
  4269.       state.
  4270.  
  4271.    established
  4272.  
  4273.       If a Call-Clear-Request is received, the telco call SHOULD be
  4274.       released via appropriate mechanisms and a Call-Disconnect-Notify
  4275.       message SHOULD BE sent to the LNS.  If the call is disconnected by
  4276.       the client or by the telco interface, a Call-Disconnect-Notify
  4277.       message MUST be sent to the LNS.  Return to idle state after send-
  4278.       ing the Call-Disconnect-Notify.
  4279.  
  4280.  
  4281.  
  4282.  
  4283. Valencia                    expires May 1997                    [Page 65]
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289. INTERNET DRAFT                                             December 1996
  4290.  
  4291.  
  4292. 7.5.2 LNS Outgoing Call States
  4293.  
  4294.    State         Event                  Action                  New State
  4295.    -----         -----                  ------                  ---------
  4296.    idle          Open request           Send                    wait-reply
  4297.                                         Outgoing-Call-Request
  4298.  
  4299.    wait-reply    Receive                Clean-up                idle
  4300.                  Outgoing-Call-Reply
  4301.                  with Error
  4302.  
  4303.    wait-reply    Receive                Null                    wait-connect
  4304.                  Outgoing-Call-Reply
  4305.  
  4306.    wait-reply    Abort request          Send                    wait-disconnect
  4307.                                         Call-Clear-Request
  4308.  
  4309.    wait-connect  Abort request          Send
  4310.                                         Call-Clear-Request      wait-disconnect
  4311.  
  4312.    wait-connect  Receive                Get ready for data      established
  4313.                  Outgoing-Call-Connected
  4314.                  no Error
  4315.  
  4316.    wait-connect  Receive                Clean-up                idle
  4317.                  Outgoing-Call-Connected
  4318.                  with Error
  4319.  
  4320.    established   Receive                Clean-up                idle
  4321.                  Call-Disconnect-Notify
  4322.  
  4323.    established   Local terminate        Send                    wait-disconnect
  4324.                                         Call-Clear-Request
  4325.  
  4326.    wait-disconnect Receive              Clean-up                idle
  4327.                  Call-Disconnect-
  4328.                  Notify
  4329.  
  4330.    The states associated with the LNS for outgoing calls are:
  4331.  
  4332.    idle
  4333.       An Outgoing-Call-Request message is sent to the LAC and the ses-
  4334.       sion moves into the wait-reply state.
  4335.  
  4336.    wait-reply
  4337.       An Outgoing-Call-Reply is received which indicates an error.  The
  4338.       session returns to idle state.  If the Outgoing-Call-Reply does
  4339.       not indicate an error, the telco call is connected and the session
  4340.       moves to the established state.
  4341.  
  4342.    wait-connect
  4343.       An Outgoing-Call-Connected is received which indicates an error.
  4344.       The session returns to idle state.  No telco call is active.  If
  4345.       the Outgoing-Call-Connected does not indicate an error, the telco
  4346.  
  4347.  
  4348.  
  4349. Valencia                    expires May 1997                    [Page 66]
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355. INTERNET DRAFT                                             December 1996
  4356.  
  4357.  
  4358.       call is
  4359.  
  4360.    established
  4361.       If a Call-Disconnect-Notify is received, the telco call has been
  4362.       terminated for the reason indicated in the Result and Cause Codes.
  4363.       The session moves back to the idle state.  If the LNS chooses to
  4364.       terminate the session, it sends a Call-Clear-Request to the LAC
  4365.       and then enters the wait-disconnect state.
  4366.  
  4367.    wait-disconnect
  4368.       A session disconnection is waiting to be confirmed by the LAC.
  4369.       Once the LNS receives the Call-Disconnect-Notify message, the ses-
  4370.       sion enters idle state.
  4371.  
  4372. 8.0 L2TP Over Specific Media
  4373.  
  4374.    L2TP tries to be self-describing, operating at a level above the par-
  4375.    ticular media over which it is carried.  However, some details of its
  4376.    connection to media are required to permit interoperable implementa-
  4377.    tions.  The following sections describe details needed to permit
  4378.    interoperability over specific media.
  4379.  
  4380. 8.1 IP/UDP
  4381.  
  4382.    L2TP uses the well-known UDP port 1701 [3].  The entire L2TP packet,
  4383.    including payload and L2TP header, is sent within a UDP datagram.
  4384.    The source and destination ports are the same (1701), with demulti-
  4385.    plexing being achieved using Tunnel ID values.  It is legal for the
  4386.    source IP address of a given Tunnel ID to change over the life of a
  4387.    connection, as this may correspond to a peer with multiple IP inter-
  4388.    faces responding to a network topology change.  Responses should
  4389.    reflect the last source IP address for that Tunnel ID.
  4390.  
  4391.    IP fragmentation may occur as the L2TP packet travels over the IP
  4392.    substrate.  L2TP makes no special efforts to optimize this.  A LAC
  4393.    implementation MAY cause its LCP to negotiate for a specific MRU,
  4394.    which could optimize for LAC environments in which the MTUs of the
  4395.    path over which the L2TP packets are likely to travel have a consis-
  4396.    tent value.
  4397.  
  4398.    Because a single UDP port is used for all packets, both the I and C
  4399.    bits MUST be used to permit correct demultiplexing.
  4400.  
  4401.    Port 1701 is used for both L2F [5] and L2TP packets.  The two types
  4402.    of packets may be detected by their headers; L2TP has a Vers field of
  4403.    2, L2F has a 1 in this field instead.
  4404.  
  4405. 8.2 IP
  4406.  
  4407.    When operating directly over IP, protocol number TBD [3] is used to
  4408.    encode the packet as L2TP-over-IP.  IP source address and MTU issues
  4409.    are identical to 8.1, except that the lack of a UDP header makes the
  4410.    packet more compact.  As in IP/UDP, the I and C bits MUST be present.
  4411.  
  4412.  
  4413.  
  4414.  
  4415. Valencia                    expires May 1997                    [Page 67]
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421. INTERNET DRAFT                                             December 1996
  4422.  
  4423.  
  4424. 9.0 Security Considerations
  4425.  
  4426.    L2TP encounters several security issues in its operation.  The gen-
  4427.    eral approach of L2TP to these issues is documented here.
  4428.  
  4429.    9.1 Tunnel Endpoint Security
  4430.  
  4431.       The tunnel endpoints may authenticate each other during tunnel
  4432.       establishment.  This authentication has the same security
  4433.       attributes as CHAP, and has reasonable protection against reply
  4434.       and snooping.
  4435.  
  4436.       Once the tunnel endpoints have authenticated, a derived Key may be
  4437.       carried in subsequent packets, which provides mild protection
  4438.       against brief or "accidental" attacks.  There is no cryptographic
  4439.       strength to these Keys, and any attacker which can snoop packets
  4440.       can take control of the tunnel.
  4441.  
  4442.       For L2TP tunnels over IP, IP-level packet security provides very
  4443.       strong protection of the tunnel.  This requires no modification to
  4444.       the L2TP protocol, and leverages extensive IETF work in this area.
  4445.  
  4446.       For L2TP tunnels over Frame Relay or other switched networks, cur-
  4447.       rent practice indicates that these media are much less likely to
  4448.       experience attacks of in-transit data.  If these attacks became
  4449.       prevalent, either the media or the L2TP packets would have to be
  4450.       encrypted.
  4451.  
  4452.    9.2 Client Security
  4453.  
  4454.       A more systematic method of protection in tunneled PPP environ-
  4455.       ments may be achieved through client security.  PPP layer encryp-
  4456.       tion would provide end-to-end security for both direct dial-in
  4457.       clients as well as PPP clients carried within a tunnel.  With this
  4458.       level of client security, sessions are protected against attacks
  4459.       against the carrying tunnel, as well as attacks on the LAC itself.
  4460.       Because both encryption and compression can occur at the PPP
  4461.       layer, the two can be coordinated, permitting compression to pre-
  4462.       cede encryption.
  4463.  
  4464.    9.3 Proxy Authentication
  4465.  
  4466.       The optional proxy CHAP function of L2TP can permit an entirely
  4467.       transparent PPP tunnel, with a single LCP and CHAP sequence being
  4468.       seen by the client.  For cases where the LAC and the entire path
  4469.       to the LNS are operated by a single entity, this function may pro-
  4470.       vide acceptable security.  For cases where LNS-initiated authenti-
  4471.       cation is required, proxy CHAP still permits an initial access
  4472.       decision to be made before accepting the tunnel, permitting the
  4473.       LNS in most cases to reject tunnel initiations rather than accept
  4474.       them and later disconnect.
  4475.  
  4476.       The optional proxy PAP may result in the cleartext password
  4477.       traversing the tunnel.  Where PAP is being used in conjunction
  4478.  
  4479.  
  4480.  
  4481. Valencia                    expires May 1997                    [Page 68]
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487. INTERNET DRAFT                                             December 1996
  4488.  
  4489.  
  4490.       with static passwords, this may pose a significant security issue.
  4491.       Where PAP is only used to transport one-time passwords, such
  4492.       issues may be greatly mitigated.  The H bit of the carrying AVP
  4493.       may be used to protect against this.
  4494.  
  4495. 10.0 Acknowledgments
  4496.  
  4497.    The AVP construct comes from Glen Zorn, who thought up the framework
  4498.    for permitting multiple vendors to contribute to a common attribute
  4499.    space in a relatively orderly fashion.
  4500.  
  4501.    Dory Leifer and Allan Rubens of Ascend Communications made valuable
  4502.    refinements to the protocol definition of L2TP and contributed to the
  4503.    editing of this document.
  4504.  
  4505. 11.0 Contacts
  4506.  
  4507.    Kory Hamzeh
  4508.    Ascend Communications
  4509.    1275 Harbor Bay Parkway
  4510.    Alameda, CA 94502
  4511.    kory@ascend.com
  4512.  
  4513.    Tim Kolar, Morgan Littlewood, Andrew J. Valencia
  4514.    Cisco Systems
  4515.    170 West Tasman Drive
  4516.    San Jose CA 95134-1706
  4517.    tkolar@cisco.com
  4518.    littlewo@cisco.com
  4519.    vandys@cisco.com
  4520.  
  4521.    Gurdeep Singh Pall
  4522.    Microsoft Corporation
  4523.    Redmond, WA
  4524.    gurdeep@microsoft.com
  4525.  
  4526.    Jeff Taarud
  4527.    (formerly of 3COM Corporation, no current contact)
  4528.  
  4529.    William Verthein
  4530.    U.S. Robotics
  4531.  
  4532. 12.0 References
  4533.  
  4534.  
  4535.    [1] W. Simpson, "The Point-to-Point Protocol (PPP)", RFC 1661,
  4536.       07/21/1994
  4537.  
  4538.    [2] A. Valencia, M. Littlewood, T. Kolar, "Layer 2 Forwarding", Internet
  4539.       draft, April 1996
  4540.  
  4541.    [3] K. Hamzeh, G. Pall, W. Verthein, J. Taarud, W. Little, "Point-to-Point
  4542.       Tunneling Protocol", Internet draft, June 1996
  4543.  
  4544.  
  4545.  
  4546.  
  4547. Valencia                    expires May 1997                    [Page 69]
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553. INTERNET DRAFT                                             December 1996
  4554.  
  4555.  
  4556.    [4] P. Mockapetris, "Domain Names - Concepts and Facilities", RFC1034,
  4557.       November 1987
  4558.  
  4559.    [5] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC 1340,
  4560.       USC/Information Sciences Institute, July 1992.
  4561.  
  4562.    [6] Sally Floyd, Van Jacobson, "Random Early Detection Gateways for
  4563.       Congestion Avoidance", IEEE/ACM Transactions on Networking,
  4564.       August 1993
  4565.  
  4566.    [7] D. Carrel, L. Grant, "The TACACS+ Protocol", draft-grant-tacacs-00.txt,
  4567.       October 1996
  4568.  
  4569.    [8] C. Rigney, A. Rubens, W. A. Simpson, S. Willens.  "Remote Authentication
  4570.       Dial In User Service (RADIUS)." draft-ietf-radius-radius-05.txt,
  4571.       Livingston, Merit, Daydreamer, July 1996.
  4572.  
  4573. Appendix A: Acknowledgment Time-Outs
  4574.  
  4575.    L2TP uses sliding windows and time-outs to provide both user session
  4576.    flow-control across the underlying medium (which may be an internet-
  4577.    work) and to perform efficient data buffering to keep the LAC-LNS
  4578.    data channels full without causing receive buffer overflow.  L2TP
  4579.    requires that a time-out be used to recover from dropped data or
  4580.    acknowledgment packets.  The exact implementation of the time-out is
  4581.    vendor-specific.  It is suggested that an adaptive time-out be imple-
  4582.    mented with backoff for congestion control.  The time-out mechanism
  4583.    proposed here has the following properties:
  4584.  
  4585.       Independent time-outs for each session.  A device (LAC or LNS)
  4586.       will have to maintain and calculate time-outs for every active
  4587.       session.
  4588.  
  4589.       An administrator-adjustable maximum time-out, MaxTimeOut, unique
  4590.       to each device.
  4591.  
  4592.       An adaptive time-out mechanism that compensates for changing
  4593.       throughput.  To reduce packet processing overhead, vendors may
  4594.       choose not to recompute the adaptive time-out for every received
  4595.       acknowledgment.  The result of this overhead reduction is that the
  4596.       time-out will not respond as quickly to rapid network changes.
  4597.  
  4598.       Timer backoff on time-out to reduce congestion.  The backed-off
  4599.       timer value is limited by the configurable maximum time-out value.
  4600.       Timer backoff is done every time an acknowledgment time-out
  4601.       occurs.
  4602.  
  4603.    In general, this mechanism has the desirable behavior of quickly
  4604.    backing off upon a time-out and of slowly decreasing the time-out
  4605.    value as packets are delivered without time-outs.
  4606.  
  4607.    Some definitions:
  4608.  
  4609.       Packet Processing Delay, "PPD", is the amount of time required for
  4610.  
  4611.  
  4612.  
  4613. Valencia                    expires May 1997                    [Page 70]
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619. INTERNET DRAFT                                             December 1996
  4620.  
  4621.  
  4622.       each peer to process the maximum amount of data buffered in their
  4623.       offered receive packet window.  The PPD is the value exchanged
  4624.       between the LAC and LNS when a call is established.  For the LNS,
  4625.       this number should be small.  For an LAC supporting modem connec-
  4626.       tions, this number could be significant.
  4627.  
  4628.       "Sample" is the actual amount of time incurred receiving an
  4629.       acknowledgment for a packet.  The Sample is measured, not calcu-
  4630.       lated.
  4631.  
  4632.       Round-Trip Time, "RTT", is the estimated round-trip time for an
  4633.       Acknowledgment to be received for a given transmitted packet.
  4634.       When the network link is a local network, this delay will be mini-
  4635.       mal (if not zero).  When the network link is the Internet, this
  4636.       delay could be substantial and vary widely.  RTT is adaptive: it
  4637.       will adjust to include the PPD and whatever shifting network
  4638.       delays contribute to the time between a packet being transmitted
  4639.       and receiving its acknowledgment.
  4640.  
  4641.       Adaptive Time-Out, "ATO", is the time that must elapse before an
  4642.       acknowledgment is considered lost.  After a time-out, the sliding
  4643.       window is partially closed and the ATO is backed off.
  4644.  
  4645. Packet Processing Delay (PPD)
  4646.  
  4647.    The PPD parameter is a 16-bit time value exchanged during the Call
  4648.    Control phase expressed in units of tenths of a second (64 means 6.4
  4649.    seconds).  The protocol only specifies that the parameter is
  4650.    exchanged, it does not specify how it is calculated.  The way values
  4651.    for ATO are calculated is implementation-dependent and need not be
  4652.    variable (static time-outs are allowed).  IF adaptive time-outs are
  4653.    to be used then the PPD should be exchanged in the call connect
  4654.    sequences.  A possible way to calculate the PPD is:
  4655.  
  4656.    PPD = ((PPP_MAX_DATA_MTU - Header) * WindowSize * 8) / ConnectRate
  4657.         + LACFudge  (for an LAC)
  4658.    or
  4659.    PPD = ((PPP_MAX_DATA_MTU - Header) * WindowSize * 8) / AvePathRate
  4660.         + LNSFudge  (for an LNS)
  4661.  
  4662.    Header is the total size of the L2TP and media dependent headers.
  4663.    MTU is the overall MTU for the link between the LAC and LNS.  Window-
  4664.    Size represents the number of packets in the sliding window, and is
  4665.    implementation-dependent.  The latency of the underlying connection
  4666.    path between the LAC and LNS could be used to pick a window size suf-
  4667.    ficient to keep the current session's pipe full.  The constant 8 con-
  4668.    verts octets to bits (assuming ConnectRate is in bits per second).
  4669.    If ConnectRate is in bytes per second, omit the 8.  LACFudge and LNS-
  4670.    Fudge are not required but can be used to take overall processing
  4671.    overhead of the LAC or LNS into account.
  4672.  
  4673.    In the case of the computed PPD for an LNS, AvePathRate is the aver-
  4674.    age bit rate of the path between the LNS and LAC.  Given that this
  4675.    number is probably very large and WindowSize is relatively small,
  4676.  
  4677.  
  4678.  
  4679. Valencia                    expires May 1997                    [Page 71]
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685. INTERNET DRAFT                                             December 1996
  4686.  
  4687.  
  4688.    LNSFudge will be the dominant factor in the computation of PPD.  It
  4689.    is recommended that the minimum value of PPD be on the order of 0.5
  4690.    second.
  4691.  
  4692.    The value of PPD is used to seed the adaptive algorithm with the ini-
  4693.    tial RTT[n-1] value.
  4694.  
  4695. A.1 Calculating Adaptive Acknowledgment Time-Out
  4696.  
  4697.    We still must decide how much time to allow for acknowledgments to
  4698.    return.  If the time-out is set too high, we may wait an unnecessar-
  4699.    ily long time for dropped packets.  If the time-out is too short, we
  4700.    may time out just before the acknowledgment arrives.  The acknowledg-
  4701.    ment time-out should also be reasonable and responsive to changing
  4702.    network conditions.
  4703.  
  4704.    The suggested adaptive algorithm detailed below is based on the TCP
  4705.    1989 implementation and is explained in Richard Steven's book TCP/IP
  4706.    Illustrated, Volume 1 (page 300).  'n' means this iteration of the
  4707.    calculation, and 'n-1' refers to values from the last calculation.
  4708.  
  4709.       DIFF[n] = SAMPLE[n] - RTT[n-1] DEV[n] = DEV[n-1] + (beta *
  4710.       (|DIFF[n]| - DEV[n-1])) RTT[n] = RTT[n-1] + (alpha * DIFF[n])
  4711.       ATO[n] = MIN (RTT[n] + (chi * DEV[n]), MaxTimeOut)
  4712.  
  4713.       DIFF represents the error between the last estimated round-trip
  4714.       time and the measured time.  DIFF is calculated on each iteration.
  4715.  
  4716.       DEV is the estimated mean deviation.  This approximates the stan-
  4717.       dard deviation.  DEV is calculated on each iteration and stored
  4718.       for use in the next iteration.  Initially, it is set to 0.
  4719.  
  4720.       RTT is the estimated round-trip time of an average packet.  RTT is
  4721.       calculated on each iteration and stored for use in the next itera-
  4722.       tion.  Initially, it is set to PPD.
  4723.  
  4724.       ATO is the adaptive time-out for the next transmitted packet.  ATO
  4725.       is calculated on each iteration.  Its value is limited, by the MIN
  4726.       function, to be a maximum of the configured MaxTimeOut value.
  4727.  
  4728.       Alpha is the gain for the average and is typically 1/8 (0.125).
  4729.  
  4730.       Beta is the gain for the deviation and is typically 1/4 (0.250).
  4731.  
  4732.       Chi is the gain for the time-out and is typically set to 4.
  4733.  
  4734.    To eliminate division operations for fractional gain elements, the
  4735.    entire set of equations can be scaled.  With the suggested gain con-
  4736.    stants, they should be scaled by 8 to eliminate all division.  To
  4737.    simplify calculations, all gain values are kept to powers of two so
  4738.    that shift operations can be used in place of multiplication or divi-
  4739.    sion.  The above calculations are carried out each time an acknowl-
  4740.    edgment is received for a packet that was not retransmitted (no time-
  4741.    out occurs).
  4742.  
  4743.  
  4744.  
  4745. Valencia                    expires May 1997                    [Page 72]
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751. INTERNET DRAFT                                             December 1996
  4752.  
  4753.  
  4754. A.2 Congestion Control: Adjusting for Time-Out
  4755.  
  4756.    This section describes how the calculation of ATO is modified in the
  4757.    case where a time-out does occur.  When a time-out occurs, the time-
  4758.    out value should be adjusted rapidly upward.  Although L2TP payload
  4759.    packets are not retransmitted when a time-out occurs, the time-out
  4760.    should be adjusted up toward a maximum limit.  To compensate for
  4761.    shifting internetwork time delays, a strategy must be employed to
  4762.    increase the time-out when it expires.  A simple formula called
  4763.    Karn's Algorithm is used in TCP implementations and may be used in
  4764.    implementing the backoff timers for the LNS or the LAC.  Notice that
  4765.    in addition to increasing the time-out, we also shrink the size of
  4766.    the window as described in the next section.
  4767.  
  4768.    Karn's timer backoff algorithm, as used in TCP, is:
  4769.  
  4770.       NewTIMEOUT = delta * TIMEOUT
  4771.  
  4772.    Adapted to our time-out calculations, for an interval in which a
  4773.    time-out occurs, the new time-out interval ATO is calculated as:
  4774.  
  4775.       RTT[n] = delta * RTT[n-1] DEV[n] = DEV[n-1] ATO[n] = MIN (RTT[n] +
  4776.       (chi * DEV[n]), MaxTimeOut)
  4777.  
  4778.    In this modified calculation of ATO, only the two values that con-
  4779.    tribute to ATO and that are stored for the next iteration are calcu-
  4780.    lated.  RTT is scaled by delta, and DEV is unmodified.  DIFF is not
  4781.    carried forward and is not used in this scenario.  A value of 2 for
  4782.    Delta, the time-out gain factor for RTT, is suggested.
  4783.  
  4784. Appendix B:  Acknowledgment Time-Out and Window Adjustment
  4785.  
  4786. B.1 Initial Window Size
  4787.  
  4788.    Although each side has indicated the maximum size of its receive win-
  4789.    dow, it is recommended that a slow start method be used to begin
  4790.    transmitting data.  The initial window size on the transmitter is set
  4791.    to half the maximum size the receiver requested, with a minimum size
  4792.    of one packet.  The transmitter stops sending packets when the number
  4793.    of packets awaiting acknowledgment is equal to the current window
  4794.    size.  As the receiver successfully digests each window, the window
  4795.    size on the transmitter is bumped up by one packet until the maximum
  4796.    is reached.  This method prevents a system from flooding an already
  4797.    congested network because no history has been established.
  4798.  
  4799.    When for any reason an LAC or LNS receives more data than it can
  4800.    queue for the tunnel, a packet must be discarded.  In this case, it
  4801.    is recommended that a "random early discard" algorithm [6] be used
  4802.    rather than the obvious "drop last" algorithm.
  4803.  
  4804. B.2 Closing the Window
  4805.  
  4806.    When a time-out does occur on a packet, the sender adjusts the size
  4807.    of the transmit window down to one half its value when it failed.
  4808.  
  4809.  
  4810.  
  4811. Valencia                    expires May 1997                    [Page 73]
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817. INTERNET DRAFT                                             December 1996
  4818.  
  4819.  
  4820.    Fractions are rounded up, and the minimum window size is one.
  4821.  
  4822. B.3 Opening the Window
  4823.  
  4824.    With every successful transmission of a window's worth of packets
  4825.    without a time-out, the transmit window size is increased by one
  4826.    packet until it reaches the maximum window size that was sent by the
  4827.    other side when the call was connected.  As stated earlier, no
  4828.    retransmission is done on a time-out.  After a time-out, the trans-
  4829.    mission resumes with the window starting at one half the size of the
  4830.    transmit window when the time-out occurred and adjusting upward by
  4831.    one each time the transmit window is filled with packets that are all
  4832.    acknowledged without time-outs.
  4833.  
  4834. B.4 Window Overflow
  4835.  
  4836.    When a receiver's window overflows with too many incoming packets,
  4837.    excess packets are thrown away.  This situation should not arise if
  4838.    the sliding window procedures are being properly followed by the
  4839.    transmitter and receiver.  It is assumed that, on the transmit side,
  4840.    packets are buffered for transmission and are no longer accepted from
  4841.    the packet source when the transmit buffer fills.
  4842.  
  4843. Appendix C: Handling of out-of-order packets
  4844.  
  4845.    When the Sequence Number and Acknowledgment Number fields are present
  4846.    in payload packets, they are used to manage packet rate.  In addi-
  4847.    tion, they may be used to handle out-of-order arrival of packets.  A
  4848.    simple L2TP client would simply discard any packet other than a
  4849.    packet with a sequence greater than that last received; if packets 1,
  4850.    2, 3 arrived as 1, 3, 2, this would result in packet 2 being dis-
  4851.    carded.
  4852.  
  4853.    Such behavior does not affect the L2TP protocol itself, but signifi-
  4854.    cantly improved throughput in such environments may be attained by
  4855.    queueing and reordering packets when they arrive out of order.  The
  4856.    number of packets to be queued is a function of memory resources on
  4857.    the L2TP implementation, but should never be more than 1/4 of the
  4858.    total sequence number space (i.e., 16384 packets), to avoid aliasing.
  4859.  
  4860.    An implementation which queues packets in this way must also employ
  4861.    an algorithm for deciding that a given sequence number corresponds to
  4862.    a packet which is lost, rather than one which is out of order but
  4863.    still in transit.  Such a decision would likely be based upon timing,
  4864.    buffering conditions, and packet arrival characteristics.  The
  4865.    details of such a tradeoff are outside the scope of this specifica-
  4866.    tion, but it is recommended a packet should be afforded an interval
  4867.    at least twice the estimated RTT from the L2TP peer.
  4868.  
  4869. Appendix D: Transport Layer Adaptive Time-outs and Window Adjustment
  4870.  
  4871.    Appendixes A, B, and C dealt with operation of the payload packet
  4872.    sessions of L2TP.  This Appendix explains how these three algorithms
  4873.    pertain to the transport layer for L2TP control sessions.  Appendix
  4874.  
  4875.  
  4876.  
  4877. Valencia                    expires May 1997                    [Page 74]
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883. INTERNET DRAFT                                             December 1996
  4884.  
  4885.  
  4886.    B, Time-out Window Management, directly applies to the Transport
  4887.    Layer except in the case where a window size of 1 is being used.
  4888.    Appendix C, does not really apply because, for the Control Session,
  4889.    control messages MUST always be processed by the receiver in order.
  4890.    Also, there are no lost control packets because they are retransmit-
  4891.    ted by the L2TP Transport Layer.  Thus, the main topic of this
  4892.    Appendix is how to adapt the example adaptive time-out algorithm of
  4893.    Appendix A to the Control Session Transport Layer.
  4894.  
  4895.    There are two main differences between the Control Session and pay-
  4896.    load sessions: 1) Unlike lost payload packets, lost control messages
  4897.    are retransmitted and 2) There is no Packet Processing Delay value
  4898.    provided in the control session setup messages.  The latter affects
  4899.    the manner in which the initial value of the RTT estimate is deter-
  4900.    mined.  The former really doesn't affect the algorithm at all, except
  4901.    that upon a time-out, retransmission of unacknowledged control mes-
  4902.    sages should be attempted, up to the number that fit in the sliding
  4903.    window with size computed as in Appendix B.
  4904.  
  4905.    Using the symbol definitions of Appendix A, the calculation of the
  4906.    value for the PPD of the remote peer can be estimated as:
  4907.  
  4908.    PPD = ((PPP_MAX_DATA_MTU - Header) * WindowSize * 8) / AvePathRate
  4909.         + Fudge
  4910.  
  4911.    This is simply the number of bits in a full control session window
  4912.    divided by the average speed of the path between the LAC and LNS with
  4913.    a fudge factor added on to make it work.  In cases where the average
  4914.    rate of the connection between LAC and LNS isn't known, it is sug-
  4915.    gested that some value be configured that is associated with each
  4916.    possible peer.  Because Control Session windows will most likely be
  4917.    small and the connection speed will be quite high, fudge will be the
  4918.    dominant factor in this calculation.  For this reason, just configur-
  4919.    ing a single fixed initial PPD estimate to be used for all possible
  4920.    peers will probably provide adequate results.  This fudge factor
  4921.    should probably be at least 0.5 second.
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943. Valencia                    expires May 1997                    [Page 75]
  4944.  
  4945.  
  4946.