Subject: [Pana] Ping and pending request

From: Victor Fajardo <[email-masked]>
Date: Thu, 19 Apr 2007 11:50:15 -0400

Hi,

A few more issues we can check:

a. In Sec 5.5, the following text:

"
+ The last PANA-Auth-Request as well as ping request before
  completion of the initial PANA-Auth-Request and
  PANA-Auth-Answer exchange.
"

should be replace with:

"
+ The last PANA-Auth-Request before completion of the initial
  PANA-Auth-Request and PANA-Auth-Answer exchange.

+ Ping request.
"

Reasons: We should not allow ping during authentication and 
authorization phase and re-authentication phase since it will allow for 
multiple outstanding requests to be sent (ping and auth request) which 
tends to complicate state transitions. Also, we don't need liveness test 
during these phases anyway since we already rely on session lifetime to 
detect failed sessions.

b. In Sec 5.5:

"
      *  In the access phase:

         +  PANA-Auth-Request.
"

Just for clarity, maybe it should be "+  PANA-Auth-Request with any of its bit flag set".

c. Optional text we want to consider for the same complexity reason as (a) above.

-- Sec 4.2.; First paragraph; Add a sentence: "The ping request MUST be sent only when there are no other pending un-answered request".
-- Same with sec 4.3 and 4.4 with regards to re-auth and termination request. Not sure how to phrase it though. Maybe "A PANA session MUST not enter the
   [re-auth|termination] phase while there are pending un-answered request" (??).

regards,
victor

_______________________________________________
Pana mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/pana

---

From: Subir Das <[email-masked]>
Date: Thu, 19 Apr 2007 23:10:51 -0400

The updated version looks good. Few comments and suggestions on draft -15a.

regards,
-Subir

PANA Working Group                                           D. Forsberg
Internet-Draft                                                     Nokia
Intended status: Standards Track                           Y. Ohba (Ed.)
Expires: October 6, 2007                                         Toshiba
                                                                B. Patil
                                                                   Nokia
                                                           H. Tschofenig
                                                                 Siemens
                                                                A. Yegin
                                                                 Samsung
                                                           April 4, 2007

     Protocol for Carrying Authentication for Network Access (PANA)
                        draft-ietf-pana-pana-15a

Status of this Memo

   By submitting this Internet-Draft, each author represents that any
   applicable patent or other IPR claims of which he or she is aware
   have been or will be disclosed, and any of which he or she becomes
   aware will be disclosed, in accordance with Section 6 of BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups.  Note that
   other groups may also distribute working documents as Internet-
   Drafts.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   The list of current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt.

   The list of Internet-Draft Shadow Directories can be accessed at
   http://www.ietf.org/shadow.html.

   This Internet-Draft will expire on October 6, 2007.

Copyright Notice

   Copyright (C) The IETF Trust (2007).

Forsberg, et al.         Expires October 6, 2007                [Page 1]

Internet-Draft                    PANA                        April 2007

Abstract

   This document defines the Protocol for Carrying Authentication for
   Network Access (PANA), a network-layer transport for Extensible
   Authentication Protocol (EAP) to enable network access authentication
   between clients and access networks.  In EAP terms, PANA is a UDP-
   based EAP lower layer that runs between the EAP peer and the EAP
   authenticator.

Table of Contents

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.1.  Specification of Requirements  . . . . . . . . . . . . . .  4
   2.  Terminology  . . . . . . . . . . . . . . . . . . . . . . . . .  5
   3.  Protocol Overview  . . . . . . . . . . . . . . . . . . . . . .  7
   4.  Protocol Details . . . . . . . . . . . . . . . . . . . . . . .  9
     4.1.  Authentication and Authorization Phase . . . . . . . . . .  9
     4.2.  Access Phase . . . . . . . . . . . . . . . . . . . . . . . 12
     4.3.  Re-authentication Phase  . . . . . . . . . . . . . . . . . 12
     4.4.  Termination Phase  . . . . . . . . . . . . . . . . . . . . 14
   5.  Processing Rules . . . . . . . . . . . . . . . . . . . . . . . 15
     5.1.  Fragmentation  . . . . . . . . . . . . . . . . . . . . . . 15
     5.2.  Sequence Number and Retransmission . . . . . . . . . . . . 15
     5.3.  PANA Security Association  . . . . . . . . . . . . . . . . 16
     5.4.  Message Authentication . . . . . . . . . . . . . . . . . . 17
     5.5.  Message Validity Check . . . . . . . . . . . . . . . . . . 18
     5.6.  PaC Updating its IP Address  . . . . . . . . . . . . . . . 19
     5.7.  Session Lifetime . . . . . . . . . . . . . . . . . . . . . 19
     5.8.  Error Handling . . . . . . . . . . . . . . . . . . . . . . 20
   6.  Message Format . . . . . . . . . . . . . . . . . . . . . . . . 21
     6.1.  IP and UDP Headers . . . . . . . . . . . . . . . . . . . . 21
     6.2.  PANA Message Header  . . . . . . . . . . . . . . . . . . . 21
     6.3.  AVP Format . . . . . . . . . . . . . . . . . . . . . . . . 23
   7.  PANA Messages  . . . . . . . . . . . . . . . . . . . . . . . . 26
     7.1.  PANA-Client-Initiation (PCI) . . . . . . . . . . . . . . . 28
     7.2.  PANA-Auth-Request (PAR)  . . . . . . . . . . . . . . . . . 28
     7.3.  PANA-Auth-Answer (PAN) . . . . . . . . . . . . . . . . . . 29
     7.4.  PANA-Termination-Request (PTR) . . . . . . . . . . . . . . 29
     7.5.  PANA-Termination-Answer (PTA)  . . . . . . . . . . . . . . 29
     7.6.  PANA-Notification-Request (PNR)  . . . . . . . . . . . . . 29
     7.7.  PANA-Notification-Answer (PNA) . . . . . . . . . . . . . . 30
   8.  AVPs in PANA . . . . . . . . . . . . . . . . . . . . . . . . . 31
     8.1.  Algorithm AVP  . . . . . . . . . . . . . . . . . . . . . . 31
     8.2.  AUTH AVP . . . . . . . . . . . . . . . . . . . . . . . . . 32
     8.3.  EAP-Payload AVP  . . . . . . . . . . . . . . . . . . . . . 32
     8.4.  Failed-AVP AVP . . . . . . . . . . . . . . . . . . . . . . 32
     8.5.  Failed-Message-Header AVP  . . . . . . . . . . . . . . . . 32

Forsberg, et al.         Expires October 6, 2007                [Page 2]

Internet-Draft                    PANA                        April 2007

     8.6.  Key-Id AVP . . . . . . . . . . . . . . . . . . . . . . . . 33
     8.7.  Nonce AVP  . . . . . . . . . . . . . . . . . . . . . . . . 33
     8.8.  Result-Code AVP  . . . . . . . . . . . . . . . . . . . . . 33
       8.8.1.  Authentication Results Codes . . . . . . . . . . . . . 33
       8.8.2.  Protocol Error Result Codes  . . . . . . . . . . . . . 34
     8.9.  Session-Lifetime AVP . . . . . . . . . . . . . . . . . . . 36
     8.10. Termination-Cause AVP  . . . . . . . . . . . . . . . . . . 36
   9.  Retransmission Timers  . . . . . . . . . . . . . . . . . . . . 37
     9.1.  Transmission and Retransmission Parameters . . . . . . . . 38
   10. IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 39
     10.1. PANA UDP Port Number . . . . . . . . . . . . . . . . . . . 39
     10.2. PANA Message Header  . . . . . . . . . . . . . . . . . . . 39
       10.2.1. Version  . . . . . . . . . . . . . . . . . . . . . . . 39
       10.2.2. Message Type . . . . . . . . . . . . . . . . . . . . . 39
       10.2.3. Flags  . . . . . . . . . . . . . . . . . . . . . . . . 40
     10.3. AVP Header . . . . . . . . . . . . . . . . . . . . . . . . 40
       10.3.1. AVP Code . . . . . . . . . . . . . . . . . . . . . . . 40
       10.3.2. Flags  . . . . . . . . . . . . . . . . . . . . . . . . 41
     10.4. AVP Values . . . . . . . . . . . . . . . . . . . . . . . . 41
       10.4.1. Result-Code AVP Values . . . . . . . . . . . . . . . . 41
       10.4.2. Termination-Cause AVP Values . . . . . . . . . . . . . 41
   11. Security Considerations  . . . . . . . . . . . . . . . . . . . 42
     11.1. General Security Measures  . . . . . . . . . . . . . . . . 42
     11.2. Initial Exchange . . . . . . . . . . . . . . . . . . . . . 43
     11.3. EAP Methods  . . . . . . . . . . . . . . . . . . . . . . . 44
     11.4. Cryptographic Keys . . . . . . . . . . . . . . . . . . . . 44
     11.5. Per-packet Ciphering . . . . . . . . . . . . . . . . . . . 44
     11.6. PAA-to-EP Communication  . . . . . . . . . . . . . . . . . 45
     11.7. Liveness Test  . . . . . . . . . . . . . . . . . . . . . . 45
     11.8. Early Termination of a Session . . . . . . . . . . . . . . 45
   12. Acknowledgments  . . . . . . . . . . . . . . . . . . . . . . . 46
   13. References . . . . . . . . . . . . . . . . . . . . . . . . . . 47
     13.1. Normative References . . . . . . . . . . . . . . . . . . . 47
     13.2. Informative References . . . . . . . . . . . . . . . . . . 47
   Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 49
   Intellectual Property and Copyright Statements . . . . . . . . . . 51

Forsberg, et al.         Expires October 6, 2007                [Page 3]

Internet-Draft                    PANA                        April 2007

1.  Introduction

   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.

   Scope of this work is identified as designing a network layer
   transport for network access authentication methods.  The Extensible
   Authentication Protocol (EAP) [RFC3748] provides such authentication
   methods.  In other words, PANA carries 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 [RFC3748].

   Various environments and usage models for PANA are identified in
   Appendix A of [RFC4058].  Potential security threats for
   network-layer access authentication protocol are discussed in
   [RFC4016].  These have been essential in defining the requirements
   [RFC4058] on the PANA protocol.  Note that some of these requirements
   are imposed by the chosen payload, EAP [RFC3748].

   There are components that are part of a complete secure network
   access solution but are outside of the PANA protocol specification,
   including authentication method choice, data traffic protection,
   PAA-EP protocol, and PAA discovery.  PANA authentication output is
   used for creating access control filters.  These components are
   described in separate documents (see [I-D.ietf-pana-framework],
   [I-D.ietf-pana-snmp] and [I-D.ietf-dhc-paa-option]).  The readers are
   recommended to read the PANA Framework document
   [I-D.ietf-pana-framework] prior to reading this protocol
   specification document.

1.1.  Specification of Requirements

   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 [RFC2119].

Forsberg, et al.         Expires October 6, 2007                [Page 4]

Internet-Draft                    PANA                        April 2007

2.  Terminology

   PANA Client (PaC):

      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 (authentication) for
      network access authorization.  The PaC and the EAP peer are
      co-located in the same access device.

   PANA Authentication Agent (PAA):

      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 access device.  The PAA and the
      EAP authenticator (and optionally the EAP server) are co-located
      in the same node.  Note the authentication and authorization
      procedure can, according to the EAP model, also be offloaded to
      the backend AAA infrastructure.

   PANA Session:

      A PANA session is established between the PANA Client (PaC) and
      the PANA Authentication Agent (PAA), and terminates as a result of
      an authentication or liveness test failure, a message delivery
      failure after retransmissions reach maximum values, session
      lifetime expiration, or an explicit termination message.  A fixed
      session identifier is maintained throughout a session.  A session
      cannot be shared across multiple network interfaces.

   Session Lifetime:

      A duration that is associated with a PANA session.  For an
      established PANA session, the session lifetime is bound to the
      lifetime of the current authorization given to the PaC.  The
      session lifetime can be updated[a1] by a new round of EAP
      authentication before it expires.

   Session Identifier:

      This identifier is used to uniquely identify a PANA session on the
      PaC and the PAA.  It is included in PANA messages to bind the
      message to a specific PANA session.  This bidirectional identifier
      is allocated by the PAA in the initial request message and freed
      when the session terminates.  The session identifier is assigned
      by the PAA and is unique within the PAA [a2]during the lifetime of the
      session.

Forsberg, et al.         Expires October 6, 2007                [Page 5]

