RFC 2059
RADIUS Accounting
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 β οΈ ifAcct-Delay-Timeis in the attributes of an Accounting-Request, its value gets updated when the packet is retransmitted. that changes the content of theAttributesfield, 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 π«Ά
5.12. Acct-Link-Count πβ¨
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
- ietf: rfc2059 1997-01
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms