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-07.txt < prev    next >
Text File  |  1997-10-21  |  239KB  |  5,739 lines

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