Subject: [AAA-WG]: [issue] Minor clarifications/corrections to Base-10-2

From: "Bob Kopacz" <[email-masked]>
Date: Fri, 5 Apr 2002 17:22:53 -0500

Issue:          Minor clarifications/corrections to Base-10-2
Submitter name: Bob Kopacz 
Submitter email address:[email-masked] 
Date first submitted: 04-05-2002 
Reference: 
Document:       draft-base-10-2
Comment type:   Technical 
Priority:       1 
Section: 

Rationale/Explanation of issue: 

  Minor corrections/clarifications to base-10-2.

Requested change:

- - - -

In the Table of Contents

      1.1.1 Differences from Radius

  Capitalize "Radius"

- - - -

In section 8.1  Authorization Session State Machine

  Replace the two entries:
    
    State     Event                          Action     New State
    -------------------------------------------------------------
    
    Open      Home server wants to           send ASR   Discon
              terminate the service
    
    Discon    ASA Received                   Cleanup    Idle

  With:

    State     Event                          Action     New State
    -------------------------------------------------------------
        
    Open      Home server wants to           send ASR   Open
              terminate the service
        
    Open      ASA Received                   Cleanup    Idle
              with Result-Code 
              = UNKNOWN-SESSION-ID
        
    Open      ASA Received                   None       Open
              with Result-Code               (ignore)
              not = UNKNOWN-SESSION-ID
        
    Not       ASA Received                   None       No Change.
    Open

  This per issue#275, which I think was accepted, but the changes
  weren't made to the state table.

- - - -

In section 10.1  Base Protocol Command AVP Table

  Change:
                         +-----------------------------------------------+
                         |                  Command-Code                 |
                         |---+---+---+---+---+---+---+---+---+---+---+---+
     Attribute Name      |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA|
     --------------------|---+---+---+---+---+---+---+---+---+---+---+---|
     User-Name           |0  |0  |0  |0  |0  |0  |0-1|0-1|1  |1  |1  |1  |

  To:

     Attribute Name      |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA|
     --------------------|---+---+---+---+---+---+---+---+---+---+---+---|
     User-Name           |0  |0  |0  |0  |0  |0  |0-1|0-1|1  |0-1|1  |0-1|

  This per issue#264 (which I think was accepted but the changes weren't
  made to the occurrence rule table): "Since it is natural and harmless for
  an implementation to echo back the User-Name, allow but do not require the
  User-Name AVP to appear in Answer messages, if present in the Request."

- - - -

In 14.1  Normative References

  These have expired:

    [AAATRANS] draft-ietf-aaa-transport-04.txt, June 2001.

  These are not the latest:

    [CMS] draft-ietf-aaa-diameter-cms-sec-03.txt

- - - -

In 14.2  Non-Normative References

  These are not the latest:

    [DIAMMIP] draft-ietf-aaa-diameter-mobileip-08.txt

    [MIPV4] IP Mobility Support.  RFC 2002

    [NASREQ] draft-ietf-aaa-diameter-nasreq-08.txt

- - - -

In section 16  Authors' Addresses
  
  | Questions about this memo can be directed to:
  |
  |    Pat R. Calhoun
  |    Black Storm Networks
  |    250 Cambridge Avenue, Suite 200
  |    Palo Alto, California, 94306
  |    USA
  |
  |     Phone:  +1 650-617-2932
  |       Fax:  +1 650-786-6445
  |    E-mail:  [email-masked]

  I don't think this is Pat's email address (though it's the one
  he encourages me to use :)

- - - -

In section 17  Full Copyright Statement

   Copyright (C) The Internet Society (2001).  All Rights Reserved.

Should the year be (2002) ?

- - - -

---

From: Bernard Aboba <[email-masked]>
Date: Sat, 6 Apr 2002 09:37:44 -0800 (PST)

Assigned Issue #325.

---

From: Jari Arkko <[email-masked]>
Date: Sun, 07 Apr 2002 11:41:12 +0300

>       1.1.1 Differences from Radius

Yes.

>     State     Event                          Action     New State

I agree with 275, but the solution isn't as simple as this. The
current state machine doesn't have 'asa received' action on the 'discon'
state and your solution doesn't have the ability to resend ASR due to
a temporary failure.

