rfc2059.txt

来自「RFC 的详细文档!」· 文本 代码 · 共 1,404 行 · 第 1/3 页

TXT
1,404
字号






Network Working Group                                          C. Rigney
Request for Comments: 2059                                    Livingston
Category: Informational                                     January 1997


                           RADIUS Accounting

Status of this Memo

   This memo provides information for the Internet community.  This memo
   does not specify an Internet standard of any kind.  Distribution of
   this memo is unlimited.

Abstract

   This document describes a protocol for carrying accounting
   information between a Network Access Server and a shared Accounting
   Server.

Table of Contents

   1.     Introduction ..........................................    2
      1.1       Specification of Requirements ...................    3
      1.2       Terminology .....................................    3
   2.     Operation .............................................    3
   3.     Packet Format .........................................    4
   4.     Packet Types ..........................................    6
      4.1       Accounting-Request ..............................    7
      4.2       Accounting-Response .............................    8
   5.     Attributes ............................................    9
      5.1       Acct-Status-Type ................................   11
      5.2       Acct-Delay-Time .................................   12
      5.3       Acct-Input-Octets ...............................   13
      5.4       Acct-Output-Octets ..............................   13
      5.5       Acct-Session-Id .................................   14
      5.6       Acct-Authentic ..................................   15
      5.7       Acct-Session-Time ...............................   16
      5.8       Acct-Input-Packets ..............................   17
      5.9       Acct-Output-Packets .............................   17
      5.10      Acct-Terminate-Cause ............................   18
      5.11      Acct-Multi-Session-Id ...........................   20
      5.12      Acct-Link-Count .................................   21
      5.13      Table of Attributes .............................   22
   Security Considerations ......................................   24
   References ...................................................   24
   Acknowledgements .............................................   24
   Chair's Address ..............................................   25
   Author's Address .............................................   25



Rigney                       Informational                      [Page 1]

RFC 2059                   RADIUS Accounting                January 1997


1.  Introduction

   Managing dispersed serial line and modem pools for large numbers of
   users can create the need for significant administrative support.
   Since modem pools are by definition a link to the outside world, they
   require careful attention to security, authorization and accounting.
   This can be best achieved by managing a single "database" of users,
   which allows for authentication (verifying user name and password) as
   well as configuration information detailing the type of service to
   deliver to the user (for example, SLIP, PPP, telnet, rlogin).

   The RADIUS (Remote Authentication Dial In User Service) document [4]
   specifies the RADIUS protocol used for Authentication and
   Authorization.  This memo extends the use of the RADIUS protocol to
   cover delivery of accounting information from the Network Access
   Server (NAS) to a RADIUS accounting server.

   Key features of RADIUS Accounting are:

      Client/Server Model

         A Network Access Server (NAS) operates as a client of the
         RADIUS accounting server.  The client is responsible for
         passing user accounting information to a designated RADIUS
         accounting server.

         The RADIUS accounting server is responsible for receiving the
         accounting request and returning a response to the client
         indicating that it has successfully received the request.

         The RADIUS accounting server can act as a proxy client to other
         kinds of accounting servers.

      Network Security

         Transactions between the client and RADIUS accounting server
         are authenticated through the use of a shared secret, which is
         never sent over the network.

      Extensible Protocol

         All transactions are comprised of variable length Attribute-
         Length-Value 3-tuples.  New attribute values can be added
         without disturbing existing implementations of the protocol.

   In this document, several words are used to signify the requirements
   of the specification.  These words are often capitalized.




Rigney                       Informational                      [Page 2]

RFC 2059                   RADIUS Accounting                January 1997


1.1  Specification of Requirements

   MUST      This word, or the adjective "required", means that the
             definition is an absolute requirement of the specification.

   MUST NOT  This phrase means that the definition is an absolute
             prohibition of the specification.

   SHOULD    This word, or the adjective "recommended", means that there
             may exist valid reasons in particular circumstances to
             ignore this item, but the full implications must be
             understood and carefully weighed before choosing a
             different course.

   MAY       This word, or the adjective "optional", means that this
             item is one of an allowed set of alternatives.  An
             implementation which does not include this option MUST be
             prepared to interoperate with another implementation which
             does include the option.