Internet-Draft                    PANA                        April 2007

   PANA Security Association (PANA SA):

      A PANA security association is formed between the PaC and the PAA
      by sharing cryptographic keying material and associated context.
      The formed duplex security association is used to protect the
      bidirectional PANA signaling traffic between the PaC and PAA.

   Enforcement Point (EP):

      A node on the access network where per-packet enforcement policies
      (i.e., filters) are applied on the inbound and outbound traffic of
      access devices.  The EP and the PAA may be co-located.  EPs should
      prevent data traffic from and to any unauthorized client unless
      it's either PANA or one of the other allowed traffic types (e.g.,
      ARP, IPv6 neighbor discovery, DHCP, etc.).  Detailed enforcement
      policies may be specified in deployment-specific PANA
      applicability documents.
[a3]
   Master Session Key (MSK):

      A key derived by the EAP peer and the EAP server and transported
      to the EAP authenticator [RFC3748].

   For additional terminology definitions see the PANA framework
   document [I-D.ietf-pana-framework].

Forsberg, et al.         Expires October 6, 2007                [Page 6]

Internet-Draft                    PANA                        April 2007

3.  Protocol Overview

   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.

   The protocol messaging consists of a series of requests and answers,
   some of which may be initiated by either end.  Each message can carry
   zero or more AVPs within the payload.  The main payload of PANA is
   EAP which performs authentication.  PANA helps the PaC and PAA
   establish an EAP session.

   PANA is a UDP-based protocol.  It has its own retransmission
   mechanism to reliably deliver messages.

   PANA messages are sent between the PaC and PAA as part of a PANA
   session.  A PANA session consists of distinct phases:

   o  Authentication and authorization phase: This is the phase that
      initiates a new PANA session and executes EAP between the PAA and
      PaC.  The PANA session can be initiated by both the PaC and the
      PAA.  The EAP payload (which carry an EAP method inside) is what
      is used for authentication.  The PAA conveys the result of
      authentication and authorization to the PaC at the end of this
      phase.

   o  Access phase: After a successful authentication and authorization
      the host[a4] gains access to the network and can send and receive IP[a5]
      data traffic through the EP(s).  At any time during this phase,
      the PaC and PAA may optionally send PANA notification messages to
      test liveness of the PANA session on the peer.

   o  Re-authentication phase: During the access phase, the PAA must
      initiate re-authentication before the PANA session lifetime
      expires.  EAP is carried by PANA to perform authentication.[a6]  This
      phase may be optionally triggered by both the PaC and the PAA
      without any respect to the session lifetime. [a7] The session moves to
      this phase from the access phase, and returns back there upon
      successful re-authentication.

   o  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 clean up the session at the other end.

   Cryptographic protection of messages between the PaC and PAA is

Forsberg, et al.         Expires October 6, 2007                [Page 7]

Internet-Draft                    PANA                        April 2007

   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 generate per-message authentication codes that provide
   integrity protection and authentication.

   Throughout the lifetime of a session, various problems found with the
   incoming messages can generate an error request message (see
   Section 5.8) sent in response.[a8]

Forsberg, et al.         Expires October 6, 2007                [Page 8]

Internet-Draft                    PANA                        April 2007

4.  Protocol Details

   The following sections explain in detail the various phases of a PANA
   session.

4.1.  Authentication and Authorization Phase

   The main task of the authentication and authorization phase is to
   establish a PANA session and carry EAP messages between the PaC and
   the PAA.  The PANA session can be initiated by either the PaC or the
   PAA.

   PaC-initiated Session:

      When the PaC initiates a PANA session, it sends a
      PANA-Client-Initiation message to the PAA.  When the PaC is not
      configured with an IP address of the PAA before initiating the
      PANA session, DHCP [I-D.ietf-dhc-paa-option] is used as the
      default method for dynamically configuring the IP address of the
      PAA.  Alternative methods for dynamically discovering the IP
      address of the PAA may be used for PaC-initiated session but they
      are outside the scope of this specification.  The PAA that
      receives the PANA-Client-Initiation message MUST respond to the
      PaC with a PANA-Auth-Request message.

   PAA-initiated Session:

      When the PAA knows the IP address of the PaC, it MAY send an
      unsolicited PANA-Auth-Request to the PaC.  The details of how PAA
      can learn the IP address of the PaC are outside the scope of this
      specification.

   A session identifier for the session is assigned by the PAA and
   carried in the initial PANA-Auth-Request message.  The same session
   identifier MUST be carried in the subsequent messages exchanged
   between the PAA and PaC throughout the session.

   When the PaC receives the initial PANA-Auth-Request message from a
   PAA, it responds with a PANA-Auth-Answer message, if it wishes to
   continue the PANA session.

   The initial PANA-Auth-Request and PANA-Auth-Answer messages MUST have
   'S' (Start) bit set, regardless of whether the session is initiated
   by the PaC or the PAA.  Non-initial PANA-Auth-Request and
   PANA-Auth-Answer messages as well as any other messages MUST NOT have
   'S' bit set.

   The PAA SHOULD limit the rate it processes incoming

[a9]

Forsberg, et al.         Expires October 6, 2007                [Page 9]

Internet-Draft                    PANA                        April 2007

   PANA-Client-Initiation messages in order not to subject itself to
   denial-of service (DoS) attacks.  Details of rate limiting are
   outside the scope of this specification.

   An Algorithm AVP MAY be included in the initial PANA-Auth-Request in
   order to indicate required and available capabilities for the network
   access.  This AVP MAY be used by the PaC for assessing the capability
   match even before the authentication takes place.  Since this AVP is
   provided in the insecure initial request, there are certain security
   risks involved in using the provided information.  See Section 11 for
   further discussion on this.

   If the PAA wants to stay stateless in response to a
   PANA-Client-Initiation message, it SHOULD NOT include an EAP-Payload
   AVP in the initial PANA-Auth-Request message, and it SHOULD NOT re-
   transmit the message on a timer.  For this reason, the PaC MUST
   retransmit the PANA-Client-Initiation message until it enters the
   authentication and authorization phase by receiving the second
   PANA-Auth-Request message (not a retransmission of the initial one)
   from the PAA.
[a10]
   It is possible that both the PAA and the PaC initiate the PANA
   session at the same time, i.e., the PAA unsolicitedly sends the
   initial PANA-Auth-Request message while the PaC sends a
   PANA-Client-Initiation message.  To resolve the race condition, the
   PAA SHOULD silently discard the PANA-Client-Initiation message
   received from the PaC after it has sent the initial PANA-Auth-Request
   message.  The PAA uses the source IP address and the source port
   number of the PANA-Client-Initiation message to identify the PaC
   among multiple PANA-Client-Initiation messages sent from different
   PaCs.

   EAP 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 message.  This optimization SHOULD NOT be used when
   it takes time to generate the EAP message (due to, e.g., intervention
   of human input), in which case returning an PANA-Auth-Answer message
   without piggybacking an EAP message can avoid unnecessary
   retransmission of the PANA-Auth-Request message.

   A Nonce AVP MUST be included in the first non-initial
   PANA-Auth-Request and PANA-Auth-Answer messages, and MUST NOT be
   included in any other message.

   The result of PANA authentication is carried in the last
   PANA-Auth-Request message sent from the PAA to the PaC.  This message
   carries the EAP authentication result and the result of PANA

Forsberg, et al.         Expires October 6, 2007               [Page 10]

Internet-Draft                    PANA                        April 2007

   authentication.  The last PANA-Auth-Request message MUST be
   acknowledged with a PANA-Auth-Answer message.  The last
   PANA-Auth-Request and PANA-Auth-Answer messages MUST have 'C'
   (Complete) bit set, and any other message MUST NOT have 'C' bit set.
   Figure 1 shows an example sequence in the authentication and
   authorization phase for a PaC-initiated session.

   PaC      PAA  Message(sequence number)[AVPs]
   --------------------------------------------------------------------
      ----->     PANA-Client-Initiation(0)
      <-----     PANA-Auth-Request(x)         // 'S' bit set
      ----->     PANA-Auth-Answer(x)          // 'S' bit set
      <-----     PANA-Auth-Request(x+1)[Nonce, EAP]
      ----->     PANA-Auth-Answer(x+1)[Nonce] // No piggybacking EAP
      ----->     PANA-Auth-Request(y)[EAP]
      <-----     PANA-Auth-Answer(y)
      <-----     PANA-Auth-Request(x+2)[EAP]
      ----->     PANA-Auth-Answer(x+2)[EAP][a11]
      <-----     PANA-Auth-Request(x+3)[Result-Code, EAP, Key-Id,
                                            Algorithm, Lifetime, AUTH]
                                               // 'C' bit set
      ----->     PANA-Auth-Answer(x+3)[Key-Id, AUTH]
                                               // 'C' bit set

    Figure 1: Example sequence for the authentication and authorization
                     phase for a PaC-initiated session

   When an EAP method that is capable of deriving keys is used during
   the authentication and authorization phase and the keys are
   successfully derived, the last PANA-Auth-Request message MUST contain
   a Key-Id AVP and an AUTH AVP, and an Algorithm AVP for the first
   derivation of keys in the session, and any subsequent message MUST
   contain an AUTH AVP.  An Algorithm AVP MUST NOT be contained in any
   PANA-Auth-Request message after the first derivation of keys in the
   session.

   EAP authentication can fail at a pass-through authenticator without
   sending an EAP Failure message [RFC4137].  When this occurs, the PAA
   SHOULD silently terminate the session, expecting that a session
   timeout on the PaC will clean up the state on the PaC.

   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 or authorization locally
   rejected by the PAA.  When this occurs, the PAA MUST send the last
   PANA-Auth-Request with a result code PANA_AUTHORIZATION_REJECTED.  If
   an MSK is available, the last PANA-Auth-Request and PANA-Auth-Answer
   messages MUST be protected with an AUTH AVP and carry a Key-Id AVP.

Forsberg, et al.         Expires October 6, 2007               [Page 11]

Internet-Draft                    PANA                        April 2007

   The last PANA-Auth-Request message MUST also carry an Algorithm AVP
   if it is for the first derivation of keys in the session.  The PANA
   session MUST be deleted immediately after the last PANA-Auth message
   exchange.
[a12]
4.2.  Access Phase

   Once the authentication and authorization phase or the
   re-authentication phase successfully completes,[a13] the PaC gains access
   to the network and can send and receive IP data traffic through the
   EP(s) and the PANA session enters the access phase.  In this phase,
   PANA-Notification-Request and PANA-Notification-Answer messages with
   'P' (Ping) bit set (ping request and ping answer messages,
   respectively) 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 ping request 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 ping answer message.  The ping request and answer
   messages MUST be protected with an AUTH AVP when a PANA SA is
   available.

   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.  Additionally, an implementation MAY
   rate-limit processing of  the incoming ping requests.  It should be noted
   that if a PAA or PaC which considers its connectivity lost after a
   relatively small number of unresponsive pings coupled with a peer
   that is aggressively rate-limiting the ping request and answer
   messages, false-positives could result. [a14] Care should be taken when
   rate-limiting ping request and answer messages to periodically
   respond, and a PAA or PaC should not rely on ping request and answer
   messages to quickly determine loss of connectivity.

4.3.  Re-authentication Phase

   The PANA session in the access phase can enter the 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 access phase.  Otherwise, the session is deleted.[a15]

   When the PaC wants to initiate re-authentication, it sends a
   PANA-Notification-Request message with 'A' bit set (a re-
   authentication request message) to the PAA.  This message MUST
   contain the session identifier assigned to the session being
   re-authenticated.  If the PAA already has an established PANA session
   for the PaC with the matching session identifier, it MUST first
   respond with a PANA-Notification-Answer message with 'A' bit set (a

Forsberg, et al.         Expires October 6, 2007               [Page 12]

Internet-Draft                    PANA                        April 2007

   re-authentication answer message), followed by a PANA-Auth-Request
   message that starts a new EAP authentication.  If the PAA cannot
   identify the session, it MUST silently discard the message.  The
   first PANA-Auth-Request and PANA-Auth-Answer messages in the
   re-authentication phase MUST have 'S' bit cleared [a16]and carry a Nonce
   AVP.

   The PaC may receive a PANA-Auth-Request before receiving the answer
   to its outstanding re-authentication request message.  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.
   The PaC MUST keep discarding the received PANA-Auth-Requests until it
   receives the answer to its request.
