RFC 2059

RADIUS Accounting

πŸ“… published January 1997, from ietf

RFC 2059: RADIUS Accounting πŸŽ€

Okay bestie, so this one is by C. Rigney from Livingston, published in January 1997 from the Network Working Group. It's an Informational doc, which means it's sharing info with the Internet community and is not an official standard. It doesn't list anything it obsoletes or updates. πŸ’…

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

1. Introduction 🌸

Okay so managing dispersed serial line and modem pools for large numbers of users can take a LOT of admin support. 😩 Modem pools are by definition a link to the outside world, so they need careful attention to security, authorization and accounting. The best way to handle that is managing a single "database" of users, which lets you do authentication (verifying user name and password) and keeps configuration info about the type of service to deliver to each user (for example, SLIP, PPP, telnet, rlogin). It's giving organization. 🧚

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. πŸ’œ

Here are the key features of RADIUS Accounting:

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. Secret keeping, iconic. 🀫

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. Main character energy for future features. ✨

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

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

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. It's how the packets find their match. πŸ’•

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. Security, but make it cute. πŸ›‘οΈ

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. Different vibes, different rules. πŸ™ˆ

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

okay so attributes can show up more than once in a packet πŸ‘€ and when they do, bestie, the order of attributes of the same type SHOULD be preserved πŸŽ€ the order between attributes of different types? not required, so chill πŸ’…

4. Packet Types ✨

the whole vibe of a RADIUS packet is decided by its Code field, which is the very first octet πŸ‘‘

4.1. Accounting-Request ✨

Description

Accounting-Request packets are sent from a client (usually a Network Access Server or its proxy 🌸) to a RADIUS accounting server. They carry the info used to do accounting for a service a user is getting πŸ’– the client sends a RADIUS packet with the Code field set to 4 (Accounting-Request) ✨

okay, here's the tea πŸ«–: when 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 it πŸ’€

any attribute that's valid in a RADIUS Access-Request or Access-Accept is also valid in an Accounting-Request, EXCEPT the following, which MUST NOT be present in an Accounting-Request: User-Password, CHAP-Password, Reply-Message, State πŸ™…β€β™€οΈ also, either NAS-IP-Address or NAS-Identifier MUST be present in a RADIUS Accounting-Request. and 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 πŸ¦‹

here's the Accounting-Request packet at a glance 🧚 the fields go left to right, obviously 😌

    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 πŸ”’

heads up bestie ⚠️ if Acct-Delay-Time is in the attributes of an Accounting-Request, its value gets updated when the packet is retransmitted. that changes the content of the Attributes field, so you need a new Identifier and a new Request Authenticator 😭

Request Authenticator

the Request Authenticator of an Accounting-Request is a 16-octet MD5 hash value, calculated the way we described in "Request Authenticator" above πŸ”

Attributes

the Attributes field is variable in length and holds a list of Attributes πŸ“¦

4.2. Accounting-Response πŸ¦‹

Description

Accounting-Response packets are sent by the RADIUS accounting server to the client to say "yep, got your Accounting-Request and recorded it successfully" πŸ’… if it was recorded successfully, 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 gets matched with a pending Accounting-Request. invalid packets are silently discarded πŸ™ˆ

a RADIUS Accounting-Response is not required to have any attributes in it 🫢

here's the Accounting-Response summary πŸ“ left to right again!

    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 that caused this Accounting-Response πŸ’–

Response Authenticator

the Response Authenticator of an Accounting-Response is a 16-octet MD5 hash value, calculated the way we described in "Response Authenticator" above πŸ”

Attributes

the Attributes field is variable in length and holds 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's description πŸ’…

the end of the list of attributes is marked by the Length of the RADIUS packet πŸ“

summary of the attribute 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     |  Value ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type

the Type field is one octet 🧚 the up-to-date values are 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 spec is about these 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 it tells you 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 holds info specific to the attribute. its format and length are determined by the Type and Length fields πŸ’œ

there are four data types for the Value field 🌸

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 says 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 (like when booting up) by specifying Accounting-On, and to mark the end of accounting (like right before a scheduled reboot) by specifying Accounting-Off πŸ”Œ

summary of the Acct-Status-Type attribute 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

40 for Acct-Status-Type πŸ’…

Length

6 πŸ“

Value

the Value field is four octets πŸ’– the values are:

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

5.2. Acct-Delay-Time ⏰

Description

this attribute says how many seconds the client has been trying to send this record for. you can subtract that from the time of arrival on the server to get the approximate time of the event that made this Accounting-Request πŸ•°οΈ (network transit time is ignored, fr πŸ™ƒ)

note that changing the Acct-Delay-Time makes the Identifier change too. see the discussion under Identifier above πŸ‘€

summary of the Acct-Delay-Time attribute 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

41 for Acct-Delay-Time 🌈

Length

6 πŸ“

Value

the Value field is four octets ✨

5.3. Acct-Input-Octets πŸ“₯

Description

this attribute says how many octets have been received from the port over the course of this service being provided. it can ONLY be present in Accounting-Request records where the Acct-Status-Type is set to Stop πŸ›‘

summary of the Acct-Input-Octets attribute 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

42 for Acct-Input-Octets πŸ’œ

Length

6 πŸ“

Value

the Value field is four octets 🫢

5.4. Acct-Output-Octets ✨

Description πŸ¦‹

Okay bestie, this attribute counts how many octets were sent to the port while the service was being delivered πŸ’–. It can only show up in Accounting-Request records where the Acct-Status-Type is set to Stop, so it's an end-of-session stat πŸ’….

A quick peek at the layout, read 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 πŸ”’

  • Type: 43, the number for Acct-Output-Octets 🌸

Length πŸ“

  • Length: 6 πŸŽ€

Value πŸ’œ

The Value field is four octets, so it's a fixed-size slot 🧚


5.5. Acct-Session-Id 🌈

Description πŸ’«

This one is a unique Accounting ID that makes it super easy to match start and stop records in a log file πŸ“’. The start and stop records for a given session MUST have the same Acct-Session-Id, no exceptions πŸ™…β€β™€οΈ. It's strongly recommended that the Acct-Session-Id be a printable ASCII string, so your logs stay readable bestie πŸ“.

Here's an example that's giving real main character energy πŸ‘‘. One implementation uses a string with an 8-digit upper case hexadecimal number. The first two digits go up on each reboot and wrap every 256 reboots. The next 6 digits count up from 0 for the first person logging in after a reboot, all the way to 2^24-1, which is about 16 million 🀯. Other encodings are possible too, so don't feel boxed in πŸ¦‹.

The layout, 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: 44, the number for Acct-Session-Id 🌸

