Recent from talks
Nothing was collected or created yet.
Diameter (protocol)
View on Wikipedia
| Internet protocol suite |
|---|
| Application layer |
| Transport layer |
| Internet layer |
| Link layer |
Diameter is an authentication, authorization, and accounting (AAA) protocol for computer networks. It evolved from the earlier RADIUS protocol. It belongs to the application layer protocols in the Internet protocol suite.
Diameter Applications extend the base protocol by adding new commands and/or attributes, such as those for use with the Extensible Authentication Protocol (EAP).
Comparison with RADIUS
[edit]The name is a play on words, derived from the RADIUS protocol, which is the predecessor (a diameter is twice the radius). Diameter is not directly backward compatible but provides an upgrade path for RADIUS. The main features provided by Diameter but lacking in RADIUS are:
- Support for SCTP
- Capability negotiation
- Application layer acknowledgements; Diameter defines failover methods and state machines (RFC 3539)
- Extensibility; new commands can be defined
- Aligned on 32 bit boundaries
Also: Like RADIUS, it is intended to work in both local and roaming AAA situations. It uses TCP or SCTP, unlike RADIUS which uses UDP. Unlike RADIUS it includes no encryption but can be protected by transport-level security (IPSEC or TLS). The base size of the AV identifier is 32 bit unlike RADIUS which uses 8 bit as the base AV identifier size. Like RADIUS, it supports stateless as well as stateful modes. Like RADIUS, it supports application-layer acknowledgment and defines failover. Diameter is used for many different interfaces defined by the 3GPP standards, with each interface typically defining new commands and attributes.
Applications
[edit]A Diameter Application is not a software application but is a protocol based on the Diameter base protocol defined in RFC 6733 (obsoletes RFC 3588) and RFC 7075. Each application is defined by an application identifier and can add new command codes and/or new mandatory AVPs (Attribute-Value Pair). Adding a new optional AVP does not require a new application.
Examples of Diameter applications:
- Diameter Mobile IPv4 Application (MobileIP, RFC 4004)
- Diameter Network Access Server Application (NASREQ, RFC 7155)(Obsoletes: RFC 4005)
- Diameter Extensible Authentication Protocol Application (RFC 4072)
- Diameter Credit-Control Application (DCCA, RFC 8506])(Obsoletes: RFC 4006)
- Diameter Session Initiation Protocol Application (RFC 4740)
- Various applications in the 3GPP IP Multimedia Subsystem
(Generic Bootstrapping Architecture): Bootstrapping Server Function
History
[edit]The Diameter protocol was initially developed by Pat R. Calhoun, Glen Zorn, and Ping Pan in 1998 to provide a framework for authentication, authorization, and accounting (AAA) that could overcome the limitations of RADIUS. At the time Diameter was designed, RADIUS was believed to have issues with reliability, scalability, security, and flexibility. RADIUS also did not support large policies which were needed for telephony applications. The Diameter protocol defines a policy protocol used by clients to perform Policy, AAA, and resource control. This allows a single server to handle policies for many services.[1]
Like RADIUS, Diameter provides AAA functionality, but uses TCP and SCTP instead of UDP, therefore delegating detection and handling of communication problems to those protocols. The Diameter protocol is enhanced further by the development of the 3rd Generation Partnership Project (3GPP) IP Multimedia Subsystem (IMS). The S6a, S6b, Gx, Gy, Sy, Rx, Cx, Dh, Dx, Rf, Ro, Sh and Zh interfaces are supported by Diameter applications.[2] Through the use of extensions, the protocol was designed to be extensible to support proxies, brokers, strong security, mobile IP, network-access servers (NASREQ), accounting and resource management.
Protocol description
[edit]This section needs expansion. You can help by adding to it. (June 2008) |
The Diameter base protocol is defined by RFC 6733 (Obsoletes: RFC 3588 and RFC 5719) and defines the minimum requirements for an AAA protocol. Diameter Applications can extend the base protocol by adding new commands, attributes, or both. Diameter security is provided by IPsec or TLS. The IANA has assigned TCP and SCTP port number 3868 to Diameter, as stated in section 11.4 of RFC 6733.
Packet format
[edit]The packet consists of a Diameter header and a variable number of Attribute–Value Pairs, or AVPs, for encapsulating information relevant to the Diameter message.
| Bit offset | 0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | version | message length | ||||||||||||||||||||||||||||||
| 32 | R |
P |
E |
T |
command code | |||||||||||||||||||||||||||
| 64 | application ID | |||||||||||||||||||||||||||||||
| 96 | hop-by-hop ID | |||||||||||||||||||||||||||||||
| 128 | end-to-end ID | |||||||||||||||||||||||||||||||
| 160 ... |
AVPs ... | |||||||||||||||||||||||||||||||
Version
[edit]This field indicates the version of the Diameter Base Protocol. As of 2014, the only value supported is 1.[3]
Message length
[edit]The Message Length field indicates the length of the Diameter message in bytes, including the header fields and the padded AVPs.
Command flags
[edit]The "R" (Request) bit – If set, the message is a request. If cleared, the message is an answer.
The "P" (Proxiable) bit – If set, the message MAY be proxied, relayed or redirected. If cleared, the message MUST be locally processed.
The "E" (Error) bit – If set, the message contains a protocol error, and the message will not conform to the CCF described for this command. Messages with the "E" bit set are commonly referred to as error messages. This bit MUST NOT be set in request messages.
The "T" (Potentially re-transmitted message) bit – This flag is set after a link failover procedure, to aid the removal of duplicate requests. It is set when resending requests not yet acknowledged as an indication of a possible duplicate due to a link failure.
Commands
[edit]Each command Request/Answer pair is assigned a command code. Whether it is the request or answer is identified via the 'R' bit in the Command Flags field of the header.
The values 0-255 are reserved for RADIUS backward compatibility. The values 256-16777213 are for permanent, standard commands allocated by IANA. The values 16777214 and 16777215 (hex 0xFFFFFE and 0xFFFFFF) are reserved for experimental and testing purposes.
A Command Code is used to determine the action that is to be taken for a particular message. Some common Diameter commands defined in the protocol (base and applications) are:
| Command-Name | Abbr. | Code | Application |
|---|---|---|---|
| AA-Request | AAR | 265 | Diameter NAS Application - RFC 7155 |
| AA-Answer | AAA | 265 | Diameter NAS Application - RFC 7155 |
| Diameter-EAP-Request | DER | 268 | Diameter EAP Application - RFC 4072 |
| Diameter-EAP-Answer | DEA | 268 | Diameter EAP Application - RFC 4072 |
| Abort-Session-Request | ASR | 274 | Diameter base |
| Abort-Session-Answer | ASA | 274 | Diameter base |
| Accounting-Request | ACR | 271 | Diameter base |
| Accounting-Answer | ACA | 271 | Diameter base |
| Credit-Control-Request | CCR | 272 | Diameter Credit-Control Application - RFC 8506 (Obsoletes RFC 4006) |
| Credit-Control-Answer | CCA | 272 | Diameter Credit-Control Application - RFC 8506 (Obsoletes RFC 4006) |
| Capabilities-Exchange-Request | CER | 257 | Diameter base |
| Capabilities-Exchange-Answer | CEA | 257 | Diameter base |
| Device-Watchdog-Request | DWR | 280 | Diameter base |
| Device-Watchdog-Answer | DWA | 280 | Diameter base |
| Disconnect-Peer-Request | DPR | 282 | Diameter base |
| Disconnect-Peer-Answer | DPA | 282 | Diameter base |
| Re-Auth-Request | RAR | 258 | Diameter base |
| Re-Auth-Answer | RAA | 258 | Diameter base |
| Session-Termination-Request | STR | 275 | Diameter base |
| Session-Termination-Answer | STA | 275 | Diameter base |
| User-Authorization-Request | UAR | 283 | Diameter SIP Application - RFC 4740 |
| User-Authorization-Answer | UAA | 283 | Diameter SIP Application - RFC 4740 |
| Server-Assignment-Request | SAR | 284 | Diameter SIP Application - RFC 4740 |
| Server-Assignment-Answer | SAA | 284 | Diameter SIP Application - RFC 4740 |
| Location-Info-Request | LIR | 285 | Diameter SIP Application - RFC 4740 |
| Location-Info-Answer | LIA | 285 | Diameter SIP Application - RFC 4740 |
| Multimedia-Auth-Request | MAR | 286 | Diameter SIP Application - RFC 4740 |
| Multimedia-Auth-Answer | MAA | 286 | Diameter SIP Application - RFC 4740 |
| Registration-Termination-Request | RTR | 287 | Diameter SIP Application - RFC 4740 |
| Registration-Termination-Answer | RTA | 287 | Diameter SIP Application - RFC 4740 |
| Push-Profile-Request | PPR | 288 | Diameter SIP Application - RFC 4740 |
| Push-Profile-Answer | PPA | 288 | Diameter SIP Application - RFC 4740 |
| User-Authorization-Request | UAR | 300 | Diameter base (3GPP) RFC 3589 |
| User-Authorization-Answer | UAA | 300 | Diameter base (3GPP) RFC 3589 |
| Server-Assignment-Request | SAR | 301 | Diameter base (3GPP) RFC 3589 |
| Server-Assignment-Answer | SAA | 301 | Diameter base (3GPP) RFC 3589 |
| Location-Info-Request | LIR | 302 | Diameter base (3GPP) RFC 3589 |
| Location-Info-Answer | LIA | 302 | Diameter base (3GPP) RFC 3589 |
| Multimedia-Auth-Request | MAR | 303 | Diameter base (3GPP) RFC 3589 |
| Multimedia-Auth-Answer | MAA | 303 | Diameter base (3GPP) RFC 3589 |
| Registration-Termination-Request | RTR | 304 | Diameter base (3GPP) RFC 3589 |
| Registration-Termination-Answer | RTA | 304 | Diameter base (3GPP) RFC 3589 |
| Push-Profile-Request | PPR | 305 | Diameter base (3GPP) RFC 3589 |
| Push-Profile-Answer | PPA | 305 | Diameter base (3GPP) RFC 3589 |
| User-Data-Request | UDR | 306 | Diameter base (3GPP) RFC 3589 |
| User-Data-Answer | UDA | 306 | Diameter base (3GPP) RFC 3589 |
| Profile-Update-Request | PUR | 307 | Diameter base (3GPP) RFC 3589 |
| Profile-Update-Answer | PUA | 307 | Diameter base (3GPP) RFC 3589 |
| Subscribe-Notifications-Request | SNR | 308 | Diameter base (3GPP) RFC 3589 |
| Subscribe-Notifications-Answer | SNA | 308 | Diameter base (3GPP) RFC 3589 |
| Push-Notification-Request | PNR | 309 | Diameter base (3GPP) RFC 3589 |
| Push-Notification-Answer | PNA | 309 | Diameter base (3GPP) RFC 3589 |
| Bootstrapping-Info-Request | BIR | 310 | Diameter base (3GPP) RFC 3589 |
| Bootstrapping-Info-Answer | BIA | 310 | Diameter base (3GPP) RFC 3589 |
| Message-Process-Request | MPR | 311 | Diameter base (3GPP) RFC 3589 |
| Message-Process-Answer | MPA | 311 | Diameter base (3GPP) RFC 3589 |
| Update-Location-Request | ULR | 316 | 3GPP TS 29.272 [RFC 5516] |
| Update-Location-Answer | ULA | 316 | 3GPP TS 29.272 [RFC 5516] |
| Cancel-Location-Request | CLR | 317 | 3GPP TS 29.272 [RFC 5516] |
| Cancel-Location-Answer | CLA | 317 | 3GPP TS 29.272 [RFC 5516] |
| Authentication-Information-Request | AIR | 318 | 3GPP TS 29.272 [RFC 5516] |
| Authentication-Information-Answer | AIA | 318 | 3GPP TS 29.272 [RFC 5516] |
| Insert-Subscriber-Data-Request | IDR | 319 | 3GPP TS 29.272 [RFC 5516] |
| Insert-Subscriber-Data-Answer | IDA | 319 | 3GPP TS 29.272 [RFC 5516] |
| Delete-Subscriber-Data-Request | DSR | 320 | 3GPP TS 29.272 [RFC 5516] |
| Delete-Subscriber-Data-Answer | DSA | 320 | 3GPP TS 29.272 [RFC 5516] |
| Purge-UE-Request | PER | 321 | 3GPP TS 29.272 [RFC 5516] |
| Purge-UE-Answer | PEA | 321 | 3GPP TS 29.272 [RFC 5516] |
| Notify-Request | NR | 323 | 3GPP TS 29.272 [RFC 5516] |
| Notify-Answer | NA | 323 | 3GPP TS 29.272 [RFC 5516] |
| Provide-Location-Request | PLR | 8388620 | 3GPP-LCS-SLg (Application-ID 16777255) |
| Provide-Location-Answer | PLA | 8388620 | 3GPP-LCS-SLg (Application-ID 16777255) |
| Routing-Info-Request | RIR | 8388622 | 3GPP-LCS-SLh (Application-ID 16777291) |
| Routing-Info-Answer | RIA | 8388622 | 3GPP-LCS-SLh (Application-ID 16777291) |
| AA-Mobile-Node-Request | AMR | 260 | Diameter Mobile IPv4 - RFC 4004 |
| AA-Mobile-Node-Answer | AMA | 260 | Diameter Mobile IPv4 - RFC 4004 |
| Home-Agent-MIP-Request | HAR | 262 | Diameter Mobile IPv4 - RFC 4004 |
| Home-Agent-MIP-Answer | HAA | 262 | Diameter Mobile IPv4 - RFC 4004 |
| Configuration-Information-Request | CIR | 8388718 | S6t per 3GPP TS 29.336 |
| Configuration-Information-Answer | CIA | 8388718 | S6t per 3GPP TS 29.336 |
| Reporting-Information-Request | RIR | 8388719 | S6t per 3GPP TS 29.336 |
| Reporting-Information-Answer | RIA | 8388719 | S6t per 3GPP TS 29.336 |
| NIDD-Information-Request | NIR | 8388726 | S6t per 3GPP TS 29.336 |
| NIDD-Information-Answer | NIA | 8388726 | S6t per 3GPP TS 29.336 |
Application-ID
[edit]Application-ID is used to identify for which Diameter application the message is applicable. The application can be an authentication application, an accounting application, or a vendor-specific application.
Diameter agents conforming to a certain Diameter extension publicize its support by including a specific value of in the Auth-Application-ID Attribute of the Capabilities-Exchange-Request (CER) and Capabilities-Exchange-Answer (CEA) command.
The value of the Application-ID field in the header is the same as any relevant Application-ID AVPs contained in the message. For instance, the value of the Application-ID and of the Auth-Application-ID Attribute in the Credit-Control-Request (CCR) and Credit-Control-Answer (CCA) Command for the Diameter Credit-Control Application is 4.[4]
| Application-ID | Abbr. | Full name | Usage |
|---|---|---|---|
| 0 | Base | Diameter Common Messages | Diameter protocol association establishment/teardown/maintenance |
| 16777216 | Cx/Dx | 3GPP Cx/Dx | IMS I/S-CSCF to HSS interface |
| 16777217 | Sh | 3GPP Sh | VoIP/IMS SIP Application Server to HSS interface |
| 16777236 | Rx | 3GPP Rx | Policy and charging control |
| 16777238 | Gx | 3GPP Gx | Policy and charging control |
| 16777251 | S6a/S6d | 3GPP S6a/S6d | LTE Roaming signaling |
| 16777252 | S13 | 3GPP 13 | Interface between EIR and MME |
| 16777255 | SLg | 3GPP LCS SLg | Location services |
| 16777345 | S6t | 3GPP S6t | Interface between SCEF and HSS |
Hop-by-Hop Identifier
[edit]The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in network byte order) that is used to match the requests with their answers as the same value in the request is used in the response.
The Diameter protocol requires that relaying and proxying agents maintain transaction state, which is used for failover purposes. Transaction state implies that upon forwarding a request, its Hop-by-Hop Identifier is saved; the field is replaced with a locally unique identifier, which is restored to its original value when the corresponding answer is received. The request's state is released upon receipt of the answer. Received answers that do not match a known Hop-by-Hop Identifier are ignored by the Diameter agent.
In case of redirecting agents, the Hop-by-Hop Identifier is maintained in the header as the Diameter agent responds with an answer message.
End-to-End Identifier
[edit]The End-to-End Identifier is an unsigned 32-bit integer field (in network byte order) that is used to detect duplicate messages along with the combination of the Origin-Host AVP.
When creating a request, the End-to-End Identifier is set to a locally unique value. The End-to-End Identifier is not modified by Diameter agents of any kind, and the same value in the corresponding request is used in the answer.
This section needs expansion. You can help by adding to it. (December 2009) |
Attribute–Value Pairs (AVP)
[edit]| Bit offset | 0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | AVP code | |||||||||||||||||||||||||||||||
| 32 | V |
M |
P |
AVP length | ||||||||||||||||||||||||||||
| 64 | vendor ID (optional) | |||||||||||||||||||||||||||||||
| 96 ... |
data ... | |||||||||||||||||||||||||||||||
For simplicity, AVP Flag "V" bit Means Vendor Specific; "M" bit means Mandatory; "P" bit means Protected.
The "V" bit, known as the Vendor-Specific bit, indicates whether the optional Vendor-ID field is present in the AVP header. When set the AVP Code belongs to the specific vendor code address space.
The "M" bit, known as the Mandatory bit, indicates whether support of the AVP is required. If an AVP with the "M" bit set is received by a Diameter client, server, proxy, or translation agent and either the AVP or its value is unrecognized, the message must be rejected. Diameter Relay and redirect agents must not reject messages with unrecognized AVPs.
The "P" bit indicates the need for encryption for end-to-end security.
| Attribute-Name | Code | Data Type |
|---|---|---|
| Acct-Interim-Interval | 85 | Unsigned32 |
| Accounting-Realtime-Required | 483 | Enumerated |
| Acct-Multi-Session-Id | 50 | UTF8String |
| Accounting-Record-Number | 485 | Unsigned32 |
| Accounting-Record-Type | 480 | Enumerated |
| Accounting-Session-Id | 44 | OctetString |
| Accounting-Sub-Session-Id | 287 | Unsigned64 |
| Acct-Application-Id | 259 | Unsigned32 |
| Auth-Application-Id | 258 | Unsigned32 |
| Auth-Request-Type | 274 | Enumerated |
| Authorization-Lifetime | 291 | Unsigned32 |
| Auth-Grace-Period | 276 | Unsigned32 |
| Auth-Session-State | 277 | Enumerated |
| Re-Auth-Request-Type | 285 | Enumerated |
| Class | 25 | OctetString |
| Destination-Host | 293 | DiamIdent |
| Destination-Realm | 283 | DiamIdent |
| Disconnect-Cause | 273 | Enumerated |
| E2E-Sequence | 300 | Grouped |
| Error-Message | 281 | UTF8String |
| Error-Reporting-Host | 294 | DiamIdent |
| Event-Timestamp | 55 | Time |
| Experimental-Result | 297 | Grouped |
| Experimental-Result-Code | 298 | Unsigned32 |
| Failed-AVP | 279 | Grouped |
| Firmware-Revision | 267 | Unsigned32 |
| Host-IP-Address | 257 | Address |
| Inband-Security-Id | 299 | Unsigned32 |
| Multi-Round-Time-Out | 272 | Unsigned32 |
| Origin-Host | 264 | DiamIdent |
| Origin-Realm | 296 | DiamIdent |
| Origin-State-Id | 278 | Unsigned32 |
| Product-Name | 269 | UTF8String |
| Proxy-Host | 280 | DiamIdent |
| Proxy-Info | 284 | Grouped |
| Proxy-State | 33 | OctetString |
| Redirect-Host | 292 | DiamURI |
| Redirect-Host-Usage | 261 | Enumerated |
| Redirect-Max-Cache-Time | 262 | Unsigned32 |
| Result-Code | 268 | Unsigned32 |
| Route-Record | 282 | DiamIdent |
| Session-Id | 263 | UTF8String |
| Session-Timeout | 27 | Unsigned32 |
| Session-Binding | 270 | Unsigned32 |
| Session-Server-Failover | 271 | Enumerated |
| Supported-Vendor-Id | 265 | Unsigned32 |
| Termination-Cause | 295 | Enumerated |
| User-Name | 1 | UTF8String |
| Vendor-Id | 266 | Unsigned32 |
| Vendor-Specific-Application-Id | 260 | Grouped |
State machines
[edit]This section needs expansion. You can help by adding to it. (December 2009) |
The RFC 3588 defines a core state machine for maintaining connections between peers and processing messages. This is part of the basic protocol functionality and all stacks should support it and as such abstract from the connectivity related operations.
-
Peer State Machine Part 1
-
Peer State Machine Part 2
Additionally, application specific state machines can be introduced either later or at a higher abstraction layer. The RFC 3588 defines an authorization and an accounting state machine.
-
Diameter Authorization State Machines (Client)
-
Diameter Authorization State Machines (Server)
-
Diameter Accounting State Machines (Client)
-
Diameter Accounting State Machines (Server)
Message flows
[edit]
The communication between two diameter peers starts with the establishment of a transport connection (TCP or SCTP). The initiator then sends a Capabilities-Exchange-Request (CER) to the other peer, which responds with a Capabilities-Exchange-Answer (CEA). For RFC3588 compliant peers TLS (Transport Layer Security) may optionally be negotiated. For RFC6733 compliant peers TLS negotiation may optionally happen before the CER/CEA.
The connection is then ready for exchanging application messages.
If no messages have been exchanged for some time either side may send a Device-Watchdog-Request (DWR) and the other peer must respond with Device-Watchdog-Answer.
Either side may terminate the communication by sending a Disconnect-Peer-Request (DPR) which the other peer must respond to with Disconnect-Peer-Answer. After that the transport connection can be disconnected.
RFCs
[edit]The Diameter protocol is currently defined in the following IETF RFCs: Obsolete RFCs are indicated with strikethrough text.
| # | Title | Date published | Obsoleted by |
|---|---|---|---|
| RFC 6733 | |||
| RFC 3589 | Diameter Command Codes for Third Generation Partnership Project (3GPP) Release 5. | September 2003 | |
| RFC 4004 | Diameter Mobile IPv4 Application. | August 2005 | |
| RFC 7155 | |||
| RFC 8506 | |||
| RFC 4072 | Diameter Extensible Authentication Protocol (EAP) Application. | August 2005 | |
| RFC 4740 | Diameter Session Initiation Protocol (SIP) Application. M. | November 2006 | |
| RFC 5224 | Diameter Policy Processing Application. | March 2008 | |
| RFC 5431 | Diameter ITU-T Rw Policy Enforcement Interface Application. | March 2009 | |
| RFC 5447 | Diameter Mobile IPv6: Support for Network Access Server to Diameter Server Interaction. | February 2009 | |
| RFC 5516 | Diameter Command Code Registration for the Third Generation Partnership Project (3GPP) Evolved Packet System (EPS). | April 2009 | |
| RFC 5624 | Quality of Service Parameters for Usage with Diameter. | August 2009 | |
| RFC 6733 | |||
| RFC 6733 | Diameter Base Protocol. | October 2012 | |
| RFC 6737 | The Diameter Capabilities Update Application. | October 2012 | |
| RFC 7155 | Diameter Network Access Server Application. | April 2014 | |
| RFC 8506 | Diameter Credit-Control Application | March 2019 |
See also
[edit]References
[edit]- ^ Pat R. Calhoun, Glen Zorn, and Ping Pan (February 2001). "DIAMETER Framework Document". Ietf Datatracker. IETF. Retrieved 30 April 2009.
{{cite news}}: CS1 maint: multiple names: authors list (link) - ^ Naman Mehta (20 March 2009). "Introduction to Diameter Protocol - What is Diameter Protocol?". Sun Microsystems. Archived from the original on 4 July 2011. Retrieved 30 April 2009.
- ^ Arkko, J.; Loughney, J. (2012). Fajardo, V; Zorn, G (eds.). "RFC 6733 - Diameter Base Protocol". Proposed Standard. Standards Track. doi:10.17487/RFC6733. ISSN 2070-1721. Retrieved 12 October 2014.
- ^ Hakala, H.; Mattila, L.; Stura, M.; Loughney, J. (2005). "RFC 4006 - Diameter Credit-Control Application". Proposed Standard. Standards Track. doi:10.17487/RFC4006.
External links
[edit]- Introduction to Diameter - Get the next generation AAA protocol
- Cisco page outlining differences between RADIUS and DIAMETER
- Diameter: next generation's AAA protocol Paper about Diameter by Håkan Ventura
- Reference page listing vendors of Diameter Gateways, Diameter Signaling Controllers and Diameter Stacks
Diameter (protocol)
View on GrokipediaBackground
Definition and Purpose
The Diameter protocol is an Authentication, Authorization, and Accounting (AAA) framework designed for computer networks, providing extensible messaging to support applications such as network access or IP mobility in both local and roaming situations.[3] It serves as a base protocol that enables reliable and scalable AAA services, particularly in distributed environments like IP-based telecommunications networks.[3] At its core, Diameter aims to facilitate secure and efficient exchange of AAA data, incorporating mechanisms for reliable transport, failover, and scalability to handle high-volume, distributed operations.[3] It operates over TCP or SCTP to ensure ordered delivery of messages, enhancing dependability in peer-to-peer communications.[4] These features make it suitable for environments requiring robust handling of authentication requests, authorization decisions, and accounting records across network elements. Diameter offers high-level benefits including improved reliability over its predecessor RADIUS, support for proxy and relay agents to enable flexible routing of AAA requests, and extensibility through the definition of new applications and commands.[3] This design allows it to adapt to evolving access technologies while maintaining a peer-to-peer model for direct interactions between nodes.[3]Evolution from RADIUS
The Remote Authentication Dial-In User Service (RADIUS) protocol, defined in RFC 2865, served as the foundational AAA framework for network access but exhibited several limitations that hindered its scalability and reliability in modern environments. Primarily, RADIUS operates over UDP, which lacks inherent retransmission mechanisms, leading to potential packet loss and inconsistent reliability across implementations.[5] Additionally, it provides no standardized failover procedures, resulting in behavior that varies by vendor, and offers limited transmission security confined to response packet authentication without per-packet confidentiality or integrity protections.[5] RADIUS also lacks explicit support for agent roles such as proxies or relays, making proxying in large networks challenging, and its server-initiated messages are optional, impeding features like session termination.[5] Furthermore, extensibility is constrained by its fixed attribute format without mandatory/non-mandatory flags or robust error reporting, and peer discovery requires manual configuration, increasing administrative overhead.[5] Diameter was developed as a successor to RADIUS to overcome these shortcomings, introducing a more robust and extensible design while maintaining conceptual alignment with AAA functions. A key advancement is the shift to reliable transport protocols like TCP or SCTP, which provide built-in retransmission and ordered delivery to mitigate UDP's unreliability.[6] Diameter incorporates universal transmission security through TLS over TCP or DTLS over SCTP, ensuring both confidentiality and integrity for all packets, far surpassing RADIUS's limited protections.[5] It defines explicit roles for agents—including relays, proxies, redirects, and translation agents—with standardized behaviors to facilitate proxying and routing in large-scale networks.[7] Server-initiated messages are mandatory, enabling proactive features such as disconnects, and capabilities exchange during peer association allows negotiation of supported features, addressing RADIUS's absence of such mechanisms.[5] Failover is supported through defined algorithms, state machines, and the T flag for duplicate detection, ensuring consistent recovery from failures.[8] In terms of protocol structure, Diameter employs Attribute-Value Pairs (AVPs) for data encoding, offering greater flexibility than RADIUS's rigid attribute format; AVPs support diverse data types (e.g., OctetString, Integer32), grouped constructs, and flags to indicate mandatory or optional status, enhancing extensibility.[9] Routing in Diameter relies on command codes within messages, combined with application IDs and peer routing tables, providing more precise and scalable directionality compared to RADIUS's simpler code-based approach.[10] Vendor-specific extensions are enabled through dedicated namespaces for AVPs and codes, allowing customization without protocol conflicts, and dynamic peer discovery via DNS SRV and NAPTR records reduces configuration burdens.[11] Error reporting is improved with dedicated result codes and informative messages, supporting better diagnostics than RADIUS's limited options.[5] While Diameter represents a significant evolution, it includes provisions for backward compatibility with RADIUS through translation gateways that map attributes to AVPs—reusing codes 1 through 255 for legacy RADIUS attributes without a Vendor-Id—and supports hybrid environments where Diameter proxies interface with RADIUS servers.[9] However, Diameter is not intended as a direct drop-in replacement, as its peer-to-peer architecture and enhanced features necessitate targeted migrations in AAA infrastructures.[5]Historical Development
The Diameter protocol originated in the late 1990s as part of the Internet Engineering Task Force (IETF) efforts to develop a more robust Authentication, Authorization, and Accounting (AAA) framework capable of supporting emerging mobile and IP-based networks, addressing limitations in the existing RADIUS protocol such as scalability and security for next-generation services. Initial development began with early Internet-Drafts authored by Pat R. Calhoun and collaborators, including drafts on Diameter's proxy architecture in August 1998 and integration with Session Initiation Protocol (SIP) in November 1998, marking the protocol's foundational work within the IETF AAA Working Group (AAATWG).[12] Key milestones in standardization followed rapidly in the early 2000s. The first comprehensive drafts for the base protocol emerged between 1998 and 2000 under the IETF's AAATWG, culminating in the publication of RFC 3588 in September 2003, which defined the core Diameter base protocol for AAA applications in network access and IP mobility.[13] This specification was later obsoleted by RFC 6733 in October 2012, which provided clarifications on security mechanisms, transport protocols like SCTP, and other refinements without altering the fundamental architecture.[14] The development was significantly influenced by the 3rd Generation Partnership Project (3GPP), particularly for the IP Multimedia Subsystem (IMS) in mobile networks, where joint IETF-3GPP design teams addressed AAA requirements for PDP context support and SIP integration starting around 2001.[15] Adoption of Diameter accelerated in the 2010s with the rollout of 4G/LTE networks, where it became the standard for AAA signaling in evolved packet cores, enabling efficient subscriber management and policy control at scale.[16] By the mid-2010s, widespread deployment in LTE infrastructures solidified its role, transitioning from RADIUS in many telecom environments. As of 2025, Diameter maintains ongoing relevance in 5G signaling for core network functions like authentication and session management, supporting the coexistence of 4G and 5G ecosystems.[17] No major revisions to the base protocol have occurred since RFC 6733, but the ecosystem has expanded through new RFCs defining extensions for applications such as credit-control (RFC 8506, 2018) and overload rate control (RFC 8582, 2019), adapting to emerging telecom demands.[18]Applications
Core Functions in AAA
The Diameter protocol provides a robust framework for Authentication, Authorization, and Accounting (AAA) operations, enabling secure and scalable management of network access and resource usage.[3] As an evolution from the RADIUS protocol, Diameter addresses limitations in handling complex, high-volume AAA scenarios by introducing enhanced reliability, security, and extensibility features.[3] These core functions operate conceptually through peer-to-peer exchanges, where clients and servers collaborate to verify identities, allocate permissions, and track consumption without relying on centralized hierarchies.[3] Authentication in Diameter verifies the identity of users or devices by facilitating the exchange of credentials and challenges between clients and servers.[19] This process often involves multi-round interactions, where an initial request prompts the server to issue a challenge, and subsequent responses confirm the provided credentials against stored profiles.[20] Such mechanisms ensure that only legitimate entities gain entry, supporting diverse authentication methods like passwords, tokens, or certificates in a unified protocol structure.[21] Following successful authentication, authorization determines and grants specific access rights and session parameters to the user.[22] The server evaluates policies to assign resources, such as bandwidth limits or service levels, and communicates these in response messages, often including details on session duration and state management.[23] This step ensures that authenticated users receive tailored permissions aligned with administrative rules, preventing unauthorized overreach.[21] Accounting captures and records usage data for billing, auditing, or analytics purposes, typically through sequenced records of session activity.[21] It employs start records to initiate tracking, stop records to conclude sessions, and interim updates to report ongoing consumption at defined intervals, allowing for accurate aggregation of metrics like data volume or connection time.[24] Diameter's design supports real-time accounting in high-volume environments, such as mobile networks, by mandating timely delivery of records within policy-defined windows to enable immediate processing and decision-making.[25] These AAA functions integrate seamlessly via request-answer message pairs that maintain session continuity throughout the lifecycle.[26] A client initiates a request encapsulating authentication or authorization details, receives an answer with outcomes and parameters, and follows with accounting updates, all correlated through unique session identifiers for end-to-end traceability.[27] This paired exchange model ensures atomicity and reliability, combining authentication, authorization, and accounting into cohesive sessions that adapt to dynamic network demands.[21]Deployments in Networks
Diameter is deployed in network access servers (NAS) to provide authentication, authorization, and accounting (AAA) services for various access technologies, including Wi-Fi, DSL, and VPN connections. In DSL environments, it supports framed access protocols like PPP over ADSL, using AVPs such as Framed-IP-Address to assign subscriber resources during authentication. For VPNs, Diameter facilitates compulsory tunneling via dedicated AVPs like Tunnel-Type and Tunnel-Client-Endpoint, enabling secure remote access integration with AAA servers. Wi-Fi authentication leverages NAS-Port-Type specifications for IEEE 802.11, allowing seamless user verification in wireless hotspots.[28] In mobile and IP networks, Diameter plays a central role in policy control and charging, particularly in 4G LTE architectures through interactions with the Policy and Charging Rules Function (PCRF), and in 5G through the Policy Control Function (PCF). It enables real-time policy decisions for data sessions, such as bandwidth allocation and QoS enforcement, via interfaces like Gx between the Packet Data Network Gateway (P-GW) and PCRF in LTE. In IP-based core networks, Diameter handles subscriber authentication and roaming, supporting the Evolved Packet System (EPS) for seamless mobility. As of 2025, Diameter remains a key AAA protocol in mobile networks, underpinning the majority of global traffic for authentication and billing in LTE deployments and for legacy interworking and roaming in 5G, where HTTP/2-based Service-Based Interfaces (SBIs) are adopted for many new core functions.[29][30][31][32] For VoIP and IP Multimedia Subsystem (IMS) deployments, Diameter supports session initiation and border control by integrating AAA with Session Initiation Protocol (SIP) signaling. It authorizes multimedia sessions through interfaces like Cx to the Home Subscriber Server (HSS) for user profile retrieval and Gq to PCRF for policy enforcement at the Proxy-Call Session Control Function (P-CSCF). Session Border Controllers (SBCs) use Diameter for accounting and border security, ensuring compliant media flows across IMS domains while preventing unauthorized access.[29] The signaling market is projected to exceed USD 1.2 billion as of 2025, driven by 5G adoption. In 5G specifically, while SBIs handle many policy tasks, Diameter authorizes network slicing in interworking scenarios by enforcing slice-specific policies through PCF functions, enabling differentiated services like low-latency slices for IoT or enhanced mobile broadband. Diameter is used in 5G interfaces such as N27 (equivalent to S6a) for authentication and roaming interworking.[33][34][35][36] Large-scale Diameter deployments face scalability challenges, including signaling congestion from high message volumes in 5G networks, which can degrade performance during peak loads. These are addressed through load balancing mechanisms in Diameter Routing Agents (DRAs) and Signaling Controllers (DSCs), which distribute traffic across server pools using Layer 7 message inspection for efficient resource utilization and failover.[31][35][17]Extensions for Specific Domains
The Diameter protocol's extensibility is achieved through the definition of new applications that reuse the base protocol's core mechanisms while introducing unique Application Identifiers (AppIDs) assigned by the Internet Assigned Numbers Authority (IANA), along with domain-specific command codes and Attribute-Value Pairs (AVPs). This allows vendors and standards bodies to tailor the protocol for specialized use cases without altering its foundational peer-to-peer architecture or transport reliability features. As of 2025, 141 such AppIDs have been assigned, enabling more than 20 distinct applications across various domains, with many allocated to 3GPP for telecommunications-specific adaptations.[37] In mobile networks, 3GPP has developed key extensions for the IP Multimedia Subsystem (IMS), particularly through the Cx and Dx interfaces, which facilitate authentication, authorization, and user profile management between the Serving-CSCF (S-CSCF) and the Home Subscriber Server (HSS).[38] The Cx interface supports procedures like user registration and location updates using Diameter commands such as User-Authorization-Request (UAR), while Dx extends this for roaming scenarios by relaying queries across visited networks. For policy and charging control, the Gx interface between the Policy and Charging Enforcement Function (PCEF) and Policy and Charging Rules Function (PCRF) enables dynamic provisioning of charging rules and quality-of-service (QoS) policies, using commands like Credit-Control-Request (CCR) and Credit-Control-Answer (CCA).[39] Similarly, the Rx interface connects the Application Function (AF) to the PCRF, allowing applications to request policy decisions for media flows, such as bandwidth allocation for VoLTE sessions, through AVPs like Media-Component-Description.[40] These extensions are integral to deployments in 4G LTE and IMS environments, where they handle session setup and resource allocation in real-time, and continue in 5G for IMS and interworking. The Diameter Credit-Control Application, specified in RFC 4006, provides a framework for real-time prepaid charging across diverse services like network access and IP mobility, using event- and session-based charging models with granular credit unit management.[41] It introduces specific AVPs such as Granted-Service-Unit and Used-Service-Unit to track consumption, enabling operators to authorize and deduct credits dynamically during service delivery.[41] For network access servers (NAS), the NASREQ application defined in RFC 4005 supports authentication, authorization, and accounting (AAA) functions, including service-specific authorizations via commands like Service-Specific-Authorization-Request. Complementing this, the Extensible Authentication Protocol (EAP) application in RFC 4072 transports EAP payloads between NAS and backend authentication servers, allowing flexible support for methods like EAP-TLS or EAP-SIM without protocol modifications.[32]Protocol Architecture
Overall Design Principles
The Diameter protocol is designed as a robust successor to RADIUS, addressing limitations in scalability, security, and extensibility for modern authentication, authorization, and accounting (AAA) applications such as network access and IP mobility.[3] Its architecture emphasizes a modular base protocol that supports pluggable applications through mechanisms like Application IDs, allowing new commands, Attribute-Value Pairs (AVPs), and values to be defined without altering the core framework.[10] This extensibility is further enhanced by vendor-specific AVPs identified via the Vendor-ID, enabling proprietary extensions while maintaining interoperability.[42] Reliability is a cornerstone of Diameter's design, achieved through mandatory failover support, where messages can be forwarded to alternate peers upon failure, and session recovery using unique identifiers like the Session-Id AVP, Hop-by-Hop Sequence Numbers, and End-to-End Identifiers.[22] The protocol mandates operation over reliable transports such as TCP or SCTP, complemented by application-layer acknowledgments, Device-Watchdog messages for peer monitoring, and congestion control via the Tc timer (set to 30 seconds) and Result-Code AVPs like DIAMETER_TOO_BUSY to handle overload.[6] Accounting records are retransmitted as needed to ensure completeness during disruptions.[8] Security is integrated at the transport level, requiring connections between peers to use TLS over TCP or DTLS over SCTP, with IPsec as an optional alternative for protection against eavesdropping and tampering.[43] Mutual authentication is enforced during peer establishment, either through TLS/DTLS certificates or Capabilities-Exchange-Request/Answer (CER/CEA) messages, ensuring only authorized nodes participate in Diameter exchanges.[44] Scalability is facilitated by dynamic peer discovery using DNS NAPTR and SRV records, eliminating the need for static configurations in large deployments.[45] Diameter employs a realm-based routing model to manage administrative domains globally, where messages are routed via the Destination-Realm AVP against a routing table of realm names, supporting efficient forwarding based on the realm portion of Network Access Identifiers (NAIs) and Application IDs while preventing loops with the Route-Record AVP.[46] This model, along with redirection via the Redirect-Host AVP, enables seamless operation across dynamic realms without centralized coordination.[47]Peer-to-Peer Model
The Diameter protocol employs a peer-to-peer model, enabling flexible interactions among nodes where any participant can initiate requests or provide responses, in contrast to the strict client-server architecture of its predecessor, RADIUS.[3] This design supports diverse network topologies and allows nodes to dynamically assume different roles based on context, facilitating scalable and decentralized AAA (Authentication, Authorization, and Accounting) operations.[6] Diameter defines several distinct node roles to manage message origination, processing, and routing within this peer-to-peer framework:- Clients act as initiators, typically edge devices such as Network Access Servers (NAS) or Mobile IP Foreign Agents, that generate AAA requests on behalf of users or services.[10]
- Servers process these requests, performing user authentication, authorization, and accounting functions for a specific realm.[10]
- Relays forward messages between peers without modifying content or maintaining session state, relying solely on routing-related Attribute-Value Pairs (AVPs) to determine paths.[48]
- Proxies route messages while potentially modifying them, enforcing policies, and preserving session state to support advanced mediation.[49]
- Redirects respond to requests by providing alternative peer identities or host details, such as through the Redirect-Host-Usage AVP, without relaying the messages themselves.[50]
Transport and Routing
The Diameter protocol employs reliable transport protocols to ensure message delivery across networks, primarily using Transmission Control Protocol (TCP) as the default option or Stream Control Transmission Protocol (SCTP) for enhanced reliability. TCP provides connection-oriented, reliable delivery suitable for most deployments, while SCTP offers advantages such as multi-homing, which allows a single endpoint to use multiple IP addresses for redundancy and failover, and ordered delivery to maintain message sequence without head-of-line blocking on multiple streams. Both protocols operate on the standard port 3868 for non-secure connections, as specified in the base protocol.[6][54][55] Routing in Diameter is facilitated through a combination of Attribute-Value Pairs (AVPs) that identify origins and destinations, enabling efficient message forwarding in peer-to-peer architectures. The Origin-Host and Origin-Realm AVPs specify the sending node's identity and administrative domain, respectively, while Destination-Host and Destination-Realm AVPs direct messages to the intended recipient or realm. For cross-realm scenarios, proxy chains are employed, where intermediate proxy agents relay messages, recording the path via Route-Record AVPs and maintaining state with Proxy-Info AVPs to support routing decisions and potential retransmissions. This mechanism allows Diameter to scale across interconnected realms without requiring direct peer connections everywhere.[56][57][58][59][60] To manage congestion and connection health, Diameter incorporates watchdog mechanisms using Device-Watchdog-Request (DWR) and Device-Watchdog-Answer (DWA) messages, which peers exchange periodically to verify liveness and detect failures proactively. Elective termination is handled through Disconnect-Peer-Request (DPR) and Disconnect-Peer-Answer (DPA) messages, enabling graceful shutdowns in response to overload or administrative needs, thus preventing resource exhaustion. The protocol supports both IPv4 and IPv6 addressing natively over these transports. Routing loops are avoided by checking the Route-Record AVPs; if the Origin-Host of the message is already present in the list, the message is rejected with Result-Code DIAMETER_LOOP_DETECTED (3005).[61][62][63][64][65]Message Structure
Header Composition
The Diameter message header is a fixed-length structure consisting of 20 octets that precedes the variable-length payload in every Diameter message.[64] This header provides essential metadata for message parsing, routing, and processing, ensuring interoperability across Diameter nodes.[64] It is transmitted over reliable transport protocols such as TCP or SCTP, where the header's fixed size facilitates initial message boundary detection.[4] The header comprises seven fields: Version, Message Length, Command Flags, Command-Code, Application-ID, Hop-by-Hop Identifier, and End-to-End Identifier.[52] The Version field occupies the first octet and is always set to 1, indicating compliance with the Diameter base protocol version defined in RFC 6733; this value ensures backward compatibility and allows future versions to be distinguished if needed.[52] Following this, the Message Length field spans three octets and specifies the total length of the Diameter message in bytes, encompassing the 20-octet header and all subsequent Attribute-Value Pairs (AVPs) padded to a 4-octet boundary.[52] This length must be a multiple of 4 and at least 20 bytes; values that are non-zero but invalid (e.g., not a multiple of 4 or exceeding transport limits) trigger protocol errors, such as the DIAMETER_INVALID_MESSAGE_LENGTH result code (5015), potentially leading to message discard or connection closure.[52] All multi-octet fields, including Message Length, use network byte order (big-endian) for consistent interpretation across heterogeneous systems.[64] The Command Flags field, a single octet, contains four defined bit flags that control message semantics and handling, with the remaining four bits reserved and set to zero.[66] Bit 0 (Request, R) is set to 1 for request messages initiating an operation and 0 for answer messages responding to requests; it must not be set in answers.[66] Bit 1 (Proxiable, P) indicates (when 1) that the message may be relayed, proxied, or redirected by intermediate nodes, or (when 0) that it requires local processing only at the destination.[66] Bit 2 (Error, E) is set to 1 to signal a protocol-level error in the message and 0 otherwise; it must not be set in requests.[66] Bit 3 (Potentially retransmitted, T) is set to 1 if the message might be a duplicate due to retransmission and 0 for initial transmissions; it must not be set in answers or error responses.[66] Receivers ignore any non-zero values in the reserved bits, but setting them may result in the DIAMETER_INVALID_HDR_BITS error (3008).[67] The Command-Code field occupies three octets and uniquely identifies the operation or command being invoked, such as capabilities exchange or accounting requests.[52] The Application-ID field is a 32-bit unsigned integer that specifies the Diameter application to which the message applies, with value 0 indicating the base protocol and other values identifying specific applications or vendors.[52] The Hop-by-Hop Identifier and End-to-End Identifier are 32-bit unsigned integers used for correlating requests and answers, as detailed in the Sequence Identifiers subsection.[52]| Field | Octets | Description |
|---|---|---|
| Version | 1 | Protocol version (always 1). |
| Message Length | 3 | Total message length in bytes (header + padded AVPs), multiple of 4. |
| Command Flags | 1 | Bit flags: R (request/answer), P (proxiable), E (error), T (retransmitted). |
| Command-Code | 3 | Unique command identifier. |
| Application-ID | 4 | Identifies the Diameter application (0 for base protocol). |
| Hop-by-Hop Identifier | 4 | Matches requests/answers within a hop. |
| End-to-End Identifier | 4 | Uniquely identifies the entire transaction end-to-end. |
Command Codes and Flags
The Command-Code field in a Diameter message header is a 24-bit unsigned integer that identifies the specific command being invoked, enabling up to 16,777,216 unique commands to support extensibility across base and application-specific uses.[64] This field is positioned immediately after the message length and flags in the header, allowing peers to quickly determine the message type for processing.[64] Command codes are assigned and managed by the Internet Assigned Numbers Authority (IANA) through its Diameter Command Codes registry, with values from 0 to 255 reserved for RADIUS backward compatibility.[68] Values from 256 to 8,388,607 are allocated via IETF Review for the Diameter base protocol, standards-track, and other IETF applications; higher values up to 16,777,215 are for vendor-defined commands via First Come First Served procedures, requiring documentation of the command's purpose and AVP usage.[68] [69] In the base protocol, request and answer messages for a given command share the same code, distinguished instead by the Request bit in the flags field.[52] The following table lists key base protocol command codes, illustrating their use in core Diameter functions:| Command Code | Command Name | Purpose |
|---|---|---|
| 257 | Capabilities-Exchange-Request/Answer (CER/CEA) | Negotiate capabilities and parameters during peer connection establishment.[51] |
| 258 | Re-Auth-Request/Answer (RAR/RAA) | Trigger re-authentication or re-authorization of an existing session.[62] |
| 280 | Device-Watchdog-Request/Answer (DWR/DWA) | Monitor the liveness of a peer connection.[61] |
| 282 | Disconnect-Peer-Request/Answer (DPR/DPA) | Gracefully terminate a peer connection.[70] |
- R (Request) bit: Set to 1 for request messages to indicate initiation of a transaction; cleared to 0 for answer messages, signaling completion or response. This bit is mandatory for all base commands and must align with the command's expected direction.[52]
- P (Proxiable) bit: Set to 1 if the message may be proxied, relayed, or redirected by intermediaries; cleared to 0 for direct peer-to-peer delivery only. This supports Diameter's distributed architecture in multi-hop scenarios.[52][65]
- E (Error) bit: Set to 1 in answer messages reporting protocol-level errors, such as invalid AVPs or routing failures; never set in requests. When set, the message carries a Result-Code AVP detailing the error.[52][73]
- T (Potentially re-transmitted) bit: Set to 1 for messages that may represent retransmissions of unacknowledged requests or duplicates from peer table entries; cleared to 0 otherwise. This aids in duplicate detection and handling during network disruptions.[52][8]
Sequence Identifiers
In the Diameter protocol, sequence identifiers play a crucial role in ensuring reliable message exchange by facilitating the correlation of requests and responses, detecting duplicates, and maintaining transaction integrity across multi-hop paths. The protocol employs two primary 32-bit unsigned integer fields in its message header: the Hop-by-Hop Identifier and the End-to-End Identifier. These fields, positioned immediately after the Command Code and Application-ID in the header, enable nodes to track messages without relying on external state, supporting robust operation in distributed authentication, authorization, and accounting (AAA) environments.[64] The Hop-by-Hop Identifier is generated by each Diameter node to uniquely match a request with its corresponding answer within a single hop, ensuring that responses are properly associated even in the presence of transport failures or retransmissions. It is initialized to a random value at the start of a connection and incremented monotonically for each subsequent message sent over that peer connection, remaining locally unique across reboots where feasible to avoid collisions. This identifier is preserved and restored by relay or proxy agents during message forwarding, allowing them to maintain pending transaction queues and detect unmatched responses. Upon establishing a new connection to the same peer—such as after a failover or reconnection—the Hop-by-Hop Identifier sequence is reset, starting fresh to align with the new transport session.[64][74] Complementing this, the End-to-End Identifier is set by the originating node for each request and remains unchanged throughout the entire transaction path, providing a session-wide unique tag that spans multiple hops. Designed to be locally unique for at least four minutes (even across node reboots), it is typically constructed by combining a timestamp in the high-order bits with a random value in the lower bits, ensuring low probability of duplication within a realm. Receivers use this identifier in conjunction with the Origin-Host AVP to identify and discard duplicate messages, preventing redundant processing that could arise from retransmissions or routing anomalies. Like the Hop-by-Hop Identifier, it is reset upon new peer connections but is primarily managed at the transaction level rather than per hop.[64][65] Together, these identifiers enforce at-most-once delivery semantics, where messages are processed no more than once per transaction, and contribute to loop prevention by enabling nodes to track message provenance alongside the Route-Record AVP—though the identifiers themselves focus on correlation and deduplication rather than explicit routing loops. This design minimizes state overhead while providing essential safeguards for Diameter's peer-to-peer model, particularly in high-availability scenarios involving failover and load balancing.[11][75]Attribute-Value Pairs (AVPs)
Attribute-Value Pairs (AVPs) serve as the primary mechanism for carrying extensible data within Diameter messages, enabling the transport of authentication, authorization, accounting, and other protocol-specific information between peers. Following the fixed Diameter message header, one or more AVPs form the variable-length payload, allowing for flexible encoding of parameters required by the base protocol and its applications. This design supports the protocol's extensibility, where new AVPs can be defined without altering the core message format.[76] The structure of an AVP consists of a header and a data field. The header includes a 32-bit AVP Code, which is assigned by IANA to uniquely identify the attribute; an 8-bit AVP Flags field; and a 24-bit AVP Length field indicating the total length of the AVP in octets, including the header and data. If the Vendor-Specific flag is set, a 32-bit Vendor-ID follows the flags. The data field is variable-length and type-specific, padded with zeros to align on 4-octet boundaries to ensure efficient processing. All multi-octet fields, including the AVP Code, Length, and data (where applicable), are encoded in network byte order. Grouped AVPs, a special type, allow nesting of other AVPs within the data field to represent complex structures logically.[77][78][79] AVP data types are defined to handle diverse information, categorized into basic types such as Integer32 (32-bit signed integer), Unsigned64 (64-bit unsigned integer), UTF8String (UTF-8 encoded string), and OctetString (arbitrary octet sequence), as well as derived types like DiameterIdentity (a realm-qualified hostname) and Enumerated (integer values with defined meanings). These types ensure precise representation of protocol elements, with grouped types facilitating hierarchical data organization.[78] The AVP Flags field uses specific bits to guide receiver behavior: the Mandatory (M) bit (bit 1) requires the AVP to be recognized and processed, triggering an error (e.g., DIAMETER_AVP_UNSUPPORTED) if unknown; the Vendor-Specific (V) bit (bit 0) indicates vendor-defined extensions; bits 2-7 are reserved and must be set to 0. The remaining bits are reserved and ignored. Over 200 standard AVPs have been defined across IETF specifications, with the base protocol alone specifying 47 core ones for essential functions like session management and error reporting. The mandatory flag enforces critical processing, while non-mandatory unknown AVPs can be safely ignored, promoting backward compatibility.[77][80]| Flag Bit | Name | Description |
|---|---|---|
| 0 | V (Vendor-Specific) | If set, includes a Vendor-ID; denotes vendor-specific AVP. |
| 1 | M (Mandatory) | If set, receiver must understand and process; unknown triggers error. |
| 2-7 | Reserved | Must be 0; receiver ignores. |
Operational Behavior
State Machines
The Diameter base protocol defines finite state machines to manage peer connections, user sessions, and recovery procedures, ensuring reliable and ordered interactions between nodes. These state machines are essential for maintaining the protocol's peer-to-peer nature and handling dynamic network conditions. The base protocol mandates three primary state machines: the peer state machine for connection management, the authorization session state machine for user authorization, and the accounting session state machine for resource tracking, with failover procedures integrated into the peer and accounting state machines.[70][22][21][81]Peer State Machine
The peer state machine governs the lifecycle of connections between Diameter nodes, starting from initiation to graceful termination. It operates independently of transport protocols but triggers actions based on events like incoming messages or timeouts. Stable states include Closed (no active connection), I-Open (initiator open), and R-Open (responder open), with intermediate states facilitating transitions.[70] Key states and transitions are outlined below:| State | Description | Transitions and Triggers |
|---|---|---|
| Closed | No connection exists; initial or post-termination state. | To Wait-Conn-Ack via connection initiation event. |
| Wait-Conn-Ack | Local node attempts to establish a connection as originator; awaiting acknowledgment of outgoing connection request. | To Wait-I-CEA via received connection acknowledgment, then send CER. |
| Wait-I-CEA | Awaiting Capabilities-Exchange-Answer (CEA) after sending Capabilities-Exchange-Request (CER). | To I-Open via successful CEA processing. |
| Open (I-Open/R-Open) | Connection established and capabilities exchanged; normal operational state. | To Closed via DPR/DPA for graceful shutdown or watchdog failure. |
Session State Machines
Session state machines handle per-user interactions, tracking authorization and accounting independently of peer connections. They use identifiers like Session-Id for authorization and Acct-Session-Id for accounting to correlate events across nodes. These machines support both stateful (full session tracking) and stateless (no persistent state) modes, depending on the Diameter application.[22][21] The authorization session state machine maintains user sessions through states such as Idle (pre-session), Open (active authorization), and Disconnected (termination pending). It manages timeouts via Authorization-Lifetime to enforce session duration and Auth-Grace-Period for graceful re-authentication extensions, preventing abrupt expirations. Re-authentication is initiated server-side using Re-Auth-Request (RAR) and Re-Auth-Answer (RAA) messages, allowing dynamic policy updates without session disruption; the machine transitions based on Re-Auth-Request-Type AVP values like AUTHORIZE_ONLY or TERMINATE. Client and server variants differ in state persistence, with stateful modes required for applications needing full lifecycle tracking.[83][84][85][86][87] The accounting session state machine similarly uses Idle, Open, and Disconnected states to record resource usage, supporting record types like START_RECORD (session initiation), INTERIM_RECORD (periodic updates), and STOP_RECORD (termination). It handles timeouts through Acct-Interim-Interval for interim reporting, ensuring continuous tracking even during network interruptions; upon recovery, sessions resume from the last known state using Origin-State-Id for synchronization. This machine is crucial for billing and auditing, with stateful operation optional but recommended for reliable aggregation across peers in scenarios such as real-time required accounting.[88][21][89][90]Message Processing Flows
Diameter message processing flows define the sequence of request and answer exchanges between peers to establish connections, authenticate users, authorize services, and record accounting data. These flows operate within the peer-to-peer model, leveraging transport layers like SCTP or TCP for reliable delivery, and are triggered by state machines that manage peer relationships.[6] The capabilities exchange flow initiates peer connections by negotiating supported features. A Diameter client sends a Capabilities-Exchange-Request (CER) message, identified by Command Code 257 with the 'R' bit set in the header flags, containing mandatory AVPs such as Origin-Host, Origin-Realm, Host-IP-Address, Vendor-Id, and Product-Name, along with optional AVPs like Supported-Vendor-Id, Auth-Application-Id, and Acct-Application-Id to advertise supported vendors and applications.[51] The responding server replies with a Capabilities-Exchange-Answer (CEA) message, mirroring the CER's structure but including a Result-Code AVP (e.g., 2001 for DIAMETER_SUCCESS) to confirm compatibility, and may include Error-Message or Failed-AVP if discrepancies arise.[51] This exchange ensures peers agree on vendor-specific AVPs and application identifiers before proceeding to application-level interactions, without involving proxying or redirection.[91] For authentication, authorization, and accounting (AAA) operations, the flow begins with an application-specific request, such as an authentication request, sent from a client to a server via the Destination-Realm AVP for realm-based routing and optionally Destination-Host for direct targeting.[92] The server processes the request and responds with an answer message containing a Result-Code AVP indicating outcomes, such as 2001 for success or values in the 3000 series for protocol errors.[65] In proxying scenarios, relay agents forward the request unchanged except for non-routing AVPs, while proxy agents may insert Route-Record and Proxy-Info AVPs to track the path and add policy enforcement, replacing the Hop-by-Hop Identifier to maintain transaction integrity.[93] The answer traverses the reverse path, restoring original identifiers, enabling multi-hop support for distributed AAA services.[74] Accounting flows use Accounting-Request (ACR) and Accounting-Answer (ACA) messages, both with Command Code 271, to record session events in sequences that support real-time or batch processing.[71] An ACR with Accounting-Record-Type AVP set to 1 (START) initiates a session, including Acct-Session-Id and optionally Acct-Multi-Session-Id for grouped sessions; the server acknowledges with an ACA containing Result-Code 2001.[89] Interim updates follow at intervals specified by Acct-Interim-Interval AVP (e.g., every 600 seconds), using Accounting-Record-Type 3, with Accounting-Record-Number AVP ensuring sequence integrity.[94] The sequence concludes with an ACR of type 4 (STOP), capturing final usage data, confirmed by ACA.[89] These flows inherently support asynchronous operations, allowing peers to process messages independently without blocking, as managed by state machines in states like PendingS or PendingI.[88] Retransmissions ensure reliability using the Hop-by-Hop Identifier in the message header to match requests and answers, with the 'T' flag set on retransmitted messages; duplicates are detected via the End-to-End Identifier combined with Origin-Host AVP.[81] Upon transport failure, pending messages are queued and forwarded to alternate peers with the 'T' flag, preventing loss in failover scenarios.[65]Error Handling
The Diameter protocol employs a structured approach to error handling, utilizing result codes in answer messages to indicate the outcome of request processing. These codes are categorized into success, protocol errors, transient failures, and permanent failures, as defined in RFC 6733 and aligned with 3GPP specifications, enabling peers to distinguish between recoverable and irrecoverable conditions. Success is denoted by codes in the 2000-2999 range, with 2001 (DIAMETER_SUCCESS) signaling normal completion without errors. Protocol errors (3000-3999), which are transient and handled hop-by-hop (often with the 'E' bit set), may allow rerouting, such as 3002 (DIAMETER_UNABLE_TO_DELIVER) for routing failures where no upstream server supports the application or route exists. Transient failures (4000-4999) permit retries on the same peer, for example 4001 (DIAMETER_AUTHENTICATION_REJECTED). Permanent errors, indicating non-recoverable issues, use the 5000-5999 range, like 5001 (DIAMETER_AVP_UNSUPPORTED) when an unrecognized AVP is encountered.[95][96][97] This classification supports appropriate recovery actions, with 3xxx codes potentially prompting rerouting, 4xxx retries on the same peer, and 5xxx halting further attempts. Error messages are conveyed through specific flags and AVPs in Diameter answers, differentiating protocol-level issues from application-specific ones. The 'E' flag in the message header is set for protocol errors, such as invalid message formatting or routing problems, requiring hop-by-hop resolution; it remains unset for application errors, like authentication rejections, which are handled end-to-end.[67] Accompanying the result code, the Error-Message AVP (code 281) provides a human-readable UTF-8 string describing the error for diagnostic purposes.[9] Additionally, the Failed-AVP (code 279) encapsulates the offending AVP to aid debugging, while the Error-Reporting-Host AVP (code 294) identifies the originating peer.[9] Asynchronous error notifications occur via server-initiated messages, such as Abort-Session-Request or Session-Termination-Request, incorporating these AVPs to inform clients of session-related failures without pending transactions.[98] Recovery from errors emphasizes reliability through retransmission and redundancy mechanisms. The transport layer, using TCP or SCTP, manages retransmissions with a default Tc timer of 30 seconds; upon timeout or transient errors like DIAMETER_TOO_BUSY (indicating overload), clients may resend requests.[45] For peer unavailability, failover to alternate servers is supported by maintaining transaction state and the 'T' (potentially re-transmittable) flag in requests, allowing agents to reroute pending messages upon detecting transport failures or codes like 3002.[61] Failback re-establishes connections to recovered peers, ensuring continuity in peer-to-peer communications.[6] These procedures minimize disruptions in AAA operations while correlating errors using end-to-end and hop-by-hop identifiers for traceability.[81]| Category | Result-Code Range | Example Code and Meaning | Recovery Implication |
|---|---|---|---|
| Success | 2000-2999 | 2001 (DIAMETER_SUCCESS): Normal completion | None required |
| Protocol Errors (Transient) | 3000-3999 | 3002 (DIAMETER_UNABLE_TO_DELIVER): No route | Reroute or failover to alternate peer |
| Transient Failures | 4000-4999 | 4001 (DIAMETER_AUTHENTICATION_REJECTED): Authentication rejected | Retry on same peer |
| Permanent Errors | 5000-5999 | 5001 (DIAMETER_AVP_UNSUPPORTED): Invalid AVP | Cease attempts; log for diagnostics |
Standards
Base Protocol Specifications
The base protocol specifications for the Diameter protocol are defined through key Request for Comments (RFC) documents published by the Internet Engineering Task Force (IETF), establishing the foundational framework for authentication, authorization, and accounting (AAA) operations. These specifications outline the core message structure, transport mechanisms, and peer-to-peer interactions required for Diameter implementations.[1] RFC 6733, titled "Diameter Base Protocol" and published in October 2012 as a Proposed Standard, serves as the primary current specification, obsoleting RFC 3588 and providing comprehensive details on the protocol header, Attribute-Value Pairs (AVPs), and state machines. It introduces enhancements such as support for Stream Control Transmission Protocol (SCTP) as a transport option and clarifications on security considerations, including improved handling of Transport Layer Security (TLS). As of November 2025, RFC 6733 remains the active base protocol without further obsoletions.[1] Earlier foundational documents include RFC 3588, "Diameter Base Protocol" from September 2003 (also Proposed Standard), which formed the initial core specification but was superseded by RFC 6733 due to errata and updates. Complementing this, RFC 3539, "Authentication, Authorization and Accounting (AAA) Transport Profile" from June 2003 (Proposed Standard), addresses transport-related issues for AAA protocols, including Diameter, such as reliability and congestion control.[99] The following table summarizes the core RFCs for the Diameter base protocol specifications:| RFC Number | Title | Publication Date | Status |
|---|---|---|---|
| 6733 | Diameter Base Protocol | October 2012 | Proposed Standard |
| 3588 | Diameter Base Protocol | September 2003 | Obsoleted (by RFC 6733) |
| 3539 | Authentication, Authorization and Accounting (AAA) Transport Profile | June 2003 | Proposed Standard |
Application and Extension RFCs
The Diameter protocol extends its base framework through specialized applications and extensions, each defined in dedicated RFCs to support domain-specific use cases such as network access, mobile IP, and session initiation. These applications are identified by a unique 32-bit Application-ID field in the Diameter message header, with the Internet Assigned Numbers Authority (IANA) maintaining the official registry of assigned values. While the base protocol provides the foundational transport and routing mechanisms, these RFCs define command codes, attribute-value pairs (AVPs), and procedures tailored to particular authentication, authorization, and accounting (AAA) scenarios.[1] Key Diameter applications and extensions have been standardized primarily through the IETF's Diameter Maintenance and Extensions (DIME) working group, with some alignment to 3GPP specifications for telecommunications domains like IP Multimedia Subsystem (IMS). The DIME WG was concluded in March 2024 after publishing several enhancements. For instance, RFC 4005 specifies the NASREQ application for AAA interactions with network access servers, while RFC 4072 enables the transport of Extensible Authentication Protocol (EAP) messages over Diameter. In 3GPP contexts, RFC 4740 defines the Cx interface application for SIP-based authentication and authorization in IMS, though much of the detailed IMS implementation relies on 3GPP Technical Specifications (TS). Similarly, RFC 5779 outlines Diameter support for Proxy Mobile IPv6 (PMIPv6), facilitating AAA between mobile access gateways and servers. More recent extensions include RFC 8583 for Diameter load information conveyance (May 2019) and RFC 9390 for Diameter group signaling (April 2023). The following table summarizes selected seminal RFCs for Diameter applications and extensions:| RFC Number | Title | Publication Date | Application Focus |
|---|---|---|---|
| 4005 | Diameter Network Access Server Application | August 2005 | AAA for network access servers (NASREQ) |
| 4072 | Diameter Extensible Authentication Protocol (EAP) Application | August 2005 | EAP payload transport for authentication |
| 4740 | Diameter Session Initiation Protocol (SIP) Application | August 2007 | SIP/IMS Cx interface for user authentication and service authorization |
| 5779 | Diameter Proxy Mobile IPv6: Mobile Access Gateway and Local Mobility Anchor Interaction with Diameter Server | February 2010 | AAA support for PMIPv6 mobility management |
| 8583 | Diameter Load Information Conveyance | May 2019 | Conveyance of load information between Diameter nodes |
| 9390 | Diameter Group Signaling | April 2023 | Support for group-based signaling in Diameter |
| 7423 | Diameter Applications Design Guidelines | January 2015 | Best practices for developing and extending Diameter applications |