1.2.  Terminology

   This document uses the following terms:

   service   The NAS provides a service to the dial-in user, such as PPP
             or Telnet.

   session   Each service provided by the NAS to a dial-in user
             constitutes a session, with the beginning of the session
             defined as the point where service is first provided and
             the end of the session defined as the point where service
             is ended.  A user may have multiple sessions in parallel or
             series if the NAS supports that, with each session
             generating a separate start and stop accounting record with
             its own Acct-Session-Id.

   silently discard
             This means the implementation discards the packet without
             further processing.  The implementation SHOULD provide the
             capability of logging the error, including the contents of
             the silently discarded packet, and SHOULD record the event
             in a statistics counter.

2.  Operation

   When a client is configured to use RADIUS Accounting, at the start of
   service delivery it will generate an Accounting Start packet
   describing the type of service being delivered and the user it is



Rigney                       Informational                      [Page 3]

RFC 2059                   RADIUS Accounting                January 1997


   being delivered to, and will send that to the RADIUS Accounting
   server, which will send back an acknowledgement that the packet has
   been received.  At the end of service delivery the client will
   generate an Accounting Stop packet describing the type of service
   that was delivered and optionally statistics such as elapsed time,
   input and output octets, or input and output packets.  It will send
   that to the RADIUS Accounting server, which will send back an
   acknowledgement that the packet has been received.

   The Accounting-Request (whether for Start or Stop) is submitted to
   the RADIUS accounting server via the network. It is recommended that
   the client continue attempting to send the Accounting-Request packet
   until it receives an acknowledgement, using some form of backoff.  If
   no response is returned within a length of time, the request is re-
   sent a number of times.  The client can also forward requests to an
   alternate server or servers in the event that the primary server is
   down or unreachable.  An alternate server can be used either after a
   number of tries to the primary server fail, or in a round-robin
   fashion.  Retry and fallback algorithms are the topic of current
   research and are not specified in detail in this document.

   The RADIUS accounting server MAY make requests of other servers in
   order to satisfy the request, in which case it acts as a client.

   If the RADIUS accounting server is unable to successfully record the
   accounting packet it MUST NOT send an Accounting-Response
   acknowledgment to the client.

3.  Packet Format

   Exactly one RADIUS Accounting packet is encapsulated in the UDP Data
   field [1], where the UDP Destination Port field indicates 1813
   (decimal).

   When a reply is generated, the source and destination ports are
   reversed.















Rigney                       Informational                      [Page 4]

RFC 2059                   RADIUS Accounting                January 1997


   A summary of the RADIUS data format is shown below.  The fields are
   transmitted from left to right.

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Code      |  Identifier   |            Length             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |                         Authenticator                         |
   |                                                               |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Attributes ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-

Code

   The Code field is one octet, and identifies the type of RADIUS
   packet.  When a packet is received with an invalid Code field, it is
   silently discarded.

   RADIUS Accounting Codes (decimal) are assigned as follows:

        4       Accounting-Request
        5       Accounting-Response


Identifier

   The Identifier field is one octet, and aids in matching requests and
   replies.

Length

   The Length field is two octets.  It indicates the length of the
   packet including the Code, Identifier, Length, Authenticator and
   Attribute fields.  Octets outside the range of the Length field
   should be treated as padding and should be ignored on reception.  If
   the packet is shorter than the Length field indicates, it should be
   silently discarded.  The minimum length is 20 and maximum length is
   4096.

Authenticator

   The Authenticator field is sixteen (16) octets.  The most significant
   octet is transmitted first.  This value is used to authenticate the
   messages between the client and RADIUS accounting server.



Rigney                       Informational                      [Page 5]

RFC 2059                   RADIUS Accounting                January 1997


   Request Authenticator

      In Accounting-Request Packets, the Authenticator value is a 16
      octet MD5 [3] checksum, called the Request Authenticator.

      The NAS and RADIUS accounting server share a secret.  The Request
      Authenticator field in Accounting-Request packets contains a one-
      way MD5 hash calculated over a stream of octets consisting of the
      Code + Identifier + Length + 16 zero octets + request attributes +
      shared secret (where + indicates concatenation).  The 16 octet MD5
      hash value is stored in the Authenticator field of the
      Accounting-Request packet.

      Note that the Request Authenticator of an Accounting-Request can
      not be done the same way as the Request Authenticator of a RADIUS
      Access-Request, because there is no User-Password attribute in an
      Accounting-Request.

