The format of the identifier in this AVP depends upon the value of
the Tunnel-Type AVP. For example, to identify an L2TP tunnel
connection fully, the L2TP Tunnel Id and Call Id might be encoded in
this field. The exact encoding of this field is implementation
dependent.
8.11. Acct-Tunnel-Packets-Lost AVP
The Acct-Tunnel-Packets-Lost AVP (AVP Code 86) is of type Unsigned32
and contains the number of packets lost on a given link.
9. RADIUS/Diameter Protocol Interactions
This section describes some basic guidelines that servers acting as
AAA Translation Agents may use. A complete description of all the
differences between RADIUS and Diameter is beyond the scope of this
section and document. Note that this document does not restrict
implementations from creating additional translation methods, as long
as the translation function doesn’t violate the RADIUS or the
Diameter protocols.
Although the Diameter protocol is in many ways a superset of RADIUS
functions, a number of RADIUS representations are not allowed, so
that new capabilities can be used without the old problems.
There are primarily two different situations that must be handled:
one in which a RADIUS request is received that must be forwarded as a
Diameter request, and another in which the inverse is true. RADIUS
does not support a peer-to-peer architecture, and server-initiated
operations are generally not supported. See [RADDynAuth] for an
alternative.
Some RADIUS attributes are encrypted. RADIUS security and encryption
techniques are applied on a hop-per-hop basis. A Diameter agent will
have to decrypt RADIUS attribute data entering the Diameter system,
and if that information is forwarded, the agent MUST secure it by
using Diameter specific techniques.
Note that this section uses the two terms, "AVP" and "attribute", in
a concise and specific manner. The former is used to signify a
Diameter AVP, and the latter to signify a RADIUS attribute.
9.1. RADIUS Request Forwarded as Diameter Request
This section describes the actions that should be taken when a
Translation Agent receives a RADIUS message to be translated to a
Diameter message.
Note that RADIUS servers are assumed to be stateless. It is also
quite possible for the RADIUS messages that comprise the session
(i.e., authentication and accounting messages) to be handled by
different Translation Agents in the proxy network. Therefore, a
RADIUS/Diameter Translation Agent SHOULD NOT be assumed to have an
accurate track on session-state information.
When a Translation Agent receives a RADIUS message, the following
steps should be taken:
- If a Message-Authenticator attribute is present, the value MUST
be checked but not included in the Diameter message. If it is
incorrect, the RADIUS message should be silently discarded.
The gateway system SHOULD generate and include a Message-
Authenticator in returned RADIUS responses.
- The transport address of the sender MUST be checked against the
NAS identifying attributes. See the description of NAS-
Identifier and NAS-IP-Address below.
- The Translation Agent must maintain transaction state
information relevant to the RADIUS request, such as the
Identifier field in the RADIUS header, any existing RADIUS
Proxy-State attribute, and the source IP address and port
number of the UDP packet. These may be maintained locally in a
state table or saved in a Proxy-Info AVP group. A Diameter
Session-Id AVP value must be created using a session state
mapping mechanism.
- If the RADIUS request contained a State attribute and the
prefix of the data is "Diameter/", the data following the
prefix contains the Diameter Origin-Host/Origin-Realm/Session-
Id. If no such attributes are present and the RADIUS command
is an Access-Request, a new Session-Id is created. The
Session-Id is included in the Session-Id AVP.
- The Diameter Origin-Host and Origin-Realm AVPs MUST be created
and added by using the information from an FQDN corresponding
to the NAS-IP-Address attribute (preferred if available),
and/or to the NAS-Identifier attribute. (Note that the RADIUS
NAS-Identifier is not required to be an FQDN.)
- The response MUST have an Origin-AAA-Protocol AVP added,
indicating the protocol of origin of the message.
- The Proxy-Info group SHOULD be added, with the local server’s
identity specified in the Proxy-Host AVP. This should ensure
that the response is returned to this system.
- The Destination-Realm AVP is created from the information found
in the RADIUS User-Name attribute.
- If the RADIUS User-Password attribute is present, the password
must be unencrypted by using the link’s RADIUS shared secret.
The unencrypted value must be forwarded in a User-Password AVP
using Diameter security.
- If the RADIUS CHAP-Password attribute is present, the Ident and
Data portion of the attribute are used to create the CHAP-Auth
grouped AVP.
- If the RADIUS message contains an address attribute, it MUST be
converted to the appropriate Diameter AVP and type.
- If the RADIUS message contains Tunnel information [RADTunnels],
the attributes or tagged groups should each be converted to a
Diameter Tunneling Grouped AVP set. If the tunnel information
contains a Tunnel-Password attribute, the RADIUS encryption
must be resolved, and the password forwarded, by using Diameter
security methods.
- If the RADIUS message received is an Accounting-Request, the
Acct-Status-Type attribute value must be converted to a
Accounting-Record-Type AVP value. If the Acct-Status-Type
attribute value is STOP, the local server MUST issue a
Session-Termination-Request message once the Diameter
Accounting-Answer message has been received.
- If the Accounting message contains an Acct-Termination-Cause
attribute, it should be translated to the equivalent
Termination-Cause AVP value. (see below)
- If the RADIUS message contains the Accounting-Input-Octets,
Accounting-Input-Packets, Accounting-Output-Octets, or
Accounting-Output-Packets, these attributes must be converted
to the Diameter equivalents. Further, if the Acct-Input-
Gigawords or Acct-Output-Gigawords attributes are present,
these must be used to properly compute the Diameter accounting
AVPs.
The corresponding Diameter response is always guaranteed to be
received by the same Translation Agent that translated the original
request, due to the contents of the Proxy-Info AVP group in the
Diameter request. The following steps are applied to the response
message during the Diameter-to-RADIUS translation:
- If the Diameter Command-Code is set to AA-Answer and the
Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH, the
gateway must send a RADIUS Access-Challenge. This must have
the Origin-Host, Origin-Realm, and Diameter Session-Id AVPs
encapsulated in the RADIUS State attribute, with the prefix
"Diameter/", concatenated in the above order separated with "/"
characters, in UTF-8 [UTF-8]. This is necessary to ensure that
the Translation Agent receiving the subsequent RADIUS Access-
Request will have access to the Session Identifier and be able
to set the Destination-Host to the correct value. If the
Multi-Round-Time-Out AVP is present, the value of the AVP MUST
be inserted in the RADIUS Session-Timeout AVP.
- If the Command-Code is set to AA-Answer, the Diameter Session-
Id AVP is saved in a new RADIUS Class attribute whose format
consists of the string "Diameter/" followed by the Diameter
Session Identifier. This will ensure that the subsequent
Accounting messages, which could be received by any Translation
Agent, would have access to the original Diameter Session
Identifier.
- If a Proxy-State attribute was present in the RADIUS request,
the same attribute is added in the response. This information
may be found in the Proxy-Info AVP group, or in a local state
table.
- If state information regarding the RADIUS request was saved in
a Proxy-Info AVP or local state table, the RADIUS Identifier
and UDP IP Address and port number are extracted and used in
issuing the RADIUS reply.
When translating a Diameter AA-Answer (with successful result code)
to RADIUS Access-Accept that contains a Session-Timeout or
Authorization-Lifetime AVP, take the following steps:
- If the Diameter message contains a Session-Timeout AVP but no
Authorization-Lifetime AVP, translate it to a Session-Timeout
attribute (not a Termination-Action).
- If the Diameter message contains an Authorization-Lifetime AVP
but no Session-Timeout AVP, translate it to a Session-Timeout
attribute and a Termination-Action set to AA-REQUEST. (Remove
Authorization-Lifetime and Re-Auth-Request-Type.)
- If the Diameter message has both, the Session-Timeout must be
greater than or equal to the Authorization-Lifetime (required
by [BASE]). Translate it to a Session-Timeout value (with
value from Authorization-Lifetime AVP, the smaller one) and
with the Termination-Action set to AA-REQUEST. (Remove the
Authorization-Lifetime and Re-Auth-Request-Type.)
9.1.1. RADIUS Dynamic Authorization Considerations
A Diameter/RADIUS gateway may communicate with a server that
implements RADIUS Dynamic Authorization [RADDynAuth]. If the server
supports these functions, it MUST be listening on the assigned port
and would receive RADIUS CoA-Request and Disconnect-Request messages.
These can be mapped into the Diameter Re-Auth-Request (RAR) and
Abort-Session-Request (ASR) message exchanges, respectively [BASE].
If the [RADDynAuth] is not supported, the port would not be active
and the RADIUS server would receive an ICMP Port Unreachable
indication. Alternatively, if the messages are received but with an
inappropriate Service-Type, the gateway can respond with the
appropriate NAK message and an Error-Cause attribute with the value
of 405, "Unsupported Service".
The RADIUS CoA-Request and Disconnect-Request messages will not
contain a Diameter Session-Id. Diameter requires that this value
match an active session context. The gateway MUST have a session Id
cache (or other means) to identify the sessions these functions
pertain to. If unable to identify the session, the gateway (or NAS)
should return an Error-Cause value 503, "Session Context Not Found".
The RADIUS CoA-Request message only supports a change of
authorization attributes, and the received CoA-Request SHOULD include
a Service-Type of "Authorize-Only". This indicates an extended
exchange request by the rules given in [RADDynAuth] section 3.2, note
6. This is the only type of exchange supported by Diameter [BASE].
For the CoA-Request, the translated RAR message will have a Re-Auth-
Type of AUTHORIZE_ONLY. The returned RAA will be translated into a
CoA-NAK with Error-Cause "Request Initiated". The gateway’s Diameter
client SHOULD also start a reauthorization sequence by sending an AAR
message, which will be translated into an Access-Request message.
The RADIUS server will use the Access-Accept (or Access-Reject)
message to convey the new authorization attributes, which the gateway
will pass back in an AAA message.
Any attributes included in the COA-Request or Access-Accept message
are to be considered mandatory in Diameter. If they cannot be
supported, they MUST result in an error message return to the RADIUS
server, with an Error-Cause of "Unsupported Attribute". The Diameter
NAS will attempt to apply all the attributes supplied in the AA
message to the session.
A RADIUS Disconnect-Request message received by the gateway would be
translated to a Diameter Abort-Session-Request (ASR) message [BASE].
The results will be returned by the Diameter client in an Abort-
Session-Answer (ASA) message. A success indication would translate
to a RADIUS Disconnect-ACK, and a failure would generate a
Disconnect-NAK.
9.2. Diameter Request Forwarded as RADIUS Request
When a server receives a Diameter request to be forwarded to a RADIUS
entity, the following are examples of the steps that may be taken:
- The Origin-Host AVP’s value is inserted into the NAS-Identifier
attribute.
- The following information MUST be present in the corresponding
Diameter response and therefore MUST be saved, either in a
local state table or encoded in a RADIUS Proxy-State attribute:
1. Origin-Host AVP
2. Session-Id AVP
3. Proxy-Info AVP
4. Any other AVP that MUST be present in the response and
has no corresponding RADIUS attribute.
- If the CHAP-Auth AVP is present, the grouped AVPs are used to
create the RADIUS CHAP-Password attribute data.
- If the User-Password AVP is present, the data should be
encrypted and forwarded by using RADIUS rules. The same is
true for any other RADIUS-encrypted attribute values.
- AVPs of the type Address must be translated to the
corresponding RADIUS attribute.
- If the Accounting-Input-Octets, Accounting-Input-Packets,
Accounting-Output-Octets, or Accounting-Output-Packets AVPs are
present, they must be translated to the corresponding RADIUS
attributes. If the value of the Diameter AVPs do not fit
within a 32-bit RADIUS attribute, the RADIUS Acct-Input-
Gigawords and Acct-Output-Gigawords must be used.
- If the RADIUS link supports the Message-Authenticator attribute
[RADIUSExt], it SHOULD be generated and added to the request.
When the corresponding response is received by the Translation Agent,
which is guaranteed in the RADIUS protocol, the following steps may
be taken:
- If the RADIUS code is set to Access-Challenge, a Diameter AA-
Answer message is created with the Result-Code set to
DIAMETER_MULTI_ROUND_AUTH. If the Session-Timeout AVP is
present in the RADIUS message, its value is inserted into the
Multi-Round-Time-Out AVP.
- If a Proxy-State attribute is present, extract the encoded
information; otherwise, retrieve the original Proxy-Info AVP
group information from the local state table.
- The response’s Origin-Host information is created from the FQDN
of the RADIUS message’s source IP address. The same FQDN is
also stored to a Route-Record AVP.
- The response’s Destination-Host AVP is copied from the saved
request’s Origin-Host information.
- The Session-Id information can be recovered from local state,
or from the constructed State or Proxy-State attribute, as
above.
- If a Proxy-Info AVP was present in the request, the same AVP
MUST be added to the response.
- If the RADIUS State attributes are present, they must be
present in the Diameter response, minus those added by the
gateway.
- Any other AVPs that were saved at request time, and that MUST
be present in the response, are added to the message.
When translating a RADIUS Access-Accept to Diameter AA-Answer that
contains a Session-Timeout attribute, do the following:
- If the RADIUS message contains a Session-Timeout attribute and
a Termination-Action attribute set to DEFAULT (or no
Termination-Action attribute at all), translate it to AA-Answer
with a Session-Timeout AVP and remove the Termination-Action
attribute.
- If the RADIUS message contains a Session-Timeout attribute and
a Termination-Action attribute set to AA-REQUEST, translate it
to AA-Answer with Authorization-Lifetime AVP and with Re-Auth-
Request-Type set to AUTHORIZE_AUTHENTICATE and remove the
Session-Timeout attribute.
9.2.1. RADIUS Dynamic Authorization Considerations
A RADIUS/Diameter gateway communicating with a RADIUS client that
implements RADIUS Dynamic Authorization [RADDynAuth] may translate
Diameter Re-Auth-Request (RAR) messages and Abort-Session-Request
(ASR) messages [BASE] into RADIUS CoA-Request and Disconnect-Request
messages respectively.
If the RADIUS client does not support the capability, the gateway
will receive an ICMP Port Unreachable indication when it transmits
the RADIUS message. Even if the NAS supports [RADDynAuth], it may
not support the Service-Type in the request message. In this case it
will respond with a NAK message and (optionally) an Error-Cause
attribute with value 405, "Unsupported Service". If the gateway
encounters these error conditions, or if it does not support
[RADDynAuth], it sends a Diameter Answer message with an Result-Code
AVP of "DIAMETER_COMMAND_UNSUPPORTED" to the AAA server.
When encoding the RADIUS messages, the gateway MUST include the
Diameter Session-ID in the RADIUS State attribute value, as mentioned
above. The RADIUS client should return it in the response.
A Diameter Re-Auth-Request (RAR) message [BASE] received by the
gateway will be translated into a RADIUS CoA-Request and sent to the
RADIUS client. The RADIUS client should respond with a CoA-ACK or
CoA-NAK message, which the gateway should translate into a Re-Auth-
Answer (RAA) message.
If the gateway receives a RADIUS CoA-NAK response containing a
Service-Type Attribute with value "Authorize Only" and an Error-Cause
Attribute with value "Request Initiated", this indicates an extended
exchange request per [RADDynAuth] section 3.2, note 6.
The response is translated to a Diameter Re-Auth-Answer (RAA) with a
Result-Code AVP of "DIAMETER_LIMITED_SUCCESS" sent to the AAA server.
Subsequently, the gateway should receive a RADIUS Access-Request from
the NAS, with a Service-Type of "Authorize Only". This is translated
into a Diameter AA-Request with an Auth-Request-Type AVP of
AUTHORIZE_ONLY and sent to the AAA server. The AAA server will then
reply with a Diameter AA-Answer, which is translated into a RADIUS
Access-Accept or Access-Reject, depending on the value of the
Result-Code AVP.
A Diameter Abort-Session-Request (ASR) message [BASE] received by the
gateway will be translated into a RADIUS Disconnect-Request and sent
to the RADIUS client. The RADIUS client should respond with a
Disconnect-ACK or Disconnect-NAK message, which the gateway should
translate into an Abort-Session-Answer (ASA) message.
If the gateway receives a RADIUS Disconnect-NAK response containing a
Service-Type Attribute with value "Authorize Only" and an Error-Cause
Attribute with value "Request Initiated", the Disconnect-NAK response
is translated into a Diameter Abort-Session-Answer (ASA) with a
Result-Code AVP of "DIAMETER_LIMITED_SUCCESS" sent to the AAA server.
Subsequently, the gateway should receive a RADIUS Access-Request from
the NAS, with a Service-Type of "Authorize Only". This is translated
into a Diameter AA-Request with an Auth-Request-Type AVP of
AUTHORIZE_ONLY and sent to the AAA server. The AAA server will then
reply with a Diameter AA-Answer, which is translated into a RADIUS
Access-Accept or Access-Reject, depending on the value of the
Result-Code AVP.
9.3. AVPs Used Only for Compatibility
The AVPs defined in this section SHOULD only be used for backwards
compatibility when a Diameter/RADIUS translation function is invoked
and are not typically originated by Diameter systems during normal
operations.
+---------------------+
| AVP Flag rules |
|----+-----+----+-----|----+
AVP Section | | |SHLD| MUST| |
Attribute Name Code Defined Value Type |MUST| MAY | NOT| NOT|Encr|
-----------------------------------------|----+-----+----+-----|----|
NAS-Identifier 32 9.3.1 UTF8String | M | P | | V | Y |
NAS-IP-Address 4 9.3.2 OctetString| M | P | | V | Y |
NAS-IPv6-Address 95 9.3.3 OctetString| M | P | | V | Y |
State 24 9.3.4 OctetString| M | P | | V | Y |
Termination- 295 9.3.5 Enumerated | M | P | | V | Y |
Cause | | | | | |
Origin-AAA- 408 9.3.6 Enumerated | M | P | | V | Y |
Protocol | | | | | |
-----------------------------------------|----+-----+----+-----|----|
9.3.1. NAS-Identifier AVP
The NAS-Identifier AVP (AVP Code 32) [RADIUS] is of type UTF8String
and contains the identity of the NAS providing service to the user.
This AVP SHOULD only be added by a RADIUS/Diameter Translation Agent.
When this AVP is present, the Origin-Host AVP identifies the NAS
providing service to the user.
In RADIUS it would be possible for a rogue NAS to forge the NAS-
Identifier attribute. Diameter/RADIUS translation agents SHOULD
attempt to check a received NAS-Identifier attribute against the
source address of the RADIUS packet, by doing an A/AAAA RR query. If
the NAS-Identifier attribute contains an FQDN, then such a query
would resolve to an IP address matching the source address. However,
the NAS-Identifier attribute is not required to contain an FQDN, so
such a query could fail. If it fails, an error should be logged, but
no action should be taken, other than a reverse lookup on the source
address and insert the resulting FQDN into the Route-Record AVP.
Diameter agents and servers SHOULD check whether a NAS-Identifier AVP
corresponds to an entry in the Route-Record AVP. If no match is
found, then an error is logged, but no other action is taken.
9.3.2. NAS-IP-Address AVP
The NAS-IP-Address AVP (AVP Code 4) [RADIUS] is of type OctetString
and contains the IP Address of the NAS providing service to the user.
This AVP SHOULD only be added by a RADIUS/Diameter Translation Agent.
When this AVP is present, the Origin-Host AVP identifies the NAS
providing service to the user.
In RADIUS it would be possible for a rogue NAS to forge the NAS-IP-