Let me propose the following:

- We still keep the Discon state as an indication in the server on what
   we wanted to do
- Upon receiving a successful ASA, we don't go to Idle but wait for the STR
- Upon receiving an ASA with UNKNOWN_SESSION_ID, we go to Idle

> In section 10.1  Base Protocol Command AVP Table

Yes.

>     [CMS] draft-ietf-aaa-diameter-cms-sec-03.txt

Yes.

>     [NASREQ] draft-ietf-aaa-diameter-nasreq-08.txt

Yes. 2002=>3220.

> Should the year be (2002) ?

Yes.

Jari

---

From: Jari Arkko <[email-masked]>
Date: Sun, 07 Apr 2002 11:51:06 +0300

Issue #325 was a proposed modification to the ASR/ASA handling in the
server auth state machine. Issue #TBD is split from #315 and deals with
making the server acct machine stateful (idle/open).

In my previous mail to the list, I proposed a solution to #325. An
attachment to this e-mail has the updated state machine that implements
this solution. Please comment.

The #TBD issue has also been discussed on the list. After some off-line
discussions with the folks who brought this up, I think I now agree that
in some cases one does want to make accounting stateful. However, not in
all situations. Even if the choice is largely done by applications, I
propose that we list the mandatory state machine (stateless) in the base,
but also give an optional state machine that can be used and shared by applications
that want to keep state. The latter state machine is stricter in the sense
that it doesn't accept all 'strings' of accounting requests, but allows state
to be kept. So its use is a tradeoff in losing records under network partition
conditions and knowing the state. Again, the updated state machine has the
modifications and please comment this as well.

Diffs to base-10-2 are also attached.

