RFC 2139

RADIUS Accounting

๐Ÿ“… published April 1997, from ietf

RFC 2139: RADIUS Accounting ๐ŸŽ€

  • Series: Network Working Group ๐ŸŒธ
  • Request for Comments: 2139 โœจ
  • Author: C. Rigney, Livingston ๐Ÿ’–
  • Date: April 1997 ๐Ÿ—“๏ธ
  • Category: Informational ๐Ÿงš
  • Obsoletes: RFC 2059 ๐Ÿ’… (this one replaces it, bestie)
  • Updates: nothing listed ๐Ÿ™ˆ

Status of this Memo ๐Ÿ“œ

okay so this memo is giving "information for the Internet community" ๐Ÿ’โ€โ™€๏ธ. It does NOT set an Internet standard of any kind, and distribution is totally unlimited ๐ŸŒˆ.

Abstract โœจ

this doc describes a protocol for carrying accounting information between a Network Access Server and a shared Accounting Server. That's the whole main-character plot ๐Ÿฆ‹.

Implementation Note ๐Ÿ”ฅ

so the RADIUS Accounting protocol was documented here, and there was some confusion about port numbers ๐Ÿ™ƒ. Early deployments used port 1646, which clashes with the "sa-msg-port" service ๐Ÿ’€. The officially assigned port for RADIUS Accounting is 1813 ๐Ÿ’œ. Remember 1813, the real one ๐Ÿซถ.

Table of Contents ๐Ÿ—‚๏ธ

   1.     Introduction ..........................................    2
      1.1       Specification of Requirements ...................    3
      1.2       Terminology .....................................    3
   2.     Operation .............................................    4
   3.     Packet Format .........................................    5
   4.     Packet Types ..........................................    7
      4.1       Accounting-Request ..............................    7
      4.2       Accounting-Response .............................    8
   5.     Attributes ............................................   10
      5.1       Acct-Status-Type ................................   11
      5.2       Acct-Delay-Time .................................   12
      5.3       Acct-Input-Octets ...............................   13
      5.4       Acct-Output-Octets ..............................   14
      5.5       Acct-Session-Id .................................   14
      5.6       Acct-Authentic ..................................   15
      5.7       Acct-Session-Time ...............................   16
      5.8       Acct-Input-Packets ..............................   16
      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 ..............................................   24
   Author's Address .............................................   25

1. Introduction ๐ŸŒท

okay so managing dispersed serial line and modem pools for a ton of users can take serious admin support ๐Ÿ˜ฉ. Modem pools are literally a link to the outside world, so they need careful attention to security, authorization and accounting ๐Ÿ”. The bestie move is managing one single "database" of users ๐Ÿ’พ. That covers authentication (checking user name and password) and also config info saying what kind of service to hand out, like SLIP, PPP, telnet or rlogin ๐Ÿ“ž.

The RADIUS (Remote Authentication Dial In User Service) document [4] is where the RADIUS protocol for Authentication and Authorization lives ๐Ÿง . This memo extends RADIUS so it can deliver accounting info 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) acts as a client of the RADIUS accounting server. The client is in charge of passing user accounting info to a designated RADIUS accounting server ๐Ÿ“จ. The accounting server receives the accounting request and sends back a response saying it got it successfully ๐Ÿ’Œ. The RADIUS accounting server can also act as a proxy client to other kinds of accounting servers ๐Ÿชž.
  • Network Security ๐Ÿ”’: transactions between the client and the RADIUS accounting server are authenticated with a shared secret, and that secret is never sent over the network ๐Ÿคซ.
  • Extensible Protocol ๐Ÿงฉ: every transaction is made of variable length Attribute-Length-Value 3-tuples. New attribute values can be added without disturbing existing implementations of the protocol โœจ.

1.1. Specification of Requirements ๐Ÿ“‹