[a17]
   When the PAA initiates re-authentication, it sends a
   PANA-Auth-Request message containing the session identifier for the
   PaC.  The PAA MUST initiate EAP re-authentication before the current
   session lifetime expires.

   Re-authentication of an on-going PANA session MUST NOT reset the
   sequence numbers.

   For any re-authentication, if there is an established PANA SA, re-
   authentication request and answer messages and subsequent
   PANA-Auth-Request and PANA-Auth-Answer messages MUST be protected
   with an AUTH AVP.  The final PANA-Auth-Request and PANA-Auth-Answer
   messages and any subsequent PANA message MUST be protected by using
   the key generated from the latest EAP authentication.

   PaC      PAA  Message(sequence number)[AVPs]
   ------------------------------------------------------
      ----->     PANA-Notification-Request(q)[AUTH] // 'A' bit set
      <-----     PANA-Notification-Answer(q)[AUTH]  // 'A' bit set
      <-----     PANA-Auth-Request(p)[EAP, Nonce, AUTH]
      ----->     PANA-Auth-Answer(p)[AUTH, Nonce]
      ----->     PANA-Auth-Request(q+1)[EAP, AUTH]
      <-----     PANA-Auth-Answer(q+1)[AUTH]
      <-----     PANA-Auth-Request(p+1)[EAP, AUTH]
      ----->     PANA-Auth-Answer(p+1)[EAP, AUTH]
      <-----     PANA-Auth-Request(p+2)[Result-Code, EAP, Key-Id,
                                             Algorithm, Lifetime, AUTH]
                                                     // 'C' bit set
      ----->     PANA-Auth-Answer(p+2)[Key-Id, AUTH]// 'C' bit set

   Figure 2: Example sequence for the re-authentication phase initiated
                                  by PaC

Forsberg, et al.         Expires October 6, 2007               [Page 13]

Internet-Draft                    PANA                        April 2007

4.4.  Termination Phase

   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
   PANA-Termination-Answer message exchanges are used for disconnect
   indication and session revocation procedures.

   The reason for termination is indicated in the Termination-Cause AVP.
   When there is an established PANA SA between the PaC and the PAA, all
   messages exchanged during the termination phase MUST be protected
   with an AUTH AVP.  When the sender of the PANA-Termination-Request
   message receives a valid acknowledgment, all states maintained for
   the PANA session MUST be deleted immediately.

Forsberg, et al.         Expires October 6, 2007               [Page 14]

Internet-Draft                    PANA                        April 2007

5.  Processing Rules

5.1.  Fragmentation

   PANA does not provide fragmentation of PANA messages.  Instead, it
   relies on fragmentation provided by EAP methods and IP layer when
   needed.

5.2.  Sequence Number and Retransmission

   PANA uses sequence numbers to provide ordered and reliable delivery
   of messages.

   The 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. [a18] 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 reuse the
   sequence number contained in the original packet.

   The initial sequence numbers (ISN) are randomly picked by the PaC and
   PAA as they send their very first request messages except 
   PANA-Client-Initiation message that MUST be always 0. 
   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 the
   PANA-Client-Initiation message and the initial PANA-Auth-Request
   message.

   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.

   PANA request messages are retransmitted based on a timer until a
   response[a19] 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[a20] immediately).

   The retransmission timers SHOULD be calculated as described in
   Section 9 unless a given deployment chooses to use its own
   retransmission timers optimized for the underlying link-layer
   characteristics.

   Unless dropped due to rate limiting, the PaC and PAA MUST respond to

Forsberg, et al.         Expires October 6, 2007               [Page 15]

Internet-Draft                    PANA                        April 2007

   all duplicate request messages received.  The last transmitted answer
   MAY be cached in case it is not received by the peer and that
   generates a retransmission of the last request.  When available, the
   cached answer can be used instead of fully processing the
   retransmitted request and forming a new answer from scratch.

5.3.  PANA Security Association

   A PANA SA is created as an attribute of a PANA session when EAP
   authentication succeeds with a creation of an MSK.  A PANA SA is not
   created when the PANA authentication fails or no MSK is produced by
   the EAP authentication method.  When a new MSK is derived in the PANA
   re-authentication phase, any key derived from the old MSK MUST be
   updated to a new one that is derived from the new MSK.  In order to
   distinguish the new MSK from old ones, one Key-Id AVP MUST be carried
   in the last PANA-Auth-Request and PANA-Auth-Answer messages at the
   end of the EAP authentication which resulted in deriving a new MSK.
   The Key-Id AVP is of type Unsigned32 and MUST contain a value that
   uniquely identifies the MSK within the PANA session.  The last
   PANA-Auth-Answer message in response to the last PANA-Auth-Request
   message with a Key-Id AVP MUST contain a Key-Id AVP with the same MSK
   identifier carried in the request.  The last PANA-Auth-Request and
   PANA-Auth-Answer messages with a Key-Id AVP MUST also carry an AUTH
   AVP whose value is computed by using the new PANA_AUTH_KEY derived
   from the new MSK.  Although the specification does not mandate a
   particular method for calculation of the Key-Id AVP value, a simple
   method is to use monotonically increasing numbers.

   The PANA session lifetime is bounded by the authorization lifetime
   granted by the authentication server (same as the MSK lifetime).  The
   lifetime of the PANA SA (hence the PANA_AUTH_KEY) is the same as the
   lifetime of the PANA session.  The created PANA SA is deleted when
   the corresponding PANA session is deleted.

   PANA SA attributes as well as PANA session attributes are listed
   below:

   PANA Session attributes:

      *  Session Identifier

      *  IP address and UDP port number of the PaC.

      *  IP address and UDP port number of the PAA

      *  Sequence number of the last transmitted request

Forsberg, et al.         Expires October 6, 2007               [Page 16]

Internet-Draft                    PANA                        April 2007

      *  Sequence number of the last received request

      *  Last transmitted message payload

      *  Retransmission interval

      *  Session lifetime

      *  PANA SA attributes

   PANA SA attributes:

      *  Nonce generated by PaC (PaC_nonce)

      *  Nonce generated by PAA (PAA_nonce)

      *  MSK

      *  MSK Identifier

      *  PANA_AUTH_KEY

      *  Pseudo-random function

      *  Integrity algorithm

   The PANA_AUTH_KEY is derived from the available MSK and it is used to
   integrity protect PANA messages.  The PANA_AUTH_KEY is computed in
   the following way:

    PANA_AUTH_KEY = prf+(MSK, PaC_nonce|PAA_nonce|Session_ID|Key_ID)

   where the prf+ function is defined in IKEv2 [RFC4306].  The
   pseudo-random function to be used for the prf+ function is specified
   in the Algorithm AVP in the last PANA-Auth-Request message.  The
   length of PANA_AUTH_KEY depends on the integrity algorithm in use.
   See Section 5.4 for the detailed usage of the PANA_AUTH_KEY.
   PaC_nonce and PAA_nonce are values of the Nonce AVP carried in the
   first non-initial PANA-Auth-Answer and PANA-Auth-Request messages in
   the authentication and authorization phase or the first
   PANA-Auth-Answer and PANA-Auth-Request messages in the
   re-authentication phase, respectively.  Session_ID is the session
   identifier of the session.  Key_ID is the value of the Key-ID AVP.

5.4.  Message Authentication

   A PANA message can contain an AUTH AVP for cryptographically
   protecting the message.

Forsberg, et al.         Expires October 6, 2007               [Page 17]

Internet-Draft                    PANA                        April 2007

   When an AUTH AVP is included in a PANA message, the value field of
   the AUTH AVP is calculated by using the PANA_AUTH_KEY in the
   following way:

      AUTH AVP value = PANA_AUTH_HASH(PANA_AUTH_KEY, PANA_PDU)

   where PANA_PDU is the PANA message including the PANA header, with
   the AUTH AVP value field first initialized to 0.  PANA_AUTH_HASH
   represents the integrity algorithm specified in the Algorithm AVP in
   the last PANA-Auth-Request message.  The PaC and PAA MUST use the
   same integrity algorithm to calculate an AUTH AVP they originate and
   receive.  The algorithm is determined by the PAA.  When the PaC does
   not support the integrity algorithm specified in the last
   PANA-Auth-Request message, it MUST silently discard the message.

5.5.  Message Validity Check

   When a PANA message is received, the message is considered to be
   invalid at least when one of the following conditions are not met:

   o  Each field in the message header contains a valid value including
      sequence number, message length, message type, version number,
      flags, session identifier, etc.

   o  The message type is one of the expected types in the current
      state.  Specifically the following messages are unexpected and
      invalid:

      *  In the authentication and authorization phase and the
         re-authentication phase:

         +  PANA-Client-Initiation after completion of the initial
            PANA-Auth-Request and PANA-Auth-Answer exchange.

         +  Re-authentication request.[a21]

         +  The initial PANA-Auth-Request after a PaC receives a valid
            non-initial PANA-Auth-Request.

         +  PANA-Termination-Request.[a22]

      *  In the access phase:

Forsberg, et al.         Expires October 6, 2007               [Page 18]

Internet-Draft                    PANA                        April 2007

         +  PANA-Auth-Request.[a23]

         +  PANA-Client-Initiation.

      *  In the termination phase:

         +  PANA-Client-Initiation.

         +  All requests but PANA-Termination-Request.

   o  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 and no AVP, which needs to be at a fixed position,
      is included in a position different from this fixed position.

   o  Each AVP is decoded correctly.

   o  When an AUTH AVP is included, the AVP value matches the hash value
      computed against the received message.

   Invalid messages MUST be discarded in order to provide robustness
   against DoS attacks.  In addition, an error request message MAY be
   returned to the sender.  See Section 5.8 for details.

5.6.  PaC Updating its IP Address

   A PaC's IP address used for PANA can change in certain situations,
   e.g., when the PaC moves from one IP link to another within the same
   PAA's realm.  In order to maintain the PANA session, the PAA needs to
   be notified about the change of PaC address.

   After the PaC has changed its IP address used for PANA, it MUST send
   any valid PANA message, except for an error request or answer, to the
   PAA.  If the message that carries the new PaC IP address in the
   Source Address field of the IP header is valid, the PAA MUST update
   the PANA session with the new PaC address.  If there is an
   established PANA SA, the message MUST be protected with an AUTH AVP.

5.7.  Session Lifetime

   The authentication and authorization phase determines the PANA
   session lifetime when the network access authorization succeeds.  The
   Session-Lifetime AVP MAY be optionally included in the last
   PANA-Auth-Request message to inform the PaC about the valid lifetime
   of the PANA session.  It MUST be ignored when included in other PANA
   messages.

   When the Session-Lifetime AVP is not included in the last

Forsberg, et al.         Expires October 6, 2007               [Page 19]

Internet-Draft                    PANA                        April 2007

   PANA-Auth-Request message then the PaC has no knowledge about a PANA
   session limitation and must therefore conclude that the session is
   not limited.

   The lifetime is a non-negotiable parameter that can be used by the
   PaC to manage PANA-related state.  The PaC does not have to perform
   any actions when the lifetime expires, other than purging local
   state.  The PAA MUST initiate the re-authentication phase before the
   current session lifetime expires.

   The PaC and the PAA MAY use information obtained outside PANA (e.g.,
   lower-layer indications) to expedite the detection of a disconnected
   peer.  Availability and reliability of such indications MAY depend on
   a specific link-layer or network topology and are therefore only
   hints.  A PANA peer SHOULD use the ping request and answer exchange
   to verify that a peer is, in fact, no longer alive, unless
   information obtained outside PANA is being used to expedite the
   detection of a disconnected peer.

   The session lifetime parameter is not related to the transmission of
   ping request messages.  These messages can be used for asynchronously
   verifying the liveness of the peer.  The decision to send a ping
   request message is taken locally and does not require coordination
   between the peers.

5.8.  Error Handling

   A PANA-Notification-Request message with 'E' (Error) bit set (an
   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-Notification-Answer message with 'E' bit set (an error answer
   message).

   An adversary might craft erroneous PANA messages to launch a DoS
   attack.  Unless the PaC or the PAA performs a rate-limitation of the
   generated error request messages it may be overburdened by responding
   to bogus messages.  Note that an error answer message that is sent in
   response to an error request message does not require either the PaC
   or the PAA to create a PANA protocol state.

   If an error request or answer message is sent unprotected (i.e.,
   without using an AUTH AVP) then the message MUST be processed such
   that the receiver does not change its PANA protocol state.

Forsberg, et al.         Expires October 6, 2007               [Page 20]

Internet-Draft                    PANA                        April 2007

6.  Message Format

   This section defines message formats for PANA protocol.

6.1.  IP and UDP Headers

   Any PANA message is unicast between the PaC and the PAA.

   For any PANA message sent from the peer that has initiated the PANA
   session, the UDP source port is set to any number and the destination
   port is set to the assigned PANA port number (to be assigned by
   IANA).  For any PANA message sent from the other peer, the source
   port is set to the assigned PANA port number (to be assigned by IANA)
   and the destination port is copied from the source port of the last
   received message.  [a24]In case both the PaC and PAA initiates the session
   (i.e., PANA-Client-Initiation and unsolicited PANA-Auth-Request
   messages cross each other), then the PaC is identified as the
   initiator.

6.2.  PANA Message Header

   A summary of the PANA message header format is shown below.  The
   fields are transmitted in network byte order.

    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          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                      Session Identifier                       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        Sequence Number                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  AVPs ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-

   Version

      This Version field MUST be set to 1 to indicate PANA Version 1.

   Reserved

      This 8-bit field is reserved for future use, and MUST be set to
      zero, and ignored by the receiver.

Forsberg, et al.         Expires October 6, 2007               [Page 21]

Internet-Draft                    PANA                        April 2007

   Message Length

      The Message Length field is two octets and indicates the length of
      the PANA message including the header fields.

   Flags

      The Flags field is two octets.  The following bits are assigned:

    0                   1
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |R S C A P E r r r r r r r r r r|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      R (Request)

         If set, the message is a request.  If cleared, the message is
         an answer.

      S (Start)

         If set, the message is the first PANA-Auth-Request or PANA-
         Auth-Answer in authentication and authorization phase.  For
         other messages, this bit MUST be cleared.

      C (Complete)

         If set, the message is the last PANA-Auth-Request or PANA-Auth-
         Answer in authentication and authorization phase.  For other
         messages this bit MUST be cleared.

      A (re-Authentication)

         If set, the message is a PANA-Notification-Request or PANA-
         Notification-Answer to initiate re-authentication.  For other
         messages this bit MUST be cleared.

      P (Ping)

         If set, the message is a PANA-Notification-Request or PANA-
         Notification-Answer for liveness test.  For other messages this
         bit MUST be cleared.

      E (Error)

         If set, the message is a PANA-Notification-Request or PANA-
         Notification-Answer for error indication.  For other messages

Forsberg, et al.         Expires October 6, 2007               [Page 22]

Internet-Draft                    PANA                        April 2007

         this bit MUST be cleared.

      r (reserved)

         These flag bits are reserved for future use, and MUST be set to
         zero, and ignored by the receiver.

   Message Type

      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 [ianaweb].

   Session Identifier

      This field contains a 32 bit session identifier.

   Sequence Number

      This field contains contains a 32 bit sequence number.

   AVPs

      AVPs are a method of encapsulating information relevant to the
      PANA message.  See section Section 6.3 for more information on
      AVPs.

6.3.  AVP Format

   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 Value field till a
   word boundary is reached.  The length of the padding is not reflected
   in the AVP Length field [RFC3588].

   The fields in the AVP are sent in network byte order.  The AVP format
   is:

Forsberg, et al.         Expires October 6, 2007               [Page 23]

Internet-Draft                    PANA                        April 2007

    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)                       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Value ...
   +-+-+-+-+-+-+-+-+

   AVP Code

      The AVP Code, together with the optional Vendor ID field,
      identifies attribute that follows.  If the V-bit is not set, the
      Vendor ID is not present and the AVP Code refers to an IETF
      attribute.

   AVP Flags

      The AVP Flags field is two octets.  The following bits are
      assigned:

    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|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      V (Vendor)

         The 'V' bit, known as the Vendor-Specific bit, indicates
         whether the optional Vendor-Id field is present in the AVP
         header.  When set the AVP Code belongs to the specific vendor
         code address space.

      M (Mandatory)

         The 'M' Bit, known as the Mandatory bit, indicates whether
         support of the AVP is required.  If an AVP with the 'M' bit set
         is received by the PaC or PAA and either the AVP or its value
         is unrecognized, the message MUST be rejected and the receiver
         MUST send a PANA-Notification-Request message with 'E' bit set.
         If the AVP was unrecognized the result code of the PANA-
         Notification-Request message with 'E' bit set MUST be
         PANA_AVP_UNSUPPORTED.  If the AVP value was unrecognized the
         result code of the PANA-Notification-Request message with 'E'

Forsberg, et al.         Expires October 6, 2007               [Page 24]

Internet-Draft                    PANA                        April 2007

         bit set MUST be PANA_INVALID_AVP_DATA.  In either case the
         PANA-Notification-Request message with 'E' bit set MUST carry a
         Failed-AVP AVP containing the offending mandatory AVP.  AVPs
         with the 'M' bit cleared are informational only and a receiver
         that receives a message with such an AVP that is not
         recognized, or whose value is not recognized, MAY simply ignore
         the AVP.

      r (reserved)

         These flag bits are reserved for future use, and MUST be set to
         zero, and ignored by the receiver.

   AVP Length

      The AVP Length field is two octets, and indicates the number of
      octets in the Value field.  The length of the AVP Code, AVP
      Length, AVP Flags, Reserved and Vendor-Id fields are not counted
      in the AVP Length value.

   Reserved

      This two-octet field is reserved for future use, and MUST be set
      to zero, and ignored by the receiver.

   Vendor-Id

      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"
      [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.

   Value

      The Value field is zero or more octets and contains information
      specific to the Attribute.  The format of the Value field is
      determined by the AVP Code and Vendor-Id fields.  The length of
      the Value field is determined by the AVP Length field.

   Unless otherwise noted, AVPs defined in this document will have the
   following default AVP Flags field settings: The 'M' bit MUST be set.
   The 'V' bit MUST NOT be set.

Forsberg, et al.         Expires October 6, 2007               [Page 25]

Internet-Draft                    PANA                        April 2007

7.  PANA Messages

   Each Request/Answer message pair is assigned a Sequence Number, and
   the sub-type (i.e., request or answer) is identified via the 'R'
   (Request) bit in the Message Flags field of the PANA message header.

   Every PANA message MUST contain a message type in its header's
   Message Type field, which is used to determine the action that is to
   be taken for a particular message.  Figure 3 lists all PANA messages
   defined in this document:

   Message-Name              Abbrev. ID PaC<->PAA  Ref.
   ----------------------------------------------------------
   PANA-Client-Initiation     PCI    1  -------->  7.1
   PANA-Auth-Request          PAR    2  <------->  7.2
   PANA-Auth-Answer           PAN    2  <------->  7.3
   PANA-Termination-Request   PTR    3  <------->  7.4
   PANA-Termination-Answer    PTA    3  <------->  7.5
   PANA-Notification-Request  PNR    4  <------->  7.6
   PANA-Notification-Answer   PNA    4  <------->  7.7
   -----------------------------------------------------------

                     Figure 3: Table of PANA Messages

   Every PANA message defined MUST include a corresponding ABNF
   [RFC2234] specification, which is used to define the AVPs that MUST
   or MAY be present.  The following format is used in the definition:

  message-def      = Message-Name "::=" PANA-message

  message-name     = PANA-name

  PANA-name        = ALPHA *(ALPHA / DIGIT / "-")

  PANA-message     = header  [ *fixed] [ *required] [ *optional]
                     [ *fixed]

  header           = "< PANA-Header: " Message-Type
                     [r-bit] [s-bit] [c-bit] [a-bit] [p-bit] [e-bit] ">"

  Message-Type     = 1*DIGIT
                     ; The Message Type assigned to the message

  r-bit            = ", REQ"
                     ; If present, the 'R' bit in the Message
                     ; Flags is set, indicating that the message
                     ; is a request, as opposed to an answer.

Forsberg, et al.         Expires October 6, 2007               [Page 26]

Internet-Draft                    PANA                        April 2007

  s-bit            = ", STA"
                     ; If present, the 'S' bit in the Message
                     ; Flags is set, indicating that the message
                     ; is the initial PAR or PAN in authentication
                     ; and authorization phase.

  c-bit            = ", COM"
                     ; If present, the 'C' bit in the Message
                     ; Flags is set, indicating that the message
                     ; is the final PAR and PAN in authentication
                     ; and authorization phase or re-authentication
                     ; phase.

  a-bit            = ", REA"
                     ; If present, the 'A' bit in the Message
                     ; Flags is set, indicating that the message
                     ; is a re-authentication request or answer.

  p-bit            = ", PIN"
                     ; If present, the 'P' bit in the Message
                     ; Flags is set, indicating that the message
                     ; is a ping request or answer.

  e-bit            = ", ERR"
                     ; If present, the 'E' bit in the Message
                     ; Flags is set, indicating that the message
                     ; is an error request or answer.

  fixed            = [qual] "<" avp-spec ">"
                     ; Defines the fixed position of an AVP.

  required         = [qual] "{" avp-spec "}"
                     ; The AVP MUST be present and can appear
                     ; anywhere in the message.

  optional         = [qual] "[" avp-name "]"
                     ; The avp-name in the 'optional' rule cannot
                     ; evaluate to any AVP Name which is included
                     ; in a fixed or required rule.  The AVP can
                     ; appear anywhere in the message.

  qual             = [min] "*" [max]
                     ; See ABNF conventions, RFC 2234 Section 6.6.
                     ; The absence of any qualifiers depends on whether
                     ; it precedes a fixed, required, or optional
                     ; rule.  If a fixed or required rule has no
                     ; qualifier, then exactly one such AVP MUST
                     ; be present.  If an optional rule has no

Forsberg, et al.         Expires October 6, 2007               [Page 27]

Internet-Draft                    PANA                        April 2007

                     ; qualifier, then 0 or 1 such AVP may be
                     ; present.
                     ;
                     ; NOTE:  "[" and "]" have a different meaning
                     ; than in ABNF (see the optional rule, above).
                     ; These braces cannot be used to express
                     ; optional fixed rules (such as an optional
                     ; AUTH at the end).  To do this, the convention
                     ; is '0*1fixed'.

  min              = 1*DIGIT
                     ; The minimum number of times the element may
                     ; be present.  The default value is zero.

  max              = 1*DIGIT
                     ; The maximum number of times the element may
                     ; be present.  The default value is infinity.  A
                     ; value of zero implies the AVP MUST NOT be
                     ; present.

  avp-spec         = PANA-name
                     ; The avp-spec has to be an AVP Name, defined
                     ; in the base or extended PANA protocol
                     ; specifications.

  avp-name         = avp-spec / "AVP"
                     ; The string "AVP" stands for *any* arbitrary
                     ; AVP Name, which does not conflict with the
                     ; required or fixed position AVPs defined in
                     ; the message definition.

7.1.  PANA-Client-Initiation (PCI)

   The PANA-Client-Initiation (PCI) message is used for PaC-initiated
   session.  The Sequence Number and Session Identifier fields in this
   message MUST be set to zero (0).

   PANA-Client-Initiation ::= < PANA-Header: 1 >
                    *  [ AVP ]

7.2.  PANA-Auth-Request (PAR)

   The PANA-Auth-Request (PAR) message is either sent by the PAA or the
   PaC.

   The message MUST NOT have both 'S' and 'C' bits set.

Forsberg, et al.         Expires October 6, 2007               [Page 28]

Internet-Draft                    PANA                        April 2007

   PANA-Auth-Request ::= < PANA-Header: 2, REQ[,STA][,COM] >
                       [ EAP-Payload ]
                       [ Algorithm ]
                       [ Nonce ]
                       [ Result-Code ]
                       [ Session-Lifetime ]
                       [ Key-Id ]
                    *  [ AVP ]
                   0*1 < AUTH >

7.3.  PANA-Auth-Answer (PAN)

   The PANA-Auth-Answer (PAN) message is sent by either the PaC or the
   PAA in response to a PANA-Auth-Request message.

   The message MUST NOT have both 'S' and 'C' bits set.

   PANA-Auth-Answer ::= < PANA-Header: 2 [,STA][,COM] >
                       [ Nonce ]
                       [ EAP-Payload ]
                       [ Key-Id ]
                    *  [ AVP ]
                   0*1 < AUTH >

7.4.  PANA-Termination-Request (PTR)

   The PANA-Termination-Request (PTR) message is sent either by the PaC
   or the PAA to terminate a PANA session.

   PANA-Termination-Request ::= < PANA-Header: 3, REQ >
                       < Termination-Cause >
                    *  [ AVP ]
                   0*1 < AUTH >

7.5.  PANA-Termination-Answer (PTA)

   The PANA-Termination-Answer (PTA) message is sent either by the PaC
   or the PAA in response to PANA-Termination-Request.

   PANA-Termination-Answer ::= < PANA-Header: 3 >
                    *  [ AVP ]
                   0*1 < AUTH >

7.6.  PANA-Notification-Request (PNR)

   The PANA-Notification-Request (PNR) message is sent either by the PaC
   or the PAA for signaling re-authentication and errors, and performing
   liveness test.

Forsberg, et al.         Expires October 6, 2007               [Page 29]

Internet-Draft                    PANA                        April 2007

   If 'A' or 'P' bit is set, the message MUST NOT carry Result-Code,
   Failed-Message-Header and Failed-AVP AVPs.

   If 'E' bit is set, the message MUST carry one Result-Code AVP and one
   Failed-Message-Header AVP and MAY carry one or more Failed AVPs.

   The message MUST have one of 'A', 'P' and 'E' bits exclusively set.

 PANA-Notification-Request ::= < PANA-Header: 4, REQ[,REA][,PIN][,ERR] >
                     [ Result-Code ]
                     [ Failed-Message-Header ]
                  *  [ Failed-AVP ]
                  *  [ AVP ]
                 0*1 < AUTH >

7.7.  PANA-Notification-Answer (PNA)

   The PANA-Notification-Answer (PNA) message is sent by the PAA (PaC)
   to the PaC (PAA) in response to a PANA-Notification-Request from the
   PaC (PAA).

   The message MUST have one of 'A', 'P' and 'E' bits exclusively set.

  PANA-Notification-Answer ::= < PANA-Header: 4, REQ[,REA][,PIN][,ERR] >
                   *  [ AVP ]
                  0*1 < AUTH >

Forsberg, et al.         Expires October 6, 2007               [Page 30]

Internet-Draft                    PANA                        April 2007

8.  AVPs in PANA

   This document uses AVP Value Format such as 'OctetString' and
   'Unsigned32' as defined in Section 4.2 of [RFC3588].  The definitions
   of these data formats are not repeated in this document.

   The following table lists the AVPs used in this document, and
   specifies in which PANA messages they MAY, or MAY NOT be present.

   The table uses the following symbols:

   0     The AVP MUST NOT be present in the message.

   0+    Zero or more instances of the AVP MAY be present in the
         message.

   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.

   1     One instance of the AVP MUST be present in the message.

                         +---------------------------+
                         |        Message Type       |
                         +---+---+---+---+---+---+---+
   Attribute Name        |PCI|PAR|PAN|PTR|PTA|PNR|PNA|
   ----------------------+---+---+---+---+---+---+---+
   Algorithm             | 0 |0-1| 0 | 0 | 0 | 0 | 0 |
   AUTH                  | 0 |0-1|0-1|0-1|0-1|0-1|0-1|
   EAP-Payload           | 0 |0-1|0-1| 0 | 0 | 0 | 0 |
   Failed-AVP            | 0 | 0 | 0 | 0 | 0 | 0+| 0 |
   Failed-Message-Header | 0 | 0 | 0 | 0 | 0 |0-1| 0 |
   Key-Id                | 0 |0-1|0-1| 0 | 0 | 0 | 0 |
   Nonce                 | 0 |0-1|0-1| 0 | 0 | 0 | 0 |
   Result-Code           | 0 |0-1| 0 | 0 | 0 |0-1| 0 |
   Session-Lifetime      | 0 |0-1| 0 | 0 | 0 | 0 | 0 |
   Termination-Cause     | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
   ----------------------+---+---+---+---+---+---+---+

                      Figure 4: AVP Occurrence Table

8.1.  Algorithm AVP

   The Algorithm AVP (AVP Code 1) is used for conveying the
   pseudo-random function to derive PANA_AUTH_KEY as well as the
   integrity algorithm to compute an AUTH AVP.  The AVP data is of type
   Unsigned32.

Forsberg, et al.         Expires October 6, 2007               [Page 31]

Internet-Draft                    PANA                        April 2007

   The first 16-bit of the AVP data contains an IKEv2 Transform ID of
   Transform Type 2 [RFC4306] corresponding to the key derivation
   function.

   The last 16-bit of the AVP data contains an IKEv2 Transform ID of
   Transform Type 3 [RFC4306] for the integrity algorithm.

   All PANA implementations MUST support PRF_HMAC_SHA1 (2) [RFC2104] for
   the key derivation algorithm and AUTH_HMAC_SHA1_160 (7) [RFC4595]
   corresponding to the integrity algorithm.

8.2.  AUTH AVP

   The AUTH AVP (AVP Code 2) is used to integrity protect PANA messages.
   The AVP data payload contains the Message Authentication Code encoded
   in network byte order.  The AVP length varies depending on the
   integrity algorithm specified in an Algorithm AVP.

8.3.  EAP-Payload AVP

   The EAP-Payload AVP (AVP Code 3) is used for encapsulating the actual
   EAP message that is being exchanged between the EAP peer and the EAP
   authenticator.  The AVP data is of type OctetString.

[a25]8.4.  Failed-AVP AVP

   The Failed-AVP AVP (AVP Code 4) provides debugging information in
   cases where a message 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 using the ABNF grammar
   defined in [RFC3588] for Grouped AVP is as follows.

           <Failed-AVP> ::= < AVP Header: 4 >
                         1* {AVP}

   In case of a failed grouped AVP, the Failed-AVP contains the whole
   grouped AVP.  In case of a failed AVP inside a grouped AVP, the
   Failed-AVP contains the single offending AVP.

8.5.  Failed-Message-Header AVP

   The Failed-Message-Header AVP (AVP Code 5) provides debugging
   information in cases where a message is rejected or not fully
   processed due to erroneous information in the message header or
   payload.  The AVP data is of type OctetString.  The AVP data contains
   the 16-octet header of the message that caused the error.

Forsberg, et al.         Expires October 6, 2007               [Page 32]

Internet-Draft                    PANA                        April 2007

8.6.  Key-Id AVP

   The Key-Id AVP (AVP Code 6) is of type Integer32, and contains an MSK
   identifier.  The MSK identifier is assigned by PAA and MUST be unique
   within the PANA session.

8.7.  Nonce AVP

   The Nonce AVP (AVP Code 7) carries a randomly chosen value that is
   used in cryptographic key computations.  The recommendations in
   [RFC4086] apply with regard to generation of random values.  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
   octets inclusive.

   The length of the nonces are determined based on the available
   pseudo-random functions (PRFs) and the degree of trust placed into
   the two PaC and the PAA to compute random values.  The length of the
   random value for the nonce is determined whether

   1.  The PaC and the PAA each are likely to be able to compute a
       random nonce (according to [RFC4086]).  The length of the nonce
       has to be 1/2 the length of the PRF key [a26](e.g., 10 octets in the
       case of HMAC-SHA1).

   2.  The PaC and the PAA each are not trusted with regard to the
       computation of a random nonce (according to [RFC4086]).  The
       length of the nonce has to have the full length [a27]of the PRF key
       (e.g., 20 octets in the case of HMAC-SHA1).

   Furthermore, the strongest available PRF available for PANA has to be
   considered in this computation.  Currently, only a single PRF (namely
   HMAC-SHA1) is available and therefore the maximum output length is 20
   octets).  The recommended maximum length of the nonce value is
   therefore currently 20 octets.