Jari
8.1  Authorization Session State Machine

   This section contains a set of finite state machines, representing
   the life cycle of Diameter sessions, and which MUST be observed by
   all Diameter implementations that make use of the authentication
   and/or authorization portion of a Diameter application. The term
   Service-Specific below refers to a message defined in a Diameter
   application (e.g. Mobile IP, NASREQ).

   There are four different authorization session state machines
   supported in the Diameter base protocol. The first two describe a
   session in which the server is maintaining session state, indicated
   by the value of the Auth-Session-State AVP (or its absence).  One
   describes the session from a client perspective, the other from a
   server perspective. The second two state machines are used when the
   server does not maintain session state. Here again, one describes the
   session from a client perspective, the other from a server
   perspective.

   When a session is moved to the Idle state, any resources that were
   allocated for the particular session must be released.  Any event not
   listed in the state machines MUST be considered as an error
   condition, and an answer, if applicable, MUST be returned to the
   originator of the message.

   In the state table, the event 'Failure to send X' means that the
   Diameter agent is unable to send command X to the desired
   destination. This could be due to the peer being down, or due to the
   peer sending back a transient failure or temporary protocol error
   notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the
   Result-Code AVP of the corresponding Answer command.  The event 'X
   successfully sent' is the complement of 'Failure to send X'.

   The following state machine is observed by a client when state is
   maintained on the server:

                              CLIENT, STATEFUL
      State     Event                          Action     New State
      -------------------------------------------------------------
      Idle      Client or Device Requests      Send       Pending
                access                         service
                                               specific
                                               auth req

      Idle      ASR Received                   Send ASA   Idle
                for unknown session            with
                                               Result-Code
                                               = UNKNOWN_
                                               SESSION_ID

      Pending   Successful Service-specific    Grant      Open
                authorization answer           Access
                received with default
                Auth-Session-State value

      Pending   Successful Service-specific    Sent STR   Discon
                authorization answer received
                but service not provided

      Pending   Error processing successful    Sent STR   Discon
                Service-specific authorization
                answer

      Pending   Failed Service-specific        Cleanup    Idle
                authorization answer received

      Open      user or client device          Send       Open
                requests access to service     service
                                               specific
                                               auth req

      Open      Successful Service-specific    Extend     Open
                authorization answer received  Answer

      Open      Failed Service-specific        Discon.    Idle
                authorization answer           user/device
                received.

      Open      Session-Timeout Expires on     Send STR   Discon
                Access Device

      Open      ASR Received,                  Send ASA   Discon
                client will comply with        with
                request to end the session     Result-Code
                                               = SUCCESS,
                                               Send STR.

      Open      ASR Received,                  Send ASA   Open
                client will not comply with    with
                request to end the session     Result-Code
                                               != SUCCESS

      Open      Authorization-Lifetime +       Send STR   Discon
                Auth-Grace-Period expires on
                access device

      Discon    ASR Received                   Send ASA   Discon

      Discon    STA Received                   Discon.    Idle
                                               user/device

   The following state machine is observed by a server when it is
   maintaining state for the session:

                             SERVER, STATEFUL
      State     Event                          Action     New State
      -------------------------------------------------------------
      Idle      Service-specific authorization Send       Open
                request received, and          successful
                user is authorized             serv.
                                               specific answer

      Idle      Service-specific authorization Send       Idle
                request received, and          failed serv.
                user is not authorized         specific answer

      Open      Service-specific authorization Send       Open
                request received, and user     successful
                is authorized                  serv. specific
                                                     answer

      Open      Service-specific authorization Send       Idle
                request received, and user     failed serv.
                is not authorized              specific
                                               answer,
                                               Cleanup

      Open      Home server wants to           Send ASR   Discon
                terminate the service

      Open      Authorization-Lifetime (and    Cleanup    Idle
                Auth-Grace-Period) expires
                on home server.

      Open      Session-Timeout expires on     Cleanup    Idle
                home server

      Open      STR Received                   Send STA,  Idle
                                               Cleanup

      Discon    Failure to send ASR            Wait,      Discon
                                               resend ASR

      Discon    ASR Received with Result-Code  Cleanup    Idle
                = UNKNOWN_SESSION_ID

      Discon    ASR successfully sent and      None       Discon
                Result-Code != UNKNOWN_
                SESSION_ID

      Discon

      Not       STR Received                   Send STA,  Idle
      Open                                     Cleanup

   The following state machine is observed by a client when state is not
   maintained on the server:

                              CLIENT, STATELESS
      State     Event                          Action     New State
      -------------------------------------------------------------
      Idle      Client or Device Requests      Send       Pending
                access                         service
                                               specific
                                               auth req

      Pending   Successful Service-specific    Grant      Open
                authorization answer           Access
                received with Auth-Session-
                State set to
                NO_STATE_MAINTAINED

      Pending   Failed Service-specific        Cleanup    Idle
                authorization answer
                received

      Open      Session-Timeout Expires on     Discon.    Idle
                Access Device                  user/device

      Open      Service to user is terminated  Discon.    Idle
                                               user/device

   The following state machine is observed by a server when it is not
   maintaining state for the session:

                              SERVER, STATELESS
      State     Event                          Action     New State
      -------------------------------------------------------------
      Idle      Service-specific authorization Send serv. Idle
                request received, and          specific
                successfully processed         answer

8.2  Accounting Session State Machine

   The following state machines MUST be supported for applications
   that have an accounting portion or that require only accounting
   services. The first state machine is to be observed by clients.

   The server side in the accounting state machine depends in some
   cases on the particular application. The Diameter base protocol
   defines a default state machine that MUST be followed by accounting
   servers advertising support for the Relay application identifier
   and all applications that have not specified other state
   machines. This is the second state machine in this section
   described below.

   The default server side state machine requires the reception of
   accounting records in any order and at any time, and does not place
   any standards requirement on the processing of these records.
   Implementations of Diameter MAY perform checking, ordering,
   correlation, fraud detection, and other tasks based on these
   records. Both base Diameter AVPs as well as application specific
   AVPs MAY be inspected as a part of these tasks. The tasks can
   happen either immediately after record reception or in a
   post-processing phase. However, as these tasks are typically
   application or even policy dependent, they are not standardized by
   the Diameter specifications. Applications MAY define requirements
   on when to accept accounting records based on the used value of
   Accounting-Realtime-Required AVP, credit limits checks, and so on.

   However, the Diameter base protocol defines one optional server
   side state machine that MAY be followed by applications that
   require keeping track of the session state at the accounting
   server. Note that such tracking is incompatible with the ability to
   sustain long duration connectivity problems. Theferore, the use of
   this state machine is recommended only in applications where the
   value of the Accounting-Realtime-Required AVP is DELIVER_AND_GRANT,
   and hence accounting connectivity problems are required to cause
   the serviced user to be disconnected. Otherwise, records produced
   by the client may be lost by the server which no longer accepts
   them after the connectivity is re-established. This state machine
   is the third state machine in this section. The state machine is
   supervised by a supervision session timer Ts the which value should
   be reasonably higher than the Interim_Record_Interval value. Ts MAY
   be set to two times the value of the Interim_Record_Interval so as
   to avoid the accounting session in the Diameter server to change to
   Idle state in case of short transient network failure.

   Any event not listed in the state machines MUST be considered as an
   error condition, and a corresponding answer, if applicable, MUST be
   returned to the originator of the message.

   In the state table, the event 'Failure to send' means that the
   Diameter client is unable to communicate with the desired
   destination. This could be due to the peer being down, or due to the
   peer sending back a transient failure or temporary protocol error
   notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or
   DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting
   Answer command.

   The event 'Failed answer' means that the Diameter client received a
   non-transient failure notification in the Accounting Answer command.

   Note that the action 'Disconnect user/dev' MUST have an effect also
   to the authorization session state table, e.g. cause the STR message
   to be sent, if the given application has both
   authentication/authorization and accounting portions.

   The states PendingS, PendingI, PendingL, PendingE and PendingB stand
   for pending states to wait for an answer to an accounting request
   related to a Start, Interim, Stop, Event or buffered record,
   respectively.

                            CLIENT, ACCOUNTING
      State     Event                          Action     New State
      -------------------------------------------------------------
      Idle      Client or device requests      Send       PendingS
                access                         accounting
                                               start req.

      Idle      Client or device requests      Send       PendingE
                a one-time service             accounting
                                               event req

      Idle      Records in storage             Send       PendingB
                                               record

      PendingS  Successful accounting                     Open
                start answer received

      PendingS  Failure to send and buffer     Store      Open
                space available and realtime   Start
                not equal to DELIVER_AND_GRANT Record

      PendingS  Failure to send and no buffer             Open
                space available and realtime
                equal to GRANT_AND_LOSE

      PendingS  Failure to send and no buffer  Disconnect Idle
                space available and realtime   user/dev
                not equal to
                GRANT_AND_LOSE

      PendingS  Failed accounting start answer            Open
                received and realtime equal
                to GRANT_AND_LOSE

      PendingS  Failed accounting start answer Disconnect Idle
                received and realtime not      user/dev
                equal to GRANT_AND_LOSE

      PendingS  User service terminated        Store      PendingS
                                               stop
                                               record

      Open      Interim interval elapses       Send       PendingI
                                               accounting
                                               interim
                                               record

      Open      User service terminated        Send       PendingL
                                               accounting
                                               stop req.

      PendingI  Successful accounting interim             Open
                answer received

      PendingI  Failure to send and (buffer    Store      Open
                space available or old record  interim
                can be overwritten) and        record
                realtime not equal to
                DELIVER_AND_GRANT

      PendingI  Failure to send and no buffer             Open
                space available and realtime
                equal to GRANT_AND_LOSE

      PendingI  Failure to send and no buffer  Disconnect Idle
                space available and realtime   user/dev
                not equal to GRANT_AND_LOSE

      PendingI  Failed accounting interim                 Open
                answer received and realtime
                equal to GRANT_AND_LOSE

      PendingI  Failed accounting interim      Disconnect Idle
                answer received and realtime   user/dev
                not equal to GRANT_AND_LOSE

      PendingI  User service terminated        Store      PendingI
                                               stop
                                               record

      PendingE  Successful accounting                     Idle
                event answer received

      PendingE  Failure to send and buffer     Store      Idle
                space available                event
                                               record

      PendingE  Failure to send and no buffer             Idle
                space available

      PendingE  Failed accounting event answer            Idle
                received

      PendingB  Successful accounting answer   Delete     Idle
                received                       record

      PendingB  Failure to send                           Idle

      PendingB  Failed accounting answer       Delete     Idle
                received                       record

      PendingL  Successful accounting                     Idle
                stop answer received

      PendingL  Failure to send and buffer     Store      Idle
                space available                stop
                                               record

      PendingL  Failure to send and no buffer             Idle
                space available

      PendingL  Failed accounting stop answer             Idle
                received

                            SERVER, STATELESS ACCOUNTING
      State     Event                          Action     New State
      -------------------------------------------------------------

      Idle      Accounting start request       Send       Idle
                received, and successfully     accounting
                processed.                     start
                                               answer

      Idle      Accounting event request       Send       Idle
                received, and successfully     accounting
                processed.                     event
                                               answer

      Idle      Interim record received,       Send       Idle
                and successfully processed.    accounting
                                               answer

      Idle      Accounting stop request        Send       Idle
                received, and successfully     accounting
                processed                      stop answer

      Idle      Accounting request received,   Send       Idle
                no space left to store         accounting
                records                        answer,
                                               Result-Code
                                               = OUT_OF_
                                               SPACE

                            SERVER, STATEFUL ACCOUNTING
      State     Event                          Action     New State
      -------------------------------------------------------------

      Idle      Accounting start request       Send       Open
                received, and successfully     accounting
                processed.                     start
                                               answer,
                                               Start Ts

      Idle      Accounting event request       Send       Idle
                received, and successfully     accounting
                processed.                     event
                                               answer

      Idle      Accounting request received,   Send       Idle
                no space left to store         accounting
                records                        answer,
                                               Result-Code
                                               = OUT_OF_
                                               SPACE

      Open      Interim record received,       Send       Open
                and successfully processed.    accounting
                                               answer,
                                               Restart Ts

      Open      Accounting stop request        Send       Idle
                received, and successfully     accounting
                processed                      stop answer,
                                               Stop Ts

      Open      Accounting request received,   Send       Idle
                no space left to store         accounting
                records                        answer,
                                               Result-Code
                                               = OUT_OF_
                                               SPACE,
                                               Stop Ts
                                         
      Open      Session supervision timer Ts   Stop Ts    Idle
                expired 
145c145,150
<       Discon    ASR successfully sent          Cleanup    Idle
---
>       Discon    ASR Received with Result-Code  Cleanup    Idle
>                 = UNKNOWN_SESSION_ID
> 
>       Discon    ASR successfully sent and      None       Discon
>                 Result-Code != UNKNOWN_
>                 SESSION_ID
194,197c199,241
<    For applications that only require accounting services or
<    applications that have an accounting portion, the following state
<    machines MUST be supported.  The first is to be observed by clients,
<    the second by servers.
---
>    The following state machines MUST be supported for applications
>    that have an accounting portion or that require only accounting
>    services. The first state machine is to be observed by clients.
> 
>    The server side in the accounting state machine depends in some
>    cases on the particular application. The Diameter base protocol
>    defines a default state machine that MUST be followed by accounting
>    servers advertising support for the Relay application identifier
>    and all applications that have not specified other state
>    machines. This is the second state machine in this section
>    described below.
> 
>    The default server side state machine requires the reception of
>    accounting records in any order and at any time, and does not place
>    any standards requirement on the processing of these records.
>    Implementations of Diameter MAY perform checking, ordering,
>    correlation, fraud detection, and other tasks based on these
>    records. Both base Diameter AVPs as well as application specific
>    AVPs MAY be inspected as a part of these tasks. The tasks can
>    happen either immediately after record reception or in a
>    post-processing phase. However, as these tasks are typically
>    application or even policy dependent, they are not standardized by
>    the Diameter specifications. Applications MAY define requirements
>    on when to accept accounting records based on the used value of
>    Accounting-Realtime-Required AVP, credit limits checks, and so on.
> 
>    However, the Diameter base protocol defines one optional server
>    side state machine that MAY be followed by applications that
>    require keeping track of the session state at the accounting
>    server. Note that such tracking is incompatible with the ability to
>    sustain long duration connectivity problems. Theferore, the use of
>    this state machine is recommended only in applications where the
>    value of the Accounting-Realtime-Required AVP is DELIVER_AND_GRANT,
>    and hence accounting connectivity problems are required to cause
>    the serviced user to be disconnected. Otherwise, records produced
>    by the client may be lost by the server which no longer accepts
>    them after the connectivity is re-established. This state machine
>    is the third state machine in this section. The state machine is
>    supervised by a supervision session timer Ts the which value should
>    be reasonably higher than the Interim_Record_Interval value. Ts MAY
>    be set to two times the value of the Interim_Record_Interval so as
>    to avoid the accounting session in the Diameter server to change to
>    Idle state in case of short transient network failure.
224d267
< 
341c384
<                             SERVER, ACCOUNTING
---
>                             SERVER, STATELESS ACCOUNTING
368a412,455
> 
> 
>                             SERVER, STATEFUL ACCOUNTING
>       Idle      Accounting start request       Send       Open
>                 received, and successfully     accounting
>                 processed.                     start
>                                                answer,
>                                                Start Ts
> 
>       Idle      Accounting event request       Send       Idle
>                 received, and successfully     accounting
>                 processed.                     event
>                                                answer
> 
>       Idle      Accounting request received,   Send       Idle
>                 no space left to store         accounting
>                 records                        answer,
>                                                Result-Code
>                                                = OUT_OF_
>                                                SPACE
> 
>       Open      Interim record received,       Send       Open
>                 and successfully processed.    accounting
>                                                answer,
>                                                Restart Ts
> 
>       Open      Accounting stop request        Send       Idle
>                 received, and successfully     accounting
>                 processed                      stop answer,
>                                                Stop Ts
> 
>       Open      Accounting request received,   Send       Idle
>                 no space left to store         accounting
>                 records                        answer,
>                                                Result-Code
>                                                = OUT_OF_
>                                                SPACE,
>                                                Stop Ts
>                                          
>       Open      Session supervision timer Ts   Stop Ts    Idle
>                 expired