Response Authenticator

   The Authenticator field in an Accounting-Response packet is called
   the Response Authenticator, and contains a one-way MD5 hash
   calculated over a stream of octets consisting of the Accounting-
   Response Code, Identifier, Length, the Request Authenticator field
   from the Accounting-Request packet being replied to, and the response
   attributes if any, followed by the shared secret.  The resulting 16
   octet MD5 hash value is stored in the Authenticator field of the
   Accounting-Response packet.

Attributes

   Attributes may have multiple instances, in such a case the order of
   attributes of the same type SHOULD be preserved.  The order of
   attributes of different types is not required to be preserved.

4.  Packet Types

   The RADIUS packet type is determined by the Code field in the first
   octet of the packet.












Rigney                       Informational                      [Page 6]

RFC 2059                   RADIUS Accounting                January 1997


4.1.  Accounting-Request

   Description

      Accounting-Request packets are sent from a client (typically a
      Network Access Server or its proxy) to a RADIUS accounting server,
      and convey information used to provide accounting for a service
      provided to a user.  The client transmits a RADIUS packet with the
      Code field set to 4 (Accounting-Request).

      Upon receipt of an Accounting-Request, the server MUST transmit an
      Accounting-Response reply if it successfully records the
      accounting packet, and MUST NOT transmit any reply if it fails to
      record the accounting packet.

      Any attribute valid in a RADIUS Access-Request or Access-Accept
      packet is valid in a RADIUS Accounting-Request packet, except that
      the following attributes MUST NOT be present in an Accounting-
      Request: User-Password, CHAP-Password, Reply-Message, State.
      Either NAS-IP-Address or NAS-Identifier MUST be present in a
      RADIUS Accounting-Request.  It SHOULD contain a NAS-Port or NAS-
      Port-Type attribute or both unless the service does not involve a
      port or the NAS does not distinguish among its ports.

   A summary of the Accounting-Request packet format is shown below.
   The fields are transmitted from left to right.

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Code      |  Identifier   |            Length             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |                     Request Authenticator                     |
   |                                                               |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Attributes ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-

   Code

      4 for Accounting-Request.

   Identifier

      The Identifier field MUST be changed whenever the content of the
      Attributes field changes, and whenever a valid reply has been



Rigney                       Informational                      [Page 7]

RFC 2059                   RADIUS Accounting                January 1997


      received for a previous request.  For retransmissions where the
      contents are identical, the Identifier MUST remain unchanged.

      Note that if Acct-Delay-Time is included in the attributes of an
      Accounting-Request then the Acct-Delay-Time value will be updated
      when the packet is retransmitted, changing the content of the
      Attributes field and requiring a new Identifier and Request
      Authenticator.

   Request Authenticator

      The Request Authenticator of an Accounting-Request contains a 16-
      octet MD5 hash value calculated according to the method described
      in "Request Authenticator" above.

Attributes

   The Attributes field is variable in length, and contains a list of
   Attributes.

4.2.  Accounting-Response

   Description

      Accounting-Response packets are sent by the RADIUS accounting
      server to the client to acknowledge that the Accounting-Request
      has been received and recorded successfully.  If the Accounting-
      Request was recorded successfully then the RADIUS accounting
      server MUST transmit a packet with the Code field set to 5
      (Accounting-Response).  On reception of an Accounting-Response by
      the client, the Identifier field is matched with a pending
      Accounting-Request.  Invalid packets are silently discarded.

      A RADIUS Accounting-Response is not required to have any
      attributes in it.
















Rigney                       Informational                      [Page 8]

RFC 2059                   RADIUS Accounting                January 1997


   A summary of the Accounting-Response packet format is shown below.
   The fields are transmitted from left to right.

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Code      |  Identifier   |            Length             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |                     Response Authenticator                    |
   |                                                               |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Attributes ...

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?