8.8.  Result-Code AVP

   The Result-Code AVP (AVP Code 8) is of type Unsigned32 and indicates
   whether an EAP authentication was completed successfully or whether
   an error occurred.  Result-Code AVP values are described in the
   subsequent sections.

8.8.1.  Authentication Results Codes

   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

Forsberg, et al.         Expires October 6, 2007               [Page 33]

Internet-Draft                    PANA                        April 2007

   returned to the PaC.  These codes are used with PANA-Auth-Request
   message with 'C' bit set.

   PANA_SUCCESS                               0

      Both authentication and authorization processes are successful.

   PANA_AUTHENTICATION_REJECTED               1

      Authentication has failed.  When this error is returned, it is
      assumed that authorization is automatically failed.

   PANA_AUTHORIZATION_REJECTED                [a28]2

      The authorization process has failed.  This error could occur when
      authorization is rejected by a AAA server or rejected locally by a
      PAA, even if the authentication procedure has succeeded.

8.8.2.  Protocol Error Result Codes

   These codes are used with error request messages.  Unless stated
   otherwise, they can be generated by both the PaC and the PAA.

   PANA_MESSAGE_UNSUPPORTED                1001

      Message type not recognized or supported.

   PANA_UNABLE_TO_DELIVER                  1002

      The PAA was unable to deliver the EAP payload to the
      authentication server.  Only the PAA can generate this code.

   PANA_INVALID_HDR_BITS                   1003

      A message was received whose bits in the PANA message header were
      either set to an invalid combination, or to a value that is
      inconsistent with the message type definition.

   PANA_INVALID_AVP_FLAGS                  1004

      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.

   PANA_AVP_UNSUPPORTED                    1005

      The received message contained an AVP that is not recognized or
      supported and was marked with the Mandatory bit.  A PANA message

Forsberg, et al.         Expires October 6, 2007               [Page 34]

Internet-Draft                    PANA                        April 2007

      with this error MUST contain one or more Failed-AVP AVP containing
      the AVPs that caused the failure.

   PANA_INVALID_AVP_DATA                   1006

      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.

   PANA_MISSING_AVP                        1007

      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.

   PANA_RESOURCES_EXCEEDED                 1008

      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 the PAA can
      generate this code.

   PANA_CONTRADICTING_AVPS                 1009

      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 the PAA can generate this code.

   PANA_AVP_NOT_ALLOWED                    1010

      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.

   PANA_AVP_OCCURS_TOO_MANY_TIMES          1011

      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.

Forsberg, et al.         Expires October 6, 2007               [Page 35]

Internet-Draft                    PANA                        April 2007

   PANA_UNSUPPORTED_VERSION                1012

      This error is returned when a message was received, whose version
      number is unsupported.

   PANA_UNABLE_TO_COMPLY                   1013

      This error is returned when a request is rejected for unspecified
      reasons.

   PANA_INVALID_AVP_LENGTH 1014

      The message contained an AVP with an invalid length.  The error
      request message indicating this error MUST include the offending
      AVPs within a Failed-AVP AVP.

   PANA_INVALID_MESSAGE_LENGTH             1015

      This error is returned when a message is received with an invalid
      message length.

8.9.  Session-Lifetime AVP

   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.

8.10.  Termination-Cause AVP

   The Termination-Cause AVP (AVP Code 10) 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.

   LOGOUT                   1  (PaC -> PAA)

      The client initiated a disconnect

   ADMINISTRATIVE           4  (PAA -> PaC)

      The client was not granted access, or was disconnected, due to
      administrative reasons.

   SESSION_TIMEOUT          8  (PAA -> PaC)

      The session has timed out, and service has been terminated.

Forsberg, et al.         Expires October 6, 2007               [Page 36]

Internet-Draft                    PANA                        April 2007

9.  Retransmission Timers

   The PANA protocol provides retransmissions for the
   PANA-Client-Initiation message and all request messages.

   PANA retransmission timers are based on the model used in DHCPv6
   [RFC3315].  Variables used here are also borrowed from this
   specification.  PANA is a request/response-based protocol.  The
   message exchange terminates when the requester successfully receives
   the answer, a protected error message for the request is received, or
   the message exchange is considered to have failed according to the
   retransmission mechanism described below.

   The retransmission behavior is controlled and described by the
   following variables:

         RT     Retransmission timeout

         IRT    Initial retransmission time

         MRC    Maximum retransmission count

         MRT    Maximum retransmission time

         MRD    Maximum retransmission duration

         RAND   Randomization factor

   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.

   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.

   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.

   RT for the first message transmission is based on IRT:

         RT = IRT + RAND*IRT

   RT for each subsequent message transmission is based on the previous
   value of RT:

Forsberg, et al.         Expires October 6, 2007               [Page 37]

Internet-Draft                    PANA                        April 2007

         RT = 2*RTprev + RAND*RTprev

   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:

         if (RT > MRT)
            RT = MRT + RAND*MRT

   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.

   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.

   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.

   If both MRC and MRD are zero, the client continues to transmit the
   message until it receives a response.