In this document, several words are used to signify the requirements of the specification ๐ŸŽฏ. These words are often capitalized ๐Ÿ’….

  • MUST: this word, or the adjective "required", means the definition is an absolute requirement of the specification ๐Ÿ”ฅ.
  • MUST NOT: this phrase means the definition is an absolute prohibition of the specification ๐Ÿšซ.
  • SHOULD: this word, or the adjective "recommended", means 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 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 the NAS provides to a dial-in user counts as a session. A session begins at the point where service is first provided and ends at the point where service is ended. A user may have multiple sessions in parallel or in series if the NAS supports that, and each session generates a separate start and stop accounting record with its own Acct-Session-Id ๐ŸŒˆ.
  • silently discard ๐Ÿค: the implementation discards the packet without any 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, it generates an Accounting Start packet at the start of service delivery ๐Ÿ. That packet describes the type of service being delivered and the user it's being delivered to. The client sends it to the RADIUS Accounting server, which sends back an acknowledgement that the packet arrived ๐Ÿ’Œ. At the end of service delivery, the client generates an Accounting Stop packet describing the type of service that was delivered, and optionally stats like elapsed time, input and output octets, or input and output packets ๐Ÿ“ˆ. It sends that to the RADIUS Accounting server too, which again sends back an acknowledgement ๐Ÿ’–.

