Subject: RE: [AAA-WG]: [issue] Bug in Acct state machine + Split State Machines into Client vs. Server

From: <[email-masked]>
Date: Thu, 28 Mar 2002 15:27:35 +0200

Hi all,

Pete's text seems OK - can the group review it an make sure it looks
OK?

John

> -----Original Message-----
> From: ext Pete McCann [mailto:[email-masked]]
> Sent: 27 March, 2002 19:59
> To: [email-masked]
> Subject: [AAA-WG]: [issue] Bug in Acct state machine + Split State
> Machines into Client vs. Server
> 
> 
> 
> Issue:                    Bug in Acct state machine + State machines
>                           should be split into client vs. server
> Submitter name:           Pete McCann
> Submitter email address:  [email-masked]
> Date first submitted:     03-27-2002
> Reference:
> Document:                 diameter-base-09
> Comment type:             Technical
> Priority:                 S
> Section:                  8.1, 8.2
> 
> Rationale:
> 
> Currently, there is no way to enter the PendingI state in the 
> accounting state
> machine.  This is a bug.
> 
> The state machines given in the diameter base document are confusing
> to read, because they mix client and server states.
> 
> Requested Change:
> 
> Split each machine in two, and replace 8.1 and 8.2 with the following
> text.  Note the addition of an event to the client accounting state
> machine to enter the PendingI state:
> 
> 
> 
> 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.
> 
>    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
> 
>       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      Accounting message sent        process    Open
> 
>       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
>                                                STR
> 
>       Open      Authorization-Lifetime +       send STR   Discon
>                 Auth-Grace-Period expires on
>                 access device
> 
>       Discon    ASR Received                   None       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      Accounting message received    process    Open
> 
>       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
> 
>       Open      Authorization-Lifetime (and    Cleanup    Discon
>                 Auth-Grace-Period) expires
>                 on home server.
> 
>       Open      Session-Timeout expires on     Cleanup    Discon
>                 home server
> 
>       Open      STR Received                   Send STA   Idle
> 
>       Not       ASA Received                   None       No Change.
>       Open
> 
>       Discon    STR Received                   Send STA   Idle
> 
> 
> 
>    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      Accounting message sent        process    Open
> 
>       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. Open
>                 request received, and          specific
>                 successfully processed         answer
> 
>       Open      Accounting message received    process    Open
> 
> 
> 
> 
> 8.2  Accounting Session State Machine
> 
>    For applications that only require accounting services, 
> the following
>    state machines MUST be supported.  The first is to be observed by
>    clients, the second by servers.
> 
>    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.
> 
> 
>                             CLIENT, ACCOUNTING
>       State     Event                          Action     New State
>       -------------------------------------------------------------
>       Idle      Client or device requests      send       PendingS
>                 access                         accounting
>                                                start req.
> 
>       Open      Interim interval elapses       send       PendingI
>                                                accounting
>                                                interim
>                                                record
> 
>       Idle      Client or device requests      send       PendingE
>                 a one-time service             accounting
>                                                event req
> 
>       Idle      Records in storage             Send       PendingB
>                                                record
> 
>       Open      User service terminated        send       PendingL
>                                                accounting
>                                                stop req.
> 
>       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
> 
>       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
> 
>       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
> 
>       PendingB  Successful accounting answer   Delete     Idle
>                 received                       record
> 
>       PendingB  Failure to send                           Idle
> 
>       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
> 
> 
> 
> 
>                             SERVER, ACCOUNTING
>       State     Event                          Action     New State
>       -------------------------------------------------------------
> 
>       Idle      Accounting start request       send       Open
>                 received, and successfully     accounting
>                 processed.                     start
>                                                answer
> 
>       Idle      Accounting event request       send       Idle
>                 received, and successfully     accounting
>                 processed.                     event
>                                                answer
> 
>       Open      Receive Interim Record         send       Open
>                                                accounting
>                                                answer
> 
>       Open      Accounting stop request        send       Idle
>                 received, and successfully     accounting
>                 processed                      stop answer
> 
> 
> 
>