9.1.  Transmission and Retransmission Parameters

   This section presents a table of values used to describe the message
   retransmission behavior of PANA requests that are retransmitted
   (REQ_*) and PANA-Client-Initiation message (PCI_*).  The table shows
   default values.

          Parameter       Default   Description
          ------------------------------------------------
          PCI_IRT           1 sec   Initial PCI timeout.
          PCI_MRT         120 secs  Max PCI timeout value.
          PCI_MRC           0       Max PCI retransmission attempts.
          PCI_MRD           0       Max PCI retransmission duration.

          REQ_IRT           1 sec   Initial Request timeout.
          REQ_MRT          30 secs  Max Request timeout value.
          REQ_MRC          10       Max Request retransmission attempts.
          REQ_MRD           0       Max Request retransmission duration.

   So for example the first RT for the PBR message is calculated using
   REQ_IRT as the IRT:

           RT = REQ_IRT + RAND*REQ_IRT

Forsberg, et al.         Expires October 6, 2007               [Page 38]

Internet-Draft                    PANA                        April 2007

10.  IANA Considerations

   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 [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".

   This section explains the criteria to be used by the IANA for
   assignment of numbers within namespaces defined within this document.

   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.

10.1.  PANA UDP Port Number

   PANA uses one well-known UDP port number Section 6.1), which needs to
   be assigned by the IANA.

10.2.  PANA Message Header

   As defined in Section 6.2, the PANA message header contains two
   fields that requires IANA namespace management; the Version, Message
   Type and Flags fields.

10.2.1.  Version

   The Version namespace is used to identify PANA versions.  The Version
   values are assigned by Standards Action [IANA].  This document
   defines the Version 1.

10.2.2.  Message Type

   The Message Type namespace is used to identify PANA messages.  Values
   0-65,519 are for permanent, standard message types, allocated by IETF
   Consensus [IANA].  This document defines the Message Types 1-4.  See
   Section 7.1 through Section 7.7 for the assignment of the namespace

Forsberg, et al.         Expires October 6, 2007               [Page 39]

Internet-Draft                    PANA                        April 2007

   in this specification.

   The values 65,520 and 65,535 (hexadecimal values 0xfff0 - 0xffff) are
   reserved for experimental messages.  As these codes are only for
   experimental and testing purposes, no guarantee is made for
   interoperability between the communicating PaC and PAA using
   experimental commands, as outlined in [IANA-EXP].

10.2.3.  Flags

   There are 16 bits in the Flags field of the PANA message header.
   This document assigns bit 0 ('R'), 1 ('S'), 2 ('C'), 3 ('A'), 4 ('P')
   and 5 ('E').  The remaining bits MUST only be assigned via a
   Standards Action [IANA].

10.3.  AVP Header

   As defined in Section 6.3, 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.

10.3.1.  AVP Code

   The 16-bit 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 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.

   AVP Code 0 is not used.  This document defines the AVP Codes 1-10.
   See Section 8.1 through Section 8.10 for the assignment of the
   namespace in this specification.

   AVPs may be allocated following Designated Expert with Specification
   Required [IANA] or Standards Action.  AVPs with 'M' bit set MUST be
   allocated by Standards Action.

   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

Forsberg, et al.         Expires October 6, 2007               [Page 40]

Internet-Draft                    PANA                        April 2007

   be encouraged instead.

10.3.2.  Flags

   There are 16 bits in the AVP Flags field of the AVP header, defined
   in Section 6.3.  This document assigns bit 0 ('V') and bit 1 ('M').
   The remaining bits should only be assigned via a Standards Action .

10.4.  AVP Values

   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 [IANA].

10.4.1.  Result-Code AVP Values

   As defined in Section 8.8.1 and Section 8.8.2 the Result-Code AVP
   (AVP Code 8) defines the values 0-3 and 1001-1015.

   All remaining values are available for assignment via IETF Consensus
   [IANA].

10.4.2.  Termination-Cause AVP Values

   As defined in Section 8.10, the Termination-Cause AVP (AVP Code 10)
   defines the values 1, 4 and 8.

   All remaining values are available for assignment via IETF Consensus
   [IANA].

Forsberg, et al.         Expires October 6, 2007               [Page 41]

Internet-Draft                    PANA                        April 2007

11.  Security Considerations

   The PANA protocol defines a UDP-based EAP encapsulation that runs
   between two IP-enabled nodes.  Various security threats that are
   relevant to a protocol of this nature are outlined in [RFC4016].
   Security considerations stemming from the use of EAP and EAP methods
   are discussed in [RFC3748] [I-D.ietf-eap-keying].  This section
   provides a discussion on the security-related issues that are related
   to PANA framework and protocol design.

   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 cryptographically-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).

11.1.  General Security Measures

   PANA provides multiple mechanisms to secure a PANA session.

   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
   spoofing messages to disturb ongoing PANA and EAP sessions unless it
   can also eavesdrop to synchronize on the expected sequence number.
   Furthermore, impact of replay attacks is reduced as any stale message
   (i.e., a request or answer with an unexpected sequence number and/or
   a session identifier for a non-existing session) and any duplicate
   answer are immediately discarded, and a duplicate request can trigger
   transmission of the cached answer (i.e., no need to process the
   request and generate a new answer).

   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 the initial PANA-Auth-Request
   message that is received from the segment of the access network where
   only the PaCs are supposed to be connected (i.e., preventing PAA

Forsberg, et al.         Expires October 6, 2007               [Page 42]

Internet-Draft                    PANA                        April 2007

   impersonation).

   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 MSK exported by
   the EAP method.  This SA is used for generating an AUTH AVP to
   protect the PANA message header and payload (including the complete
   EAP message).

   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 AUTH verification is silently discarded.  The
   earliest this protection can be enabled is when the PANA-Auth-Request
   message that signals a successful authentication (EAP Success) is
   generated.  Starting with these messages, any subsequent PANA message
   until the session gets torn down can be cryptographically protected.

   The lifetime of the PANA SA is set to PANA session lifetime which is
   bounded by the authorization lifetime granted by the authentication
   server.  An implementation MAY add a grace period to that value.
   Unless the PANA session is extended by executing another EAP
   authentication, the PANA SA is removed when the current session
   expires.

   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.

11.2.  Initial Exchange

   The initial PANA-Auth-Request and PANA-Auth-Answer exchange is
   vulnerable to spoofing attacks as these messages are not
   authenticated and integrity protected.  In order to prevent very
   basic DoS attacks an adversary should not be able to cause state
   creation by sending PANA-Client-Initiation messages to the PAA.  This
   protection is achieved by allowing the responder (PAA) to create as
   little amount of state as possible in the initial message exchange.
   However, it is difficult to prevent all spoofing attacks in the
   initial message exchange entirely.

   In networks where lower-layers are not secured prior to running PANA,
   the capability discovery enabled through inclusion of an Algorithm
   AVP in the initial PANA-Auth-Request message is susceptible to
   spoofing leading to DoS attacks.  Therefore, usage of this AVP during
   the initial message exchange in such insecure networks is NOT

Forsberg, et al.         Expires October 6, 2007               [Page 43]

Internet-Draft                    PANA                        April 2007

   RECOMMENDED.  The same AVP is delivered with integrity protection via
   the last PANA-Auth-Request message upon successful authentication.

11.3.  EAP Methods

   Eavesdropping EAP messages 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 Response/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.

   To prevent these threats, [I-D.ietf-pana-framework] suggests using
   proper EAP methods for particular environments.  Depending on the
   deployment environment an EAP authentication method 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.

11.4.  Cryptographic Keys

   When the EAP method exports an MSK, this key is used to produce a
   PANA SA with PANA_AUTH_KEY with a distinct key ID.  The PANA_AUTH_KEY
   is unique to the PANA session, and takes PANA-based nonce values into
   computation to cryptographically separate itself from the MSK.

   The PANA_AUTH_KEY is solely used for authentication and integrity
   protection of the PANA messages within the designated session.

   The PANA SA lifetime is bounded by the MSK lifetime.  Another
   execution of EAP method yields in a new MSK, and updates the PANA SA,
   PANA_AUTH_KEY and key ID.

11.5.  Per-packet Ciphering

   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 SA establishment.  The PANA framework allows
   generation of cryptographic keys from the PANA SA and use the keys
   with a secure association protocol to enable per-packet cryptographic
   protection such as link-layer or IPsec-based ciphering
   [I-D.ietf-pana-ipsec].  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.  How cryptographic keys are
   generated from the PANA SA and used with a secure association

Forsberg, et al.         Expires October 6, 2007               [Page 44]

Internet-Draft                    PANA                        April 2007

   protocol is outside the scope of this document.

11.6.  PAA-to-EP Communication

   The PANA framework allows separation of PAA from EP.  SNMPv3
   [I-D.ietf-pana-snmp] MAY be used between 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.

11.7.  Liveness Test

   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,
   expecting the peer to 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.

   Any valid PANA answer message received in response to a recently sent
   request message can be taken as an indication of peer's liveness.
   The PaC or PAA MAY forgo sending an explicit ping request message if
   a recent exchange has already confirmed that the peer is alive.

11.8.  Early Termination of a Session

   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.

Forsberg, et al.         Expires October 6, 2007               [Page 45]

Internet-Draft                    PANA                        April 2007

12.  Acknowledgments

   We would like to thank Mark Townsley, Jari Arkko, Mohan
   Parthasarathy, Julien Bournelle, Rafael Marin Lopez, Pasi Eronen,
   Randy Turner, Erik Nordmark, Lionel Morand, Avi Lior, Susan Thomson,
   Giaretta Gerardo, Joseph Salowey, Sasikanth Bharadwaj, Spencer
   Dawkins, Tom Yu, Bernard Aboba and all members of the PANA working
   group for their valuable comments to this document.

Forsberg, et al.         Expires October 6, 2007               [Page 46]

Internet-Draft                    PANA                        April 2007

13.  References

13.1.  Normative References

   [RFC2104]  Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
              Hashing for Message Authentication", RFC 2104,
              February 1997.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC2234]  Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
              Specifications: ABNF", RFC 2234, November 1997.

   [RFC3588]  Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J.
              Arkko, "Diameter Base Protocol", RFC 3588, September 2003.

   [RFC3748]  Aboba, B., Blunk, L., Vollbrecht, J., Carlson, J., and H.
              Levkowetz, "Extensible Authentication Protocol (EAP)",
              RFC 3748, June 2004.

   [RFC4086]  Eastlake, D., Schiller, J., and S. Crocker, "Randomness
              Requirements for Security", BCP 106, RFC 4086, June 2005.

   [RFC4595]  Maino, F. and D. Black, "Use of IKEv2 in the Fibre Channel
              Security Association Management Protocol", RFC 4595,
              July 2006.

   [I-D.ietf-dhc-paa-option]
              Morand, L., "DHCP options for PANA Authentication Agents",
              draft-ietf-dhc-paa-option-05 (work in progress),
              December 2006.

   [IANA]     Narten, T. and H. Alvestrand, "Guidelines for Writing an
              IANA Considerations Section in RFCs",  BCP 26, RFC 2434,
              October 1998.

13.2.  Informative References

   [RFC3315]  Droms, R., Bound, J., Volz, B., Lemon, T., Perkins, C.,
              and M. Carney, "Dynamic Host Configuration Protocol for
              IPv6 (DHCPv6)", RFC 3315, July 2003.

   [RFC4016]  Parthasarathy, M., "Protocol for Carrying Authentication
              and Network Access (PANA) Threat Analysis and Security
              Requirements", RFC 4016, March 2005.

   [RFC4058]  Yegin, A., Ohba, Y., Penno, R., Tsirtsis, G., and C. Wang,

Forsberg, et al.         Expires October 6, 2007               [Page 47]