The Accounting-Request (whether it's for Start or Stop) is submitted to the RADIUS accounting server over the network ๐ŸŒ. It is recommended that the client keep trying to send the Accounting-Request packet until it gets an acknowledgement, using some form of backoff โณ. If no response comes back within a set length of time, the request is re-sent a number of times ๐Ÿ”. The client can also forward requests to an alternate server or servers if 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. No receipt for a packet it couldn't record, bestie ๐Ÿšซ๐Ÿ’….

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 ๐Ÿ”„.

This memo documents the RADIUS Accounting protocol. There has been some confusion in the assignment of port numbers for this protocol. The early deployment of RADIUS Accounting was done using the erroneously chosen port number 1646, which conflicts with the "sa-msg-port" service. The officially assigned port number for RADIUS Accounting is 1813 ๐Ÿ™ƒโœจ.

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 helps match requests with 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 the 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 the RADIUS accounting server ๐Ÿ’œ.

Request Authenticator ๐Ÿ”

okay so in Accounting-Request packets, the Authenticator value is a 16 octet MD5 [3] checksum, and it's called the Request Authenticator ๐Ÿ’–

The NAS and RADIUS accounting server share a secret ๐Ÿคซ The Request Authenticator field in Accounting-Request packets holds a one-way MD5 hash, calculated over a stream of octets made of: Code + Identifier + Length + 16 zero octets + request attributes + shared secret (where + just means concatenation ๐Ÿงฉ). That 16 octet MD5 hash value gets 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 ๐ŸŒธ It holds a one-way MD5 hash calculated over a stream of octets: 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 gets stored in the Authenticator field of the Accounting-Response packet ๐ŸŽ€

Attributes ๐Ÿง

Attributes can show up more than once, and in that 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, so no stress there ๐Ÿซถ


4. Packet Types ๐Ÿ‘‘

The RADIUS packet type is determined by the Code field in the first octet of the packet โœจ

4.1. Accounting-Request ๐Ÿ“ฎ

Description

Accounting-Request packets get sent from a client (typically a Network Access Server or its proxy) to a RADIUS accounting server ๐Ÿ“ค They carry info used to provide accounting for a service given to a user. The client sends a RADIUS packet with the Code field set to 4 (Accounting-Request) ๐Ÿ’Œ

Once the server gets an Accounting-Request, it MUST transmit an Accounting-Response reply if it successfully records the accounting packet, and it MUST NOT transmit any reply if it fails to record the accounting packet ๐Ÿ˜ญ

Any attribute that's valid in a RADIUS Access-Request or Access-Accept packet is also 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 doesn't involve a port or the NAS doesn't 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 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. That changes the content of the Attributes field and requires 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) โœ… When the client receives an Accounting-Response, 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 ๐ŸŒท

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

Code

5 for Accounting-Response ๐Ÿฆ‹

Identifier

The Identifier field is a copy of the Identifier field of the Accounting-Request which caused this Accounting-Response ๐Ÿชž

Response Authenticator

The Response Authenticator of an Accounting-Response contains a 16-octet MD5 hash value, calculated according to the method described in "Response Authenticator" above ๐Ÿ”

Attributes

The Attributes field is variable in length, and contains a list of zero or more Attributes ๐Ÿงบ


5. Attributes ๐ŸŽ€

RADIUS Attributes carry the specific authentication, authorization and accounting details for the request and response ๐Ÿ’ผ

Some attributes MAY be included more than once ๐ŸŒˆ What that does is attribute specific, and it's spelled out in each attribute description ๐Ÿ“–

The end of the list of attributes is indicated by the Length of the RADIUS packet ๐Ÿ“

A summary of the attribute format is shown below. The fields are transmitted from left to right โœจ

    0                   1                   2
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |  Value ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

The Type field is one octet ๐Ÿ“ Up-to-date values of the RADIUS Type field are specified in the most recent "Assigned Numbers" RFC [2]. Values 192-223 are reserved for experimental use, values 224-240 are reserved for implementation-specific use, and values 241-255 are reserved and should not be used ๐Ÿšซ This specification concerns the following values:

     1-39   (refer to RADIUS document [4])
    40      Acct-Status-Type
    41      Acct-Delay-Time
    42      Acct-Input-Octets
    43      Acct-Output-Octets
    44      Acct-Session-Id
    45      Acct-Authentic
    46      Acct-Session-Time
    47      Acct-Input-Packets
    48      Acct-Output-Packets
    49      Acct-Terminate-Cause
    50      Acct-Multi-Session-Id
    51      Acct-Link-Count
    60+     (refer to RADIUS document [4])

Length

The Length field is one octet, and indicates the length of this attribute including the Type, Length and Value fields. If an attribute is received in an Accounting-Request with an invalid Length, the entire request should be silently discarded ๐Ÿ—‘๏ธ

Value

The Value field is zero or more octets and contains information specific to the attribute. The format and length of the Value field is determined by the Type and Length fields ๐Ÿงฎ

The format of the Value field is one of four data types ๐Ÿ’…

string    0-253 octets

address   32 bit value, most significant octet first.

integer   32 bit value, most significant octet first.

time      32 bit value, most significant octet first -- seconds
          since 00:00:00 GMT, January 1, 1970.  The standard
          Attributes do not use this data type but it is presented
          here for possible use within Vendor-Specific attributes.

5.1. Acct-Status-Type โฏ๏ธ

Description

This attribute indicates whether this Accounting-Request marks the beginning of the user service (Start) or the end (Stop) ๐Ÿšฆ

It MAY be used by the client to mark the start of accounting (for example, upon booting) by specifying Accounting-On, and to mark the end of accounting (for example, just before a scheduled reboot) by specifying Accounting-Off ๐Ÿ”Œ

A summary of the Acct-Status-Type attribute 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |             Value
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Value (cont)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

40 for Acct-Status-Type ๐Ÿงธ

Length

6

Value

The Value field is four octets ๐Ÿซง

 1      Start
 2      Stop
 7      Accounting-On
 8      Accounting-Off

5.2. Acct-Delay-Time ๐Ÿ•ฐ๏ธ

Description

This attribute indicates how many seconds the client has been trying to send this record for. It can be subtracted from the time of arrival on the server to find the approximate time of the event generating this Accounting-Request. (Network transit time is ignored.) โณ

Note that changing the Acct-Delay-Time causes the Identifier to change; see the discussion under Identifier above ๐Ÿ”„

A summary of the Acct-Delay-Time attribute 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
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         |     Type      |    Length     |             Value
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                    Value (cont)         |
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

41 for Acct-Delay-Time ๐ŸŒธ

Length

6

Value

The Value field is four octets.

5.3. Acct-Input-Octets ๐Ÿ“ฅ

Description

Okay bestie, this one counts how many octets came IN through the port over the whole time the service was being provided. ๐ŸŒŠ It can ONLY show up in Accounting-Request records where the Acct-Status-Type is set to Stop. ๐Ÿ’…

A quick peek at the Acct-Input-Octets format is below. The fields go 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |             Value
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Value (cont)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

42 is the type for Acct-Input-Octets. ๐ŸŽ€

Length

6 ๐Ÿ’–

Value

The Value field is four octets. ๐Ÿซถ

5.4. Acct-Output-Octets ๐Ÿ“ค

Description

This is the mirror image of the last one! ๐Ÿชž It tells you how many octets were sent OUT to the port while delivering the service. Like Acct-Input-Octets, it can only be present in Accounting-Request records where the Acct-Status-Type is set to Stop. ๐Ÿฆ‹

Here's the format, left to right as always. ๐ŸŒธ

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |             Value
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Value (cont)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

43 is the type for Acct-Output-Octets. ๐Ÿ“

Length

6 โœจ

Value

The Value field is four octets. ๐Ÿ’œ

5.5. Acct-Session-Id ๐Ÿ”‘

Description

This one is the unique Accounting ID that makes start and stop records easy to match up in a log file. ๐Ÿ—‚๏ธ Ngl, it's the main character of matching! ๐Ÿ‘‘ The start and stop records for a given session MUST have the same Acct-Session-Id. Non-negotiable, bestie. ๐Ÿ™…โ€โ™€๏ธ It is strongly recommended that the Acct-Session-Id be a printable ASCII string. ๐Ÿ”ค

For example, one implementation uses a string with an 8-digit upper case hexadecimal number. The first two digits increment on each reboot and wrap every 256 reboots. The next 6 digits count from 0 for the first person logging in after a reboot, going up to 2^24-1, which is about 16 million. Other encodings are possible. ๐Ÿงš

Here's the format, left to right. ๐ŸŽ€

    0                   1                   2
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |  String ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

44 is the type for Acct-Session-Id. ๐ŸŒˆ

Length

>= 3 ๐Ÿ’–

String

The String field SHOULD be a string of printable ASCII characters. ๐Ÿ”คโœจ

5.6. Acct-Authentic ๐Ÿชช

Description

This attribute MAY be included in an Accounting-Request to show how the user was authenticated. That could be by RADIUS, by the NAS itself, or by another remote authentication protocol. ๐Ÿ›ก๏ธ Users who are given service without being authenticated SHOULD NOT generate Accounting records. Bestie, no ID, no records! ๐Ÿ™…โ€โ™€๏ธ๐Ÿ’…

Here's the format, 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |             Value
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Value (cont)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

45 is the type for Acct-Authentic. ๐ŸŽ€

Length

6 ๐ŸŒธ

Value

The Value field is four octets, and it's an integer with these meanings: ๐Ÿ”ข

       1      RADIUS
       2      Local
       3      Remote

5.7. Acct-Session-Time โฑ๏ธ

Description

This one tells you how many seconds the user has received service for. โณ It can only be present in Accounting-Request records where the Acct-Status-Type is set to Stop. Time's up, bestie! ๐Ÿ’€

Format, 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |             Value
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Value (cont)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

46 is the type for Acct-Session-Time. ๐Ÿ’–

Length

6 โœจ

Value

The Value field is four octets. ๐Ÿซถ

5.8. Acct-Input-Packets ๐Ÿ“ฆ

Description

This one counts how many packets came IN through the port while the service was being provided to a Framed User. ๐Ÿ“ฅ It can only be present in Accounting-Request records where the Acct-Status-Type is set to Stop. ๐Ÿงš

Format, 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |             Value
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Value (cont)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

47 is the type for Acct-Input-Packets. ๐ŸŽ€

Length

6 ๐Ÿ’œ

Value

The Value field is four octets. ๐Ÿฆ‹

5.9. Acct-Output-Packets ๐Ÿ“จ

Description

The outbound packet counterpart! ๐Ÿ”ฅ This one tells you how many packets were sent OUT to the port while delivering the service to a Framed User. Same rule as always: it can only be present in Accounting-Request records where the Acct-Status-Type is set to Stop. ๐Ÿ›‘

Format, 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |             Value
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Value (cont)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

48 is the type for Acct-Output-Packets. ๐Ÿ“

Length

6 โœจ

Value

The Value field is four octets. ๐Ÿ’…

5.10. Acct-Terminate-Cause ๐Ÿšช

Description

This one spills the tea on HOW the session ended. โ˜• It can only be present in Accounting-Request records where the Acct-Status-Type is set to Stop. ๐Ÿ™ˆ

Format, 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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |             Value
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Value (cont)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

49 is the type for Acct-Terminate-Cause. ๐ŸŒˆ

Length

6 ๐ŸŽ€

Value

The Value field is four octets, containing an integer that specifies the cause of session termination. Here's the lineup: ๐Ÿ”ข๐Ÿ‘‘

      1       User Request
      2       Lost Carrier
      3       Lost Service
      4       Idle Timeout
      5       Session Timeout
      6       Admin Reset
      7       Admin Reboot
      8       Port Error
      9       NAS Error
      10      NAS Request
      11      NAS Reboot
      12      Port Unneeded
      13      Port Preempted
      14      Port Suspended
      15      Service Unavailable
      16      Callback
      17      User Error
      18      Host Request

And here's what each one actually means, bestie. ๐Ÿซถ

      User Request         User requested termination of service, for
                           example with LCP Terminate or by logging out.

      Lost Carrier         DCD was dropped on the port.

      Lost Service         Service can no longer be provided; for
                           example, user's connection to a host was
                           interrupted.

      Idle Timeout         Idle timer expired.

      Session Timeout      Maximum session length timer expired.

      Admin Reset          Administrator reset the port or session.

      Admin Reboot         Administrator is ending service on the NAS,
                           for example prior to rebooting the NAS.

      Port Error           NAS detected an error on the port which
                           required ending the session.

      NAS Error            NAS detected some error (other than on the
                           port) which required ending the session.

      NAS Request          NAS ended session for a non-error reason not
                           otherwise listed here.

      NAS Reboot           The NAS ended the session in order to reboot
                           non-administratively ("crash").

      Port Unneeded        NAS ended session because resource usage fell
                           below low-water mark (for example, if a
                           bandwidth-on-demand algorithm decided that
                           the port was no longer needed).

      Port Preempted       NAS ended session in order to allocate the
                           port to a higher priority use.

      Port Suspended       NAS ended session to suspend a virtual
                           session.

      Service Unavailable  NAS was unable to provide requested service.

      Callback             NAS is terminating current session in order
                           to perform callback for a new session.

      User Error           Input from user is in error, causing
                           termination of session.

      Host Request         Login Host terminated session normally.

5.11. Acct-Multi-Session-Id ๐Ÿงฉ

Description

This is the unique Accounting ID that links together multiple related sessions in a log file. ๐Ÿ”— Each session linked together would have its own unique Acct-Session-Id, but they'd all share the same Acct-Multi-Session-Id. Squad goals! ๐Ÿ‘ฏโ€โ™€๏ธ๐Ÿ’– It is strongly recommended that the Acct-Multi-Session-Id be a printable ASCII string. ๐Ÿ”ค

Format, left to right: ๐Ÿฆ‹

    0                   1                   2
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |  String ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   Type

Type

50 is the type for Acct-Multi-Session-Id. ๐ŸŒธ

Length

>= 3 ๐Ÿ’œ

String

The String field SHOULD be a string of printable ASCII characters. ๐Ÿ”ค๐Ÿซถ

Description ๐Ÿ’–

okay so this attribute tells the server how many links have been part of a given multilink session at the moment the accounting record gets made ๐Ÿ“Š the NAS MAY include the Acct-Link-Count attribute in any Accounting-Request that might have multiple links ๐Ÿฆ‹

Type ๐ŸŽ€

51 for Acct-Link-Count ๐ŸŒธ

Length ๐Ÿ“

6

Value ๐Ÿ’…

ngl this one is a little bit iconic ๐Ÿ‘‘ the Value field is four octets and holds the number of links seen so far in this Multilink Session โœจ

it helps an accounting server figure out when it has every record for a given Multilink session ๐Ÿงš here's the logic: once the number of Accounting-Requests received with Acct-Status-Type = Stop, sharing the same Acct-Multi-Session-Id and unique Acct-Session-Id's, equals the biggest Acct-Link-Count value seen in those requests, then all the Stop Accounting-Requests for that Multilink Session have arrived ๐Ÿ™Œ

here's an example with 8 Accounting-Requests so it's easier to picture ๐Ÿ’œ only the relevant attributes are shown, but the Accounting-Request will also carry more attributes with accounting info ๐Ÿ“

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Type      |    Length     |             Value
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Value (cont)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   Multi-Session-Id   Session-Id   Status-Type   Link-Count
   "10"               "10"         Start         1
   "10"               "11"         Start         2
   "10"               "11"         Stop          2
   "10"               "12"         Start         3
   "10"               "13"         Start         4
   "10"               "12"         Stop          4
   "10"               "13"         Stop          4
   "10"               "10"         Stop          4

5.13. Table of Attributes ๐Ÿ“‹

this table is your cheat sheet for which attributes can show up in Accounting-Request packets ๐ŸŽ€ no attributes should be found in Accounting-Response packets except Proxy-State and possibly Vendor-Specific ๐Ÿ’Œ

                      #     Attribute
                      0-1   User-Name
                      0     User-Password
                      0     CHAP-Password
                      0-1   NAS-IP-Address [5]
                      0-1   NAS-Port
                      0-1   Service-Type
                      0-1   Framed-Protocol
                      0-1   Framed-IP-Address
                      0-1   Framed-IP-Netmask
                      0-1   Framed-Routing
                      0+    Filter-Id
                      0-1   Framed-MTU
                      0+    Framed-Compression
                      0+    Login-IP-Host
                      0-1   Login-Service
                      0-1   Login-TCP-Port
                      0     Reply-Message
                      0-1   Callback-Number
                      0-1   Callback-Id
                      0+    Framed-Route
                      0-1   Framed-IPX-Network
                      0     State
                      0+    Class
                      0+    Vendor-Specific
                      0-1   Session-Timeout
                      0-1   Idle-Timeout
                      0-1   Termination-Action
                      0-1   Called-Station-Id
                      0-1   Calling-Station-Id
                      0-1   NAS-Identifier [4]
                      0+    Proxy-State
                      0-1   Login-LAT-Service
                      0-1   Login-LAT-Node
                      0-1   Login-LAT-Group
                      0-1   Framed-AppleTalk-Link
                      0-1   Framed-AppleTalk-Network
                      0-1   Framed-AppleTalk-Zone
                      1     Acct-Status-Type
                      0-1   Acct-Delay-Time
                      0-1   Acct-Input-Octets
                      0-1   Acct-Output-Octets
                      1     Acct-Session-Id
                      0-1   Acct-Authentic
                      0-1   Acct-Session-Time
                      0-1   Acct-Input-Packets
                      0-1   Acct-Output-Packets
                      0-1   Acct-Terminate-Cause
                      0+    Acct-Multi-Session-Id
                      0+    Acct-Link-Count
                      0     CHAP-Challenge
                      0-1   NAS-Port-Type
                      0-1   Port-Limit
                      0-1   Login-LAT-Port

[5] An Accounting-Request MUST contain either a NAS-IP-Address or a NAS-Identifier, and it is permitted (but not recommended) for it to contain both. โš ๏ธ

heads up bestie, that [5] note is the big one: an Accounting-Request MUST contain either a NAS-IP-Address or a NAS-Identifier ๐Ÿšจ it's allowed to have both, but that's not recommended ๐Ÿ’€

the table below defines what the entries above mean ๐ŸŒˆ

   0     This attribute MUST NOT be present
   0+    Zero or more instances of this attribute MAY be present.
   0-1   Zero or one instance of this attribute MAY be present.
   1     Exactly one instance of this attribute MUST be present.

Security Considerations ๐Ÿ”’

okay bestie, this part is SERIOUS ๐Ÿ˜ญ security issues get briefly covered in the sections about the authenticator that goes inside accounting requests and responses ๐Ÿ›ก๏ธ that authenticator uses a shared secret, and that secret is never sent over the network ๐Ÿคซ๐Ÿ”

References ๐Ÿ“š

[1] Postel, J., "User Datagram Protocol", STD 6, RFC 768, USC/Information Sciences Institute, August 1980.

[2] Reynolds, J., and Postel, J., "Assigned Numbers", STD 2, RFC 1700, USC/Information Sciences Institute, October 1994.

[3] Rivest, R., and Dusse, S., "The MD5 Message-Digest Algorithm", RFC 1321, MIT Laboratory for Computer Science, RSA Data Security Inc., April 1992.

[4] Rigney, C., Rubens, A., Simpson, W., and Willens, S., "Remote Authentication Dial In User Service (RADIUS)", RFC 2138, April 1997.

Acknowledgments ๐Ÿซถ

RADIUS and RADIUS Accounting were originally developed by Livingston Enterprises for their PortMaster series of Network Access Servers ๐ŸŒŸ

Chair's Address ๐ŸŽ€

The RADIUS working group can be contacted via the current chair:

Carl Rigney Livingston Enterprises 4464 Willow Road Pleasanton, California 94588

Phone: +1 510 426 0770 EMail: cdr@livingston.com

Author's Address ๐Ÿ’Œ

Questions about this memo can also be directed to:

Carl Rigney Livingston Enterprises 4464 Willow Road Pleasanton, California 94588

EMail: cdr@livingston.com

๐Ÿ“ฆ where this page comes from