<?xml version='1.0'?> <?xml-stylesheet type='text/xsl'
href='http://xml.resource.org/authoring/rfc2629.xslt' ?> 
<!DOCTYPE rfc
SYSTEM 'rfc2629.dtd' [ <!ENTITY rfc2629 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml'>
<!ENTITY ikev2 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-ipsec-ikev2.xml'>
<!ENTITY pana-threats-eval PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pana-threats-eval.xml'>
<!ENTITY pana-requirements PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pana-requirements.xml'>
<!ENTITY context-transfer PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-seamoby-ctp.xml'>
<!ENTITY diameter-eap PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-aaa-eap.xml'>
<!ENTITY eap-keying PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-eap-keying.xml'>
<!ENTITY ike-dpd PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-ipsec-dpd.xml'>
<!ENTITY pana-ipsec PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pana-ipsec.xml'>
<!ENTITY pana-dhcp PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.tschofenig-pana-bootstrap-rfc3118.xml'>
<!ENTITY pana-framework PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pana-framework.xml'>
<!ENTITY pana-snmp PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pana-snmp.xml'>
<!ENTITY aaaarch-handoff PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.irtf-aaaarch-handoff'>
<!ENTITY eap-statemachine PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-eap-statemachine.xml'>
<!ENTITY rfc2119 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY rfc2131 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2131.xml'>
<!ENTITY rfc2988 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2988.xml'>
<!ENTITY rfc2716 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2716.xml'>
<!ENTITY rfc2409 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2409.xml'>
<!ENTITY rfc2234 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2234.xml'>
<!ENTITY rfc3588 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3588.xml'>
<!ENTITY rfc2522 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2522.xml'>
<!ENTITY rfc2478 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2478.xml'>
<!ENTITY rfc3329 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3329.xml'>
<!ENTITY rfc3315 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3315.xml'>
<!ENTITY rfc2462 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2462.xml'> 
<!ENTITY rfc2464 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2464.xml'>
<!ENTITY rfc3456 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3456.xml'> 
<!ENTITY rfc3748 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3748.xml'>]
>

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>

<rfc ipr='full3667' docName='draft-ietf-pana-pana-07a'>

  <front>

    <title abbrev="PANA">
      Protocol for Carrying Authentication for Network Access (PANA)
    </title>

    <author initials="D." surname="Forsberg"
      fullname="Dan Forsberg">
      <organization abbrev="Nokia">
	Nokia Research Center
      </organization>
      <address>
	<postal>
	  <street>P.O. Box 407</street>
	  <city>FIN-00045 NOKIA GROUP</city>
	  <country>Finland</country>
	</postal>
	<phone>+358 50 4839470</phone>
        <email>dan.forsberg@nokia.com</email>
      </address>
    </author>
                                                                                
    <author initials="Y." surname="Ohba (Ed.)"
      fullname="Yoshihiro Ohba">
      <organization abbrev="Toshiba">
	Toshiba America Research, Inc.
      </organization>
      <address>
	<postal>
	  <street>1 Telcordia Drive</street>
	  <city>Piscataway</city>
	  <region>NJ</region>
	  <code>08854</code>
	  <country>USA</country>
	</postal>
	<phone>+1 732 699 5305</phone>
	<email>yohba@tari.toshiba.com</email>
      </address>
    </author>
                                                                                
    <author initials="B." surname="Patil"
      fullname="Basavaraj Patil">
      <organization abbrev="Nokia">
	Nokia
      </organization>
      <address>
	<postal>
	  <street>6000 Connection Dr.</street>
	  <city>Irving</city>
	  <region>TX</region>
	  <code>75039</code>
	  <country>USA</country>
	</postal>
	<phone>+1 972-894-6709</phone>
	<email>Basavaraj.Patil@nokia.com</email>
      </address>
    </author>

    <author initials="H." surname="Tschofenig"
      fullname="Hannes Tschofenig">
      <organization abbrev="Siemens">
	Siemens Corporate Technology
      </organization>
      <address>
	<postal>
	  <street>Otto-Hahn-Ring 6</street>
	  <region>81739 Munich</region>
	  <country>Germany</country>
	</postal>
	<email>Hannes.Tschofenig@siemens.com</email>
      </address>
    </author>
    <author initials="A.E." surname="Yegin"
      fullname="Alper E. Yegin">
      <organization abbrev="Samsung">
	Samsung Advanced Institute of Technology
      </organization>
      <address>
	<postal>
	  <street>75 West Plumeria Drive</street>
	  <city>San Jose</city>
	  <region>CA</region>
	  <code>95134</code>
	  <country>USA</country>
	</postal>
	<phone>+1 408 544 5656</phone>
	<email>alper.yegin@samsung.com</email>
      </address>
    </author>

    <date month="December" year="2004"/>
    <workgroup>PANA Working Group </workgroup>

    <abstract>
      <t>
        This document defines the Protocol for Carrying Authentication
        for Network Access (PANA), a link-layer agnostic transport for
        Extensible Authentication Protocol (EAP) to enable network
        access authentication between clients and access networks.
        PANA can carry any authentication method that can be specified
        as an EAP method, and it can be used on any link that can
        carry IP.  PANA protocol specification covers the
        client-to-network access authentication part of an overall
        secure network access framework, which additionally includes
        other protocols and mechanisms for service provisioning,
        access control as a result of initial authentication, and
        accounting.
      </t>
    </abstract>

  </front>
  <middle>
    <section title='Introduction'>
      <t>
        Providing secure network access service requires access
        control based on the authentication and authorization of the
        clients and the access networks.  Client-to-network
        authentication provides parameters that are needed to police
        the traffic flow through the enforcement points.  A protocol
        is needed to carry authentication methods between the client
        and the access network.
      </t>
      <t>
        Currently there is no standard network-layer solution for
        authenticating clients for network access.  Appendix A of
        <xref target='I-D.ietf-pana-requirements'/> describes the
        problem statement that led to the development of PANA.
      </t>
      <t>
        Scope of this work is identified as designing a link-layer
        agnostic transport for network access authentication methods.
        The Extensible Authentication Protocol (EAP) <xref
        target='RFC3748'/> provides such authentication methods.  In
        other words, PANA will carry EAP which can carry various
        authentication methods.  By the virtue of enabling transport
        of EAP above IP, any authentication method that can be carried
        as an EAP method is made available to PANA and hence to any
        link-layer technology.  There is a clear division of labor
        between PANA (an EAP lower layer), EAP and EAP methods as
        described in <xref target='RFC3748'/>.
      </t>
      <t>
        Various environments and usage models for PANA are identified
        in Appendix A of <xref target='I-D.ietf-pana-requirements'/>.
        Potential security threats for network-layer access
        authentication protocol are discussed in <xref
        target='I-D.ietf-pana-threats-eval'/>.  These have been
        essential in defining the requirements <xref
        target='I-D.ietf-pana-requirements'/> on the PANA protocol.
        Note that some of these requirements are imposed by the chosen
        payload, EAP <xref target='RFC3748'/>.
      </t>
      <t>
        There are components that are part of a complete secure
        network solution but are outside of the PANA protocol
        specification, including IP address configuration,
        authentication method choice, filter rule installation, data
        traffic protection and PAA-EP protocol.  These components are
        described in separate documents (see <xref
        target='I-D.ietf-pana-framework'/> and <xref
        target='I-D.ietf-pana-snmp'/>).  The readers are recommended
        to go through the PANA Framework document <xref
        target='I-D.ietf-pana-framework'/> prior to reading this
        protocol specification document.
      </t>
      <section title="Specification of Requirements">
        <t>
          In this document, several words are used to signify the
          requirements of the specification.  These words are often
          capitalized.  The key words "MUST", "MUST NOT", "REQUIRED",
          "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",
          "MAY", and "OPTIONAL" in this document are to be interpreted
          as described in <xref target="RFC2119" />.
        </t>
      </section>
    </section>
    <section anchor='section-terminology' title='Terminology'>
      <list style='hanging'>
	<vspace blankLines="1"/>
        <t hangText='PANA Client (PaC):'>
	  <vspace blankLines="1"/>
	  <t>
            The client side of the protocol that resides in the access
            device (e.g., laptop, PDA, etc.).  It is responsible for
            providing the credentials in order to prove its identity
            for network access authorization.
	  </t>
        </t>
	<vspace blankLines="1"/>
        <t hangText='PANA Authentication Agent (PAA):'>
	  <vspace blankLines="1"/>
	  <t>
	    The protocol entity in the access network whose
	    responsibility is to verify the credentials provided by a
	    PANA client (PaC) and authorize network access to the
	    device associated with the client and identified by a
	    Device Identifier (DI).  Note the authentication and
	    authorization procedure can, according to the EAP model,
	    be also offloaded to the backend AAA infrastructure.
	  </t>
        </t>
	<vspace blankLines="1"/>
        <t hangText='PANA Session:'>
	  <vspace blankLines="1"/>
	  <t>
	    A PANA session begins with the handshake between the PANA
	    Client (PaC) and the PANA Authentication Agent (PAA), and
	    terminates as a result of an authentication failure, a
	    timeout, or an explicit termination message.  A fixed
	    session identifier is maintained throughout a session.  A
	    session cannot be shared across multiple network
	    interfaces.
	  </t>
        </t>
	<vspace blankLines="1"/>
        <t hangText='Session Identifier:'>
	  <vspace blankLines="1"/>
	  <t>
	    This identifier is used to uniquely identify a PANA
	    session on the PAA and PaC.  It includes an identifier of
	    the PAA, therefore it cannot be shared across multiple
	    PAAs.  It is included in PANA messages to bind the message
	    to a specific PANA session.  This bidirectional identifier
	    is allocated by the PAA following the handshake and freed
	    when the session terminates.
	  </t>
        </t>
	<vspace blankLines="1"/>
        <t hangText='PANA Security Association (PANA SA):'>
	  <vspace blankLines="1"/>
	  <t>
	    A PANA security association is a relationship between the
	    PaC and PAA, formed by the sharing of cryptographic keying
	    material and associated context.  Security associations
	    are duplex.  That is, one security association is needed
	    to protect the bidirectional traffic between the PaC and
	    the PAA.
	  </t>
        </t>
	<vspace blankLines="1"/>
        <t hangText='Device Identifier (DI):'>
	  <vspace blankLines="1"/>
	  <t>
	    The identifier used by the network as a handle to control
	    and police the network access of a client.  Depending on
	    the access technology, this identifier may contain an
	    address that is carried in protocol headers (e.g., IP or
	    link-layer address), or a locally significant identifier
	    that is made available by the local protocol stack (e.g.,
	    circuit id, PPP interface id) of a connected device.
	  </t>
        </t>
	<vspace blankLines="1"/>
        <t hangText='Enforcement Point (EP):'>
	  <vspace blankLines="1"/>
	  <t>
            A node on the access network where per-packet enforcement
            policies (i.e., filters) are applied on the inbound and
            outbound traffic of client devices.  Information such as
            the DI and (optionally) cryptographic keys are provided by
            the PAA per client for generating filters on the EP.  EP
            and PAA may be co-located.
	  </t>
        </t>
	<vspace blankLines="1"/>
        <t hangText='Network Access Provider (NAP):'>
	  <vspace blankLines="1"/>
	  <t>
	    A service provider that provides physical and link-layer
	    connectivity to an access network it manages.
	  </t>
        </t>
	<vspace blankLines="1"/>
        <t hangText='AAA-Key:'>
	  <vspace blankLines="1"/>
	  <t>
	    A key derived by the EAP peer and EAP server and
	    transported to the authenticator <xref
	    target='I-D.ietf-eap-keying'/>.
	  </t>
        </t>
      </list>
    </section>
    <section title='Protocol Overview'>
      <t>
	The PANA protocol is run between a client (PaC) and a server
	(PAA) in order to perform authentication and authorization for
	the network access service.
      </t>
      <t>
	The protocol messaging consists of a series of request and
	responses, some of which may be initiated by either ends. Each
	message can carry zero or more AVPs as payload.  The main
	payload of PANA is EAP which performs authentication. PANA
	helps PaC and PAA establish an EAP session.
      </t>
      <t>
	PANA is a UDP-based protocol.  It has its own retransmission
	mechanism to reliably deliver messages.
      </t>
      <t>
	PANA messages are sent between a PaC and PAA as part of a PANA
	session.  A PANA session consists of distinct phases:
      </t>
      <list style='symbols'>
	<vspace blankLines="1"/>
	<t>
	  Discovery and handshake phase: This is the phase that
	  initiates a new PANA session.  The PaC discovers the PAA(s)
	  by either explicitly soliciting advertisements for them or
	  receiving unsolicited advertisements.  The PaC's answer sent
	  in response to an advertisement starts a new session.
	</t>
	<vspace blankLines="1"/>
	<t>
	  Authentication phase: Immediately following the handshake
	  phase is the EAP execution between the PAA and PaC.  The EAP
	  payloads (which carry an EAP method inside) is what is used
	  for authentication.  Authentication phase may involve
	  execution of two EAP sessions back-to-back, one for the NAP
	  and one for the ISP.
	</t>
	<vspace blankLines="1"/>
	<t>
	  Authorized phase: Following a successful PANA authentication
	  phase, the PaC gains access to the network and can send and
	  receive IP data traffic through EP.  During this phase, the
	  PaC and PAA may optionally ping each other to test liveness
	  of the PANA session on each end.
	</t>
	<vspace blankLines="1"/>
	<t>
	  Re-authentication phase: Following an authorized phase, the
	  PAA must initiate re-authentication before the PANA session
	  lifetime expires.  Again EAP is carried by PANA to perform
	  authentication.  This phase may be optionally triggered by
	  both the PaC and the PAA without any respect to the session
	  lifetime.  The session moves to this phase from authorized
	  phase, and returns back there upon successful
	  re-authentication.
	</t>
	<vspace blankLines="1"/>
	<t>
	  Termination phase: The PaC or PAA may choose to discontinue
	  the access service at any time.  An explicit disconnect
	  message can be sent by either end.  If either the PaC or the
	  PAA disconnects without engaging in termination messaging,
	  it is expected that either the expiration of a finite
	  session lifetime or failed liveness tests would do the job.
	</t>
      </list>
      <figure anchor='figure-pana-protocol' 
	title='Illustration of PANA Messages in a Session'>
        <artwork>
  PaC  PAA    Message
-----------------------------------------------------
// Discovery and handshake phase
   -----&gt;     PANA-PAA-Discover
   &lt;-----     PANA-Start-Request
   -----&gt;     PANA-Start-Answer

// Authentication phase
   &lt;-----     PANA-Auth-Request /* EAP Request */
   -----&gt;     PANA-Auth-Answer
   -----&gt;     PANA-Auth-Request /* EAP Response */
   &lt;-----     PANA-Auth-Answer
   &lt;-----     PANA-Bind-Request /* EAP Success */
   -----&gt;     PANA-Bind-Answer

// Authorized phase (IP data traffic allowed)
   &lt;-----     PANA-Ping-Request
   -----&gt;     PANA-Ping-Answer  

// Termination phase
   -----&gt;     PANA-Termination-Request
   &lt;-----     PANA-Termination-Answer
	</artwork>
      </figure>
      <t>
	Note that depending on the environment and deployment the
	protocol flow depicted in <xref
	target='figure-pana-protocol'/> can be abbreviated.
      </t>
      <t>
	Cryptographic protection of messages between the PaC and PAA
	is possible as soon as EAP in conjunction with the EAP method
	exports a shared key.  That shared key is used to create a
	PANA SA.  The PANA SA helps generating per-message
	authentication codes that provide integrity protection and
	authentication.
      </t>
      <t>
	PANA also allows creation of a new PANA session with a new PAA
	out of an existing session with another PAA.  This
	optimization allows PaC achieve quicker authorization without
	having to run EAP upon movement (changing PAAs).
      </t>
      <t>
	Throughout the lifetime of a session, various problems found
	with the incoming messages can generate a PANA error message
	sent in response.
      </t>
    </section>
    <section anchor='section-protocol-details' title='Protocol Details'>
      <t>
	The following sections explain in detail the various phases of
	a PANA session.
      </t>
      <section title='Payload Encoding'>
	<t>
          The payload of any PANA message consists of zero or more
          AVPs (Attribute Value Pairs). The subsequent sections refer
          to these AVPs, therefore the list of AVPs are provided with
          a brief description before more extensive descriptions are
          included later in the document.
	</t>
	<list style='symbols'>
	  <vspace blankLines="1"/>
	  <t>
	    Cookie AVP: contains a random value that is used for
	    making PAA discovery robust against blind resource
	    consumption DoS attacks.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Protection-Capability AVP: contains the type of per-packet
	    protection (link-layer vs. network-layer) when a
	    cryptographic mechanism should be enabled after PANA
	    authentication.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Device-Id AVP: contains a device identifier (link-layer
	    address or an IP address) of the PaC or an EP.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    EAP AVP: contains an EAP PDU.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    MAC AVP: contains a Message Authentication Code that
	    integrity protects the PANA message.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Termination-Cause AVP: contains the reason of session
	    termination.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Result-Code AVP: contains information about the protocol
	    execution results.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Session-Id AVP: contains the PANA session identifier value.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Session-Lifetime AVP: contains the duration of authorized
	    access.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Failed-AVP: contains an offending AVP that caused a
	    failure.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    NAP-Information AVP, ISP-Information AVP: contains the
	    identifier of a NAP and an ISP, respectively.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Key-Id AVP: contains a AAA-Key identifier.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    PPAC AVP: Post-PANA-Address-Configuration AVP.  Used to
	    indicate the available/chosen IP address configuration
	    methods that can be used by the PaC after successful PANA
	    authentication.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Nonce AVP: contains a randomly chosen value that is used
	    in cyrptographic key computations.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    IP-Address AVP: contains an IP Address of the PaC.
	  </t>
	</list>
      </section>
      <section anchor='section-discovery-and-handshake-phase'
	title='Discovery and Handshake Phase'>
	<t>
          When a PaC attaches to a network, and knows that it has to
          discover a PAA, it SHOULD send a PANA-PAA-Discover message
          to a well-known link local multicast address (TBD) and UDP
          port (TBD).  The PAA discovery assumes that the PaC and the
          PAA are one hop away from each other.  If the PaC knows the
          IP address of the PAA (based on pre-configuration), it MAY
          unicast the PANA-PAA-Discover message to that address.
	</t>
	<t>
          When the PAA receives a PANA-PAA-Discover message from a
          PaC, the PAA SHOULD unicast a PANA-Start-Request message to
          the PaC.
	</t>
	<t>
          The PaC MAY also choose to start sending data packets before
          getting authenticated.  The EP in an access network that
          implements PANA SHOULD drop unauthorized packets upon
          receipt.  Additionally, the EP MAY also take this traffic as
          an indication of unauthorized PaC and notify the PAA.  The
          EP-to-PAA notification SHOULD be sent via <xref
          target='I-D.ietf-pana-snmp'/>.  In response, the PAA SHOULD
          send an unsolicited PANA-Start-Request message to the PaC.
          This is called "traffic-driven PAA discovery" (an
          alternative to PaC explicitly soliciting for PAA).  Note
          that this optional feature MAY NOT be present in all
          deployments, therefore PaCs MUST NOT assume its
          availability.
	</t>
	<t>
	  When a PaC receives a PANA-Start-Request message from a PAA,
	  it responds with a PANA-Start-Answer message if it wishes to
	  enter an authentication phase.  
	</t>
	<t>
	  There can be multiple PAAs on the link and a PaC may receive
	  multiple PANA-Start-Request messages from those PAAs.  The
	  authentication and authorization result does not depend on
	  which PAA is chosen by the PaC.  By default the PaC MAY
	  choose the PAA that sent the first response.
	</t>
	<t>
          A PANA-Start-Request message MAY carry a Cookie AVP that
          contains a cookie.  The cookie is used for preventing the
          PAA from resource consumption DoS attacks by blind attackers
          which bombard the PAA with PANA-PAA-Discover messages.  By
          relying on a cookie mechanism the PAA can avoid per-PaC
          state creation until after the PaC can produce the same
          cookie in its PANA-Start-Answer message.  In order to do
          that, the cookie MUST be computed in such a way that it does
          not require any per-session state maintenance on the PAA in
          order to verify the cookie returned in a PANA-Start-Answer
          message.  The PAA discovery that takes advantage of cookies
          is called "stateless PAA discovery".  The exact algorithms
          and syntax used for generating cookies does not affect
          interoperability and hence is not specified here.  An
          example algorithm is described below.
	  <artwork>
   Cookie =
     &lt;secret-version&gt; | HMAC_SHA1( &lt;Device-Id of PaC&gt; , &lt;secret&gt; )
	  </artwork>
	</t>
	<t>
	  where &lt;secret&gt; is a randomly generated secret known
	  only to the PAA, &lt;secret-version&gt; is an index used for
	  choosing the secret for generating the cookie and '|'
	  indicates concatenation.  The secret-version should be
	  changed frequently enough to prevent replay attacks.  The
	  secret key is valid for a certain time frame.
	</t>
	<t>
	  When the PaC sends a PANA-Start-Answer message in response
	  to a PANA-Start-Request containing a Cookie AVP, the answer
	  MUST contain a Cookie AVP with the cookie value copied from
	  the request.
	</t>
	<t>
	  When the PAA receives the PANA-Start-Answer message from the
	  PaC, it verifies the cookie.  The cookie is considered as
	  valid if the received cookie has the expected value.  If the
	  computed cookie is valid, the protocol enters the
	  authentication phase.  Otherwise, it MUST silently discard
	  the received message.
	</t>
	<t>
	  Initial EAP Request MAY be optionally carried by the
	  PANA-Start-Request (as opposed to by a later
	  PANA-Auth-Request) message in order to reduce the number of
	  round-trips.  This optimization SHOULD NOT be used if the
	  PAA discovery is desired to be stateless.
	</t>
	<t>
	  A Protection-Capability AVP and a
	  Post-PANA-Address-Configuration (PPAC) AVP MAY be included
	  in the PANA-Start-Request in order to indicate required and
	  available capabilities for the network access.  These AVPs
	  MAY be used by the PaC for assessing the capability match
	  even before the authentication takes place.  Since these
	  AVPs are provided during the insecure discovery and
	  handshake phase, there are certain security risks involved
	  in using the provided information.  See <xref
	  target='section-security-considerations'/> for further
	  discussion on this.
	</t>
	<t>
	  If the initial EAP Request message is carried in the
	  PANA-Start-Request message, an EAP Response message MUST be
	  carried in the PANA-Start-Answer message returned to the
	  PAA.
	</t>
	<t>
	  The PANA-Start-Request/Answer exchange is needed before
	  entering an authentication phase even when the PaC is
	  pre-configured with PAAs IP address and the
	  PANA-PAA-Discover message is unicast.
	</t>
	<t>
	  A Nonce AVP MUST be included in PANA-Start-Request and
	  PANA-Start-Answer messages.  The nonces are used to
	  establish a PANA SA.
	</t>
	<t>
          A PANA-Start-Request message of a stateless PAA discovery
          MUST NOT be retransmitted as this voids the statelessness on
          the PAA.  Instead, the PaC MUST retransmit the
          PANA-PAA-Discover until it receives a PANA-Start-Request
          message, and retransmit the PANA-Start-Answer message until
          it receives a PANA-Auth-Request message.  The PaC can
          determine whether the PAA is using stateless discovery by
          the presence of Cookie AVP.  The PANA-Start-Request message
          MUST be retransmitted instead of the PANA-Start-Answer
          message when stateful PAA discovery is used.
	</t>
  	<t>
	  It is possible that both the PAA and the PaC initiate the
	  discovery and handshake procedure at the same time, i.e.,
	  the PAA sends a PANA-Start-Request message while the PaC
	  sends a PANA-PAA-Discover message.  To resolve the race
	  condition, the PAA SHOULD silently discard the
	  PANA-PAA-Discover message received from the PaC after it has
	  sent a PANA-Start-Request message with creating a state
	  (i.e., no Cookie AVP is included in the message) for the
	  PaC.  In this case the PAA will retransmit
	  PANA-Start-Request based on a timer, if the PaC doesn't
	  respond in time (message was lost for example).  If the PAA
	  had sent a PANA-Start-Request message without creating a
	  state for the PaC (i.e., a Cookie AVP was included in the
	  message), then it SHOULD answer to the PANA-PAA-Discover
	  message.
	</t>
	<t>
	  <xref target='figure-paa-discovery1'/> shows an example
	  sequence for the discovery and handshake phase when a
	  PANA-PAA-Discover message is sent by the PaC.  <xref
	  target='figure-paa-discovery2'/> shows an example sequence
	  for the discovery and handshake phase that is triggered by
	  data traffic.
	</t>
	<figure anchor='figure-paa-discovery1' 
	  title='Example Sequence for Discovery and Handshake Phase 
	  when PANA-PAA-Discover is sent by PaC'>
	  <artwork>
   PaC      PAA         Message(seqno)[AVPs]
   ------------------------------------------------------
      -----&gt;            PANA-PAA-Discover(0)
      &lt;-----            PANA-Start-Request(x)[Nonce, Cookie]
      -----&gt;            PANA-Start-Answer(x)[Nonce, Cookie]
                        (continued to authentication phase)

	  </artwork>
	</figure>

	<figure anchor='figure-paa-discovery2' 
	  title='Example Sequence for Discovery and Handshake
	  when discovery is triggered by data traffic'>
	  <artwork>
   PaC   EP      PAA    Message(seqno)[AVPs]
   ------------------------------------------------------
    ----&gt;o              (Data packet arrival or L2 trigger)
          ------&gt;       PAA-to-EP protocol, or another mechanism
    &lt;------------       PANA-Start-Request(x)[Nonce, Cookie]
    ------------&gt;       PANA-Start-Answer(x)[Nonce, Cookie]
                        (continued to authentication phase)
                                                                              
	  </artwork>
	</figure>
      </section>
      <section anchor='section-authentication-phase' title='Authentication Phase'>
	<t>
          The main task in authentication phase is to carry EAP
          messages between the PaC and the PAA.  EAP Request and
          Response messages are carried in PANA-Auth-Request messages.
          PANA-Auth-Answer messages are simply used to acknowledge
          receipt of the requests.  As an optimization, a
          PANA-Auth-Answer message MAY include the EAP Response.
          Another optimization allows optionally carrying the first
          EAP Request/Response in PANA-Start-Request/Answer message as
          described in <xref
          target='section-discovery-and-handshake-phase'/>
	</t>
	<t>
          PANA allows execution of two separate authentication
          methods, one with NAP and one with ISP under the same PANA
          session.  This optional feature may be offered by the PAA
          and accepted by the PaC.  When performed separately, the
          result of first EAP authentication is signaled via
          PANA-FirstAuth-End-Request and PANA-FirstAuth-End-Answer
          message exchange which delineates the first method execution
          from the next.  See <xref target='section-nap-isp'/> for a
          detailed discussion on NAP/ISP separate authentication.
       </t>
       <t>
          The result of PANA authentication is carried in a
          PANA-Bind-Request message sent from PAA to PaC.  This
          message carries the final EAP authentication method message
          (whether it is the second method of NAP and ISP separate
          authentication, or the sole authentication method) and the
          result of PANA authentication.  The PANA-Bind-Request
          message MUST be acknowledged with a PANA-Bind-Answer (PBA)
          message.  <xref target='figure-authentication-phase'/> shows
          an example sequence in an authentication phase (no separate
          authentication).
	</t>
	<figure anchor='figure-authentication-phase' 
	  title='Example Sequence in Authentication Phase'>
	  <artwork>
   PaC      PAA  Message(seqno)[AVPs]
   --------------------------------------------------------------------
                 (continued from discovery and handshake phase)
      &lt;-----     PANA-Auth-Request(x+1)
                    [Session-Id, EAP{Request}]
      -----&gt;     PANA-Auth-Answer(x+1)      // No piggybacking EAP-Response
                    [Session-Id]
      -----&gt;     PANA-Auth-Request(y)
                    [Session-Id, EAP{Response}]
      &lt;-----     PANA-Auth-Answer(y)
                    [Session-Id]
      &lt;-----     PANA-Auth-Request(x+2)
                    [Session-Id, EAP{Request}]
      -----&gt;     PANA-Auth-Answer(x+2)      // Piggybacking EAP-Response
                    [Session-Id, EAP{Response}] 
      &lt;-----     PANA-Bind-Request(x+3)
                    [Session-Id, EAP{Success}, Device-Id, 
                     Lifetime, Protection-Cap., PPAC, MAC]
      -----&gt;     PANA-Bind-Answer(x+3)
                    [Session-Id, Device-Id, PPAC, MAC]
	  </artwork>
	</figure>
	<t>
          When an EAP method that is capable of deriving keys is used
          during the authentication phase and the keys are
          successfully derived, the PANA message that carries the EAP
          Success (PANA-FirstAuth-End-Request, PANA-Bind-Request) and
          any subsequent message MUST contain a MAC AVP.
	</t>
	<t>
	  The PANA-Bind-Request and the PANA-Bind-Answer message
	  exchange is also used for binding device identifiers of the
	  PaC and EP(s), and the IP address of the PAA to the PANA
	  SA. To achieve this, the PANA-Bind-Request SHOULD contain
	  the device identifier(s) of the EP(s) in Device-Id AVP(s)
	  when they are either MAC or IP address(es), and the IP
	  address of the PAA in an IP-Address AVP.  PANA-Bind-Answer
	  SHOULD contain PaC's device identifier in a Device-Id AVP
	  when it is already presented with that of EP(s).  The PaC
	  MUST use the same type of device identifier as contained in
	  the PANA-Bind-Request message. This exchange when protected
	  by a MAC AVP prevents man-in-the-middle attacks.  The
	  PANA-Bind-Request message MAY also contain a
	  Protection-Capability AVP to indicate if link-layer or
	  network-layer ciphering should be initiated after PANA.  No
	  link-layer or network-layer specific information is included
	  in the Protection-Capability AVP.  It is assumed that the
	  PAA is aware of the security capabilities of the access
	  network.  The PANA protocol does not specify how the PANA SA
	  and the Protection-Capability AVP will be used to provide
	  per-packet protection for data traffic.
	</t>
	<t>
          Additionally, the PANA-Bind-Request message MUST include a
          Post-PANA-Address-Configuration (PPAC) AVP, which helps the
          PAA to inform the PaC about whether a new IP address MUST be
          configured and the available methods to do so.  The PaC MUST
          include a PPAC AVP in order to indicate its choice of method
          when there is a match between the methods offered by the PAA
          and the methods available on the PaC.  When there is no
          match, a PPAC AVP MUST NOT be included and the Result-Code
          AVP MUST be set to PANA_PPAC_CAPABILITY_UNSUPPORTED in the
          PANA-Bind-Answer message.
	</t>
	<t>
	  PANA-Bind-Request and PANA-Bind-Answer messages MUST be
	  retransmitted based on the retransmission rule described in
	  <xref target='section-seqno'/>.
	</t>
	<t>
	  EAP authentication can fail at a pass-through authenticator
	  without sending an EAP-Failure message <xref
	  target='I-D.ietf-eap-statemachine'/>.  When this occurs, the
	  PAA SHOULD send a PANA-Error-Request message to the PaC with
	  using PANA_UNABLE_TO_COMPLY result code.  The PaC SHOULD not
	  change its state unless the error message is secured by PANA
	  or lower layer.  In any case, a more appropriate way is to
	  rely on a timeout on the PaC.
	</t>
	<t>
	  There is a case where EAP authentication succeeds with
	  producing an EAP-Success message but network access
	  authorization fails due to, e.g., authorization rejected by
	  a AAA proxy or authorization locally rejected by the PAA.
	  When this occurs, the PAA MUST send PANA-Bind-Request with a
	  result code PANA_AUTHORIZATION_REJECTED.  If a AAA-Key is
	  established between the PaC and the PAA by the time when the
	  EAP-Success message is generated by the EAP server (this is
	  the case when the EAP method provides protected success
	  indication), this PANA-Bind message exchange MUST be
	  protected with a MAC AVP and carry a Key-Id AVP.  The
	  AAA-Key and the PANA session MUST be deleted immediately
	  after the PANA-Bind message exchange.
	</t>
      </section>
      <section title='Authorized Phase'>
	<t>
	  Once an authentication phase or a re-authentication phase
	  successfully completes, the PaC gains access to the network
	  and can send and receive IP data traffic through EP and the
	  PANA session enters an authorized phase.  In this phase,
	  PANA-Ping-Request and PANA-Ping-Answer messages can be used
	  for testing the liveness of the PANA session on the PANA
	  peer.  Both the PaC and the PAA are allowed to send a
	  PANA-Ping-Request message to the communicating peer whenever
	  they need to make sure the availability of the session on
	  the peer and expect the peer to return a PANA-Ping-Answer
	  message.  Both PANA-Ping-Request and PANA-Ping-Answer
	  messages MUST be protected with a MAC AVP when a PANA SA is
	  available.
	</t>
	<t>
	  Implementations MUST limit the rate of performing this test.
	  The PaC and the PAA can handle rate limitation on their own,
	  they do not have to perform any coordination with each
	  other.  There is no negotiation of timers for this purpose.
	</t>
	<t>
	  <xref target="figure-liveness-test1"/> and <xref
	  target="figure-liveness-test2"/> show liveness tests as
	  they are initiated by the PaC and the PAA respectively.
	</t>
	<figure anchor='figure-liveness-test1' 
	  title='Example Sequence for PaC-initiated liveness test'>
	  <artwork>
   PaC      PAA     Message(seqno)[AVPs]
   ------------------------------------------------------
      -----&gt;        PANA-Ping-Request(q)[Session-Id, MAC]
      &lt;-----        PANA-Ping-Answer(q)[Session-Id, MAC]
                                                                              
	  </artwork>
	</figure>

	<figure anchor='figure-liveness-test2' 
	  title='Example Sequence for PAA-initiated liveness test'>
	  <artwork>
   PaC      PAA     Message(seqno)[AVPs]
   ------------------------------------------------------
      &lt;-----        PANA-Ping-Request(p)[Session-Id, MAC]
      -----&gt;        PANA-Ping-Answer(p)[Session-Id, MAC]
	  </artwork>
	</figure>
      </section>
      <section title='Re-authentication Phase'>
	<t>
	  A PANA session in an authorized phase can enter a
	  re-authentication phase to extend the current session
	  lifetime by re-executing EAP.  Once the re-authentication
	  phase successfully completes, the session re-enters the
	  authorized phase.  Otherwise, the session is deleted.
	</t>
	<t>
	  When a PaC wants to initiate re-authentication, it sends a
	  PANA-Reauth-Request message to the PAA.  This message MUST
	  contain a Session-Id AVP which is used for identifying the
	  PANA session on the PAA.  If the PAA already has an
	  established PANA session for the PaC with the matching
	  identifier, it MUST first respond with a PANA-Reauth-Answer,
	  followed by a PANA-Auth-Request that starts a new EAP
	  authentication.  If PAA cannot identify the session, it MUST
	  respond with a PANA-Error-Request with the error code
	  PANA_UNKNOWN_SESSION_ID.  PANA-Reauth-Request/Answer
	  messages MUST contain a MAC AVP when PANA SA is available.
	</t>
	<t>
	  PaC may receive a PANA-Auth-Request before receiving the
	  answer to its outstanding PANA-Reauth-Request.  This
	  condition can arise due to packet re-ordering or a race
	  condition between the PaC and PAA when they both attempt to
	  engage in re-authentication.  PaC MUST keep discarding the
	  received PANA-Auth-Requests until it receives the answer to
	  its request.
	</t>
	<t>
	  When the PAA initiates re-authentication, it sends a
	  PANA-Auth-Request message containing the session identifier
	  for the PaC to enter an authentication phase.  PAA SHOULD
	  initiate EAP authentication before the current session
	  lifetime expires.
	</t>
	<t>
	  Re-authentication of an on-going PANA session MUST maintain
	  the existing sequence numbers.
	</t>
	<t>
	  For any re-authentication, if there is an established PANA
	  SA, PANA-Auth-Request and PANA-Auth-Answer messages MUST be
	  protected by adding a MAC AVP to each message.  Any
	  subsequent EAP-based authentication MUST be performed with
	  the same ISP and NAP that was selected during the initial
	  authentication.  An example sequence for a re-authentication
	  initiated by a PaC is shown in <xref
	  target='figure-reauth'/>.
	</t>
	<figure anchor='figure-reauth' 
	  title='Example Sequence for re-authentication initiated by
	  PaC'>
	  <artwork>
   PaC      PAA  Message(seqno)[AVPs]
   ------------------------------------------------------
      -----&gt;     PANA-Reauth-Request(q)
                    [Session-Id, MAC]
      &lt;-----     PANA-Reauth-Answer(q)
                    [Session-Id, MAC]     
      &lt;-----     PANA-Auth-Request(p)
                    [Session-Id, EAP{Request}, MAC]
      -----&gt;     PANA-Auth-Answer(p)        // No piggybacking EAP-Response
                    [Session-Id, MAC] 
      -----&gt;     PANA-Auth-Request(q+1)
                    [Session-Id, EAP{Response}, MAC]
      &lt;-----     PANA-Auth-Answer(q+1)      // No piggybacking EAP-Response
                    [Session-Id, MAC]
      &lt;-----     PANA-Auth-Request(p+1)
                    [Session-Id, EAP{Request}, MAC]
      -----&gt;     PANA-Auth-Answer(p+1)      // Piggybacking EAP-Response
                    [Session-Id, EAP{Response}, MAC]
      &lt;-----     PANA-Bind-Request(p+2)
                    [Session-Id, EAP{Success}, Device-Id, Key-Id, 
                     IP-Address, Lifetime, Protection-Cap., PPAC, MAC]
      -----&gt;     PANA-Bind-Answer(p+2)
                    [Session-Id, Device-Id, Key-Id, PPAC, MAC]
	  </artwork>
	</figure>
      </section>
      <section title='Termination Phase'>
	<t>
	  A procedure for explicitly terminating a PANA session can be
	  initiated either from the PaC (i.e., disconnect indication)
	  or from the PAA (i.e., session revocation).  The
	  PANA-Termination-Request and the PANA-Termination-Answer
	  message exchanges are used for disconnect indication and
	  session revocation procedures.
	</t>
	<t>
	  The reason for termination is indicated in the
	  Termination-Cause AVP.  When there is an established PANA SA
	  established between the PaC and the PAA, all messages
	  exchanged during the termination phase MUST be protected
	  with a MAC AVP.  When the sender of the
	  PANA-Termination-Request receives a valid acknowledgment,
	  all states maintained for the PANA session MUST be deleted
	  immediately.
	</t>
	  <figure anchor='figure-termination' 
	  title='Example Sequence for Session Termination'>
	  <artwork>
   PaC      PAA     Message(seqno)[AVPs]
   ------------------------------------------------------
      -----&gt;        PANA-Termination-Request(q)[Session-Id, MAC]
      &lt;-----        PANA-Termination-Answer(q)[Session-Id, MAC]
                                                                              
 	  </artwork>
	</figure>
      </section>
      <section anchor='section-nap-isp' title='Separate NAP and ISP
      Authentication'>
	<t>
	  PANA allows running at most two EAP sessions in sequence in
	  an authentication phase to support separate NAP and ISP
	  authentication as described in this section.  A typical
	  network access authentication includes execution of one EAP
	  method with the ISP.  This separation allows PaC to perform
	  an additional authentication method for receiving
	  differentiated services from the NAP.
        </t>
        <t>
          Currently, running multiple EAP sessions in sequence in an
          authentication phase is designed only for separate NAP and
          ISP authentication.  It is not for running arbitrary number
          of EAP sessions in sequence, or giving the PaC another
          chance to try another EAP authentication method within an
          integrated NAP and ISP authentication when an EAP
          authentication method fails.  
        </t>
        <t>
          Within separate NAP and ISP authentication, the NAP
          authentication and the ISP authentication are considered
          completely independent.  Presence or success of one should
          not effect the other.  Making a network access authorization
          decision based on the success or failure of each
          authentication is a network policy issue.
	</t>
	<section
	  anchor='section-nap-isp-discovery-phase' title='Negotiating
	  Separate NAP and ISP Authentication'>
	  <t>
	    When the PaC and PAA negotiates in the discovery and
	    handshake phase to perform separate NAP and ISP
	    authentication, the PaC and the PAA operate in the
	    following way in addition to the behavior defined in <xref
	    target='section-discovery-and-handshake-phase'/>
	  </t>
	  <t>
	    In the discovery and handshake phase, the PAA MAY
	    advertise availability of separate NAP and ISP
	    authentication (<xref target='I-D.ietf-pana-framework'/>)
	    by setting the S-flag on the message header of the
	    PANA-Start-Request.
	  </t>
	  <t>
            If the S-flag of the received PANA-Start-Request message
            is set, the PaC can indicate its desire to perform
            separate NAP and ISP authentication by setting the S-flag
            in the PANA-Start-Answer message.  If the S-flag of the
            received PANA-Start-Request message is not set, the PaC
            MUST NOT set the S-flag in the PANA-Start-Answer message
            sent back to the PAA.
	  </t>
	  <t>
            If the S-flag in the PANA-Start-Answer message is not set,
            only one authentication is performed (ISP-only) and the
            processing occurs as described in <xref
            target='section-discovery-and-handshake-phase'/>.
          </t>
          <t>
            When the S-flag is set in a PANA-Start-Request message,
            the initial EAP Request MUST NOT be carried in the
            PANA-Start-Request message.  (If the initial EAP Request
            were contained in the PANA-Start-Request message during
            the S-flag negotiation, the PaC cannot tell whether the
            EAP Request is for NAP authentication or ISP
            authentication.)
          </t>
<!--
          <t>
            If the S-flag in the PANA-Start-Answer message is set, the
            determination of the destination AAA server or realm for
            ISP authentication is performed as described in <xref
            target='section-isp-selection'/>.  In addition, where
            backend AAA servers are used for NAP authentication, the
            NAP is considered the ultimate AAA realm, and the
            destination AAA server for this authentication is
            determined entirely by the local configuration on the
            access server hosting the PAA (NAS).
	  </t>
-->
	</section>
	<section
	  anchor='section-nap-isp-authentication-phase'
	  title='Execution of Separate NAP and ISP Authentication'>
	  <t>
	    When the PaC and PAA have negotiated in the discovery and
	    handshake phase to perform separate NAP and ISP
	    authentication, the PaC and the PAA operate in the following
	    way in addition to the behavior defined in <xref
		target='section-authentication-phase'/> 
	    <vspace blankLines="1"/>
	    <list style='symbols'>
	      <vspace blankLines="1"/>
	      <t>
		The S-flag of PANA-Auth-Request and PANA-Auth-Answer
		messages MUST be set.
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		An EAP Success/Failure message is carried in a
		PANA-FirstAuth-End-Request (PFER) message as well as a
		PANA-Bind-Request (PBR) message.  The
		PANA-FirstAuth-End-Request message MUST be used at the
		end of the first EAP authentication and the
		PANA-Bind-Request MUST be used for the second EAP
		authentication.  The PANA-FirstAuth-End-Request
		messages MUST be acknowledged with a
		PANA-FirstAuth-End-Answer (PFEA) message.
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		If the first EAP authentication has failed, the PAA
		can choose not to perform the second EAP
		authentication by clearing the S-flag of the
		PANA-FirstAuth-End-Request message.  In this case, the
		S-flag of the PANA-FirstAuth-End-Answer message sent
		by the PaC MUST be cleared.  If the S-flag of the
		PANA-FirstAuth-End-Request message is set when the
		first EAP authentication has failed, the PaC can
		choose not to perform the second EAP authentication by
		clearing the S-flag of the PANA-FirstAuth-End-Answer
		message.  If the first EAP authentication failed and
		the S-flag is not set in the PANA-FirstAuth-End-Answer
		message as a result of those operations, the PANA
		session MUST be immediately deleted.  Otherwise, the
		second EAP authentication MUST be performed.
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		The PAA determines the execution order of NAP
		authentication and ISP authentication.  In this case,
		the PAA can indicate which authentication (NAP
		authentication or ISP authentication) is currently
		occurring by using N-flag in the PANA message header.
		When NAP authentication is being performed, the N-flag
		MUST be set.  When ISP authentication is being
		performed, the N-flag MUST NOT be set.  The N-flag
		MUST NOT be set when S-flag is not set.
	      </t>
	    </list>
	  </t>
          <t>
            When the PaC and PAA have negotiated in the discovery and
            handshake phase to perform separate NAP and ISP
            authentication, and the lower-layer is insecure, the two
            EAP authentication methods used in the separate
            authentication MUST be capable of deriving keys (AAA-Key).
          </t>
	</section>
	<section
	  anchor='section-nap-isp-key' title='AAA-Key Calculation'>
	  <t>
	    When the PaC and PAA have negotiated in the discovery and
	    handshake phase to perform separate NAP and ISP
	    authentication, if the lower-layer is insecure, the two
	    EAP authentication methods used in the separate
	    authentication MUST be capable of deriving keys.  In this
	    case, if the first EAP authentication is successful, the
	    PANA-FirstAuth-End-Request and PANA-FirstAuth-End-Answer
	    messages as well as PANA-Auth-Request and PANA-Auth-Answer
	    messages in the second EAP authentication MUST be
	    protected with the key derived from the AAA-Key for the
	    first EAP authentication.  The PANA-Bind-Request and
	    PANA-Bind-Answer messages and all subsequent PANA messages
	    exchanged in authorized phase, re-authentication phase and
	    termination phase MUST be protected either with the
	    AAA-Key for the first EAP authentication if the first EAP
	    authentication succeeds and the second EAP authentication
	    fails, or with the AAA-Key for the second EAP
	    authentication if the first EAP authentication fails and
	    the second EAP authentication succeeds, or with the
	    compound AAA-Key derived from the two AAA-Keys, one for
	    the first EAP authentication and the other from the second
	    EAP authentication, if both the first and second EAP
	    authentications succeed.
	  </t>
	</section>
      </section>
    </section>
    <section title='Protocol Design Details and Processing Rules'>
      <section anchor='section-transport' title='Transport Layer'>
	<t>
	  PANA uses UDP as its transport layer protocol.  The UDP port
	  number is TBD.  All messages except for PANA-PAA-Discover
	  are always unicast.  PANA-PAA-Discover MAY be unicast when
	  the PaC knows the IP address of the PAA.
	</t>
	<section title='Fragmentation'>
	  <t>
	    PANA does not provide fragmentation of PANA messages.
	    Instead, it relies on fragmentation provided by EAP
	    methods and IP layer when needed.
	  </t>
	</section>
      </section>
      <section anchor='section-seqno' title='Sequence Number and
	Retransmission'>
	<t>
	  PANA uses sequence numbers to provide ordered and reliable
	  delivery of messages.
	</t>
	<t>
	  PaC and PAA maintain two sequence numbers: the next one to
	  be used for a request it initiates and the next one it
	  expects to see in a request from the other end.  These
	  sequence numbers are 32-bit unsigned numbers.  They are
	  monotonically incremented by 1 as new requests are generated
	  and received, and wrapped to zero on the next message after
	  2^32-1.  Answers always contain the same sequence number as
	  the corresponding request.  Retransmissions maintain the
	  same sequence number.
	</t>
	<t>
	  The initial sequence numbers (ISN) are randomly picked by
	  PaC and PAA as they send their very first request messages.
	  PANA-PAA-Discover message carries sequence number 0.
	</t>
	<t>
	  When a request message is received, it is considered valid
	  in terms of sequence numbers if and only if its sequence
	  number matches the expected value.  This check does not
	  apply to PANA-PAA-Discover, and the very first request
	  messages.
	</t>
	<t>
	  When an answer message is received, it is considered valid
	  in terms of sequence numbers if and only if its sequence
	  number matches that of the currently outstanding request.  A
	  peer can only have one outstanding request at a time.
	</t>
	<t>
          PANA messages are retransmitted based on a timer until a
          response is received (in which case the retransmission timer
          is stopped) or the number of retransmission reaches the
          maximum value (in which case the PANA session MUST be
          deleted immediately).
        </t>
        <t>
          The initial discovery and handshake phase requires special
          handling.  PaC MUST retransmit PANA-PAA-Discover if a
          subsequent PANA-Start-Request is not received in time.  Even
          though a PANA-Start-Request is received, PANA-PAA-Discover
          may still have to be retransmitted.  This is because a
          stateless PAA discovery requires one time transmission of a
          solicited PANA-Start-Request.  PAA MUST NOT start a timer
          and retransmit the request in order to avoid state creation.
          If the received PANA-Start-Request included a Cookie AVP (an
          indication of stateless discovery), PaC MUST retransmit
          PANA-PAA-Discover until the first PANA-Auth-Request is
          received.  Otherwise, PaC can rely on PAA to retransmit the
          PANA-Start-Requests as soon as PaC receives the first one
          (i.e., PaC can stop sending PANA-PAA-Discover).
        </t>
        <t>
          The retransmission timers SHOULD be calculated as described
          in <xref target='RFC2988'/> to provide congestion control.
          See <xref target='section-retransmission'/> for default
          timer and maximum retransmission count parameters.
        </t>
	<t>
	  PaC and PAA MUST respond to duplicate requests.  Last
	  transmitted PANA answer MAY be cached in case it is not
	  received by the peer and that generates a retransmission of
	  the last request.  When available, a cached answer can be
	  used instead of fully processing the retransmitted request
	  and forming a new answer from scratch.
	</t>
	<t>
	  PANA MUST NOT generate EAP message duplication.  EAP payload
	  of a retransmitted PANA message MUST NOT be passed to the
	  EAP layer.
	</t>
      </section>
      <section anchor='section-pana-security-association' 
	title='PANA Security Association'>
	<t>
	  A PANA SA is created as an attribute of a PANA session when
	  EAP authentication succeeds with a creation of a AAA-Key.  A
	  PANA SA is not created when the PANA authentication fails or
	  no AAA-Key is produced by any EAP authentication method.  In
	  the case where two EAP authentications are performed in
	  sequence in a single PANA authentication phase, it is
	  possible that two AAA-Keys are derived.  If this happens,
	  the PANA SA MUST be generated from both AAA-Keys.  When a
	  new AAA-Key is derived as a result of EAP-based
	  re-authentication, any key derived from the old AAA-Key MUST
	  be updated to a new one that is derived from the new
	  AAA-Key.  In order to distinguish the new AAA-Key from old
	  ones, one Key-Id AVP MUST be carried in PANA-Bind-Request
	  and PANA-Bind-Answer messages or PANA-FirstAuth-End-Request
	  and PANA-FirstAuth-End-Answer messages at the end of the EAP
	  authentication which resulted in deriving a new AAA-Key.
	  The Key-Id AVP is of type Unsigned32 and MUST contain a
	  value that uniquely identifies the AAA-Key within the PANA
	  session.  The PANA-Bind-Answer message (or the
	  PANA-FirstAuth-End-Answer message) sent in response to a
	  PANA-Bind-Request message (or a PANA-FirstAuth-End-Request
	  message) with a Key-Id AVP MUST contain a Key-Id AVP with
	  the same AAA-Key identifier carried in the request.
	  PANA-Bind-Request, PANA-Bind-Answer,
	  PANA-FirstAuth-End-Request and PANA-FirstAuth-End-Answer
	  messages with a Key-Id AVP MUST also carry a MAC AVP whose
	  value is computed by using the new PANA-MAC-KEY derived from
	  the new AAA-Key (or the new pair of AAA-Keys when the
	  PANA_MAC_KEY is derived from two AAA-Keys).  Although the
	  specification does not mandate a particular method for
	  calculation of Key-Id AVP value, a simple method is to use
	  monotonically increasing numbers.
	</t>
	<t>
	  The created PANA SA is deleted when the corresponding PANA
	  session is deleted.  The lifetime of the PANA SA is the same
	  as the lifetime of the PANA session for simplicity.
	</t>
	<t>
	  PANA SA attributes as well as PANA session attributes are
	  listed below:
	</t>
	<vspace blankLines="1"/>
	<list style='hanging'>
	  <t hangText='PANA Session attributes:'>
	    <list style='symbols'>
	      <vspace blankLines="1"/>
	      <t>
		Session-Id
	      </t>
              <vspace blankLines="1"/>
	      <t>
		Device-Id of PaC
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		IP address of PaC (may be the same as the Device-Id of PaC)
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		IP address of PAA
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		List of device identifiers of EPs
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		Sequence number of the last transmitted request
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		Sequence number of the last received request
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		Last transmitted message payload
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		Retransmission interval
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		Session lifetime
	      </t>
	      <vspace blankLines="1"/>
	      <t>
		Protection-Capability
	      </t>
	      <vspace blankLines="1"/>
              <t>
		PANA SA attributes:
		<list style='symbols'>
		  <vspace blankLines="1"/>
		  <t>
		    Nonce generated by PaC (PaC_nonce)
		  </t>
		  <vspace blankLines="1"/>
		  <t>
		    Nonce generated by PAA (PAA_nonce)
		  </t>
		  <vspace blankLines="1"/>
		  <t>
		    AAA-Key
		  </t>
		  <vspace blankLines="1"/>
		  <t>
		    AAA-Key Identifier
		  </t>
		  <vspace blankLines="1"/>
		  <t>
		    PANA_MAC_KEY
		  </t>
		</list>
	      </t>
	    </list>
	  </t>
	</list>
	<t>
          The PANA_MAC_KEY is derived from the available AAA-Key(s)
          and it is used to integrity protect PANA messages. If there
          is only one AAA-Key available, e.g., due to ISP-only
          authentication, or with one failed and one successful NAP
          and ISP separate authentication (see <xref
          target='section-nap-isp'/>), the PANA_MAC_KEY computation is
          based on that single key.  Otherwise, two AAA-Keys available
          to PANA can be combined in following way ('|' indicates
          concatenation):
        </t>
	<artwork>
   AAA-Key = AAA-Key1 | AAA-Key2
	</artwork>
        <t>
	   The PANA_MAC_KEY is computed in the following way:
	</t>
	<artwork>
   PANA_MAC_KEY = The first N bits of
                  HMAC_SHA1(AAA-Key, PaC_nonce | PAA_nonce | Session-ID)
	</artwork>
        <t>
	  where the value of N depends on the integrity protection
	  algorithm in use, i.e., N=160 for HMAC-SHA1.  The length of
	  AAA-Key MUST be N bits or longer.  See Section <xref
	  target='section-message-authentication-code'/> for the
	  detailed usage of the PANA_MAC_KEY.
	</t>
      </section>
      <section anchor='section-message-authentication-code'
	title='Message Authentication Code'>
	<t>
	  A PANA message can contain a MAC (Message Authentication
	  Code) AVP for cryptographically protecting the message.
	</t>
	<t>
	  When a MAC AVP is included in a PANA message, the value
	  field of the MAC AVP is calculated by using the PANA_MAC_KEY
	  in the following way:
	</t>
	<artwork>
   MAC AVP value = PANA_MAC_PRF(PANA_MAC_KEY, PANA_PDU)
	</artwork>
	<t>
	  where PANA_PDU is the PANA message including the PANA
	  header, with the MAC AVP value field first initialized to 0.
	  PANA_MAC_PRF represents the pseudo random function
	  corresponding to the MAC algorithm specified in the MAC AVP.
	  In this version of draft, PANA_MAC_PRF is HMAC-SHA1.  The
	  PaC and PAA MUST use the same algorithm to calculate a MAC
	  AVP they originate and receive.  The algorithm is determined
	  by the PAA when a PANA-Bind-Request with a MAC AVP is sent.
	  When the PaC does not support the MAC algorithm specified in
	  the PANA-Bind-Request message, it MUST silently discard the
	  message.  The PAA MUST NOT change the MAC algorithm
	  throughout the continuation of the PANA session.
	</t>
      </section>
      <section title='Message Validity Check'>
	<t>
	  When a PANA message is received, the message is considered
	  to be invalid at least when one of the following conditions
	  are not met:
	  <list style='symbols'>
	    <vspace blankLines="1"/>
	    <t>
	      The IP Hop Limit (or TTL) field has a value of 255,
	      i.e., the packet could not possibly have been forwarded
	      by a router.  
	    </t>
	    <vspace blankLines="1"/>
	    <t>
	      Each field in the message header contains a valid value
	      including sequence number, message length, message type,
	      version number, flags, etc.
	    </t>
	    <vspace blankLines="1"/>
	    <t>
	      When a device identifier of the PaC is bound to the PANA
	      session, it matches the device identifier carried in MAC
	      or or IP header, or other locally-significant identifier
	      provided by the lower-layers (e.g., circuit ID) unless
	      the message is a PANA-Update-Request with an IP-Address
	      AVP.
	    </t>
	    <vspace blankLines="1"/>
	    <t>
	      The message type is one of the expected types in the
	      current state.  Specifically the following messages are
	      unexpected and invalid:
	      <list style='symbols'>
		<vspace blankLines="1"/>
		<t>
		  In discovery and handshake phase:
		  <list style='symbols'>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-Termination-Request and PANA-Ping-Request.
		    </t>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-Bind-Request.
		    </t>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-Update-Request.
		    </t>
		  </list>
		</t>
		<vspace blankLines="1"/>
		<t>
		  In authentication phase:
		  <list style='symbols'>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-PAA-Discover.
		    </t>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-Update-Request.
		    </t>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-Start-Request after a PaC receives the
		      first valid PANA-Auth-Request.
		    </t>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-Termination-Request before the PaC receives
		      the first successful PANA-Bind-Request.
		    </t>
		  </list>
		</t>
		<vspace blankLines="1"/>
		<t>
		  Authorized phase:
		  <list style='symbols'>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-Start-Request as well as a non-duplicate
		      PANA-Bind-Request.
		    </t>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-PAA-Discover.
		    </t>
		  </list>
		</t>
		<vspace blankLines="1"/>
		<t>
		  In termination phase:
		  <list style='symbols'>
		    <vspace blankLines="1"/>
		    <t>
		      PANA-PAA-Discover.
		    </t>
		    <vspace blankLines="1"/>
		    <t>
		      All requests but PANA-Termination-Request.
		    </t>
		    <vspace blankLines="1"/>
		  </list>
		</t>
	      </list>
	    </t>
	    <vspace blankLines="1"/>
	    <t>
	      The message payload contains a valid set of AVPs allowed
	      for the message type and there is no missing AVP that
	      needs to be included in the payload.
	    </t>
	    <vspace blankLines="1"/>
	    <t>
	      Each AVP is decoded correctly.
	    </t>
	    <vspace blankLines="1"/>
	    <t>
	      When a MAC AVP is included, the AVP value matches the
	      MAC value computed against the received message.
	    </t>
	    <vspace blankLines="1"/>
	    <t>
	      When a Device-Id AVP is included, the AVP is valid if
	      the device identifier type contained in the AVP is
	      supported (check performed by both PaC and PAA) and is
	      the requested one (check performed by PAA only) and the
	      device identifier value contained in the AVP matches the
	      value extracted from the lower-layer encapsulation
	      header corresponding to the device identifier type
	      contained in the AVP (check performed by PAA only).
	      Note that a Device-Id AVP carries the PaC's device
	      identifier in messages from PaC to PAA and EP(s)' device
	      identifier in messages from PAA to PaC.
	    </t>
	    <vspace blankLines="1"/>
	    <t>
	      When an IP-Address AVP is received in a message, the AVP
	      is valid if the IP address matches the source address in
	      the IP header.
	    </t>
	  </list>
	</t>
	<t>
	    Invalid messages MUST be discarded in order to provide
	    robustness against DoS attacks.  In addition, an error
	    notification message MAY be returned to the sender.  See
	    <xref target='section-error-handling'/> for details.
	</t>
      </section>
      <section title='Device ID Choice'>
	<t>
          The device identifier used in the context of PANA can be an
          IP address, a MAC address, or an identifier that is not
          carried in data packets but has local significance in
          identifying a connected device (e.g., circuit id, PPP
          interface id).  The last type of identifiers are commonly
          used in point-to-point links where MAC addresses are not
          available and lower-layers are already physically or
          cryptographically secured.
	</t>
	<t>
	  It is assumed that the PAA knows the link type and the
	  security mechanisms being provided or required on the access
	  network (e.g., based on physical security, link-layer
	  ciphers enabled before or after PANA, or IPsec).  Based on
	  that information, the PAA can decide what type of EP device
	  id will be used when running PANA with the client.  When
	  IPsec-based security <xref target='I-D.ietf-pana-ipsec'/> is
	  the choice of access control, the PAA SHOULD provide IP
	  address(es) as EP(s)' device ID, and expect the PaC to
	  provide its IP address in return.  In case IPsec is not
	  used, MAC addresses are used as device IDs when available.
	  If non-IPsec access control is enabled, and a MAC address is
	  not available, device ID exchange does not occur within
	  PANA.  Instead, peers rely on lower-layers to provide
	  locally-significant identifiers along with received PANA
	  packets.
	</t>
      </section>
	<section title='PaC Updating its IP Address'>
	<t>
	  A PaC's IP address can change in certain situations.  For
	  example, the PANA framework <xref
	  target='I-D.ietf-pana-framework'/> describes a case in which
	  a PaC replaces a pre-PANA address (PRPA) with a post-PANA
	  address (POPA), and the PaC and PAA create host routes to
	  each other in order to maintain on-link communication based
	  on the POPA.  The PAA needs to be notified about the change
	  of PaC address.
	</t>
	<t>
	  After the PaC has changed its address, it MUST send a
	  PANA-Update-Request message to the PAA.  The message MUST
	  carry the new PaC address in an IP-Address AVP.  If the
	  address contained in the request is invalid, the PAA MUST
	  send a PANA-Error message with the result code
	  PANA_INVALID_IP_ADDRESS.  Otherwise, the PAA MUST update the
	  PANA session with the new PaC address and return a
	  PANA-Update-Answer message.  If there is an established PANA
	  SA, both PANA-Update-Request and PANA-Update-Answer messages
	  MUST be protected with a MAC AVP.
	</t>
      </section>
      <section title='Session Lifetime'>
	<t>
	  The authentication phase determines the PANA session
	  lifetime when the network access authorization succeeds.
	  The Session-Lifetime AVP MAY be optionally included in the
	  PANA-Bind-Request message to inform PaC about the valid
	  lifetime of the PANA session.  It MUST be ignored when
	  included in other PANA messages.
	</t>
	<t>
	  The lifetime is a non-negotiable parameter that can be used
	  by PaC to manage PANA-related state.  PaC does not have to
	  perform any actions when the lifetime expires, other than
	  optionally purging local state.  PAA SHOULD initiate EAP
	  authentication before the current session lifetime expires.
	</t>
	<t>
	  PaC and PAA MAY optionally rely on lower-layer indications
	  to expedite the detection of a disconnected peer.
	  Availability and reliability of such indications depend on
	  the specific access technologies.  PANA peer can use
	  PANA-Ping-Request message to verify the disconnection before
	  taking an action.
	</t>
	<t>
	  The session lifetime parameter is not related to the
	  transmission of PANA-Ping-Request messages.  These messages
	  can be used for asynchronously verifying the liveness of the
	  peer.  The decision to send PANA-Ping-Request message is
	  taken locally and does not require coordination between the
	  peers.
	</t>
	<t>
          When separate ISP and NAP authentication is performed, it is
          possible that different authorization lifetime values are
          associated with the two authentications.  In this case, the
          smaller authorization lifetime value MUST be used for
          calculating the PANA Session-Lifetime value.  As a result,
          when entering a re-authentication phase, both NAP and ISP
          authentication will be performed in the same
          re-authentication phase.
	</t>
      </section>
      <section anchor='section-isp-selection' title='Network Selection'>
	<t>
	  In a discovery and handshake phase, a PANA-Start-Request
	  message sent from the PAA MAY contain zero or one
	  NAP-Information AVP and zero or more ISP-Information AVPs to
	  advertise the information on the NAP and/or ISPs.  The PaC
	  MAY indicate its choice of ISP by including an
	  ISP-Information AVP in the PANA-Start-Answer message.  When
	  a AAA backend is used, the identity of the destination AAA
	  server or realm MUST be determined based on the explicitly
	  chosen ISP.  When the ISP-Information AVP is not present,
	  the access network MAY rely on the client identifier carried
	  in the EAP authentication method to make this determination.
	  The PaC can choose an ISP and contain an ISP-Information AVP
	  for the chosen ISP in a PANA-Start-Answer message even when
	  there is no ISP-Information AVP contained in the
	  PANA-Start-Request message.
	</t>
      </section>
      <section anchor='section-error-handling' title='Error Handling'>
	  <t>
	    A PANA-Error-Request message MAY be sent by either the PaC
	    or the PAA when a badly formed PANA message is received or
	    in case of other errors.  The receiver of this request
	    MUST respond with a PANA-Error-Answer message.  If the
	    cause of this error message was a request message (e.g.,
	    PANA-PAA-Discover or *-Request), then the request MAY be
	    retransmitted immediately without waiting for its
	    retransmission timer to go off.  If the cause of the error
	    was a response message, the receiver of the
	    PANA-Error-Request message SHOULD NOT resend the same
	    response until it receives the next request.
	  </t>
	  <t>
            Erroneous PANA messages may be exploited by adverseries to
            launch DoS attacks on the victims.  Unless the PaC or PAA
            rate-limits the generated PANA-Error-Request messages it
            may be overburdened by having tp respond to bogus packets.
            Limiting the number of error notifications sent to a given
            peer during a (configurable) period of time may be useful.
	  </t>
	  <t>
            When an error message is sent unprotected (i.e., no MAC
            AVP) and the lower-layer is insecure, the error message is
            treated as an informational message.  The receiver of such
            an error message MUST NOT change its state unless the
            error persists and the PANA session is not making any
            progress.
	  </t>
      </section>
    </section>
    <section anchor='section-mobility-handling' title='Mobility'>
      <t>
	A mobile PaC's network access authentication performance can
	be enhanced by deploying a context-transfer-based mechanism,
	where some session attributes are transferred from the
	previous PAA to the new one in order to avoid performing a
	full EAP authentication (reactive approach).  Additional
	mechanisms that are based on the proactive AAA state
	establishment at one or more candidate PAAs may be developed
	in the future <xref target='I-D.irtf-aaaarch-handoff'/>.  The
	details of a context-transfer-based mechanism is provided in
	this section.
      </t>
      <t>
	Upon changing its point of attachment, a PaC that wants to
	quickly resume its ongoing PANA session without running EAP
	MAY send its unexpired PANA session identifier in its
	PANA-Start-Answer message.  Along with the Session-Id AVP, a
	MAC AVP MUST be included in this message.  The MAC AVP is
	computed by using the PANA_MAC_KEY shared between the PaC and
	its previous PAA that has an unexpired PANA session with the
	PaC.  This action signals PaC's desire to perform the mobility
	optimization.  In the absence of a Session-Id AVP in this
	message, the PANA session takes its usual course (i.e.,
	EAP-based authentication is performed).
      </t>
      <t>
	If a PAA receives a session identifier in the
	PANA-Start-Answer message, and it is configured to enable this
	optimization, it SHOULD retrieve the PANA session attributes
	from the previous PAA.  Current PAA determines the identity of
	the previous PAA by looking at the DiameterIdentity part of
	the PANA session identifier.  The MAC AVP can only be verified
	by the previous PAA, therefore a copy of the PANA message MUST
	be provided to the previous PAA.  The mechanism required to
	send a copy of the PANA-Start-Answer message from current PAA
	to the previous PAA, and retrieve the session attributes is
	outside the scope of PANA protocol.  The Context Transfer
	Protocol <xref target='I-D.ietf-seamoby-ctp'/> might be useful
	for this purpose.
      </t>
      <t>
	When the previous or current PAA is not configured to enable
	this optimization, the current PAA can not retrieve the PANA
	session attributes, or the PANA session has already expired
	(i.e., session lifetime is zero), the PAA MUST send the
	PANA-Auth-Request message with a new session identifier and
	let the PANA exchange take its usual course.  This action will
	engage EAP-based authentication and create a fresh PANA
	session from scratch.
      </t>
      <t>
	In case the current PAA can retrieve the on-going PANA session
	attributes from the previous PAA, the PANA session continues
	with a PANA-Bind exchange.
      </t>
      <t>
	As part of the context transfer, an intermediate AAA-Key
	material is provided by the previous PAA to the current PAA.
	<artwork>
   AAA-Key-int = The first N bits of
                 HMAC-SHA1(AAA-Key, DiameterIdentity | Session-ID)
        </artwork>
      </t>
      <t>
	The value of N depends on the integrity protection algorithm
	in use, i.e., N=160 for HMAC-SHA1.  DiameterIdentity is the
	identifier of the current PAA.  Session-ID is the identifier
	of the PaC's PANA session with the previous PAA.
      </t>
      <t>
	The current PAA and PaC compute the new AAA-Key by using the
	nonce values and the AAA-Key-int.
	<artwork>
   AAA-Key-new = The first N bits of
                 HMAC-SHA1(AAA-Key-int, PaC_nonce | PAA_nonce)
        </artwork>
      </t>
      <t>
	New PANA_MAC_KEY is computed based on the algorithm described
	in <xref target='section-pana-security-association'/>, by
	using the new AAA-Key and the new Session-ID assigned by the
	current PAA.  The MAC AVP contained in the PANA-Bind-Request
	and PANA-Bind-Answer messages MUST be generated and verified
	by using the new PANA_MAC_KEY.  The Session-ID AVP MUST
	include a new session identifier assigned by the current PAA.
	A new PANA session is created upon successful completion of
	this exchange.
      </t>
      <t>
	Note that correct operation of this optimization relies on
	many factors, including applicability of authorization state
	from one network attachment to another.  <xref
	target='I-D.ietf-eap-keying'/> identifies this operation as
	"fast handoff" and provides deployment considerations.
	Operators are recommended to take those guidelines into
	account when using this optimization in their networks.
      </t>
    </section>
    <section title='PANA Headers and Formats'>
      <t>
	This section defines message formats for PANA protocol.
      </t>
      <section anchor='section-ip-udp-headers' title='IP and UDP Headers'>
	<t>
	  The Hop Limit (or TTL) field of the IP header MUST be set to
	  255.  When a PANA-PAA-Discover message is multicast, IP
	  destination address of the message is set to a well-known
	  link-local multicast address (TBD).  A PANA-PAA-Discover
	  message MAY be unicast in some cases as specified in <xref
	  target='section-discovery-and-handshake-phase'/>.
	  Any other PANA packet is unicast between the PaC and the
	  PAA.  The source and destination addresses SHOULD be set to
	  the addresses on the interfaces from which the message will
	  be sent and received, respectively.
	</t>
	<t>
	  When the PANA packet is sent in response to a request, the
	  UDP source and destination ports of the response packet MUST
	  be copied from the destination and source ports of the
	  request packet, respectively.  The destination port of an
	  unsolicited PANA packet MUST be set to an assigned value
	  (TBD), and the source port MUST be set to a value chosen by
	  the sender.
	</t>
      </section>
      <section anchor='section-pana-header' title='PANA Header'>
	<t>
	  A summary of the PANA header format is shown below.  The
	  fields are transmitted in network byte order.
	</t>
	<artwork>

       0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Version    |   Reserved    |        Message Length         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |            Flags              |         Message Type          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                      Sequence Number                          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  AVPs ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-
	</artwork>

	<list style='hanging'>
	  <vspace blankLines="1"/>
	  <t hangText='Version'>
	    <vspace blankLines="1"/>
	    <t>
	      This Version field MUST be set to 1 to indicate PANA Version 1.
	    </t>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='Reserved'>
	    <vspace blankLines="1"/>
	    <t>
	      This 8-bit field is reserved for future use, and MUST be
	      set to zero, and ignored by the receiver.
	    </t>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='Message Length'>
	    <vspace blankLines="1"/>
	    <t>
	      The Message Length field is three octets and indicates
	      the length of the PANA message including the header
	      fields.
	    </t>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='Flags'>
	    <vspace blankLines="1"/>
	    <t>
	      The Flags field is eight bits.  The following bits are assigned:
	    </t>
	    <artwork>
    0                   1          
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |R S N r r r r r r r r r r r r r|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	    </artwork>
	    <list style='hanging'>
	      <vspace blankLines="1"/>
	      <t hangText='R(equest)'>
		<vspace blankLines="1"/>
		<t>
		  If set, the message is a request.  If cleared, the
		  message is an answer.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='S(eparate)'>
		<vspace blankLines="1"/>
		<t>
		  When the S-flag is set in a PANA-Start-Request
		  message it indicates that PAA is willing to offer
		  separate NAP and ISP authentication.  When the
		  S-flag is set in a PANA-Start-Answer message it
		  indicates that the PaC accepts on performing
		  separate NAP and ISP authentication.  When the
		  S-flag is set in a PANA-Auth-Request/Answer,
		  PANA-FirstAuth-End-Request/Answer and
		  PANA-Bind-Request/Answer messages it indicates that
		  separate NAP and ISP authentication is being
		  performed in the authentication phase.  For other
		  cases, S-flag MUST NOT be set.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='N(AP authentication)'>
		<vspace blankLines="1"/>
		<t>
		  When the N-flag is set in a PANA-Auth-Request
		  message, it indicates that the current EAP
		  authentication is for NAP authentication.  When the
		  N-flag is unset in a PANA-Auth-Request message, it
		  indicates that the current EAP authentication is for
		  ISP authentication.  The PaC MUST copy the value of
		  the flag in its requests from the last received
		  request of the PAA.  The value of the flag on an
		  answer MUST be copied from the request.  The N-flag
		  MUST NOT be set when S-flag is not set.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='r(eserved)'>
		<vspace blankLines="1"/>
		<t>
                  These flag bits are reserved for future use, and
                  MUST be set to zero, and ignored by the receiver.
		</t>
	      </t>
	    </list>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='Message Type'>
	    <vspace blankLines="1"/>
	    <t>
	      The Message Type field is two octets, and is used in
	      order to communicate the message type with the message.
	      The 16-bit address space is managed by IANA <xref
	      target='ianaweb'/>.  PANA uses its own address space for
	      this field.
	    </t>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='Sequence Number'>
	    <vspace blankLines="1"/>
	    <t>
	      The Sequence Number field contains a 32 bit value. 
	    </t>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='AVPs'>
	    <vspace blankLines="1"/>
	    <t>
	      AVPs are a method of encapsulating information relevant
	      to the PANA message.  See section <xref
	      target='section-avp-header'/> for more information on
	      AVPs.
	    </t>
	  </t>
	</list>
      </section>
      <section anchor='section-avp-header' title='AVP Header'>
	<t>
	  Each AVP of type OctetString MUST be padded to align on a
	  32-bit boundary, while other AVP types align naturally.  A
	  number of zero-valued bytes are added to the end of the AVP
	  Data field till a word boundary is reached.  The length of
	  the padding is not reflected in the AVP Length field <xref
	  target='RFC3588'/>.
	</t>
	<t>
	  The fields in the AVP header MUST be sent in network byte
	  order. The format of the header is:
	</t>
	<artwork>
       0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |           AVP Code            |           AVP Flags           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |          AVP Length           |            Reserved           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                         Vendor-Id (opt)                       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Data ...
   +-+-+-+-+-+-+-+-+
	</artwork>
	<list style='hanging'>
	  <vspace blankLines="1"/>
	  <t hangText='AVP Code'>
	    <vspace blankLines="1"/>
	    <t>
	      The AVP Code, combined with the Vendor-Id field,
	      identifies the attribute uniquely.  AVP numbers are
	      allocated by IANA <xref target='ianaweb'/>.  PANA uses
	      its own address space for this field although some of
	      the AVP formats are borrowed from Diameter protocol
	      <xref target='RFC3588'/>.
	    </t>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='AVP Flags'>
	    <vspace blankLines="1"/>
	    <t>
	      The AVP Flags field is two octets.  The following bits
	      are assigned:
	    </t>
	    <artwork>
    0                   1          
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |V M r r r r r r r r r r r r r r|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	    </artwork>
	    <list style='hanging'>
	      <vspace blankLines="1"/>
	      <t hangText='M(andatory)'>
		<vspace blankLines="1"/>
		<t>
		  The 'M' Bit, known as the Mandatory bit, indicates
		  whether support of the AVP is required.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='V(endor)'>
		<vspace blankLines="1"/>
		<t>
		  The 'V' bit, known as the Vendor-Specific bit,
		  indicates whether the optional Vendor-Id field is
		  present in the AVP header.  
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='r(eserved)'>
		<vspace blankLines="1"/>
		<t>
		  These flag bits are reserved for future use, and
		  MUST be set to zero, and ignored by the receiver.
		</t>
	      </t>
	    </list>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='AVP Length'>
	    <vspace blankLines="1"/>
	    <t>
	      The AVP Length field is four octets, and indicates the
	      number of octets in this AVP including the AVP Code, AVP
	      Length, AVP Flags, and the AVP data.
	    </t>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='Reserved'>
	    <vspace blankLines="1"/>
	    <t>
	      This two-octet field is reserved for future use, and
	      MUST be set to zero, and ignored by the receiver.
	    </t>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='Vendor-Id'>
	    <vspace blankLines="1"/>
	    <t>
	      The Vendor-Id field is present if the 'V' bit is set in
	      the AVP Flags field.  The optional four-octet Vendor-Id
	      field contains the IANA assigned "SMI Network Management
	      Private Enterprise Codes" <xref target='ianaweb'/>
	      value, encoded in network byte order.  Any vendor
	      wishing to implement a vendor-specific PANA AVP MUST use
	      their own Vendor-Id along with their privately managed
	      AVP address space, guaranteeing that they will not
	      collide with any other vendor's vendor-specific AVP(s),
	      nor with future IETF applications.
	    </t>
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='Data'>
	    <vspace blankLines="1"/>
	    <t>
	      The Data field is zero or more octets and contains
	      information specific to the Attribute.  The format and
	      length of the Data field is determined by the AVP Code
	      and AVP Length fields.
	    </t>
	  </t>
	</list>
      </section>
    </section>
    <section title='PANA Messages, Message Specifications and AVPs'>
      <section title='PANA Messages'>
	<t>
	  <xref target='figure-pana-messages'/> lists all PANA
	  messages defined in this document.
	</t>
	<figure anchor='figure-pana-messages' title='PANA Message Overview'>
	  <artwork>
              Message          Direction: PaC---PAA
              ----------------------------------------
              PANA-PAA-Discover           --------&gt;
                                                                                  
              PANA-Start-Request          &lt;--------
              PANA-Start-Answer           --------&gt;
                                                                                      
              PANA-Auth-Request           &lt;-------&gt;
              PANA-Auth-Answer            &lt;-------&gt;
                                                                                  
              PANA-Reauth-Request         --------&gt;
              PANA-Reauth-Answer          &lt;--------

              PANA-FirstAuth-End-Request  &lt;--------
              PANA-FirstAuth-End-Answer   --------&gt;

              PANA-Bind-Request           &lt;--------
              PANA-Bind-Answer            --------&gt;
                                                                                      
              PANA-Ping-Request           &lt;-------&gt;
              PANA-Ping-Answer            &lt;-------&gt;
                                                                                      
              PANA-Termination-Request    &lt;-------&gt;
              PANA-Termination-Answer     &lt;-------&gt;
                                                                                      
              PANA-Update-Request         --------&gt;
              PANA-Update-Answer          &lt;--------

              PANA-Error-Request          &lt;-------&gt;
              PANA-Error-Answer           &lt;-------&gt;
	  </artwork>
	</figure>
      </section>
      <section anchor='section-message-spec' title='Message Specifications'>
	<t>
	  Every PANA message MUST include a corresponding ABNF <xref
	  target='RFC2234'/> specification found in <xref
	  target='RFC3588'/>.
	</t>
	<t>
	  Example:
	</t>
	<artwork>
   message ::= &lt; PANA-Header: &lt;Message type&gt;, [REQ] [SEP] &gt;
             * [ AVP ]
	</artwork>
	<section anchor='section-message-pdi' title='PANA-PAA-Discover (PDI)'>
	  <t>
	    The PANA-PAA-Discover (PDI) message is used to discover
	    the address of PAA(s).  The sequence number in this
	    message is always set to zero (0).
	  </t>
	  <artwork>
      PANA-PAA-Discover ::= &lt; PANA-Header: 1 &gt;
                 *  [ AVP ]
	  </artwork>
	</section>
	<section title='PANA-Start-Request (PSR)'>
	  <t>
	    PANA-Start-Request (PSR) is sent by the PAA to the PaC to
	    advertise availability of the PAA and start PANA
	    authentication.  The PAA sets the sequence number to an
	    initial random value.
	  </t>
	  <artwork>
      PANA-Start-Request ::= &lt; PANA-Header: 2, REQ [SEP] &gt;
                    { Nonce }
                    [ Cookie ]
                    [ EAP-Payload ]
                    [ NAP-Information ]
                 *  [ ISP-Information ]
                    [ Protection-Capability]
                    [ PPAC ]
                 *  [ AVP ]
	  </artwork>
	</section>
	<section title='PANA-Start-Answer (PSA)'>
	  <t>
            PANA-Start-Answer (PSA) is sent by the PaC to the PAA in
            response to a PANA-Start-Request message.  This message
            completes the handshake to start PANA authentication.
	  </t>
	  <artwork>
      PANA-Start-Answer ::= &lt; PANA-Header: 2 [SEP] &gt;
                    { Nonce }
                    [ Session-Id ] 
                    [ Cookie ]
                    [ EAP-Payload ]
                    [ ISP-Information ]
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Auth-Request (PAR)'>
	  <t>
	    PANA-Auth-Request (PAR) is either sent by the PAA or the
	    PaC.  Its main task is to carry an EAP-Payload AVP.
	  </t>
	  <artwork>
      PANA-Auth-Request ::= &lt; PANA-Header: 3, REQ [SEP] [NAP] &gt;
                    &lt; Session-Id &gt;
                    &lt; EAP-Payload &gt;
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Auth-Answer (PAN)'>
	  <t>
	    PANA-Auth-Answer (PAN) is sent by either the PaC or the
	    PAA in response to a PANA-Auth-Request message.  It MAY
	    carry an EAP-Payload AVP.
	  </t>
	  <artwork>
      PANA-Auth-Answer ::= &lt; PANA-Header: 3 [SEP] [NAP] &gt;
                    &lt; Session-Id &gt;
                    [ EAP-Payload ]
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Reauth-Request (PRAR)'>
	  <t>
	    PANA-Reauth-Request (PRAR) is sent by the PaC to the PAA
	    to re-initiate EAP authentication.
	  </t>
	  <artwork>
      PANA-Reauth-Request ::= &lt; PANA-Header: 4, REQ &gt;
                    &lt; Session-Id &gt;
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Reauth-Answer (PRAA)'>
	  <t>
	    PANA-Reauth-Answer (PRAA) is sent by the PAA to the PaC in
	    response to a PANA-Reauth-Request message.
	  </t>
	  <artwork>
      PANA-Reauth-Answer ::= &lt; PANA-Header: 4 &gt;
                    &lt; Session-Id &gt;
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Bind-Request (PBR)'>
	  <t>
	    PANA-Bind-Request (PBR) is sent by the PAA to the PaC to
	    deliver the result of PANA authentication.
	  </t>
	  <artwork>
      PANA-Bind-Request ::= &lt; PANA-Header: 5, REQ [SEP] [NAP] &gt;
                    &lt; Session-Id &gt;
                    { Result-Code }
                    { PPAC }
                    { IP-Address }
                    [ EAP-Payload ]
                    [ Session-Lifetime ]
                    [ Protection-Capability ]
                    [ Key-Id ]
                 *  [ Device-Id ]
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Bind-Answer (PBA)'>
	  <t>
	    PANA-Bind-Answer (PBA) is sent by the PaC to the PAA in
	    response to a PANA-Result-Request message.
	  </t>
	  <artwork>
      PANA-Bind-Answer ::= &lt; PANA-Header: 5 [,SEP] [NAP] &gt;
                    &lt; Session-Id &gt;
                    { Result-Code }
                    [ PPAC ]
                    [ Device-Id ]
                    [ Key-Id ]
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Ping-Request (PPR)'>
	  <t>
	    PANA-Ping-Request (PPR) is either sent by the PaC or the
	    PAA for performing liveness test.
	  </t>
	  <artwork>
      PANA-Ping-Request ::= &lt; PANA-Header: 6, REQ &gt;
                    &lt; Session-Id &gt;
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Ping-Answer (PPA)'>
	  <t>
	    PANA-Ping-Answer (PPA) is sent in response to a
	    PANA-Ping-Request.
	  </t>
	  <artwork>
      PANA-Ping-Answer ::= &lt; PANA-Header: 6 &gt;
                    &lt; Session-Id &gt;
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Termination-Request (PTR)'>
	  <t>
	    PANA-Termination-Request (PTR) is sent either by the PaC
	    or the PAA to terminate a PANA session.
	  </t>
	  <artwork>
      PANA-Termination-Request ::= &lt; PANA-Header: 7, REQ &gt;
                    &lt; Session-Id &gt;
                    &lt; Termination-Cause &gt;
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Termination-Answer (PTA)'>
	  <t>
	    PANA-Termination-Answer (PTA) is sent either by the PaC or
	    the PAA in response to PANA-Termination-Request.
	  </t>
	  <artwork>
      PANA-Termination-Answer ::= &lt; PANA-Header: 7 &gt;
                    &lt; Session-Id &gt;
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Error-Request (PER)'>
	  <t>
	    PANA-Error is sent either by the PaC or the PAA to report
	    an error with the last received PANA message.
	  </t>
	  <artwork>
      PANA-Error-Request ::= &lt; PANA-Header: 8 REQ &gt;
                     &lt; Session-Id &gt;
                     &lt; Result-Code &gt;
                     { Failed-AVP }
                  *  [ AVP ] 
                 0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Error-Answer (PEA)'>
	  <t>
	    PANA-Error-Answer is sent in response to a PANA-Error-Request.
	  </t>
	  <artwork>
      PANA-Error-Answer ::= &lt; PANA-Header: 8 &gt;
                     &lt; Session-Id &gt;
                  *  [ AVP ] 
                 0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-FirstAuth-End-Request (PFER)'>
	  <t>
	    PANA-FirstAuth-End-Request (PFER) is sent by the PAA to
	    the PaC to signal the result of the first EAP
	    authentication method when separate NAP and ISP
	    authentication is performed.
	  </t>
	  <artwork>
      PANA-FirstAuth-End-Request ::= &lt; PANA-Header: 9, REQ [SEP] [NAP] &gt;
                    &lt; Session-Id &gt;
                    { EAP-Payload }
                    { Result-Code }
                    [ Key-Id ]
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-FirstAuth-End-Answer (PFEA)'>
	  <t>
	    PANA-FirstAuth-End-Answer (PFEA) is sent by the PaC to the
	    PAA in response to a PANA-FirstAuth-End-Request message.
	  </t>
	  <artwork>
      PANA-FirstAuth-End-Answer ::= &lt; PANA-Header: 9, REQ [SEP] [NAP] &gt;
                    &lt; Session-Id &gt;
                    [ Key-Id ]
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section title='PANA-Update-Request (PUR)'>
	  <t>
	    PANA-Update-Request (PUR) is sent by the PaC to the PAA to
	    update the attributes of the PANA session.  Currently only
	    the PaC IP address attribute can be updated via this
	    mechanism.
	  </t>
	  <artwork>
      PANA-Update-Request ::= &lt; PANA-Header: 10, REQ &gt;
                    &lt; Session-Id &gt;
                    &lt; IP-Address &gt;
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
	<section anchor='section-message-pua' title='PANA-Update-Answer (PUA)'>
	  <t>
	    PANA-Update-Answer (PUA) is sent by the PAA to the PaC in
	    response to a PANA-Update-Request.
	  </t>
	  <artwork>
      PANA-Update-Answer ::= &lt; PANA-Header: 10 &gt;
                    &lt; Session-Id &gt;
                 *  [ AVP ]
                0*1 &lt; MAC &gt;
	  </artwork>
	</section>
      </section>
      <section anchor='section-avps' title='AVPs in PANA'>
	<t>
	  PANA defines several AVPs that are specific to the protocol.
	  A number of others AVPs are reused.  These are specified in
	  other documents such as <xref target='RFC3588'/>.
	</t>
	<t>
	  The following tables lists the AVPs used in this document,
	  and specifies in which PANA messages they MAY, or MAY NOT be
	  present.
	</t>
	<t>
	  The table uses the following symbols:
	</t>
	<list style='hanging' hangIndent='6'>
	  <vspace blankLines="1"/>
	  <t hangText='0    '>
	    The AVP MUST NOT be present in the message.
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='0+   '>
	    Zero or more instances of the AVP MAY be present in the
	    message.
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='0-1  '>
	    Zero or one instance of the AVP MAY be present in the
	    message.  It is considered an error if there are more than
	    one instance of the AVP.
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='1    '>
	    One instance of the AVP MUST be present in the message.
	  </t>
	  <vspace blankLines="1"/>
	  <t hangText='1+   '>
	    At least one instance of the AVP MUST be present in the
	    message.
	  </t>
	</list>
	<figure anchor='figure-avp-occurrence1' title='AVP Occurrence Table (1/3)'>
	  <artwork>
                       +-----------------------------------------+
                       |                 Message                 |
                       |                   Type                  |
                       +-----+-----+-----+-----+-----+-----+-----+
   Attribute Name      | PSR | PSA | PAR | PAN | PBR | PBA | PDI |
   --------------------+-----+-----+-----+-----+-----+-----+-----+
   Result-Code         |  0  |  0  |  0  |  0  |  1  |  1  |  0  |
   Session-Id          |  0  | 0-1 |  1  |  1  |  1  |  1  |  0  |
   Termination-Cause   |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
   EAP-Payload         | 0-1 | 0-1 |  1  | 0-1 | 0-1 |  0  |  0  |
   MAC                 |  0  | 0-1 | 0-1 | 0-1 | 0-1 | 0-1 |  0  |
   Nonce               |  1  |  1  |  0  |  0  |  0  |  0  |  0  |
   Device-Id           |  0  |  0  |  0  |  0  |  0+ | 0-1 |  0  |
   Cookie              | 0-1 | 0-1 |  0  |  0  |  0  |  0  |  0  |
   Protection-Cap.     | 0-1 |  0  |  0  |  0  | 0-1 |  0  |  0  |
   PPAC                | 0-1 |  0  |  0  |  0  |  1  | 0-1 |  0  |
   Session-Lifetime    |  0  |  0  |  0  |  0  | 0-1 |  0  |  0  |
   Failed-AVP          |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
   ISP-Information     |  0+ | 0-1 |  0  |  0  |  0  |  0  |  0  |
   NAP-Information     | 0-1 |  0  |  0  |  0  |  0  |  0  |  0  |
   Key-Id              |  0  |  0  |  0  |  0  | 0-1 | 0-1 |  0  |
   IP-Address          |  0  |  0  |  0  |  0  |  0  |  0  |  0  |
   --------------------+-----+-----+-----+-----+-----+-----+-----+
	  </artwork>
	</figure>
	<vspace blankLines="100" />
	<figure anchor='figure-avp-occurrence2' title='AVP Occurrence Table (2/3)'>
	  <artwork>
                       +-------------------------------------+
                       |              Message                |
                       |               Type                  |
                       +-----+-----+-----+-----+------+------+
   Attribute Name      | PPR | PPA | PTR | PTA | PFER | PFEA |
   --------------------+-----+-----+-----+-----+------+------+
   Result-Code         |  0  |  0  |  0  |  0  |  1   |  0   |
   Session-Id          |  1  |  1  |  1  |  1  |  1   |  1   |
   Termination-Cause   |  0  |  0  |  1  |  0  |  0   |  0   |
   EAP-Payload         |  0  |  0  |  0  |  0  |  1   |  0   |
   MAC                 | 0-1 | 0-1 | 0-1 | 0-1 | 0-1  | 0-1  |
   Nonce               |  0  |  0  |  0  |  0  |  0   |  0   |
   Device-Id           |  0  |  0  |  0  |  0  |  0   |  0   |
   Cookie              |  0  |  0  |  0  |  0  |  0   |  0   |
   Protection-Cap.     |  0  |  0  |  0  |  0  |  0   |  0   |
   PPAC                |  0  |  0  |  0  |  0  |  0   |  0   |
   Session-Lifetime    |  0  |  0  |  0  |  0  |  0   |  0   |
   Failed-AVP          |  0  |  0  |  0  |  0  |  0   |  0   |
   ISP-Information     |  0  |  0  |  0  |  0  |  0   |  0   |
   NAP-Information     |  0  |  0  |  0  |  0  |  0   |  0   |
   Key-Id              |  0  |  0  |  0  |  0  | 0-1  | 0-1  |
   IP-Address          |  0  |  0  |  0  |  0  |  0   |  0   |
   --------------------+-----+-----+-----+-----+------+------+
	  </artwork>
	</figure>
	<vspace blankLines="100" />
	<figure anchor='figure-avp-occurrence3' title='AVP Occurrence Table (3/3)'>
	  <artwork>
                       +-------------------------------------+
                       |               Message               |
                       |                Type                 |
                       +-----+-----+-----+-----+------+------+
   Attribute Name      | PUR | PUA | PER | PEA | PRAR | PRAA |
   --------------------+-----+-----+-----+-----+------+------+
   Result-Code         |  0  |  0  |  1  |  0  |  0   |  0   |
   Session-Id          |  1  |  1  |  1  |  1  |  1   |  1   |
   Termination-Cause   |  0  |  0  |  0  |  0  |  0   |  0   |
   EAP-Payload         |  0  |  0  |  0  |  0  |  0   |  0   |
   MAC                 | 0-1 | 0-1 | 0-1 | 0-1 | 0-1  | 0-1  |
   Nonce               |  0  |  0  |  0  |  0  |  0   |  0   |
   Device-Id           |  0  |  0  |  0  |  0  |  0   |  0   |
   Cookie              |  0  |  0  |  0  |  0  |  0   |  0   |
   Protection-Cap.     |  0  |  0  |  0  |  0  |  0   |  0   |
   PPAC                |  0  |  0  |  0  |  0  |  0   |  0   |
   Session-Lifetime    |  0  |  0  |  0  |  0  |  0   |  0   |
   Failed-AVP          |  0  |  0  |  1  |  0  |  0   |  0   |
   ISP-Information     |  0  |  0  |  0  |  0  |  0   |  0   |
   NAP-Information     |  0  |  0  |  0  |  0  |  0   |  0   |
   Key-Id              |  0  |  0  |  0  |  0  |  0   |  0   |
   IP-Address          |  1  |  0  |  0  |  0  |  0   |  0   |
   --------------------+-----+-----+-----+-----+------+------+
	  </artwork>
	</figure>
	<section anchor='section-mac-avp' title='MAC AVP'>
	  <t>
            The MAC (Message Authentication Code) AVP is used to
            integrity protect PANA messages.  The first octet of the
            this AVP (AVP Code 1) data contains the MAC algorithm
            type.  Rest of the AVP data payload contains the MAC
            encoded in network byte order.  The 8-bit Algorithm name
            space is managed by IANA <xref target='ianaweb'/>.  The
            AVP length varies depending on the used algorithm.
	  </t>
	  <artwork>
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |   Algorithm   |           MAC...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	  </artwork>
	  <list style='hanging'>
	    <t hangText='Algorithm'>
	      <artwork>
      1           HMAC-SHA1 (20 bytes)
	      </artwork>
	    </t>
	    <t hangText='MAC'>
	      <vspace blankLines="1"/>
	      <t>
		The Message Authentication Code is encoded in network
		byte order.
	      </t>
	    </t>
	  </list>
	</section>
	<section anchor='section-device-id-avp' title='Device-Id AVP'>
	  <t>
            The Device-Id AVP (AVP Code 2) is used for carrying device
            identifiers of PaC and EP(s).  The AVP data is of Address
            type <xref target='RFC3588'/>.  IPv4 and IPv6 addresses
            are encoded as specified in <xref target='RFC3588'/>.  The
            content and format of data (including byte and bit
            ordering) for link-layer addresses is expected to be
            specified in specific documents that describe how IP
            operates over different link-layers.  For instance, <xref
            target='RFC2464'/>.  Address families other than that are
            defined for link-layer or IP addresses MUST NOT be used
            for this AVP.
	  </t>
	</section>
	<section title='Session-Id AVP'>
	  <t>
            All messages pertaining to a specific PANA session MUST
            include a Session-Id AVP (AVP Code 3) which carries a
            PAA-assigned fixed session identifier value throughout the
            lifetime of a session.  When present, the Session-Id
            SHOULD appear immediately following the PANA header.
	  </t>
	  <t>
	    The Session-Id MUST be globally and eternally unique, as
	    it is meant to identify a PANA Session without reference
	    to any other information, and may be needed to correlate
	    historical authentication information with accounting
	    information.  The PANA Session-Id AVP has the same format
	    as the Diameter Session-Id AVP <xref target='RFC3588'/>.
	  </t>
	</section>
	<section title='Cookie AVP'>
	  <t>
            The Cookie AVP (AVP Code 4) is used for carrying a cookie
            value generated by the PAA. The AVP data is of type
            OctetString.  It is opaque and the exact content is
            outside the scope of this protocol.
	  </t>
	</section>
	<section anchor='section-protection-cap-avp' title='Protection-Capability AVP'>
	  <t>
            The Protection-Capability AVP (AVP Code 5) indicates the
            cryptographic data protection capability supported and
            required by the EPs.  The AVP data is of type
            Unsigned32. Below is a list of valid data values and
            associated protection capabilities:
	  </t>
	  <artwork>
      0          L2_PROTECTION
      1          IPSEC_PROTECTION
	  </artwork>
	</section>
	<section anchor='section-termination-cause-avp' title='Termination-Cause AVP'>
	  <t>
            The Termination-Cause AVP (AVP Code 6) is used for
            indicating the reason why a session is terminated by the
            requester.  The AVP data is of type Enumerated. The
            following Termination-Cause data values are used with
            PANA.
	  </t>
	  <list style='hanging'>
	    <vspace blankLines="1"/>
	    <t hangText='LOGOUT                   1  (PaC -> PAA)'>
	      <vspace blankLines="1"/>
	      <t>
		The client initiated a disconnect
	      </t>
	    </t>
	    <vspace blankLines="1"/>
	    <t hangText='ADMINISTRATIVE           4  (PAA -> PaC)'>
	      <vspace blankLines="1"/>
	      <t>
		The client was not granted access, or was
		disconnected, due to administrative reasons, such as
		the receipt of a Abort-Session-Request message.
	      </t>
	    </t>
	    <vspace blankLines="1"/>
	    <t hangText='SESSION_TIMEOUT          8  (PAA -> PaC)'>
	      <vspace blankLines="1"/>
	      <t>
		The session has timed out, and service has been
		terminated.
	      </t>
	    </t>
	  </list>
	</section>
	<section anchor='section-result-code-avp' title='Result-Code AVP'>
	  <t>
	    The Result-Code AVP (AVP Code 7) is of type Unsigned32 and
	    indicates whether an EAP authentication was completed
	    successfully or whether an error occurred.  Here are
	    Result-Code AVP values taken from <xref target='RFC3588'/>
	    and adapted for PANA.
	  </t>
	  <section anchor='section-authentication-result-codes' 
	    title='Authentication Results Codes'>
	    <t>
              These result code values inform the PaC about the
              authentication and authorization result.  The
              authentication result and authorization result can be
              different as described below, but only one result is
              returned to the PaC. These codes are used with
              PANA-Bind-Request and PANA-FirstAuth-End-Request
              messages.
	    </t>
	    <list style='hanging'>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_SUCCESS                            2001'>
		<vspace blankLines="1"/>
		<t>
		  Both authentication and authorization processes are
		  successful.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_AUTHENTICATION_REJECTED            4001'>
		<vspace blankLines="1"/>
		<t>
                  Authentication has failed.  When this error is
                  returned, it is assumed that authorization is
                  automatically failed.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_AUTHORIZATION_REJECTED             5003'>
		<vspace blankLines="1"/>
		<t>
                  Authorization has failed.  This error could occur
                  when authorization is rejected by a AAA proxy or
                  rejected locally by a PAA, even if the
                  authentication has succeeded.
		</t>
	      </t>
	    </list>
	  </section>
	  <section anchor='section-protocol-result-codes' 
	    title='Protocol Error Result Codes'>
	    <t>
              These codes are used with PANA-Error-Request messages.
              Unless stated otherwise, they can be generated by both
              the PaC and the PAA.
	    </t>
	    <list style='hanging'>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_MESSAGE_UNSUPPORTED                3001'>
		<vspace blankLines="1"/>
		<t>
                  Message type not recognized or supported.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_UNABLE_TO_DELIVER                  3002'>
		<vspace blankLines="1"/>
		<t>
                  PAA was unable to deliver the EAP payload to the
                  authentication server.  Only PAA can generate this
                  code.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_INVALID_HDR_BITS                   3008'>
		<vspace blankLines="1"/>
		<t>
                  A message was received whose bits in the PANA header
                  were either set to an invalid combination, or to a
                  value that is inconsistent with the message type
                  definition.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_INVALID_AVP_FLAGS                   3009'>
		<vspace blankLines="1"/>
		<t>
                  A message was received that included an AVP whose
                  flag bits are set to an unrecognized value, or that
                  is inconsistent with the AVP's definition.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_AVP_UNSUPPORTED                    5001'>
		<vspace blankLines="1"/>
		<t>
                  The received message contained an AVP that is not
                  recognized or supported and was marked with the
                  Mandatory bit.  A PANA message with this error MUST
                  contain one or more Failed-AVP AVP containing the
                  AVPs that caused the failure.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_UNKNOWN_SESSION_ID                 5002'>
		<vspace blankLines="1"/>
		<t>
                  The message contained an unknown Session-Id.  PAA
                  MUST NOT send this error result code value to PaC if
                  PaC sent an unknown Session-Id in the
                  PANA-Start-Answer message (session resumption).
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_INVALID_AVP_DATA                   5004'>
		<vspace blankLines="1"/>
		<t>
                  The message contained an AVP with an invalid value
                  in its data portion.  A PANA message indicating this
                  error MUST include the offending AVPs within a
                  Failed-AVP AVP.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_MISSING_AVP                        5005'>
		<vspace blankLines="1"/>
		<t>
                  The message did not contain an AVP that is required
                  by the message type definition.  If this value is
                  sent in the Result-Code AVP, a Failed-AVP AVP SHOULD
                  be included in the message.  The Failed-AVP AVP MUST
                  contain an example of the missing AVP complete with
                  the Vendor-Id if applicable.  The value field of the
                  missing AVP should be of correct minimum length and
                  contain zeroes.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_RESOURCES_EXCEEDED                 5006'>
		<vspace blankLines="1"/>
		<t>
                  A message was received that cannot be authorized
                  because the client has already expended allowed
                  resources.  An example of this error condition is a
                  client that is restricted to one PANA session and
                  attempts to establish a second session.  Only PAA
                  can generate this code.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_CONTRADICTING_AVPS                 5007'>
		<vspace blankLines="1"/>
		<t>
                  The PAA has detected AVPs in the message that
                  contradicted each other, and is not willing to
                  provide service to the client.  One or more
                  Failed-AVP AVPs MUST be present, containing the AVPs
                  that contradicted each other.  Only PAA can generate
                  this code.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_AVP_NOT_ALLOWED                    5008'>
		<vspace blankLines="1"/>
		<t>
                  A message was received with an AVP that MUST NOT be
                  present.  The Failed-AVP AVP MUST be included and
                  contain a copy of the offending AVP.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_AVP_OCCURS_TOO_MANY_TIMES          5009'>
		<vspace blankLines="1"/>
		<t>
                  A message was received that included an AVP that
                  appeared more often than permitted in the message
                  definition.  The Failed-AVP AVP MUST be included and
                  contain a copy of the first instance of the
                  offending AVP that exceeded the maximum number of
                  occurrences.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_UNSUPPORTED_VERSION                5011'>
		<vspace blankLines="1"/>
		<t>
                  This error is returned when a message was received,
                  whose version number is unsupported.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_UNABLE_TO_COMPLY                   5012'>
		<vspace blankLines="1"/>
		<t>
                  This error is returned when a request is rejected
                  for unspecified reasons.  For example, when an EAP
                  authentication fails at an EAP pass-through
                  authenticator without passing an EAP-Failure message
                  to the PAA, a Result-Code AVP with this error code
                  is carried in PANA-Error-Request message.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_INVALID_AVP_LENGTH                 5014'>
		<vspace blankLines="1"/>
		<t>
                  The message contained an AVP with an invalid length.
                  The PANA-Error-Request message indicating this error
                  MUST include the offending AVPs within a Failed-AVP
                  AVP.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_INVALID_MESSAGE_LENGTH             5015'>
		<vspace blankLines="1"/>
		<t>
                  This error is returned when a message is received
                  with an invalid message length.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_PROTECTION_CAPABILITY_UNSUPPORTED  5016'>
		<vspace blankLines="1"/>
		<t>
                  This error is returned when the PaC receives a
                  PANA-Bind-Request with a Protection-Capability AVP
                  and a valid MAC AVP but does not support the
                  protection capability specified in the
                  Protection-Capability AVP.  Only PaC can generate
                  this code.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_PPAC_CAPABILITY_UNSUPPORTED  5017'>
		<vspace blankLines="1"/>
		<t>
                  This error is returned in a PANA-Bind-Answer message
                  when there is no match between the list of PPAC
                  methods offered by the PAA and the ones available on
                  the PaC.  Only PaC can generate this code.
		</t>
	      </t>
	      <vspace blankLines="1"/>
	      <t hangText='PANA_INVALID_IP_ADDRESS  5018'>
		<vspace blankLines="1"/>
		<t>
                  This error is returned in a PANA-Error-Request
                  message when the IP-Address AVP in the received
                  PANA-Update-Request message is invalid (e.g., a
                  non-unicast address).  Only PAA can generate this
                  code.
		</t>
	      </t>
	    </list>
	  </section>
	</section>
	<section title='EAP-Payload AVP'>
	  <t>
            The EAP-Payload AVP (AVP Code 8) is used for encapsulating
            the actual EAP packet that is being exchanged between the
            EAP peer and the EAP authenticator.  The AVP data is of
            type OctetString.
	  </t>
	</section>
	<section title='Session-Lifetime AVP'>
	  <t>
            The Session-Lifetime AVP (AVP Code 9) contains the number
            of seconds remaining before the current session is
            considered expired.  The AVP data is of type Unsigned32.
	  </t>
	</section>
	<section title='Failed-AVP AVP'>
	  <t>
            The Failed-AVP AVP (AVP Code 10) provides debugging
            information in cases where a request is rejected or not
            fully processed due to erroneous information in a specific
            AVP.  The AVP data is of type Grouped.  The format of the
            Failed-AVP AVP is defined in <xref target='RFC3588'/>.
	  </t>
	</section>
	<section title='NAP-Information AVP'>
	  <t>
            The NAP-Information AVP (AVP Code 11) contains zero or one
            Provider-Identifier AVP which carries the identifier of
            the NAP and one Provider-Name AVP which carries the name
            of the NAP.  The AVP data is of type Grouped, and it has
            the following ABNF grammar:
	  </t>
	  <artwork>
      NAP-Information ::= &lt; AVP Header: 11 &gt;
                 0*1 { Provider-Identifier }
                     { Provider-Name }
                  *  [ AVP ] 
	  </artwork>
	</section>
	<section title='ISP-Information AVP'>
	  <t>
            The ISP-Information AVP (AVP Code 12) contains zero or one
            Provider-Identifier AVP which carries the identifier of
            the ISP and one Provider-Name AVP which carries the name
            of the ISP.  The AVP data is of type Grouped, and it has
            the following ABNF grammar:
	  </t>
	  <artwork>
      ISP-Information ::= &lt; AVP Header: 12 &gt;
                 0*1 { Provider-Identifier }
                     { Provider-Name }
                  *  [ AVP ] 
	  </artwork>
	</section>
	<section title='Provider-Identifier AVP'>
	  <t>
	    The Provider-Identifier AVP (AVP Code 13) is of type
	    Unsigned32, and contains an IANA assigned "SMI Network
	    Management Private Enterprise Codes" <xref
	    target='ianaweb'/> value, encoded in network byte order.
	  </t>
	</section>
	<section title='Provider-Name AVP'>
	  <t>
	    The Provider-Name AVP (AVP Code 14) is of type UTF8String,
	    and contains the UTF8-encoded name of the provider.
	  </t>
	</section>
	<section title='Key-Id AVP'>
	  <t>
	    The Key-Id AVP (AVP Code 15) is of type Integer32, and
	    contains an AAA-Key identifier.  The AAA-Key identifier is
	    assigned by PAA and MUST be unique within the PANA
	    session.
	  </t>
	</section>
	<section anchor='section-ppac-avp' title='Post-PANA-Address-Configuration (PPAC) AVP'>
	  <t>
            The PPAC AVP (AVP Code 16) is used for conveying the
            available types of post-PANA IP address configuration
            mechanisms when sent by the PAA, and the chosen one when
            sent by the PaC.  Each possible mechanisms is represented
            by a flag.  At least one or more of the flags MUST be set
            when sent by the PAA, and exactly one flag MUST be set
            when sent by the PaC.  The AVP data is of type Unsigned32.
	  </t>
	  <t>
	    The format of the AVP data is as follows:
	  </t>
	  <artwork>
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |N|D|A|T|I|                   Reserved                          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	  </artwork>
	  <list style='hanging'>
	    <t hangText='PPAC Flags'>
	      <list style='hanging'>
		<vspace blankLines="1"/>
		<t hangText='N (No configuration)'>
		  <vspace blankLines="1"/>
		  <t>
		    The PaC does not have to (if sent by PAA) or
		    will not (if sent by PaC) configure a new IP
		    address after PANA.
		  </t>
		</t>
		<vspace blankLines="1"/>
		<t hangText='D (DHCP)'>
		  <vspace blankLines="1"/>
		  <t>
		    The PaC can (if sent by PAA) or will (if sent by
		    PaC) use DHCP <xref target='RFC2131'/> <xref
		      target='RFC3315'/> to configure a new IP address
		    after PANA.
		  </t>
		</t>
		<vspace blankLines="1"/>
		<t hangText='A (stateless autoconfiguration)'>
		  <vspace blankLines="1"/>
		  <t>
		    The PaC can/will use stateless IPv6 address
		    autoconfiguration <xref target='RFC2462'/> to
		    configure a new IP address after PANA.
		  </t>
		</t>
		<vspace blankLines="1"/>
		<t hangText='T (DHCP with IPsec tunnel mode)'>
		  <vspace blankLines="1"/>
		  <t>
		    The PaC can/will use <xref target='RFC3456'/> to
		    configure a new IP address after PANA.
		  </t>
		</t>
		<vspace blankLines="1"/>
		<t hangText='I (IKEv2)'>
		  <vspace blankLines="1"/>
		  <t>
		    The PaC can/will use <xref
		    target='I-D.ietf-ipsec-ikev2'/> to configure a new
		    IP address after PANA.
		  </t>
		</t>
		<vspace blankLines="1"/>
		<t hangText='Reserved'>
		  <vspace blankLines="1"/>
		  <t>
		    These flag bits are reserved for future use, and
		    MUST be set to zero, and ignored by the
		    receiver.
		  </t>
		</t>
	      </list>
	    </t>
	  </list>
	  <t>
	    Unless the N-flag is set, the PaC MUST configure a new
	    IP address using one of the methods indicated by the
	    other flags.  Refer to <xref
	      target='I-D.ietf-pana-framework'/> for a detailed
	    discussion on when these methods can be used.
	  </t>
	</section>
	<section title='Nonce AVP'>
	  <t>
            The Nonce AVP (AVP Code 17) carries a randomly chosen
            value that is used in cyrptographic key computations.  The
            AVP data is of type OctetString and it contains a randomly
            generated value in opaque format.  The data length MUST be
            between 8 and 256 bytes inclusive.
	  </t>
	</section>
	<section anchor='section-ipaddress-avp' title='IP-Address AVP'>
	  <t>
            The IP-Address AVP (AVP Code 18) contains an IP address of
            the PaC or PAA.  When it is sent by the PaC, it is used to
            convey the new IP address of the PaC to the PAA when the
            PaC reconfigures its IP address after the successful PANA
            authentication.  This AVP is not used if the PaC's IP
            address used during the PANA authentication phase is still
            valid.  It is sent by the PAA in PANA-Bind-Request to bind
            the IP address of the PAA to the PANA session.  The
            payload format of the IP-Address AVP is the same as that
            of the Device-Id AVP (see See <xref
            target='section-device-id-avp'/>).  Address families for
            IPv4 or IPv6 MUST be used for this AVP.
	  </t>
	</section>
      </section>
    </section>
    <section anchor='section-retransmission' 
      title='Retransmission Timers'>
      <t>
	The PANA protocol provides retransmissions for the
	PANA-PAA-Discover and request messages.
      </t>
      <t>
	The rule is that the sender of the request message retransmits
	the request if the corresponding answer is not received in
	time.  Answer messages are sent as answers to the request
	messages, not based on a timer.
      </t>
<!--
      <t>
	PaC MUST retransmit PANA-PAA-Discover if a subsequent
	PANA-Start-Request is not received in time.  Even though a
	PANA-Start-Request is received, PANA-PAA-Discover may still
	have to be retransmitted.  This is because a stateless PANA
	handshake requires one time transmission of a
	PANA-Start-Request.  PAA MUST NOT start a timer and retransmit
	the request if it wants to avoid state creation.  If the
	received PANA-Start-Request included a Cookie AVP (an
	indication of stateless handshake), PaC MUST retransmit
	PANA-PAA-Discover until the first PANA-Auth-Request is
	received.
      </t>
-->
      <t>
	PANA retransmission timers are based on the model used in
	DHCPv6 <xref target='RFC3315'/>.  Variables used here are
	also borrowed from this specification.  PANA is a request
	response like protocol.  The message exchange terminates
	when either the request sender successfully receives the
	appropriate answer, or when the message exchange is
	considered to have failed according to the retransmission
	mechanism described below.
      </t>
      <t>
	The retransmission behavior is controlled and described by
	the following variables:
      </t>
      <artwork>
      RT     Retransmission timeout

      IRT    Initial retransmission time

      MRC    Maximum retransmission count

      MRT    Maximum retransmission time

      MRD    Maximum retransmission duration

      RAND   Randomization factor
      </artwork>
      <t>
	With each message transmission or retransmission, the sender
	sets RT according to the rules given below.  If RT expires
	before the message exchange terminates, the sender
	recomputes RT and retransmits the message.
      </t>
      <t>
	Each of the computations of a new RT include a randomization
	factor (RAND), which is a random number chosen with a
	uniform distribution between -0.1 and +0.1.  The
	randomization factor is included to minimize synchronization
	of messages.
      </t>
      <t>
	The algorithm for choosing a random number does not need to
	be cryptographically sound.  The algorithm SHOULD produce a
	different sequence of random numbers from each invocation.
      </t>
      <t>
	RT for the first message transmission is based on IRT:
      </t>
      <artwork>
      RT = IRT + RAND*IRT
      </artwork>
      <t>
	RT for each subsequent message transmission is based on the
	previous value of RT:
      </t>
      <artwork>
      RT = 2*RTprev + RAND*RTprev
      </artwork>
      <t>
	MRT specifies an upper bound on the value of RT
	(disregarding the randomization added by the use of RAND).
	If MRT has a value of 0, there is no upper limit on the
	value of RT.  Otherwise:
      </t>
      <artwork>
      if (RT > MRT)
         RT = MRT + RAND*MRT
      </artwork>
      <t>
	MRC specifies an upper bound on the number of times a sender
	may retransmit a message.  Unless MRC is zero, the message
	exchange fails once the sender has transmitted the message
	MRC times.
      </t>
      <t>
	MRD specifies an upper bound on the length of time a sender
	may retransmit a message.  Unless MRD is zero, the message
	exchange fails once MRD seconds have elapsed since the
	client first transmitted the message.
      </t>
      <t>
	If both MRC and MRD are non-zero, the message exchange fails
	whenever either of the conditions specified in the previous
	two paragraphs are met.
      </t>
      <t>
	If both MRC and MRD are zero, the client continues to
	transmit the message until it receives a response.
      </t>
      <section title='Transmission and Retransmission Parameters'>
	<t>
	  This section presents a table of values used to describe the
	  message retransmission behavior of PANA requests (REQ_*) and
	  PANA-PAA-Discover message (PDI_*).  The table shows default
	  values.
	</t>
	<artwork>
        Parameter       Default   Description
        ------------------------------------------------
        PDI_IRT           1 sec   Initial PDI timeout.
        PDI_MRT         120 secs  Max PDI timeout value.
        PDI_MRC           0       Configurable.
        PDI_MRD           0       Configurable.

        REQ_IRT           1 sec   Initial Request timeout.
        REQ_MRT          30 secs  Max Request timeout value.
        REQ_MRC          10       Max Request retry attempts.
        REQ_MRD           0       Configurable.
	</artwork>
	<t>
	  So for example the first RT for the PBR message is
	  calculated using REQ_IRT as the IRT:
	</t>
	<artwork>
        RT = REQ_IRT + RAND*REQ_IRT
	</artwork>
      </section>
    </section>
    <section anchor='section-iana-considerations' title='IANA Considerations'>
      <t>
	This section provides guidance to the Internet Assigned
	Numbers Authority (IANA) regarding registration of values
	related to the PANA protocol, in accordance with BCP 26 <xref
	target='IANA'/>.  The following policies are used here with
	the meanings defined in BCP 26: "Private Use", "First Come
	First Served", "Expert Review", "Specification Required",
	"IETF Consensus", "Standards Action".
      </t>
      <t>
	This section explains the criteria to be used by the IANA for
	assignment of numbers within namespaces defined within this
	document.
      </t>
      <t>
	For registration requests where a Designated Expert should be
	consulted, the responsible IESG area director should appoint
	the Designated Expert.  For Designated Expert with
	Specification Required, the request is posted to the PANA WG
	mailing list (or, if it has been disbanded, a successor
	designated by the Area Director) for comment and review, and
	MUST include a pointer to a public specification.  Before a
	period of 30 days has passed, the Designated Expert will
	either approve or deny the registration request and publish a
	notice of the decision to the PANA WG mailing list or its
	successor.  A denial notice must be justified by an
	explanation and, in the cases where it is possible, concrete
	suggestions on how the request can be modified so as to become
	acceptable.
      </t>
      <section title='PANA UDP Port Number'>
	<t>
	  PANA uses one well-known UDP port number (<xref
	  target='section-transport'/>, <xref
	  target='section-discovery-and-handshake-phase'/> and <xref
	  target='section-ip-udp-headers'/>), which needs to be
	  assigned by the IANA.
	</t>
      </section>
      <section title='PANA Multicast Address'>
	<t>
	  PANA uses one well-known IPv4 multicast address for which
	  the scope is limited to be link-local by setting the TTL
	  field to 255, and one well-known IPv6 link-local scoped
	  multicast address (<xref
	  target='section-discovery-and-handshake-phase'/> and
	  <xref target='section-ip-udp-headers'/>), which need to be
	  assigned by the IANA.
	</t>
      </section>
      <section title='PANA Header'>
	<t>
	  As defined in <xref target='section-pana-header'/>, the PANA
	  header contains two fields that requires IANA namespace
	  management; the Message Type and Flags field.
	</t>
	<section title='Message Type'>
	  <t>
	    The Message Type namespace is used to identify PANA
	    messages.  Values 0-65,533 are for permanent, standard
	    message types, allocated by IETF Consensus <xref
	    target='IANA'/>.  This document defines the Message Types
	    1-10.  See <xref target='section-message-pdi'/> through
	    <xref target='section-message-pua'/> for the assignment of
	    the namespace in this specification.
	  </t>
	  <t>
	    The values 65,534 and 65,535 (hexadecimal values 0xfffe -
	    0xffff) are reserved for experimental messages.  As these
	    codes are only for experimental and testing purposes, no
	    guarantee is made for interoperability between
	    communicating PaC and PAA using experimental commands, as
	    outlined in <xref target='IANA-EXP'/>.
	  </t>
	</section>
	<section title='Flags'>
	  <t>
	    There are 16 bits in the Flags field of the PANA header.
	    This document assigns bit 0 ('R'equest), bit 1
	    ('S'eparate) and bit 2 ('N'AP Authentication).  The
	    remaining bits MUST only be assigned via a Standards
	    Action <xref target='IANA'/>.
	  </t>
	</section>
      </section>
      <section title='AVP Header'>
	<t>
	  As defined in <xref target='section-avp-header'/>, the AVP
	  header contains three fields that requires IANA namespace
	  management; the AVP Code, AVP Flags and Vendor-Id fields
	  where only the AVP Code and AVP Flags create new namespaces.
	</t>
	<section title='AVP Code'>
	  <t>
	    The AVP Code namespace is used to identify attributes.
	    There are multiple namespaces.  Vendors can have their own
	    AVP Codes namespace which will be identified by their
	    Vendor-ID (also known as Enterprise-Number) and they
	    control the assignments of their vendor-specific AVP codes
	    within their own namespace.  The absence of a Vendor-ID or
	    a Vendor-ID value of zero (0) identifies the IETF IANA
	    controlled AVP Codes namespace.  The AVP Codes and
	    sometimes also possible values in an AVP are controlled
	    and maintained by IANA.
	  </t>
	  <t>
	    AVP Code 0 is not used.  This document defines the AVP
	    Codes 1-18.  See <xref target='section-mac-avp'/> through
	    <xref target='section-ipaddress-avp'/> for the assignment
	    of the namespace in this specification.
	  </t>
	  <t>
	    AVPs may be allocated following Designated Expert with
	    Specification Required <xref target='IANA'/>.  Release of
	    blocks of AVPs (more than 3 at a time for a given purpose)
	    should require IETF Consensus.
	  </t>
	  <t>
	    Note that PANA defines a mechanism for Vendor-Specific
	    AVPs, where the Vendor-Id field in the AVP header is set
	    to a non-zero value.  Vendor-Specific AVPs codes are for
	    Private Use and should be encouraged instead of allocation
	    of global attribute types, for functions specific only to
	    one vendor's implementation of PANA, where no
	    interoperability is deemed useful.  Where a
	    Vendor-Specific AVP is implemented by more than one
	    vendor, allocation of global AVPs should be encouraged
	    instead.
	  </t>
	</section>
	<section title='Flags'>
	  <t>
	    There are 16 bits in the AVP Flags field of the AVP
	    header, defined in <xref target='section-avp-header'/>.
	    This document assigns bit 0 ('V'endor Specific) and bit 1
	    ('M'andatory).  The remaining bits should only be assigned
	    via a Standards Action <xargs target='IANA'/>.
	  </t>
	</section>
      </section>
      <section title='AVP Values'>
	<t>
	  Certain AVPs in PANA define a list of values with various
	  meanings.  For attributes other than those specified in this
	  section, adding additional values to the list can be done on
	  a First Come, First Served basis by IANA <xref
	  target='IANA'/>.
	</t>
	<section title='Algorithm Values of MAC AVP'>
	  <t>
	    As defined in <xref target='section-mac-avp'/>, the
	    Algorithm field of MAC AVP (AVP Code 1) defines the value
	    of 1 (one) for HMAC-SHA1.
	  </t>
	  <t>
	    All remaining values are available for assignment via IETF
	    Consensus <xref target='IANA'/>.
	  </t>
	</section>
	<section title='Protection-Capability AVP Values'>
	  <t>
	    As defined in <xref target='section-protection-cap-avp'/>,
	    the Protection-Capability AVP (AVP Code 5) defines the
	    values 0 and 1.
	  </t>
	  <t>
	    All remaining values are available for assignment via a
	    Standards Action <xref target='IANA'/>.
	  </t>
	</section>
	<section title='Termination-Cause AVP Values'>
	  <t>
	    As defined in <xref
	    target='section-termination-cause-avp'/>, the
	    Termination-Cause AVP (AVP Code 6) defines the values 1, 4
	    and 8.
	  </t>
	  <t>
	    All remaining values are available for assignment via IETF
	    Consensus <xref target='IANA'/>.
	  </t>
	</section>
	<section title='Result-Code AVP Values'>
	  <t>
	    As defined in <xref
	    target='section-authentication-result-codes'/> and <xref
	    target='section-protocol-result-codes'/> the Result-Code
	    AVP (AVP Code 7) defines the values 2001, 3001-3002,
	    3008-3009, 4001, 5001-5009 and 5011-5019.
	  </t>
	  <t>
	    All remaining values are available for assignment via IETF
	    Consensus <xref target='IANA'/>.
	  </t>
	</section>
	<section title='Post-PANA-Address-Configuration AVP Values'>
	  <t>
	    As defined in <xref target='section-ppac-avp'/>, the
	    Post-PANA-Address-Configuration AVP (AVP Code 17) defines
	    the bits 0 ('N': no configuration), 1 ('D': DHCP), 2 ('A'
	    stateless autoconfiguration), 3 ('T': DHCP with IPsec
	    tunnel mode) and 4 ('I': IKEv2).
	  </t>
	  <t>
	    All remaining values are available for assignment via a
	    Standards Action <xref target='IANA'/>.
	  </t>
	</section>
      </section>
    </section>
    <section anchor='section-security-considerations' title='Security Considerations'>
      <t>
	The PANA protocol defines a UDP-based EAP encapsulation that
	runs between two IP-enabled nodes on the same IP link.
	Various security threats that are relevant to a protocol of
	this nature are outlined in <xref
	target='I-D.ietf-pana-threats-eval'/>.  Security
	considerations stemming from the use of EAP and EAP methods
	are discussed in <xref target='RFC3748'/>.  This section
	provides a discussion on the security-related issues that are
	related to PANA framework and protocol design.
      </t>
      <t>
	An important element in assessing security of PANA design and
	deployment in a network is the presence of lower-layer
	(physical and link-layer) security.  In the context of this
	document, lower-layers are said to be secure if they can
	prevent eavesdropping and spoofing of packets.  Examples of
	such networks are physically-secured DSL networks and 3GPP2
	networks with crytographically-secured cdma2000 link-layer.
	In these examples, the lower-layer security is enabled even
	before running the first PANA-based authentication. In the
	absence of such a pre-established secure channel, one needs to
	be created in conjunction with PANA using a link-layer or
	network-layer cryptographic mechanism (e.g., IPsec).
      </t>
      <section title='General Security Measures'>
	<t>
	  PANA provides multiple mechanisms to secure a PANA session.
	</t>
	<t>
	  Since PaC and PAA are on the same IP link, a simple TTL
	  check on the received PANA messages prevents off-link
	  attacks.
	</t>
	<t>
	  PANA messages carry sequence numbers, which are
	  monotonically incremented by 1 with every new request
	  message.  These numbers are randomly initialized at the
	  beginning of the session, and verified against expected
	  numbers upon receipt.  A message whose sequence number is
	  different than the expected one is silently discarded.  In
	  addition to accomplishing orderly delivery of EAP messages
	  and duplicate elimination, this scheme also helps prevent an
	  adversary spoof messages to disturb ongoing PANA and EAP
	  sessions unless it can also eavesdrop to synchronize on the
	  expected sequence number.
	</t>
	<t>
	  The PANA framework defines EP which is ideally located on a
	  network device that can filter traffic from the PaCs before
	  the traffic enters the Internet/intranet.  A set of filters
	  can be used to discard unauthorized packets, such as a
	  PANA-Start-Request message that is received from the segment
	  of the access network where only PaCs are supposed to be
	  connected.
	</t>
	<t>
	  The protocol also provides authentication and integrity
	  protection to PANA messages when the used EAP method can
	  generate cryptographic session keys.  A PANA SA is generated
	  based on the AAA-Key exported by the EAP method.  This SA is
	  used for generating per-packet MAC to protect the PANA
	  header and payload (including the complete EAP message).
	</t>
	<t>
	  The cryptographic protection prevents an adversary from
	  acting as a man-in-the-middle, injecting messages, replaying
	  messages and modifying the content of the exchanged
	  messages.  Any packet that fails to pass the MAC
	  verification is silently discarded.  The earliest this
	  protection can be enabled is when the very first
	  PANA-Bind-Request or PANA-FirstAuth-End-Request that signals
	  a successful authentication is generated.  Starting with
	  these messages, any subsequent PANA message until the
	  session gets torn down can be cryptographically protected.
	</t>
	<t>
	  The PANA SA enables authenticated and integrity protected
	  exchange of the device ID information between the PaC and
	  PAA.  This ensures there were no man-in-the-middle during
	  the PANA authentication.
	</t>
	<t>
	  The lifetime of the PANA SA is bounded by the AAA-authorized
	  session lifetime with an additional tolerance period.
	  Unless PANA state is updated by executing another EAP
	  authentication, the PANA SA is removed when the current
	  session expires.
	</t>
	<t>
	  The ability to use cryptographic protection within PANA is
	  determined by the used EAP method, which is generally
	  dictated by the deployment environment.  Insecure
	  lower-layers necessitate use of key-generating EAP methods.
	  In networks where lower-layers are already secured,
	  cryptographic protection of PANA messages is not necessary.
	</t>
      </section>
      <section title='Discovery'>
	<t>
	  The discovery and handshake phase is vulnerable to spoofing
	  attacks as these messages are not authenticated and
	  integrity protected.  In order to prevent very basic
	  denial-of service attacks an adversary should not be able to
	  cause state creation by sending discovery messages to the
	  PAA.  This protection is achieved by using a cookie-based
	  scheme (similar to <xref target='RFC2522'/> which allows the
	  responder (PAA) to be stateless in the first round of
	  message exchange.  A return-routability test does not
	  provide additional protection as PANA traffic is not routed
	  but simply forwarded on-link.  It is difficult to prevent
	  this threat entirely.
	</t>
	<t>
	  In networks where lower-layers are not secured prior to
	  running PANA, the capability discovery enabled through
	  inclusion of Protection-Capability and
	  Post-PANA-Address-Configuration AVPs in a PANA-Start-Request
	  message is susceptible to spoofing leading to denial-of
	  service attacks.  Therefore, usage of these AVPs during the
	  discovery and handshake phase in such insecure networks is
	  NOT RECOMMENDED.  The same AVPs are delivered via an
	  integrity-protected PANA-Bind-Request upon successful
	  authentication.
	</t>
      </section>
      <section title='EAP Methods'>
	<t>
	  Eavesdropping EAP packets might cause problems when the EAP
	  method is weak and enables dictionary or replay attacks or
	  even allows an adversary to learn the long-term password
	  directly.  Furthermore, if the optional EAP Identity payload
	  is used then it allows the adversary to learn the identity
	  of the PaC.  In such a case a privacy problem is prevalent.
	</t>
	<t>
	  To prevent these threats, <xref
	  target='I-D.ietf-pana-framework'/> suggests using proper EAP
	  methods for particular environments.  Depending on the
	  deployment environment an EAP authentication which supports
	  user identity confidentiality, protection against dictionary
	  attacks and session key establishment must be used.  It is
	  therefore the responsibility of the network operators and
	  users to choose a proper EAP method.
	</t>
      </section>
      <section title='Separate NAP and ISP Authentication'>
	<t>
	  The PANA design allows running two separate EAP sessions for
	  the same PaC in a single authentication phase: one with the
	  NAP, and one with the ISP.  The process of arriving at the
	  resultant authorization, which is a combination of the
	  individual authorizations obtained from respective service
	  providers, is outside the scope of this protocol.  In the
	  absence of lower-layer security, both authentications MUST
	  be able to generate a AAA-Key, leading to generation of a
	  PANA SA.  The resultant PANA SA cryptographically binds the
	  two AAA-Keys together, hence it prevents man-in-the-middle
	  attacks.
	</t>
      </section>
      <section title='Cryptographic Keys'>
	<t>
	  When the EAP method exports a AAA-Key, this key is used to
	  produce a PANA SA with PANA_MAC_KEY with a distinct key ID.
	  The PANA_MAC_KEY is unique to the PANA session, and takes
	  PANA-based nonce values into computation to
	  cryptographically separate itself from the AAA-Key.
	</t>
	<t>
	  The PANA_MAC_KEY is solely used for authentication and
	  integrity protection of the PANA messages within the
	  designated session.
	</t>
	<t>
	  Two AAA-Keys may be generated as a result of separate NAP
	  and ISP authentication.  In that case, the AAA-Key used with
	  the PANA SA is the combination of both keys.
	</t>
	<t>
	  The PANA SA lifetime is bounded by the AAA-Key lifetime.
	  Another execution of EAP method yields in a new AAA-Key, and
	  updates the PANA SA, PANA_MAC_KEY and key ID.
	</t>
	<t>
	  Upon PaC's movement to a another PAA (new PAA) and request
	  to perform a context transfer based optimization, the
	  current PAA computes a AAA-Key-int based on the AAA-Key, ID
	  of new PAA, and the session ID.  This AAA-Key-int is
	  delivered to the new PAA, and used in the computation of
	  AAA-Key-new, which further takes a pair of nonce values into
	  account.  After this point on, the AAA-Key-new becomes the
	  AAA-Key between the PaC and the new PAA.
	</t>
	<t>
          When link-layer or network-layer ciphering <xref
          target='I-D.ietf-pana-ipsec'/> is enabled as a result of
          successful PANA authentication, a separate PaC-EP master key
          is generated based on the AAA-Key, session ID, key ID, and
          EP ID.
	</t>
	<t>
          The lifetime of PaC-EP master key is bounded by the lifetime
          of the PANA SA. This key may be used with a secure
          association protocol <xref target='I-D.ietf-ipsec-ikev2'/>
          to produce further cipher-specific and transient keys.
	</t>
      </section>
      <section title='Per-packet Ciphering'>
	<t>
          Networks that are not secured at the lower-layers prior to
          running PANA can rely on enabling per-packet data traffic
          ciphering upon successful PANA session establishment.  The
          PANA framework allows generation of a PaC-EP master key from
          AAA-Key for using with a per-packet protection mechanism,
          such as link-layer or IPsec-based ciphering <xref
          target='I-D.ietf-pana-ipsec'/>.  In case the master key is
          not readily useful to the ciphering mechanism, an additional
          secure association protocol <xref
          target='I-D.ietf-ipsec-ikev2'/> may be needed to produce the
          required keying material.  These mechanisms ultimately
          establish a cryptographic binding between the data traffic
          generated by and for a client and the authenticated identity
          of the client.  Data traffic must be minimally data origin
          authenticated, replay and integrity protected, and
          optionally encrypted.
	</t>
      </section>
      <section title='PAA-to-EP Communication'>
	<t>
          The PANA framework allows separation of PAA from EP(s).
          SNMPv3 <xref target='I-D.ietf-pana-snmp'/> is used between
          the the PAA and EP for provisioning authorized PaC
          information on the EP.  This exchange MUST be always
          physically or cryptographically protected for
          authentication, integrity and replay protection.  It MUST
          also be privacy-protected when PaC-EP master key for
          per-packet ciphering is transmitted to the EP.
	</t>
	<t>
          The PaC-EP master key MUST be unique to the PaC and EP pair.
          The session ID and EP's device ID are taken into computation
          for achieving this effect <xref
          target='I-D.ietf-pana-ipsec'/>.  Compromise of an EP does
          not automatically lead to compromise of another EP or the
          PAA.
	</t>
      </section>
      <section title='Livenes Test'>
	<t>
	  A PANA session is associated with a session lifetime.  The
	  session is terminated unless it is refreshed by a new round
	  of EAP authentication before it expires.  Therefore, at the
	  latest a disconnected client can be detected when its
	  session expires.  A disconnect may also be detected earlier
	  by using PANA ping messages.  A request message can be
	  generated by either PaC or PAA at any time and the peer must
	  respond with an answer message.  A successful round-trip of
	  this exchange is a simple verification that the peer is
	  alive.  This test can be engaged when there is a possibility
	  that the peer might have disconnected (e.g., after the
	  discontinuation of data traffic for an extended period of
	  time).  Periodic use of this exchange as a keep-alive
	  requires additional care as it might result in congestion
	  and hence false alarms.  This exchange is cryptographically
	  protected when a PANA SA is available in order to prevent
	  threats associated with the abuse of this functionality.
	</t>
      </section>
      <section title='Mobility Optimization'>
	<t>
          The mobility optimization described in <xref
          target='section-mobility-handling'/> involves the previous
          PAA (holding AAA-Key) providing a AAA-Key-new to the current
          PAA of the PaC.  There are security risks stemming from
          potential compromise of PAAs.  Compromise of the current PAA
          does not yield compromise of the previous PAA, as AAA-Key
          cannot be computed from a compromised AAA-Key-new.  But a
          compromised previous PAA along with the intercepted nonce
          values on the current link leads to the compromise of
          AAA-Key-new.  Operators should be aware of the potential
          risk of using this optimization.
        </t>
        <t>
          An operator can reduce the risk exposure by forcing the PaC
          to perform an EAP-based authentication immediately after the
          PaC gains access to new link via the optimized PANA
          execution.  EAP-based authentication can be run in parallel
          with IP data packet transmission.
        </t>
      </section>
      <section title='Updating PaC&apos;s IP Address'>
	<t>
	  Even though the IP-Address AVP in a PANA-Update-Request can
	  be cryptographically protected by the MAC AVP, there is not
	  way to prove the ownership of the IP address presented by
	  the PaC.  Hence an authorized PaC can launch a redirect
	  attack by spoofing a victim's IP address.
	</t>
      </section>
      <section title='Early Termination of a Session'>
	<t>
	  The PANA protocol supports the ability for both the PaC and
	  the PAA to transmit a tear-down message before the session
	  lifetime expires.  This message causes state removal, a stop
	  of the accounting procedure and removes the installed
	  per-PaC state on the EP(s).  This message is
	  cryptographically protected when PANA SA is present.
	</t>
      </section>
    </section>
<!--
    <section title='Open Issues and Change History'>
      <t>
	A list of open issues is maintained at <eref
	  target='http://danforsberg.info:8080/pana-issues/' />.
      </t>
      <t>
	Issues incorporated in PANA-01 June 2003: 1, 3, 10, 5, 6, 7
	and 11.
      </t>
      <t>
	Issues incorporated in PANA-02 October 2003: 8, 17, 18, 19,
	20, 21, 22, 23, 24, 25, 26, 30, 31, 32 and 33.
      </t>
      <t>
	Issues incorporated in PANA-03 February 2004: 2, 16, 34, 35,
	36, 38, 39, 40, 42, 43, 44, 50, 51 and 60.
      </t>
      <t>
	Issues incorporated in PANA-04 May 2004: 28, 52, 53, 56, 57,
	58, 59, 61, 62, 63, 64, 65, 71, 72, 73, 74, 75, 76, 77, 78,
	79, 80 and 83.
      </t>
      <t>
	Issues incorporated in PANA-05 July 2004: 84, 85, 91, 92, 93,
	96, 97, 98, 99, 100, 103 and 107.
      </t>
      <t>
	Issues incorporated in PANA-06c September 2004: 94, 95, 104,
	105, 106, 109, 110 and 111.
      </t>
    </section>
-->
    <section title='Acknowledgments'>
      <t>
	We would like to thank Jari Arkko, Mohan Parthasarathy, Julien
	Bournelle, Rafael Marin Lopez, Pasi Eronen, Randy Turner, Erik
	Nordmark, Lionel Morand, Avi Lior, Susan Thomson, Giaretta
	Gerardo and all members of the PANA working group for their
	valuable comments to this document.
      </t>
    </section>
  </middle>
  <back>
    <references title='Normative References'>
      &rfc2119;
      &rfc2131;
      &rfc2988;
      &rfc2234;
      &rfc3588;
      &rfc2462;
      &rfc2464;
      &rfc3315;
      &rfc3456;
      &rfc3748;
      &eap-keying;
      <reference anchor='IANA'>
	<front>
	  <title>
	    Guidelines for Writing an IANA Considerations Section in RFCs
	  </title>
	  <author initials="T." surname="Narten"/>
	  <author initials="H." surname="Alvestrand"/>
	  <date month='October' year='1998'/>
	</front>
	<seriesInfo name="" value="BCP 26, RFC 2434" />
      </reference>
    </references>
    <references title='Informative References'>
      &pana-requirements;
      &rfc2522;
      &pana-threats-eval;
      &pana-ipsec;
      &pana-framework;
      &pana-snmp;
      &aaaarch-handoff;
      &eap-statemachine;
      &context-transfer;
      &ikev2;
      <reference anchor='ianaweb'>
	<front>
	  <title>Number assignment</title>
	  <author>
	    <organization>
	      IANA
	    </organization>
	  </author>
	</front>
	<seriesInfo name='' value='http://www.iana.org'/>
      </reference>
      <reference anchor='IANA-EXP'>
	<front>
	  <title>
	    Assigning Experimental and Testing Numbers Considered
	    Useful
	  </title>
	  <author initials="T." surname="Narten"/>
	  <date month='January' year='2004'/>
	</front>
	<seriesInfo name="" value="BCP 82, RFC 3692" />
      </reference>
    </references>
    <appendix title='Example Sequence of Separate NAP and ISP Authentication'>
      <t>
	A PANA message sequence with separate NAP and ISP
	authentication is illustrated in <xref
	target='figure-complete-nap-isp-sequence'/>.  The example
	assumes the following scenario:
      </t>
      <vspace blankLines="1"/>
	<list style='symbols'>
	  <vspace blankLines="1"/>
	  <t>
	    The PaC initiates the discovery and handshake phase.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    The PAA offers separate NAP and ISP authentication, as
	    well as a choice of ISP from "ISP1" and "ISP2".  The PaC
	    accepts the offer from PAA, with choosing "ISP1" as the
	    ISP.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    NAP authentication and ISP authentication is performed in
	    this order in authentication phase.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    An EAP authentication method with a single round trip is
	    used in each EAP sequence.
          </t>
	  <vspace blankLines="1"/>
	  <t>
	    After a PANA SA is established, all messages are integrity
	    and replay protected with MAC AVPs.
	  </t>
	  <vspace blankLines="1"/>
	  <t>
	    Authorized, re-authentication and termination phases
	    are not shown.
	  </t>
	</list>
	<figure anchor='figure-complete-nap-isp-sequence' 
	  title='A Complete Message Sequence for Separate NAP and ISP
	  Authentication'>
          <artwork>
   PaC      PAA  Message(seqno)[AVPs]
   -----------------------------------------------------
   // Discovery and handshake phase
      -----&gt;     PANA-PAA-Discover(0)
      &lt;-----     PANA-Start-Request(x)               // S-flag set
                    [Nonce, Cookie, 
                     ISP-Information("ISP1"),   
                     ISP-Information("ISP2"),           
                     NAP-Information("MyNAP")]
      -----&gt;     PANA-Start-Answer(x)                // S-flag set
                    [Nonce, Cookie,                  // PaC chooses "ISP1"
                     ISP-Information("ISP1")]
                                                    
   // Authentication phase
      &lt;-----     PANA-Auth-Request(x+1)              // NAP authentication
                    [Session-Id, EAP{Request}]       // S- and N-flags set
      -----&gt;     PANA-Auth-Answer(x+1)               // S- and N-flags set
                    [Session-Id]                     // No piggybacking
      -----&gt;     PANA-Auth-Request(y)                // S- and N-flags set
                    [Session-Id, EAP{Response}]  
      &lt;-----     PANA-Auth-Answer(y)[Session-Id]     // S- and N-flags set
      &lt;-----     PANA-Auth-Request(x+2)              // S- and N-flags set
                    [Session-Id, EAP{Request}]  
      -----&gt;     PANA-Auth-Answer(x+2)               // S- and N-flags set
                    [Session-Id, EAP{Response}]      // Piggybacking
      &lt;-----     PANA-FirstAuth-End-Request(x+3)     // S- and N-flags set
                    [Session-Id, EAP{Success}, Key-Id, MAC] 
      -----&gt;     PANA-FirstAuth-End-Answer(x+3)      // S- and N-flags set
                    [Session-Id, Key-Id, MAC]                     
      &lt;-----     PANA-Auth-Request(x+4)              // ISP authentication
                    [Session-Id, EAP{Request}, MAC]  // S-flag set
      -----&gt;     PANA-Auth-Answer(x+4)               // S-flag set
                    [Session-Id, MAC]                // No piggybacking
      -----&gt;     PANA-Auth-Request(y+1)              // S-flag set
                    [Session-Id, EAP{Response}, MAC] 
      &lt;-----     PANA-Auth-Answer(y+1)               // S-flag set
                    [Session-Id, MAC]   
      &lt;-----     PANA-Auth-Request(x+5)              // S-flag set
                    [Session-Id, EAP{Request}, MAC] 
      -----&gt;     PANA-Auth-Answer(x+5)               // S-flag set
                    [Session-Id, EAP{Response}, MAC] // Piggybacking
      &lt;-----     PANA-Bind-Request(x+6)              // S-flag set
                    [Session-Id, EAP{Success}, Device-Id, 
                    IP-Address, Key-Id, Lifetime, 
                    Protection-Cap., PPAC, MAC]
      -----&gt;     PANA-Bind-Answer(x+6)               // S-flag set
                    [Session-Id, Device-Id, Key-Id, 
                     PPAC, MAC]
        </artwork>
      </figure>
    </appendix>
  </back>
</rfc>