Length πŸ“

  • Length: must be 3 or more (>= 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 say how the user was authenticated. That could be by RADIUS, by the NAS itself, or by another remote authentication protocol πŸ›°οΈ. Users who get service without being authenticated SHOULD NOT generate Accounting records, bestie, that's a whole vibe check πŸ™…β€β™€οΈ.

The layout:

    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 πŸ”’

  • Type: 45, the number for Acct-Authentic 🌸

Length πŸ“

  • Length: 6 πŸŽ€

Value πŸ’œ

The Value field is four octets, and it holds one of these three values:

       1      RADIUS
       2      Local
       3      Remote

5.7. Acct-Session-Time ⏰

Description βŒ›

This attribute 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 πŸ›‘.

The layout:

    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 πŸ”’

  • Type: 46, the number for Acct-Session-Time 🌸

Length πŸ“

  • Length: 6 πŸŽ€

Value πŸ’œ

The Value field is four octets 🧚


5.8. Acct-Input-Packets πŸ“₯

Description πŸ“¦

This attribute counts how many packets have been received from 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 πŸ›‘.

The layout:

    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 πŸ”’

  • Type: 47, the number for Acct-Input-Packets 🌸

Length πŸ“

  • Length: 6 πŸŽ€

Value πŸ’œ

The Value field is four octets 🧚


5.9. Acct-Output-Packets πŸ“€

Description πŸ“¦

This one is the mirror of the last attribute πŸͺž. It counts how many packets have been sent to the port while delivering this service to a Framed User πŸ’Œ. It can only be present in Accounting-Request records where the Acct-Status-Type is set to Stop πŸ›‘.

The layout:

    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 πŸ”’

  • Type: 48, the number for Acct-Output-Packets 🌸

Length πŸ“

  • Length: 6 πŸŽ€

Value πŸ’œ

The Value field is four octets 🧚


5.10. Acct-Terminate-Cause πŸšͺ

Description 🚨

This attribute explains how the session got terminated πŸ’€. It can only be present in Accounting-Request records where the Acct-Status-Type is set to Stop πŸ›‘.

The layout:

    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 (cell)         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type πŸ”’

  • Type: 49 for Acct-Terminate-Cause 🌸

Length πŸ“

  • Length: 6 πŸŽ€

Value πŸ’œ

The Value field is four octets, holding an integer that tells you the cause of session termination. Here's the full list, bestie πŸ“œ:

      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 cause actually means 🧐:

      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 another unique Accounting ID, but this one links together multiple related sessions in a log file πŸͺ’. Each session that gets linked would have its own unique Acct-Session-Id, but they all share the same Acct-Multi-Session-Id πŸ‘―β€β™€οΈ. It's strongly recommended that the Acct-Multi-Session-Id be a printable ASCII string, so keep it clean, bestie ✨.

The layout, with the summary title exactly as written in the original:

    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, the number for Acct-Multi-Session-Id 🌸

Length πŸ“

  • Length: must be 3 or more (>= 3) πŸŽ€

String 🧡

The String field SHOULD be a string of printable ASCII characters 🫢

Description

okay so bestie, this attribute tells the accounting server how many links were known to be in a given multilink session when the accounting record got generated 🫢 The NAS MAY include the Acct-Link-Count attribute in any Accounting-Request which might have multiple links πŸ¦‹

Here's what the attribute looks like on the wire. Fields go left to right, obvi πŸ’…

    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

51 for Acct-Link-Count πŸŽ€

Length

6 🌸

Value

The Value field is four octets, and it holds the number of links seen so far in this Multilink Session πŸ’œ

Why this is so iconic: it helps the accounting server know when it has all the records for a Multilink Session πŸ‘‘ Once the number of Accounting-Requests received with Acct-Status-Type = Stop, sharing the same Acct-Multi-Session-Id and unique Acct-Session-Ids, equals the largest Acct-Link-Count value seen in those requests, every Stop Accounting-Request for that Multilink Session has arrived ✨ Literally a little checklist that finishes itself πŸ™ˆ

Let's walk through an example with 8 Accounting-Requests. Only the relevant attributes are shown here, but the requests would also carry the rest of the accounting info πŸ’–

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 guide to 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, so keep those responses clean 🫧

                  #     Attribute
                  0-1   User-Name
                  0     User-Password
                  0     CHAP-Password
                  0-1   NAS-IP-Address [4]
                  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

[4] 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. πŸ™ˆ So the rule is: at least one of those two, MUST be there, and having both is allowed but not the move πŸ’€

Here's the decoder ring for the table entries above πŸ’

   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 πŸ”βš οΈ

Security issues are briefly discussed in sections concerning the authenticator included in accounting requests and responses, using a shared secret which is never sent over the network. Bestie, this is the one to remember: the shared secret never travels over the wire, and the authenticator is where the security drama lives πŸ₯ΊπŸ’œ

References πŸ“š

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

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

[3] Rivest, R., and S. Dusse, "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 S. Willens, "Remote Authentication Dial In User Service (RADIUS)", RFC 2058, January 1997.


Acknowledgments 🫢

RADIUS and RADIUS Accounting were originally developed by Livingston Enterprises for their PortMaster series of Network Access Servers. Thank you, Livingston, for the iconic foundation πŸŒˆπŸ‘‘


Chair's Address πŸŽ€

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

Carl Rigney
Livingston Enterprises
6920 Koll Center Parkway, Suite 220
Pleasanton, California  94566

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
6920 Koll Center Parkway, Suite 220
Pleasanton, California  94566

EMail: cdr@livingston.com
πŸ“¦ where this page comes from