Internet-Draft                    PANA                        April 2007

              "Protocol for Carrying Authentication for Network Access
              (PANA) Requirements", RFC 4058, May 2005.

   [RFC4137]  Vollbrecht, J., Eronen, P., Petroni, N., and Y. Ohba,
              "State Machines for Extensible Authentication Protocol
              (EAP) Peer and Authenticator", RFC 4137, August 2005.

   [RFC4306]  Kaufman, C., "Internet Key Exchange (IKEv2) Protocol",
              RFC 4306, December 2005.

   [I-D.ietf-eap-keying]
              Aboba, B., "Extensible Authentication Protocol (EAP) Key
              Management Framework", draft-ietf-eap-keying-18 (work in
              progress), February 2007.

   [I-D.ietf-pana-ipsec]
              Parthasarathy, M., "PANA Enabling IPsec based Access
              Control", draft-ietf-pana-ipsec-07 (work in progress),
              July 2005.

   [I-D.ietf-pana-framework]
              Jayaraman, P., "Protocol for Carrying Authentication for
              Network Access (PANA) Framework",
              draft-ietf-pana-framework-07 (work in progress),
              August 2006.

   [I-D.ietf-pana-snmp]
              Mghazli, Y., "SNMP usage for PAA-EP interface",
              draft-ietf-pana-snmp-06 (work in progress), June 2006.

   [ianaweb]  IANA, "Number assignment",  http://www.iana.org.

   [IANA-EXP]
              Narten, T., "Assigning Experimental and Testing Numbers
              Considered Useful",  BCP 82, RFC 3692, January 2004.

Forsberg, et al.         Expires October 6, 2007               [Page 48]

Internet-Draft                    PANA                        April 2007

Authors' Addresses

   Dan Forsberg
   Nokia Research Center
   P.O. Box 407
   FIN-00045 NOKIA GROUP
   Finland

   Phone: +358 50 4839470
   Email: [email-masked]

   Yoshihiro Ohba
   Toshiba America Research, Inc.
   1 Telcordia Drive
   Piscataway, NJ  08854
   USA

   Phone: +1 732 699 5305
   Email: [email-masked]

   Basavaraj Patil
   Nokia
   6000 Connection Dr.
   Irving, TX  75039
   USA

   Phone: +1 972-894-6709
   Email: [email-masked]

   Hannes Tschofenig
   Siemens Corporate Technology
   Otto-Hahn-Ring 6
   81739 Munich
   Germany

   Email: [email-masked]

Forsberg, et al.         Expires October 6, 2007               [Page 49]

Internet-Draft                    PANA                        April 2007

   Alper E. Yegin
   Samsung Advanced Institute of Technology
   Istanbul,
   Turkey

   Phone: +90 538 719 0181
   Email: [email-masked]

Forsberg, et al.         Expires October 6, 2007               [Page 50]

Internet-Draft                    PANA                        April 2007

Full Copyright Statement

   Copyright (C) The IETF Trust (2007).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
   THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
   THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at
   [email-masked].

Acknowledgment

   Funding for the RFC Editor function is provided by the IETF
   Administrative Support Activity (IASA).

Forsberg, et al.         Expires October 6, 2007               [Page 51]

[a1]Extended may be a better term here.
[a2]May like to delete this part
[a3]Is it specified in a separate document. If so, pl. provide the reference, otherwise delete this sentence.
[a4]Other places ?access device? is used.  A consistent terminology  would be better. 
[a5]Is this correct?  Are DHCP, ND, ARP not IP data traffic? 
[a6]Is it authentication or re-authentication?
[a7]May consider revising this part. 
[a8]other places ?answer? is used .. terminology problem..
[a9]May consider revising the sentence.
[a10]Not  clear  in particular, the last part of the sentence.
[a11]Is this piggybacked EAP?  It is not clear why EAP is not inlcuded in PANA-Auth_Answer (y).  Some texts explaning the piggybaked EAP will be helpful 
Is it really a PANA Session?  This is happening during authentication and authorization phase which is a  part of a PANA session. Also the definition of PANA should include authorization as a cause to session termination.  [a12]
[a13]Is this true?  Accordig to eralier definition or re-authenticatrion, it happens during access phase. 
[a14]Not clear. May consider revising the senetence.
[a15]Is it deleted or "terminated"?
[a16]Some places it says   bit is not set and other places it is cleared. Consistency would be good.  
[a17]How will  PAA  know that PaC has not received it?  Will PaC  retransmit PANA-Notification-Request?
[a18]Not clear. May cosnider revising it. 
[a19]Should be 'answer'
[a20]Is it deleted or terminated ?
[a21]This seems incorrect since  it is expected that re-authentication request will apprear during re-authntication phase.
[a22]Same as before.
[a23]Same as before since PANA-Auth-Request may appear during re-authentication phase. 
[a24]What happens if PaC chooses a source port number  that is used by PAA?
[a25]This AVP describes the vaule format while few others do  not.  
[a26]Is it a MUST or SHOULD?  
[a27]Same a s before. 
[a28]How about Authentication-Success  but Authorization_Failed?  Is it useful? 
_______________________________________________
Pana mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/pana

---

From: Yoshihiro Ohba <[email-masked]>
Date: Fri, 20 Apr 2007 19:37:36 -0400

Victor,

You've raised an interesting issue (CC: Mark).  Please see my comment
below.

> during these phases anyway since we already rely on session lifetime to 

There is one problem with allowing ping in access phase only.

Suppose both a PaC and a PAA are in access phase, and the PaC sends a
ping request while the PAA sends a PAR to start re-authentication at
the same time.  Then PAA will not accept the ping request because it
has entered re-authentication phase.  If ping is allowed in any
state, then PAA can answer to the ping request.

BTW, I've found another issue here.  In the above example, The PaC
will accept the PAR sent from the PAA and can return a PAN, but it
cannot send a new PAR (this can happen if the PAN does not carry EAP),
until the ping request is answered.  This is actually breaking
lock-step behavior of PANA (queuing requests should not be required
for a lock-step protocol).

If the ping message is handled independently of other messages, then
this kind of corner case will not exist.

I now remember Mark's suggestion to have a separate sequence number
space for pana ping and handle pana ping independently of other pana
messages.  I am now pretty motivated for it :)

> Just for clarity, maybe it should be "+  PANA-Auth-Request with any of its 

I think the current text is sufficient.

BTW, at least 'R' bit is set for PAR :)

> -- Sec 4.2.; First paragraph; Add a sentence: "The ping request MUST be 
> sent only when there are no other pending un-answered request".
> -- Same with sec 4.3 and 4.4 with regards to re-auth and termination 
> request. Not sure how to phrase it though. Maybe "A PANA session MUST not 
> enter the

I think this is already covered in the following sentence in Section 5.2:

"A peer can only have one outstanding request at a time."

I found another issue on Section 5.5:

PTR should be accepted in authentication and authorization phase and
the re-authentication phase as well, otherwise, it will create a race
condition similar to the problem of ping request and PAR for re-auth
crossing each other.

Regards,
Yoshihiro Ohba

> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
>

---

From: Victor Fajardo <[email-masked]>
Date: Sun, 22 Apr 2007 20:21:17 -0400

Hi,

> messages.  I am now pretty motivated for it :)

I agree. So I guess "independent" would mean that ping processing could
be exchange at anytime after the initial PAR/PAA and maybe in parallel
with other exchanges.

> BTW, at least 'R' bit is set for PAR :)

Yes your right :)

> "A peer can only have one outstanding request at a time."

Ah ok.

regards,
victor

---

From: "Alper Yegin" <[email-masked]>
Date: Mon, 23 Apr 2007 16:03:56 +0300

> state, then PAA can answer to the ping request.

I think the issue is about having two outstanding requests (one PANA-Ping
and one other) at the same time. The PAA (or PaC) having to respond to a
PANA-Ping-Request while it has an outstanding request shall not have a
problem. What do you think?

> for a lock-step protocol).

What would be the issue of having request queuing?  

I'd like to see if we can avoid creating special case for PANA-Ping messages
(e.g., putting them under a separate treatment).

Alper

---

From: Victor Fajardo <[email-masked]>
Date: Mon, 23 Apr 2007 10:31:05 -0400

Hi Alper,

> problem. What do you think?

I think in this scenario we may already be treating PANA-Ping in a 
special way already since we are not
strictly lock-stepping anymore; i.e., ping processing seems independent 
and in parallel of other exchanges.

regards,
victor

---

From: Yoshihiro Ohba <[email-masked]>
Date: Mon, 23 Apr 2007 11:54:36 -0400

> problem. What do you think?

I think having two outstanding requests sent in different directions
is acceptable.

> What would be the issue of having request queuing?  

Queueing itself may not be an issue.  But the actual issues is the
sender would need to distinguish two cases (i.e., if there is an
outstanding ping request or not) for each state.

For example, supposed that the PaC is in a state waiting for a ping
answer.  If another event that needs to send a PAR is generated, then
the PaC processes the event, generates and queues a PAR and transits
to a state that is waiting for a PAN, and it is still waiting for a
ping answer.  This would require N*2 states (N is number of states
except for ping, multiplied by 2 to consider whether there is a ping
request or not.

> (e.g., putting them under a separate treatment).

I think the only way to avoid it is:

- Allow sending ping request in access phase only.

- Allow receiving ping request in any phase.

- When there is an outstanding ping request, discard all incoming
messages except for ping answer or error request sent in resopnse to
the ping request.

This may be an acceptable operation.

Yoshihiro Ohba

---

From: "Alper Yegin" <[email-masked]>
Date: Mon, 23 Apr 2007 22:22:17 +0300

Hi Victor,

> and in parallel of other exchanges.

I don't think it is special. I think it is true for some other messages that
the peer may have an outstanding request while it also has to respond to an
incoming request. 

PaC      PAA

1<-------- PAR
2--------> PAN
3---> PAR
4    <--- PAR
5    ---> PAR
6<---PAR
7-------> PAN
8<------- PAN

Consider messages 3 and 4 crossing each other on the wire.

Alper

---

From: "Alper Yegin" <[email-masked]>
Date: Mon, 23 Apr 2007 22:29:51 +0300

> to a state that is waiting for a PAN, and it is still waiting for a

It should not transit to such state until the PAR is actually transmitted.
I'd say PAR (or the event that leads to PAR generation) shall be queued
until the PANA-Ping is completed (ping answer is received).

> - Allow sending ping request in access phase only.

Makes sense.

> - Allow receiving ping request in any phase.

Makes sense.

> messages except for ping answer or error request sent in resopnse to

If the PaC receives a PAR while waiting for a PANA-Ping-Answer, why should
it discard the PAR?

Alper

---

From: Yoshihiro Ohba <[email-masked]>
Date: Mon, 23 Apr 2007 16:28:48 -0400

> until the PANA-Ping is completed (ping answer is received).

Yes, this is certainly possible.

> If the PaC receives a PAR while waiting for a PANA-Ping-Answer, why should

Because if the receiver processes the PAR, it may transit to another
state after processing the message, which will end up with the 2*N
problem.  On the other hand, it may be possible for the PaC to queue
the incoming PAR until the ping request is answered.  

So how about relaxing the third item to:

"
- When there is an outstanding ping request, all incoming messages
  MUST NOT be processed except for ping answer or error request sent
  in response to the ping request.
"

Yoshihiro Ohba

---

From: Victor Fajardo <[email-masked]>
Date: Mon, 23 Apr 2007 16:40:03 -0400

Hi Alper,

> Consider messages 3 and 4 crossing each other on the wire.

In general, I do agree that request crossovers are possible though my 
main difficultly is the complexity of the pana statemachine with regards 
to handling crossovers specifically with ping (problem of N*2 num of 
states mentioned by Yoshi in another thread). Anyway, we should continue 
that discussion on that thread to minimize email traffic.

best regards,
victor

---

From: "Alper Yegin" <[email-masked]>
Date: Tue, 24 Apr 2007 01:49:33 +0300

> state after processing the message, 

PANA-Ping-Request/Answer could have a separate state machine. That way, the
transitions in that state machine does not interfere with transitions in the
other state machine that deals with processing any other PANA message.

This scheme prevents any special case handling to be part of the protocol
specification. 

Your suggestion below works too I believe. Though I lean towards the above
suggestion, given that it does not special case one type of message in the
spec.

I remember once mentioning use of a separate state machine for pings. I
don't remember what the feedback was....

Alper

> which will end up with the 2*N

---

From: Yoshihiro Ohba <[email-masked]>
Date: Mon, 23 Apr 2007 19:07:45 -0400

> other state machine that deals with processing any other PANA message.

I believe having a separate state machine for ping works only when
ping has a separate sequence number space, otherwise, there would be
no way to avoid interference between the two state machines (ping
state machine and state machine for other messages).  But I may be
missing something.

Yoshihiro Ohba

---

From: "Alper Yegin" <[email-masked]>
Date: Tue, 24 Apr 2007 02:53:39 +0300

> state machine and state machine for other messages).  But I may be