---

From: Pete McCann <[email-masked]>
Date: Mon, 8 Apr 2002 15:12:34 -0500 (CDT)

Ok, I hadn't read issue 275 before suggesting changes to the ASR/ASA
handling; I think I understand it better now.  But a couple of
suggestions:

 >       Open      Home server wants to           Send ASR   Discon
...
 >       Discon    ASR Received with Result-Code  Cleanup    Idle

Should be "ASA Received...", right?

 >       Discon    ASR successfully sent and      None       Discon

Again, it's the ASA that has the Result-Code.  Maybe both of these
should be re-worded, "ASR successfully sent, ASA received with
Result-Code =/!= ..."

 >       Not       STR Received                   Send STA,  Idle

This last transition has the same action and target state as when STR
is received when Open (see above).  Can we combine them, i.e., the
following:

Any        STR Received             Send STA,       Idle
                                    Cleanup

-Pete

---

From: Jari Arkko <[email-masked]>
Date: Tue, 09 Apr 2002 05:55:30 +0300

Yes.

Yes.

Yes.

Latest state machine attached, with diff to the previous one I sent on Sunday.

Jari

                              CLIENT, STATEFUL

                             SERVER, STATEFUL

      Discon    ASR successfully sent and      Cleanup    Idle
                ASA Received with Result-Code
                = UNKNOWN_SESSION_ID

      Discon    ASR successfully sent and      None       Discon
                ASA received with Result-Code
                != UNKNOWN_SESSION_ID

                              CLIENT, STATELESS

                              SERVER, STATELESS

                            CLIENT, ACCOUNTING

                                         
      Open      Session supervision timer Ts   Stop Ts    Idle
                expired 
139,141d138
<       Open      STR Received                   Send STA,  Idle
<                                                Cleanup
< 
145c142,143
<       Discon    ASR Received with Result-Code  Cleanup    Idle
---
>       Discon    ASR successfully sent and      Cleanup    Idle
>                 ASA Received with Result-Code
149,150c147,148
<                 Result-Code != UNKNOWN_
<                 SESSION_ID
---
>                 ASA received with Result-Code
>                 != UNKNOWN_SESSION_ID
155,156c153,154
<       Not       STR Received                   Send STA,  Idle
<       Open                                     Cleanup
---