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-06.txt < prev    next >
Text File  |  1997-08-28  |  216KB  |  5,211 lines

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