Do the sequence numbers play a role our state machines? I hadn't thought so.

Alper

---

From: Yoshihiro Ohba <[email-masked]>
Date: Mon, 23 Apr 2007 20:13:23 -0400

> Do the sequence numbers play a role our state machines? I hadn't thought so.

The play is implicit based on the following lock-step constrations:

- Each peer maintains a single sequence number space for outgoing
requests.

- There is only one outstanding outgoing request allowed for each
peer.  A peer that receives a request accepts the sequence number
which is last received sequence number + 1 only.

This means sequence numbers play a role in our state machine.  Running
multiple state machines in pararell and independenly would break the
lock-step constraints.

Yoshihiro Ohba

---

From: "Alper Yegin" <[email-masked]>
Date: Tue, 24 Apr 2007 10:57:13 +0300

> which is last received sequence number + 1 only.

Both of these rules are still maintained whether we have two state machines
or one. Do we change anything? As long as we stick to "one outstanding
request at a time" rule, these rules shall apply as they are.

> multiple state machines in pararell and independenly would break the

In my understanding, "lock-step" is about "not having two outstanding
requests issued by the same peer." Based on that, I'd say the lock-step
nature is preserved.

The sequence number processing on incoming messages are done for validation.
Invalid messages are tossed away, valid ones are processed by the state
machine. I don't think we'd have a statement in our state machine
specification that uses the "sequence number" as an input and change the way
state machine runs. 

What do you think?

Alper

> > > > suggestion, given that it does not special case one type of message
> in
> > > the
> > > > spec.
> > > >

---

From: Yoshihiro Ohba <[email-masked]>
Date: Tue, 24 Apr 2007 08:55:27 -0400

> request at a time" rule, these rules shall apply as they are.

The issue I am trying to bring is complexity of maintaining two state
machines and still follow the "one outstanding request at a time"
rule.  I am actually faced with this issue while I am revising
pana-statemachine draft.

> requests issued by the same peer." Based on that, I'd say the lock-step

When we preserve "lock-step", then it means we can't run two state
machines independently, right?  This is very similar to multi-thread
programming using semaphore to access critical resource (i.s., one
outstanding request issued by the same peer) to which only one thread
can access at a time.  This constraint is basically coming from using
the same sequence number space for ping and other messages.  I am just
thinking that implementations can be much simpler if we have separate
sequence number space for ping in order to run ping state machine
independently of non-ping state machine.

Yoshihiro Ohba

---

From: Yoshihiro Ohba <[email-masked]>
Date: Wed, 25 Apr 2007 09:25:54 -0400

Hi Subir and all,

Thank you very much for your review comments.  The comments are
definitely useful to improve the quality of the draft.

Please see my response below.

-------------------------------------
   Session Lifetime:

[YO] OK, s/updated/extended/.

   Session Identifier:

[YO] We can delete "during the lifetime of the session"

   Enforcement Point (EP):

      applicability documents.[a3]

[a3]Is it specified in a separate document. If so, pl. provide the
reference, otherwise delete this sentence.

[YO] There is an expired draft: draft-morand-pana-panaoverdsl-00.txt,
but we can simply remove the sentence to move forward.

[YO] I agree, s/host/access node/.

[YO] ARP is definitely not IP.  I am not sure if we can categorize
DHCP and ND as IP control or data traffic.  I think we can remove
"data" here.

[YO] It should be s/authentication/re-authentication, because this
paragraph is talking about re-authentication phase.

[YO] I agree.  Since authorization state remains during
re-authentication, re-authentication phase should be described as a
sub-phase of access phase.  How about this?

  "Re-authentication phase is a sub-phase of access phase.  The
  session moves to this sub-phase from the access phase when
  re-authentication starts, and returns back there upon successful
  re-authentication."

[YO] I think we can simply remove the paragraph.  I don't think we
need error handling overview in protocol overview section.

   The PAA SHOULD limit the rate it processes incoming[a9]
   PANA-Client-Initiation messages in order not to subject itself to
   denial-of service (DoS) attacks.  Details of rate limiting are
   outside the scope of this specification.

[YO] How about this?

"
   The PAA SHOULD limit the rate it processes incoming
   PANA-Client-Initiation messages to provide robustness against
   denial-of service (DoS) attacks.
"

   from the PAA.[a10]

[YO] There is some leftover from previous revison that had handshake
phase which we don't have now.  We can revise the sentence to:

"
   For this reason, the PaC MUST retransmit the PANA-Client-Initiation
   message until it receives the second PANA-Auth-Request message (not
   a retransmission of the initial one) from the PAA.
"

[a11]Is this piggybacked EAP?  It is not clear why EAP is not inlcuded
in PANA-Auth_Answer (y).  Some texts explaning the piggybaked EAP will
be helpful 

[YO] We can add "// Piggybacking EAP" here.  To explain piggybacked EAP, 
we can revise the Figure 1 caption as follows:

"
    Figure 1: Example sequence for the authentication and
    authorization phase for a PaC-initiated session ("Piggybacking
    EAP" is the case in which an EAP AVP is carried in PAN.)
"

   exchange.[a12]

[a12]Is it really a PANA Session?  This is happening during
authentication and authorization phase which is a part of a PANA
session. Also the definition of PANA should include authorization as a
cause to session termination.

[YO] Yes, it's a PANA session that is terminated
(s/deleted/terminated/ per your other comment.).  With regard to
authorization as a cause to session termination, we can revise the
PANA Session definition in Section 2 to:

   PANA Session:

      A PANA session is established between the PANA Client (PaC) and
      the PANA Authentication Agent (PAA), and terminates as a result
      of an authentication or liveness test failure, a message
      delivery failure after retransmissions reach maximum values or
      session lifetime expiration, an explicit termination message or
      any event that causes discontinuation of the access service.  A
      fixed session identifier is maintained throughout a session.  A
      session cannot be shared across multiple network interfaces.

("any event that causes discontinuation of the access service" was added.)

4.2.  Access Phase

[YO] You are right.  We should remove "or the re-authentication phase".

[YO] How about this?  

"
   Therefore, a PAA or PaC should not rely on highly frequent ping
   request and answer message exchanges to quickly determine loss of
   connectivity.
"

[YO] It should be "terminated".

[a16]Some places it says bit is not set and other places it is
cleared. Consistency would be good.

[YO] We shall use "cleared" throughout the document. 

   receives the answer to its request.[a17]

[a17]How will PAA know that PaC has not received it?  Will PaC
retransmit PANA-Notification-Request?

[YO] Yes.  The PAA will answer to the PNR.

[YO] How about this?

"
   The PaC and PAA maintain two sequence numbers: the one to be used
   for the next outgoing request and the one it expects to see in the
   next incoming request.
"

[a19]Should be 'answer'

[YO] Yes, s/response/answer/.

[YO] s/deleted/terminated/.

[a21]This seems incorrect since it is expected that re-authentication
request will apprear during re-authntication phase.

[YO] You are right.  Re-auth request should be accepted at least in
re-authentication phase to deal with re-auth race condition (i.e.,
re-auth request and PAR cross each other).

[a22]Same as before.

[YO] You are right.  Re-auth request should be accepted at least in
re-authentication phase to deal with another race condition (i.e., PTR
and re-auth request or PAR cross each other).  Now I think it is
better to separate items for authentication and authorization phase
and re-authentication phase.

      *  In the access phase:

[YO] Yes, PAR should be allowed for PAA-initiated re-auth.  We should remove this.

[YO] So here is the new deny rule-set (including the resolution of
recent ping issue):

"
      *  In the authentication and authorization phase:

         +  Re-authentication request.

         +  PANA-Termination-Request.

      *  In the re-authentication phase:

         +  The initial PANA-Auth-Request.

      *  In the access phase:

         +  All requests but PANA-Termination-Request and ping request.
"

6.1.  IP and UDP Headers

[YO] According to the rule, the PAA will change its source port number
to PANA port number once the initiator is determined to be the PaC.

[a25]8.4.  Failed-AVP AVP

[YO] Because it is of type Grouped.

8.7.  Nonce AVP

[YO] The enumerated paragraphs are investigation.  So we should not
use RFC2119 requirements language there.  On the other hand, the next
paragraph should contain requirements language.  How about this?

"
   The maximum length of the nonce value in PANA Version 1 SHOULD be
   therefore 20 octets.
"

8.8.  Result-Code AVP

   PANA_SUCCESS                               0

[YO] I think PANA_AUTHORIZATION_REJECTED meant it.
------

Best Regards,
Yoshihiro Ohba

---

From: Subir Das <[email-masked]>
Date: Thu, 26 Apr 2007 13:43:45 -0400

Yoshi,
Thank you very much for addressing the comments.
My answers inline.

regards,
-Subir

> Please see my response below.
Subir> fine.
> but we can simply remove the sentence to move forward.
Subir> That would be better.
> DHCP and ND as IP control or data traffic.  I think we can remove
Subir> Agreed.
> paragraph is talking about re-authentication phase.
Subir> Ok.
>   re-authentication starts, and returns back there upon successful

Subir> Fine with me.
> need error handling overview in protocol overview section.
Subir> Even better.
>    denial-of service (DoS) attacks. 
Subir> Ok.
>    a retransmission of the initial one) from the PAA.
Subir> Much better.
>     EAP" is the case in which an EAP AVP is carried in PAN.
>   
> "
>   
Subir> Good.
> ("any event that causes discontinuation of the access service" was added.)
Subir> Fine with me. You may like to add "Authorization" after
authentication
since PANA session can be terminated if authorization fails but
authentication
succeeds.
> [YO] You are right.  We should remove "or the re-authentication phase".
Subir> good.
>    request and answer message exchanges to quickly determine loss of
Subir> The problem here is it is either request or answer. It can not be
both.
If answers arrive with frequent requests, then there is no loss of
connectivity.
Am I correct? Also you may delete "highly" here.

> [YO] It should be "terminated".
Subir> Ok.
> [YO] We shall use "cleared" throughout the document. 
Subir> fine.
> [YO] Yes.  The PAA will answer to the PNR.
Subir> The question is when PaC will retransmit instead of discarding? This
race condition may continue for a while.
>    for the next outgoing request and the one it expects to see in the
Subir> How about this:

"The PaC and PAA maintain two sequence numbers: one is for outgoing
request and the other one is for incoming request."

> [YO] Yes, s/response/answer/.
Subir> ok.
> [YO] s/deleted/terminated/.
Subir> ok.
> re-auth request and PAR cross each other).
Subir> ok.
>          +  All requests but PANA-Termination-Request and ping request.
Subir> good.
> to PANA port number once the initiator is determined to be the PaC.
Subir> ok.
> [YO] Because it is of type Grouped.
Subir> ok.
>    The maximum length of the nonce value in PANA Version 1 SHOULD be
Subir> fine.
> [YO] I think PANA_AUTHORIZATION_REJECTED meant it.
Subir> Ok.

---

From: Yoshihiro Ohba <[email-masked]>
Date: Thu, 26 Apr 2007 16:42:01 -0400

> since PANA session can be terminated if authorization fails but

OK.

> Am I correct? Also you may delete "highly" here.

I think it might be good to describe it without mentioning request and
answer messages.  How about this?

"
   Therefore, a PAA or PaC should not rely on frequent ping
   operation to quickly determine loss of connectivity.
"

> race condition may continue for a while.

PNR will be retranmitted by PaC based on retransmission timer.  So
most probably the first retransmitssion of PNR will break the race
condition if it does not get lost.

> request and the other one is for incoming request."

OK.

---

From: Subir Das <[email-masked]>
Date: Thu, 26 Apr 2007 17:00:53 -0400

>    operation to quickly determine loss of connectivity.
Subir> Fine.
Subir> Ok.

---

From: "Alper Yegin" <[email-masked]>
Date: Fri, 27 Apr 2007 01:06:32 +0300

> > request and the other one is for incoming request."

During that editing we lost some of the semantics. I'd recommend regaining
it like this:

	The PaC and PAA maintain two sequence numbers: One is for setting
the 
	sequence number of the next outgoing request, the other is for 
	matching the sequence number of the next incoming request.

Alper

---

From: Subir Das <[email-masked]>
Date: Mon, 30 Apr 2007 10:14:34 -0400

> 	matching the sequence number of the next incoming request.

  Subir>  The term 'next' is not clear to me. Does it mean that one can 
not use the sequence number for
              previous outgoing/incoming  request?