idnits 2.17.1
draft-ietf-dime-rfc3588bis-11.txt:
Checking boilerplate required by RFC 5378 and the IETF Trust (see
https://trustee.ietf.org/license-info):
----------------------------------------------------------------------------
** It looks like you're using RFC 3978 boilerplate. You should update this
to the boilerplate described in the IETF Trust License Policy document
(see https://trustee.ietf.org/license-info), which is required now.
-- Found old boilerplate from RFC 3978, Section 5.1 on line 20.
-- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on
line 6816.
-- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 6827.
-- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 6834.
-- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 6840.
Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt:
----------------------------------------------------------------------------
No issues found here.
Checking nits according to https://www.ietf.org/id-info/checklist :
----------------------------------------------------------------------------
== There are 2 instances of lines with non-RFC2606-compliant FQDNs in the
document.
== There are 2 instances of lines with non-RFC6890-compliant IPv4 addresses
in the document. If these are example addresses, they should be changed.
-- The draft header indicates that this document obsoletes RFC3588, but the
abstract doesn't seem to mention this, which it should.
Miscellaneous warnings:
----------------------------------------------------------------------------
== The copyright year in the IETF Trust Copyright Line does not match the
current year
== Line 4505 has weird spacing: '...ly with wit...'
== Line 4713 has weird spacing: '...ealtime user...'
== Line 4741 has weird spacing: '... record inter...'
== Line 4751 has weird spacing: '...ealtime user...'
== Line 4759 has weird spacing: '...ealtime user...'
== (1 more instance...)
-- The document seems to lack a disclaimer for pre-RFC5378 work, but may
have content which was first submitted before 10 November 2008. If you
have contacted all the original authors and they are all willing to grant
the BCP78 rights to the IETF Trust, then this is fine, and you can ignore
this comment. If not, you may need to add the pre-RFC5378 disclaimer.
(See the Legal Provisions document at
https://trustee.ietf.org/license-info for more information.)
-- The document date (July 9, 2008) is 5771 days in the past. Is this
intentional?
Checking references for intended status: Proposed Standard
----------------------------------------------------------------------------
(See RFCs 3967 and 4897 for information about using normative references
to lower-maturity documents in RFCs)
== Missing Reference: 'PXY' is mentioned on line 4220, but not defined
-- Possible downref: Non-RFC (?) normative reference: ref. 'FLOATPOINT'
-- Possible downref: Non-RFC (?) normative reference: ref. 'IANAADFAM'
-- Possible downref: Non-RFC (?) normative reference: ref. 'RADTYPE'
** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293)
** Obsolete normative reference: RFC 4005 (Obsoleted by RFC 7155)
** Obsolete normative reference: RFC 4006 (Obsoleted by RFC 8506)
** Obsolete normative reference: RFC 4234 (Obsoleted by RFC 5234)
** Obsolete normative reference: RFC 3588 (Obsoleted by RFC 6733)
** Obsolete normative reference: RFC 2434 (Obsoleted by RFC 5226)
** Obsolete normative reference: RFC 4306 (Obsoleted by RFC 5996)
** Obsolete normative reference: RFC 4282 (Obsoleted by RFC 7542)
** Obsolete normative reference: RFC 2960 (Obsoleted by RFC 4960)
** Obsolete normative reference: RFC 4346 (Obsoleted by RFC 5246)
** Obsolete normative reference: RFC 3280 (Obsoleted by RFC 5280)
** Obsolete normative reference: RFC 3490 (Obsoleted by RFC 5890, RFC 5891)
** Obsolete normative reference: RFC 3491 (Obsoleted by RFC 5891)
-- Obsolete informational reference (is this intentional?): RFC 3576
(Obsoleted by RFC 5176)
-- Obsolete informational reference (is this intentional?): RFC 4330
(Obsoleted by RFC 5905)
Summary: 14 errors (**), 0 flaws (~~), 10 warnings (==), 13 comments
(--).
Run idnits with the --verbose option for more detailed information about
the items above.
--------------------------------------------------------------------------------
2 DIME V. Fajardo, Ed.
3 Internet-Draft Toshiba America Research
4 Obsoletes: 3588 (if approved) J. Arkko
5 Intended status: Standards Track Ericsson Research
6 Expires: January 10, 2009 J. Loughney
7 Nokia Research Center
8 G. Zorn
9 NetCube
10 July 9, 2008
12 Diameter Base Protocol
13 draft-ietf-dime-rfc3588bis-11.txt
15 Status of this Memo
17 By submitting this Internet-Draft, each author represents that any
18 applicable patent or other IPR claims of which he or she is aware
19 have been or will be disclosed, and any of which he or she becomes
20 aware will be disclosed, in accordance with Section 6 of BCP 79.
22 Internet-Drafts are working documents of the Internet Engineering
23 Task Force (IETF), its areas, and its working groups. Note that
24 other groups may also distribute working documents as Internet-
25 Drafts.
27 Internet-Drafts are draft documents valid for a maximum of six months
28 and may be updated, replaced, or obsoleted by other documents at any
29 time. It is inappropriate to use Internet-Drafts as reference
30 material or to cite them other than as "work in progress."
32 The list of current Internet-Drafts can be accessed at
33 http://www.ietf.org/ietf/1id-abstracts.txt.
35 The list of Internet-Draft Shadow Directories can be accessed at
36 http://www.ietf.org/shadow.html.
38 This Internet-Draft will expire on January 10, 2009.
40 Copyright Notice
42 Copyright (C) The IETF Trust (2008).
44 Abstract
46 The Diameter base protocol is intended to provide an Authentication,
47 Authorization and Accounting (AAA) framework for applications such as
48 network access or IP mobility. Diameter is also intended to work in
49 both local Authentication, Authorization & Accounting and roaming
50 situations. This document specifies the message format, transport,
51 error reporting, accounting and security services to be used by all
52 Diameter applications. The Diameter base application needs to be
53 supported by all Diameter implementations.
55 Table of Contents
57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7
58 1.1. Diameter Protocol . . . . . . . . . . . . . . . . . . . . 9
59 1.1.1. Description of the Document Set . . . . . . . . . . 11
60 1.1.2. Conventions Used in This Document . . . . . . . . . 12
61 1.1.3. Changes from RFC3588 . . . . . . . . . . . . . . . . 12
62 1.2. Approach to Extensibility . . . . . . . . . . . . . . . . 13
63 1.2.1. Defining New AVP Values . . . . . . . . . . . . . . 13
64 1.2.2. Creating New AVPs . . . . . . . . . . . . . . . . . 13
65 1.2.3. Creating New Commands . . . . . . . . . . . . . . . 14
66 1.2.4. Creating New Diameter Applications . . . . . . . . . 14
67 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 15
68 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 22
69 2.1. Transport . . . . . . . . . . . . . . . . . . . . . . . . 23
70 2.1.1. SCTP Guidelines . . . . . . . . . . . . . . . . . . 24
71 2.2. Securing Diameter Messages . . . . . . . . . . . . . . . 24
72 2.3. Diameter Application Compliance . . . . . . . . . . . . . 24
73 2.4. Application Identifiers . . . . . . . . . . . . . . . . . 24
74 2.5. Connections vs. Sessions . . . . . . . . . . . . . . . . 25
75 2.6. Peer Table . . . . . . . . . . . . . . . . . . . . . . . 26
76 2.7. Routing Table . . . . . . . . . . . . . . . . . . . . . . 27
77 2.8. Role of Diameter Agents . . . . . . . . . . . . . . . . . 28
78 2.8.1. Relay Agents . . . . . . . . . . . . . . . . . . . . 30
79 2.8.2. Proxy Agents . . . . . . . . . . . . . . . . . . . . 31
80 2.8.3. Redirect Agents . . . . . . . . . . . . . . . . . . 31
81 2.8.4. Translation Agents . . . . . . . . . . . . . . . . . 32
82 2.9. Diameter Path Authorization . . . . . . . . . . . . . . . 33
83 3. Diameter Header . . . . . . . . . . . . . . . . . . . . . . . 35
84 3.1. Command Codes . . . . . . . . . . . . . . . . . . . . . . 38
85 3.2. Command Code ABNF specification . . . . . . . . . . . . . 38
86 3.3. Diameter Command Naming Conventions . . . . . . . . . . . 40
87 4. Diameter AVPs . . . . . . . . . . . . . . . . . . . . . . . . 42
88 4.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 42
89 4.1.1. Optional Header Elements . . . . . . . . . . . . . . 43
90 4.2. Basic AVP Data Formats . . . . . . . . . . . . . . . . . 44
91 4.3. Derived AVP Data Formats . . . . . . . . . . . . . . . . 45
92 4.4. Grouped AVP Values . . . . . . . . . . . . . . . . . . . 52
93 4.4.1. Example AVP with a Grouped Data type . . . . . . . . 53
94 4.5. Diameter Base Protocol AVPs . . . . . . . . . . . . . . . 56
95 5. Diameter Peers . . . . . . . . . . . . . . . . . . . . . . . 59
96 5.1. Peer Connections . . . . . . . . . . . . . . . . . . . . 59
97 5.2. Diameter Peer Discovery . . . . . . . . . . . . . . . . . 59
98 5.3. Capabilities Exchange . . . . . . . . . . . . . . . . . . 62
99 5.3.1. Capabilities-Exchange-Request . . . . . . . . . . . 63
100 5.3.2. Capabilities-Exchange-Answer . . . . . . . . . . . . 64
101 5.3.3. Vendor-Id AVP . . . . . . . . . . . . . . . . . . . 64
102 5.3.4. Firmware-Revision AVP . . . . . . . . . . . . . . . 64
103 5.3.5. Host-IP-Address AVP . . . . . . . . . . . . . . . . 65
104 5.3.6. Supported-Vendor-Id AVP . . . . . . . . . . . . . . 65
105 5.3.7. Product-Name AVP . . . . . . . . . . . . . . . . . . 65
106 5.4. Disconnecting Peer connections . . . . . . . . . . . . . 65
107 5.4.1. Disconnect-Peer-Request . . . . . . . . . . . . . . 66
108 5.4.2. Disconnect-Peer-Answer . . . . . . . . . . . . . . . 66
109 5.4.3. Disconnect-Cause AVP . . . . . . . . . . . . . . . . 67
110 5.5. Transport Failure Detection . . . . . . . . . . . . . . . 67
111 5.5.1. Device-Watchdog-Request . . . . . . . . . . . . . . 67
112 5.5.2. Device-Watchdog-Answer . . . . . . . . . . . . . . . 68
113 5.5.3. Transport Failure Algorithm . . . . . . . . . . . . 68
114 5.5.4. Failover and Failback Procedures . . . . . . . . . . 68
115 5.6. Peer State Machine . . . . . . . . . . . . . . . . . . . 69
116 5.6.1. Incoming connections . . . . . . . . . . . . . . . . 71
117 5.6.2. Events . . . . . . . . . . . . . . . . . . . . . . . 72
118 5.6.3. Actions . . . . . . . . . . . . . . . . . . . . . . 73
119 5.6.4. The Election Process . . . . . . . . . . . . . . . . 75
120 5.6.5. Capabilities Update . . . . . . . . . . . . . . . . 75
121 6. Diameter message processing . . . . . . . . . . . . . . . . . 76
122 6.1. Diameter Request Routing Overview . . . . . . . . . . . . 76
123 6.1.1. Originating a Request . . . . . . . . . . . . . . . 77
124 6.1.2. Sending a Request . . . . . . . . . . . . . . . . . 77
125 6.1.3. Receiving Requests . . . . . . . . . . . . . . . . . 78
126 6.1.4. Processing Local Requests . . . . . . . . . . . . . 78
127 6.1.5. Request Forwarding . . . . . . . . . . . . . . . . . 78
128 6.1.6. Request Routing . . . . . . . . . . . . . . . . . . 78
129 6.1.7. Predictive Loop Avoidance . . . . . . . . . . . . . 79
130 6.1.8. Redirecting requests . . . . . . . . . . . . . . . . 79
131 6.1.9. Relaying and Proxying Requests . . . . . . . . . . . 81
132 6.2. Diameter Answer Processing . . . . . . . . . . . . . . . 82
133 6.2.1. Processing received Answers . . . . . . . . . . . . 82
134 6.2.2. Relaying and Proxying Answers . . . . . . . . . . . 82
135 6.3. Origin-Host AVP . . . . . . . . . . . . . . . . . . . . . 83
136 6.4. Origin-Realm AVP . . . . . . . . . . . . . . . . . . . . 83
137 6.5. Destination-Host AVP . . . . . . . . . . . . . . . . . . 83
138 6.6. Destination-Realm AVP . . . . . . . . . . . . . . . . . . 84
139 6.7. Routing AVPs . . . . . . . . . . . . . . . . . . . . . . 84
140 6.7.1. Route-Record AVP . . . . . . . . . . . . . . . . . . 84
141 6.7.2. Proxy-Info AVP . . . . . . . . . . . . . . . . . . . 84
142 6.7.3. Proxy-Host AVP . . . . . . . . . . . . . . . . . . . 85
143 6.7.4. Proxy-State AVP . . . . . . . . . . . . . . . . . . 85
144 6.8. Auth-Application-Id AVP . . . . . . . . . . . . . . . . . 85
145 6.9. Acct-Application-Id AVP . . . . . . . . . . . . . . . . . 85
146 6.10. Inband-Security-Id AVP . . . . . . . . . . . . . . . . . 85
147 6.11. Vendor-Specific-Application-Id AVP . . . . . . . . . . . 86
148 6.12. Redirect-Host AVP . . . . . . . . . . . . . . . . . . . . 87
149 6.13. Redirect-Host-Usage AVP . . . . . . . . . . . . . . . . . 87
150 6.14. Redirect-Max-Cache-Time AVP . . . . . . . . . . . . . . . 88
151 7. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 90
152 7.1. Result-Code AVP . . . . . . . . . . . . . . . . . . . . . 91
153 7.1.1. Informational . . . . . . . . . . . . . . . . . . . 92
154 7.1.2. Success . . . . . . . . . . . . . . . . . . . . . . 92
155 7.1.3. Protocol Errors . . . . . . . . . . . . . . . . . . 93
156 7.1.4. Transient Failures . . . . . . . . . . . . . . . . . 94
157 7.1.5. Permanent Failures . . . . . . . . . . . . . . . . . 95
158 7.2. Error Bit . . . . . . . . . . . . . . . . . . . . . . . . 98
159 7.3. Error-Message AVP . . . . . . . . . . . . . . . . . . . . 98
160 7.4. Error-Reporting-Host AVP . . . . . . . . . . . . . . . . 98
161 7.5. Failed-AVP AVP . . . . . . . . . . . . . . . . . . . . . 99
162 7.6. Experimental-Result AVP . . . . . . . . . . . . . . . . . 100
163 7.7. Experimental-Result-Code AVP . . . . . . . . . . . . . . 100
164 8. Diameter User Sessions . . . . . . . . . . . . . . . . . . . 101
165 8.1. Authorization Session State Machine . . . . . . . . . . . 102
166 8.2. Accounting Session State Machine . . . . . . . . . . . . 107
167 8.3. Server-Initiated Re-Auth . . . . . . . . . . . . . . . . 112
168 8.3.1. Re-Auth-Request . . . . . . . . . . . . . . . . . . 112
169 8.3.2. Re-Auth-Answer . . . . . . . . . . . . . . . . . . . 113
170 8.4. Session Termination . . . . . . . . . . . . . . . . . . . 114
171 8.4.1. Session-Termination-Request . . . . . . . . . . . . 115
172 8.4.2. Session-Termination-Answer . . . . . . . . . . . . . 115
173 8.5. Aborting a Session . . . . . . . . . . . . . . . . . . . 116
174 8.5.1. Abort-Session-Request . . . . . . . . . . . . . . . 117
175 8.5.2. Abort-Session-Answer . . . . . . . . . . . . . . . . 117
176 8.6. Inferring Session Termination from Origin-State-Id . . . 118
177 8.7. Auth-Request-Type AVP . . . . . . . . . . . . . . . . . . 119
178 8.8. Session-Id AVP . . . . . . . . . . . . . . . . . . . . . 119
179 8.9. Authorization-Lifetime AVP . . . . . . . . . . . . . . . 120
180 8.10. Auth-Grace-Period AVP . . . . . . . . . . . . . . . . . . 121
181 8.11. Auth-Session-State AVP . . . . . . . . . . . . . . . . . 121
182 8.12. Re-Auth-Request-Type AVP . . . . . . . . . . . . . . . . 122
183 8.13. Session-Timeout AVP . . . . . . . . . . . . . . . . . . . 122
184 8.14. User-Name AVP . . . . . . . . . . . . . . . . . . . . . . 123
185 8.15. Termination-Cause AVP . . . . . . . . . . . . . . . . . . 123
186 8.16. Origin-State-Id AVP . . . . . . . . . . . . . . . . . . . 124
187 8.17. Session-Binding AVP . . . . . . . . . . . . . . . . . . . 125
188 8.18. Session-Server-Failover AVP . . . . . . . . . . . . . . . 125
189 8.19. Multi-Round-Time-Out AVP . . . . . . . . . . . . . . . . 126
190 8.20. Class AVP . . . . . . . . . . . . . . . . . . . . . . . . 126
191 8.21. Event-Timestamp AVP . . . . . . . . . . . . . . . . . . . 127
192 9. Accounting . . . . . . . . . . . . . . . . . . . . . . . . . 128
193 9.1. Server Directed Model . . . . . . . . . . . . . . . . . . 128
194 9.2. Protocol Messages . . . . . . . . . . . . . . . . . . . . 129
195 9.3. Accounting Application Extension and Requirements . . . . 129
196 9.4. Fault Resilience . . . . . . . . . . . . . . . . . . . . 130
197 9.5. Accounting Records . . . . . . . . . . . . . . . . . . . 130
198 9.6. Correlation of Accounting Records . . . . . . . . . . . . 131
199 9.7. Accounting Command-Codes . . . . . . . . . . . . . . . . 132
200 9.7.1. Accounting-Request . . . . . . . . . . . . . . . . . 132
201 9.7.2. Accounting-Answer . . . . . . . . . . . . . . . . . 133
202 9.8. Accounting AVPs . . . . . . . . . . . . . . . . . . . . . 134
203 9.8.1. Accounting-Record-Type AVP . . . . . . . . . . . . . 134
204 9.8.2. Acct-Interim-Interval AVP . . . . . . . . . . . . . 135
205 9.8.3. Accounting-Record-Number AVP . . . . . . . . . . . . 136
206 9.8.4. Acct-Session-Id AVP . . . . . . . . . . . . . . . . 136
207 9.8.5. Acct-Multi-Session-Id AVP . . . . . . . . . . . . . 136
208 9.8.6. Accounting-Sub-Session-Id AVP . . . . . . . . . . . 136
209 9.8.7. Accounting-Realtime-Required AVP . . . . . . . . . . 137
210 10. AVP Occurrence Table . . . . . . . . . . . . . . . . . . . . 138
211 10.1. Base Protocol Command AVP Table . . . . . . . . . . . . . 138
212 10.2. Accounting AVP Table . . . . . . . . . . . . . . . . . . 139
213 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 141
214 11.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 141
215 11.1.1. AVP Codes . . . . . . . . . . . . . . . . . . . . . 141
216 11.1.2. AVP Flags . . . . . . . . . . . . . . . . . . . . . 142
217 11.2. Diameter Header . . . . . . . . . . . . . . . . . . . . . 142
218 11.2.1. Command Codes . . . . . . . . . . . . . . . . . . . 142
219 11.2.2. Command Flags . . . . . . . . . . . . . . . . . . . 143
220 11.3. Application Identifiers . . . . . . . . . . . . . . . . . 143
221 11.4. AVP Values . . . . . . . . . . . . . . . . . . . . . . . 144
222 11.4.1. Result-Code AVP Values . . . . . . . . . . . . . . . 144
223 11.4.2. Accounting-Record-Type AVP Values . . . . . . . . . 144
224 11.4.3. Termination-Cause AVP Values . . . . . . . . . . . . 144
225 11.4.4. Redirect-Host-Usage AVP Values . . . . . . . . . . . 144
226 11.4.5. Session-Server-Failover AVP Values . . . . . . . . . 144
227 11.4.6. Session-Binding AVP Values . . . . . . . . . . . . . 144
228 11.4.7. Disconnect-Cause AVP Values . . . . . . . . . . . . 145
229 11.4.8. Auth-Request-Type AVP Values . . . . . . . . . . . . 145
230 11.4.9. Auth-Session-State AVP Values . . . . . . . . . . . 145
231 11.4.10. Re-Auth-Request-Type AVP Values . . . . . . . . . . 145
232 11.4.11. Accounting-Realtime-Required AVP Values . . . . . . 145
233 11.4.12. Inband-Security-Id AVP (code 299) . . . . . . . . . 145
234 11.5. Diameter TCP/SCTP Port Numbers . . . . . . . . . . . . . 145
235 11.6. NAPTR Service Fields . . . . . . . . . . . . . . . . . . 145
236 12. Diameter protocol related configurable parameters . . . . . . 147
237 13. Security Considerations . . . . . . . . . . . . . . . . . . . 148
238 13.1. TLS Usage . . . . . . . . . . . . . . . . . . . . . . . . 148
239 13.2. Peer-to-Peer Considerations . . . . . . . . . . . . . . . 149
240 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 150
241 14.1. Normative References . . . . . . . . . . . . . . . . . . 150
242 14.2. Informational References . . . . . . . . . . . . . . . . 152
243 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 154
244 Appendix B. NAPTR Example . . . . . . . . . . . . . . . . . . . 155
245 Appendix C. Duplicate Detection . . . . . . . . . . . . . . . . 156
246 Appendix D. Internationalized Domain Names . . . . . . . . . . . 158
247 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 159
248 Intellectual Property and Copyright Statements . . . . . . . . . 160
250 1. Introduction
252 Authentication, Authorization and Accounting (AAA) protocols such as
253 TACACS [RFC1492] and RADIUS [RFC2865] were initially deployed to
254 provide dial-up PPP [RFC1661] and terminal server access. Over time,
255 with the growth of the Internet and the introduction of new access
256 technologies (including wireless, DSL, Mobile IP and Ethernet), both
257 the amount and complexity of processing performed by routers and
258 network access servers (NAS) have increased, putting new demands on
259 AAA protocols.
261 Network access requirements for AAA protocols are summarized in
262 [RFC2989]. These include:
264 Failover
266 [RFC2865] does not define failover mechanisms, and as a result,
267 failover behavior differs between implementations. In order to
268 provide well defined failover behavior, Diameter supports
269 application-layer acknowledgements, and defines failover
270 algorithms and the associated state machine. This is described in
271 Section 5.5 and [RFC3539].
273 Transmission-level security
275 [RFC2865] defines an application-layer authentication and
276 integrity scheme that is required only for use with Response
277 packets. While [RFC2869] defines an additional authentication and
278 integrity mechanism, use is only required during Extensible
279 Authentication Protocol (EAP) sessions. While attribute-hiding is
280 supported, [RFC2865] does not provide support for per-packet
281 confidentiality. In accounting, [RFC2866] assumes that replay
282 protection is provided by the backend billing server, rather than
283 within the protocol itself.
285 While [RFC3162] defines the use of IPsec with RADIUS, support for
286 IPsec is not required. Since within [RFC4306] authentication
287 occurs only within Phase 1 prior to the establishment of IPsec SAs
288 in Phase 2, it is typically not possible to define separate trust
289 or authorization schemes for each application. This limits the
290 usefulness of IPsec in inter-domain AAA applications (such as
291 roaming) where it may be desirable to define a distinct
292 certificate hierarchy for use in a AAA deployment. In order to
293 provide universal support for transmission-level security, and
294 enable both intra- and inter-domain AAA deployments, Diameter
295 provides support for TLS. Security is discussed in Section 13.
297 Reliable transport
299 RADIUS runs over UDP, and does not define retransmission behavior;
300 as a result, reliability varies between implementations. As
301 described in [RFC2975], this is a major issue in accounting, where
302 packet loss may translate directly into revenue loss. In order to
303 provide well defined transport behavior, Diameter runs over
304 reliable transport mechanisms (TCP, SCTP) as defined in [RFC3539].
306 Agent support
308 [RFC2865] does not provide for explicit support for agents,
309 including Proxies, Redirects and Relays. Since the expected
310 behavior is not defined, it varies between implementations.
311 Diameter defines agent behavior explicitly; this is described in
312 Section 2.8.
314 Server-initiated messages
316 While RADIUS server-initiated messages are defined in [RFC3576],
317 support is optional. This makes it difficult to implement
318 features such as unsolicited disconnect or reauthentication/
319 reauthorization on demand across a heterogeneous deployment.
320 Support for server-initiated messages is mandatory in Diameter,
321 and is described in Section 8.
323 Transition support
325 While Diameter does not share a common protocol data unit (PDU)
326 with RADIUS, considerable effort has been expended in enabling
327 backward compatibility with RADIUS, so that the two protocols may
328 be deployed in the same network. Initially, it is expected that
329 Diameter will be deployed within new network devices, as well as
330 within gateways enabling communication between legacy RADIUS
331 devices and Diameter agents. This capability, described in
332 [RFC4005], enables Diameter support to be added to legacy
333 networks, by addition of a gateway or server speaking both RADIUS
334 and Diameter.
336 In addition to addressing the above requirements, Diameter also
337 provides support for the following:
339 Capability negotiation
341 RADIUS does not support error messages, capability negotiation, or
342 a mandatory/non-mandatory flag for attributes. Since RADIUS
343 clients and servers are not aware of each other's capabilities,
344 they may not be able to successfully negotiate a mutually
345 acceptable service, or in some cases, even be aware of what
346 service has been implemented. Diameter includes support for error
347 handling (Section 7), capability negotiation (Section 5.3), and
348 mandatory/non-mandatory attribute-value pairs (AVPs) (Section
349 4.1).
351 Peer discovery and configuration
353 RADIUS implementations typically require that the name or address
354 of servers or clients be manually configured, along with the
355 corresponding shared secrets. This results in a large
356 administrative burden, and creates the temptation to reuse the
357 RADIUS shared secret, which can result in major security
358 vulnerabilities if the Request Authenticator is not globally and
359 temporally unique as required in [RFC2865]. Through DNS, Diameter
360 enables dynamic discovery of peers. Derivation of dynamic session
361 keys is enabled via transmission-level security.
363 Over time, the capabilities of Network Access Server (NAS) devices
364 have increased substantially. As a result, while Diameter is a
365 considerably more sophisticated protocol than RADIUS, it remains
366 feasible to implement within embedded devices, given improvements in
367 processor speeds and the widespread availability of embedded TLS
368 implementations.
370 1.1. Diameter Protocol
372 The Diameter base protocol provides the following facilities:
374 o Delivery of AVPs (attribute value pairs)
376 o Capabilities negotiation
378 o Error notification
380 o Extensibility, through addition of new applications, commands and
381 AVPs (required in [RFC2989]).
383 o Basic services necessary for applications, such as handling of
384 user sessions or accounting
386 All data delivered by the protocol is in the form of an AVP. Some of
387 these AVP values are used by the Diameter protocol itself, while
388 others deliver data associated with particular applications that
389 employ Diameter. AVPs may be added arbitrarily to Diameter messages,
390 so long as the requirements of a message's ABNF are met and the ABNF
391 allows for it. AVPs are used by the base Diameter protocol to
392 support the following required features:
394 o Transporting of user authentication information, for the purposes
395 of enabling the Diameter server to authenticate the user.
397 o Transporting of service specific authorization information,
398 between client and servers, allowing the peers to decide whether a
399 user's access request should be granted.
401 o Exchanging resource usage information, which MAY be used for
402 accounting purposes, capacity planning, etc.
404 o Relaying, proxying and redirecting of Diameter messages through a
405 server hierarchy.
407 The Diameter base protocol provides the minimum requirements needed
408 for a AAA protocol, as required by [RFC2989]. The base protocol may
409 be used by itself for accounting purposes only, or it may be used
410 with a Diameter application, such as Mobile IPv4 [RFC4004], or
411 network access [RFC4005]. It is also possible for the base protocol
412 to be extended for use in new applications, via the addition of new
413 commands or AVPs. At this time the focus of Diameter is network
414 access and accounting applications. A truly generic AAA protocol
415 used by many applications might provide functionality not provided by
416 Diameter. Therefore, it is imperative that the designers of new
417 applications understand their requirements before using Diameter.
418 See Section 2.4 for more information on Diameter applications.
420 Any node can initiate a request. In that sense, Diameter is a peer-
421 to-peer protocol. In this document, a Diameter Client is a device at
422 the edge of the network that performs access control, such as a
423 Network Access Server (NAS) or a Foreign Agent (FA). A Diameter
424 client generates Diameter messages to request authentication,
425 authorization, and accounting services for the user. A Diameter
426 agent is a node that does not provide local user authentication or
427 authorization services; agents include proxies, redirects and relay
428 agents. A Diameter server performs authentication and/or
429 authorization of the user. A Diameter node MAY act as an agent for
430 certain requests while acting as a server for others.
432 The Diameter protocol also supports server-initiated messages, such
433 as a request to abort service to a particular user.
435 1.1.1. Description of the Document Set
437 Currently, the Diameter specification consists of an updated version
438 of the base protocol specification (this document), Transport Profile
439 [RFC3539] and applications: Mobile IPv4 [RFC4004], NASREQ [RFC4005],
440 Credit Control [RFC4006], EAP [RFC4072] and SIP [RFC4740]. Note that
441 this document obsoletes [RFC3588]. A summary of the base protocol
442 updates included in this document can be found in Section 1.1.3.
444 The Transport Profile document [RFC3539] discusses transport layer
445 issues that arise with AAA protocols and recommendations on how to
446 overcome these issues. This document also defines the Diameter
447 failover algorithm and state machine.
449 The Mobile IPv4 [RFC4004] application defines a Diameter application
450 that allows a Diameter server to perform AAA functions for Mobile
451 IPv4 services to a mobile node.
453 The NASREQ [RFC4005] application defines a Diameter Application that
454 allows a Diameter server to be used in a PPP/SLIP Dial-Up and
455 Terminal Server Access environment. Consideration was given for
456 servers that need to perform protocol conversion between Diameter and
457 RADIUS.
459 The Credit Control [RFC4006] application defines a Diameter
460 Application that can be used to implement real-time credit-control
461 for a variety of end user services such as network access, SIP
462 services, messaging services, and download services. It provides a
463 general solution to real-time cost and credit-control.
465 The EAP [RFC4072] application defines a Diameter Application that can
466 be used to carry EAP packets between the Network Access Server (NAS)
467 working as an EAP authenticator and a back-end authentication server.
468 The Diameter EAP application is based on NASREQ and intended for a
469 similar environment.
471 The SIP [RFC4740] application defines a Diameter Application that
472 allows a Diameter client to request authentication and authorization
473 information to a Diameter server for SIP-based IP multimedia services
474 (see SIP [RFC3261]).
476 In summary, this document defines the base protocol specification for
477 AAA, which includes support for accounting. The applications
478 documents describe applications that use this base specification for
479 Authentication, Authorization and Accounting.
481 1.1.2. Conventions Used in This Document
483 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
484 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
485 document are to be interpreted as described in [RFC2119].
487 1.1.3. Changes from RFC3588
489 This document deprecates [RFC3588] but is fully backward compatible
490 with that document. The changes introduced in this document focuses
491 on fixing issues that has surfaced during implementation of
492 [RFC3588]. An overview of some the major changes are shown below.
494 o Simplified Security Requirements. The use of a secured transport
495 for exchanging diameter messages remains mandatory. However, TLS
496 has become the primary method of securing diameter and IPSec is a
497 secondary alternative. See Section 13 for details. Along with
498 this, support for the End-to-End security framework (E2ESequence
499 AVP and 'P'-bit in the AVP header) has also been deprecated.
501 o Diameter Extensibility Changes. This includes fixes to the
502 diameter extensibility specification (Section 1.2 and others) to
503 better aid diameter application designers. It also includes
504 allocation of vendor specific command code space. The new
505 specification relaxes the allocation of command codes for vendor
506 specific uses. See Section 11.2.1 for details.
508 o Application Id Usage. Clarify the proper use of Application Id
509 information which can be found in multiple places within a
510 diameter message. This includes co-relating Application Ids found
511 in the message headers and AVPs. These changes also clearly
512 specifies the proper Application Id value to use for specific base
513 protocol messages (ASR/ASA, STR/STA) as well as clarifying the
514 content and use of Vendor-Specific-Application-Id.
516 o Routing Fixes. For general routing, specifies much more clearly
517 what information (AVPs and Application Id) can be used for making
518 routing decisions. Prioritization of redirect routing criterias
519 when multiple route entries are found via redirects has also been
520 added (See Section 6.13 for details).
522 o Simplification of Diameter Peer Discovery. The diameter discovery
523 process now supports only well known discovery schemes. The rest
524 has been deprecated. (See Section 5.2 for details).
526 There are many other many miscellaneous fixes that has been
527 introduced in this document that may not be considered significant
528 but they are important nonetheless. Examples are removal of obselete
529 types, fixes to command ABNFs, fixes state machine, clarification on
530 election process, message validation, fixes to Failed-AVP and Result-
531 Code AVP values etc. A comprehensive list of changes is now shown
532 here for practical reasons. Though, that can be generated via a diff
533 comparison between this document and [RFC3588].
535 1.2. Approach to Extensibility
537 The Diameter protocol is designed to be extensible, using several
538 mechanisms, including:
540 o Defining new AVP values
542 o Creating new AVPs
544 o Creating new commands
546 o Creating new applications
548 From the point of extensibility Diameter authentication,
549 authorization and accounting applications are treated in the same
550 way.
552 Note: Protocol designer should try to re-use existing functionality,
553 namely AVP values, AVPs, commands, and Diameter applications. Reuse
554 simplifies standardization and implementation. To avoid potential
555 interoperability issues it is important to ensure that the semantic
556 of the re-used features are well understood.
558 1.2.1. Defining New AVP Values
560 In order to allocate a new AVP value for AVPs defined in the Diameter
561 Base protocol, the IETF needs to approve a new RFC that describes the
562 AVP value. IANA considerations for these AVP values are discussed in
563 Section 11.4.
565 The allocation of AVP values for other AVPs is guided by the IANA
566 considerations of the documents that defines those AVPs. Typically,
567 allocation of new values for an AVP defined in an IETF RFC should
568 require IETF Review [RFC2434], where as values for vendor-specific
569 AVPs can be allocated by the vendor.
571 1.2.2. Creating New AVPs
573 A new AVP being defined MUST use one of the data types listed in
574 Section 4.2 or 4.3. If an appropriate derived data type is already
575 defined, it SHOULD be used instead of the base data type to encourage
576 reusability and good design practice.
578 In the event that a logical grouping of AVPs is necessary, and
579 multiple "groups" are possible in a given command, it is recommended
580 that a Grouped AVP be used (see Section 4.4).
582 The creation of new AVPs can happen in various ways. The recommended
583 approach is to define a new general-purpose AVP in a standards track
584 RFC approved by the IETF. However, as described in Section 11.1.1
585 there are also other mechanisms.
587 1.2.3. Creating New Commands
589 A new Command Code has to be allocated when new required AVPs (those
590 indicated as {AVP}) are added, deleted or are redefined (for example
591 by changing a required AVP into an optional one).
593 Furthermore, when a command is modified with respect to the number of
594 round trips then a new Command Code has to be registered.
596 A change to the ABNF of a command, such as described above, MUST
597 result in the definition of a new Command Code. This subsequently
598 leads to the need to define a new Diameter Application for any
599 application that will use that new Command.
601 The IANA considerations for commands are discussed in Section 11.2.1.
603 1.2.4. Creating New Diameter Applications
605 Every Diameter application specification MUST have an IANA assigned
606 Application Id (see Section 2.4 and Section 11.3). The managed
607 Application ID space is flat and there is no relationship between
608 different Diameter applications with respect to their application
609 IDs. As such, there is no versioning supported provided by these
610 application IDs itself; every Diameter application is a standalone
611 application that may or may not have a semantical relationship with
612 one or more Diameter applications being defined elsewhere.
614 Before describing the rules for creating new Diameter applications it
615 is important to discuss the semantic of the AVPs occurrences as
616 stated in the ABNF and the M-bit flag for an AVP. There is no
617 relationship imposed between the two; they are set independently.
619 o The ABNF indicates what AVPs are placed into a Diameter Command by
620 the sender of that Command. Often, since there are multiple modes
621 of protocol interactions many of the AVPs are indicated as
622 optional.
624 o The M-bit allows the sender to indicate to the receiver whether
625 the semantic of an AVP and it's content has to be understood
626 mandatorily or not. If the M-bit is set by the sender and the
627 receiver does not understand the AVP or the values carried within
628 that AVP then a failure is generated (see Section 7).
630 It is the decision of the protocol designer when to develop a new
631 Diameter application rather than extending Diameter in other ways.
632 However, a new Diameter application MUST be created when one or more
633 of the following criteria are met:
635 M-bit Setting
637 Adding an AVP with the M-bit in the MUST column of the AVP flag
638 table to an existing Command/Application requires a new Diameter
639 Application Id to be assigned to that Application.
641 Adding an AVP with the M-bit in the MAY column of the AVP flag
642 table to an existing Command/Application requires a new Diameter
643 Application Id to be assigned to that Application.
645 Note: The M-bit setting for a given AVP is relevant to an
646 Application and each command supported by that application where
647 the AVP is inlcuded. That is, if an AVP appears in two commands
648 for application Foo, then there should be two AVP flag tables
649 describing when to set the M-bit.
651 Commands
653 A new command is used within the existing application either
654 because an additional command is added, an existing command has
655 been modified so that a new Command Code had to be registered, or
656 a command has been deleted.
658 An implementation MAY add arbitrary optional AVPs to a command
659 defined in an application, including vendor-specific AVPs without
660 needing to define a new application. This can be done if the
661 commands ABNF allows for it. Please refer to Section 11.1.1 for
662 details.
664 1.3. Terminology
666 AAA
668 Authentication, Authorization and Accounting.
670 Accounting
672 The act of collecting information on resource usage for the
673 purpose of capacity planning, auditing, billing or cost
674 allocation.
676 Accounting Record
678 An accounting record represents a summary of the resource
679 consumption of a user over the entire session. Accounting servers
680 creating the accounting record may do so by processing interim
681 accounting events or accounting events from several devices
682 serving the same user.
684 Authentication
686 The act of verifying the identity of an entity (subject).
688 Authorization
690 The act of determining whether a requesting entity (subject) will
691 be allowed access to a resource (object).
693 AVP
695 The Diameter protocol consists of a header followed by one or more
696 Attribute-Value-Pairs (AVPs). An AVP includes a header and is
697 used to encapsulate protocol-specific data (e.g., routing
698 information) as well as authentication, authorization or
699 accounting information.
701 Broker
703 A broker is a business term commonly used in AAA infrastructures.
704 A broker is either a relay, proxy or redirect agent, and MAY be
705 operated by roaming consortiums. Depending on the business model,
706 a broker may either choose to deploy relay agents or proxy agents.
708 Diameter Agent
710 A Diameter Agent is a Diameter node that provides either relay,
711 proxy, redirect or translation services.
713 Diameter Client
715 A Diameter Client is a device at the edge of the network that
716 performs access control. An example of a Diameter client is a
717 Network Access Server (NAS) or a Foreign Agent (FA). By its very
718 nature, a Diameter Client MUST support Diameter client
719 applications in addition to the base protocol.
721 Diameter Node
723 A Diameter node is a host process that implements the Diameter
724 protocol, and acts either as a Client, Agent or Server.
726 Diameter Peer
728 A Diameter Peer is a Diameter Node to which a given Diameter Node
729 has a direct transport connection.
731 Diameter Server
733 A Diameter Server is one that handles authentication,
734 authorization and accounting requests for a particular realm. By
735 its very nature, a Diameter Server MUST support Diameter server
736 applications in addition to the base protocol.
738 Downstream
740 Downstream is used to identify the direction of a particular
741 Diameter message from the home server towards the access device.
743 Home Realm
745 A Home Realm is the administrative domain with which the user
746 maintains an account relationship.
748 Home Server
750 A Diameter Server which serves the Home Realm.
752 Interim accounting
754 An interim accounting message provides a snapshot of usage during
755 a user's session. It is typically implemented in order to provide
756 for partial accounting of a user's session in the case of a device
757 reboot or other network problem prevents the reception of a
758 session summary message or session record.
760 Local Realm
762 A local realm is the administrative domain providing services to a
763 user. An administrative domain MAY act as a local realm for
764 certain users, while being a home realm for others.
766 Multi-session
768 A multi-session represents a logical linking of several sessions.
769 Multi-sessions are tracked by using the Acct-Multi-Session-Id. An
770 example of a multi-session would be a Multi-link PPP bundle. Each
771 leg of the bundle would be a session while the entire bundle would
772 be a multi-session.
774 Network Access Identifier
776 The Network Access Identifier, or NAI [RFC4282], is used in the
777 Diameter protocol to extract a user's identity and realm. The
778 identity is used to identify the user during authentication and/or
779 authorization, while the realm is used for message routing
780 purposes.
782 Proxy Agent or Proxy
784 In addition to forwarding requests and responses, proxies make
785 policy decisions relating to resource usage and provisioning.
786 This is typically accomplished by tracking the state of NAS
787 devices. While proxies typically do not respond to client
788 Requests prior to receiving a Response from the server, they may
789 originate Reject messages in cases where policies are violated.
790 As a result, proxies need to understand the semantics of the
791 messages passing through them, and may not support all Diameter
792 applications.
794 Realm
796 The string in the NAI that immediately follows the '@' character.
797 NAI realm names are required to be unique, and are piggybacked on
798 the administration of the DNS namespace. Diameter makes use of
799 the realm, also loosely referred to as domain, to determine
800 whether messages can be satisfied locally, or whether they must be
801 routed or redirected. In RADIUS, realm names are not necessarily
802 piggybacked on the DNS namespace but may be independent of it.
804 Real-time Accounting
806 Real-time accounting involves the processing of information on
807 resource usage within a defined time window. Time constraints are
808 typically imposed in order to limit financial risk.
810 Relay Agent or Relay
812 Relays forward requests and responses based on routing-related
813 AVPs and routing table entries. Since relays do not make policy
814 decisions, they do not examine or alter non-routing AVPs. As a
815 result, relays never originate messages, do not need to understand
816 the semantics of messages or non-routing AVPs, and are capable of
817 handling any Diameter application or message type. Since relays
818 make decisions based on information in routing AVPs and realm
819 forwarding tables they do not keep state on NAS resource usage or
820 sessions in progress.
822 Redirect Agent
824 Rather than forwarding requests and responses between clients and
825 servers, redirect agents refer clients to servers and allow them
826 to communicate directly. Since redirect agents do not sit in the
827 forwarding path, they do not alter any AVPs transiting between
828 client and server. Redirect agents do not originate messages and
829 are capable of handling any message type, although they may be
830 configured only to redirect messages of certain types, while
831 acting as relay or proxy agents for other types. As with proxy
832 agents, redirect agents do not keep state with respect to sessions
833 or NAS resources.
835 Roaming Relationships
837 Roaming relationships include relationships between companies and
838 ISPs, relationships among peer ISPs within a roaming consortium,
839 and relationships between an ISP and a roaming consortium.
841 Session
843 A session is a related progression of events devoted to a
844 particular activity. Each application SHOULD provide guidelines
845 as to when a session begins and ends. All Diameter packets with
846 the same Session-Identifier are considered to be part of the same
847 session.
849 Session state
851 A stateful agent is one that maintains session state information,
852 by keeping track of all authorized active sessions. Each
853 authorized session is bound to a particular service, and its state
854 is considered active either until it is notified otherwise, or by
855 expiration.
857 Sub-session
859 A sub-session represents a distinct service (e.g., QoS or data
860 characteristics) provided to a given session. These services may
861 happen concurrently (e.g., simultaneous voice and data transfer
862 during the same session) or serially. These changes in sessions
863 are tracked with the Accounting-Sub-Session-Id.
865 Transaction state
867 The Diameter protocol requires that agents maintain transaction
868 state, which is used for failover purposes. Transaction state
869 implies that upon forwarding a request, the Hop-by-Hop identifier
870 is saved; the field is replaced with a locally unique identifier,
871 which is restored to its original value when the corresponding
872 answer is received. The request's state is released upon receipt
873 of the answer. A stateless agent is one that only maintains
874 transaction state.
876 Translation Agent
878 A translation agent is a stateful Diameter node that performs
879 protocol translation between Diameter and another AAA protocol,
880 such as RADIUS.
882 Transport Connection
884 A transport connection is a TCP or SCTP connection existing
885 directly between two Diameter peers, otherwise known as a Peer-
886 to-Peer Connection.
888 Upstream
890 Upstream is used to identify the direction of a particular
891 Diameter message from the access device towards the home server.
893 User
895 The entity requesting or using some resource, in support of which
896 a Diameter client has generated a request.
898 2. Protocol Overview
900 The base Diameter protocol may be used by itself for accounting
901 applications, but for use in authentication and authorization it is
902 always extended for a particular application. Two Diameter
903 applications are defined by companion documents: NASREQ [RFC4005],
904 Mobile IPv4 [RFC4004]. These applications are introduced in this
905 document but specified elsewhere. Additional Diameter applications
906 MAY be defined in the future (see Section 11.3).
908 Diameter Clients MUST support the base protocol, which includes
909 accounting. In addition, they MUST fully support each Diameter
910 application that is needed to implement the client's service, e.g.,
911 NASREQ and/or Mobile IPv4. A Diameter Client that does not support
912 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X
913 Client" where X is the application which it supports, and not a
914 "Diameter Client".
916 Diameter Servers MUST support the base protocol, which includes
917 accounting. In addition, they MUST fully support each Diameter
918 application that is needed to implement the intended service, e.g.,
919 NASREQ and/or Mobile IPv4. A Diameter Server that does not support
920 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X
921 Server" where X is the application which it supports, and not a
922 "Diameter Server".
924 Diameter Relays and redirect agents are, by definition, protocol
925 transparent, and MUST transparently support the Diameter base
926 protocol, which includes accounting, and all Diameter applications.
928 Diameter proxies MUST support the base protocol, which includes
929 accounting. In addition, they MUST fully support each Diameter
930 application that is needed to implement proxied services, e.g.,
931 NASREQ and/or Mobile IPv4. A Diameter proxy which does not support
932 also both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X
933 Proxy" where X is the application which it supports, and not a
934 "Diameter Proxy".
936 The base Diameter protocol concerns itself with capabilities
937 negotiation, how messages are sent and how peers may eventually be
938 abandoned. The base protocol also defines certain rules that apply
939 to all exchanges of messages between Diameter nodes.
941 Communication between Diameter peers begins with one peer sending a
942 message to another Diameter peer. The set of AVPs included in the
943 message is determined by a particular Diameter application. One AVP
944 that is included to reference a user's session is the Session-Id.
946 The initial request for authentication and/or authorization of a user
947 would include the Session-Id. The Session-Id is then used in all
948 subsequent messages to identify the user's session (see Section 8 for
949 more information). The communicating party may accept the request,
950 or reject it by returning an answer message with the Result-Code AVP
951 set to indicate an error occurred. The specific behavior of the
952 Diameter server or client receiving a request depends on the Diameter
953 application employed.
955 Session state (associated with a Session-Id) MUST be freed upon
956 receipt of the Session-Termination-Request, Session-Termination-
957 Answer, expiration of authorized service time in the Session-Timeout
958 AVP, and according to rules established in a particular Diameter
959 application.
961 2.1. Transport
963 Transport profile is defined in [RFC3539].
965 The base Diameter protocol is run on port 3868 of both TCP [RFC793]
966 and SCTP [RFC2960] transport protocols.
968 Diameter clients MUST support either TCP or SCTP, while agents and
969 servers MUST support both. Future versions of this specification MAY
970 mandate that clients support SCTP.
972 A Diameter node MAY initiate connections from a source port other
973 than the one that it declares it accepts incoming connections on, and
974 MUST be prepared to receive connections on port 3868. A given
975 Diameter instance of the peer state machine MUST NOT use more than
976 one transport connection to communicate with a given peer, unless
977 multiple instances exist on the peer in which case a separate
978 connection per process is allowed.
980 When no transport connection exists with a peer, an attempt to
981 connect SHOULD be periodically made. This behavior is handled via
982 the Tc timer, whose recommended value is 30 seconds. There are
983 certain exceptions to this rule, such as when a peer has terminated
984 the transport connection stating that it does not wish to
985 communicate.
987 When connecting to a peer and either zero or more transports are
988 specified, SCTP SHOULD be tried first, followed by TCP. See Section
989 5.2 for more information on peer discovery.
991 Diameter implementations SHOULD be able to interpret ICMP protocol
992 port unreachable messages as explicit indications that the server is
993 not reachable, subject to security policy on trusting such messages.
995 Diameter implementations SHOULD also be able to interpret a reset
996 from the transport and timed-out connection attempts. If Diameter
997 receives data up from TCP that cannot be parsed or identified as a
998 Diameter error made by the peer, the stream is compromised and cannot
999 be recovered. The transport connection MUST be closed using a RESET
1000 call (send a TCP RST bit) or an SCTP ABORT message (graceful closure
1001 is compromised).
1003 2.1.1. SCTP Guidelines
1005 The following are guidelines for Diameter implementations that
1006 support SCTP:
1008 1. For interoperability: All Diameter nodes MUST be prepared to
1009 receive Diameter messages on any SCTP stream in the association.
1011 2. To prevent blocking: All Diameter nodes SHOULD utilize all SCTP
1012 streams available to the association to prevent head-of-the-line
1013 blocking.
1015 2.2. Securing Diameter Messages
1017 Connections between Diameter peers SHOULD be protected by TLS. All
1018 Diameter base protocol implementations MUST support the use of TLS.
1019 If desired, additional security measures that are transparent to and
1020 independent of Diameter, such as IPSec [RFC4301], can be deployed to
1021 secure connections between peers. The Diameter protocol MUST NOT be
1022 used without any security mechanism.
1024 2.3. Diameter Application Compliance
1026 Application Ids are advertised during the capabilities exchange phase
1027 (see Section 5.3). For a given application, advertising support of
1028 an application implies that the sender supports all command codes,
1029 and the AVPs specified in the associated ABNFs, described in the
1030 specification.
1032 An implementation MAY add arbitrary non-mandatory AVPs to a command
1033 defined in an application, including vendor-specific AVPs only if the
1034 commands ABNF allows for it. Please refer to Section 11.1.1 for
1035 details.
1037 2.4. Application Identifiers
1039 Each Diameter application MUST have an IANA assigned Application Id
1040 (see Section 11.3). The base protocol does not require an
1041 Application Id since its support is mandatory. During the
1042 capabilities exchange, Diameter nodes inform their peers of locally
1043 supported applications. Furthermore, all Diameter messages contain
1044 an Application Id, which is used in the message forwarding process.
1046 The following Application Id values are defined:
1048 Diameter Common Messages 0
1049 NASREQ 1 [RFC4005]
1050 Mobile-IP 2 [RFC4004]
1051 Diameter Base Accounting 3
1052 Relay 0xffffffff
1054 Relay and redirect agents MUST advertise the Relay Application
1055 Identifier, while all other Diameter nodes MUST advertise locally
1056 supported applications. The receiver of a Capabilities Exchange
1057 message advertising Relay service MUST assume that the sender
1058 supports all current and future applications.
1060 Diameter relay and proxy agents are responsible for finding an
1061 upstream server that supports the application of a particular
1062 message. If none can be found, an error message is returned with the
1063 Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER.
1065 2.5. Connections vs. Sessions
1067 This section attempts to provide the reader with an understanding of
1068 the difference between connection and session, which are terms used
1069 extensively throughout this document.
1071 A connection is a transport level connection between two peers, used
1072 to send and receive Diameter messages. A session is a logical
1073 concept at the application layer, and is shared between an access
1074 device and a server, and is identified via the Session-Id AVP.
1076 +--------+ +-------+ +--------+
1077 | Client | | Relay | | Server |
1078 +--------+ +-------+ +--------+
1079 <----------> <---------->
1080 peer connection A peer connection B
1082 <----------------------------->
1083 User session x
1085 Figure 1: Diameter connections and sessions
1087 In the example provided in Figure 1, peer connection A is established
1088 between the Client and its local Relay. Peer connection B is
1089 established between the Relay and the Server. User session X spans
1090 from the Client via the Relay to the Server. Each "user" of a
1091 service causes an auth request to be sent, with a unique session
1092 identifier. Once accepted by the server, both the client and the
1093 server are aware of the session.
1095 It is important to note that there is no relationship between a
1096 connection and a session, and that Diameter messages for multiple
1097 sessions are all multiplexed through a single connection. Also note
1098 that Diameter messages pertaining to the session, both application
1099 specific and those that are defined in this document such as ASR/ASA,
1100 RAR/RAA and STR/STA MUST carry the Application Id of the application.
1101 Diameter messages pertaining to peer connection establishment and
1102 maintenance such as CER/CEA, DWR/DWA and DPR/DPA MUST carry an
1103 Application Id of zero (0).
1105 2.6. Peer Table
1107 The Diameter Peer Table is used in message forwarding, and referenced
1108 by the Routing Table. A Peer Table entry contains the following
1109 fields:
1111 Host identity
1113 Following the conventions described for the DiameterIdentity
1114 derived AVP data format in Section 4.4. This field contains the
1115 contents of the Origin-Host (Section 6.3) AVP found in the CER or
1116 CEA message.
1118 StatusT
1120 This is the state of the peer entry, and MUST match one of the
1121 values listed in Section 5.6.
1123 Static or Dynamic
1125 Specifies whether a peer entry was statically configured, or
1126 dynamically discovered.
1128 Expiration time
1130 Specifies the time at which dynamically discovered peer table
1131 entries are to be either refreshed, or expired.
1133 TLS Enabled
1135 Specifies whether TLS is to be used when communicating with the
1136 peer.
1138 Additional security information, when needed (e.g., keys,
1139 certificates)
1141 2.7. Routing Table
1143 All Realm-Based routing lookups are performed against what is
1144 commonly known as the Routing Table (see Section 12). A Routing
1145 Table Entry contains the following fields:
1147 Realm Name
1149 This is the field that is typically used as a primary key in the
1150 routing table lookups. Note that some implementations perform
1151 their lookups based on longest-match-from-the-right on the realm
1152 rather than requiring an exact match.
1154 Application Identifier
1156 An application is identified by an Application Id. A route entry
1157 can have a different destination based on the Application Id in
1158 the message header. This field MUST be used as a secondary key
1159 field in routing table lookups.
1161 Local Action
1163 The Local Action field is used to identify how a message should be
1164 treated. The following actions are supported:
1166 1. LOCAL - Diameter messages that resolve to a route entry with
1167 the Local Action set to Local can be satisfied locally, and do
1168 not need to be routed to another server.
1170 2. RELAY - All Diameter messages that fall within this category
1171 MUST be routed to a next hop server, without modifying any
1172 non-routing AVPs. See Section 6.1.9 for relaying guidelines
1174 3. PROXY - All Diameter messages that fall within this category
1175 MUST be routed to a next hop server. The local server MAY
1176 apply its local policies to the message by including new AVPs
1177 to the message prior to routing. See Section 6.1.9 for
1178 proxying guidelines.
1180 4. REDIRECT - Diameter messages that fall within this category
1181 MUST have the identity of the home Diameter server(s)
1182 appended, and returned to the sender of the message. See
1183 Section 6.1.9 for redirect guidelines.
1185 Server Identifier
1187 One or more servers the message is to be routed to. These servers
1188 MUST also be present in the Peer table. When the Local Action is
1189 set to RELAY or PROXY, this field contains the identity of the
1190 server(s) the message must be routed to. When the Local Action
1191 field is set to REDIRECT, this field contains the identity of one
1192 or more servers the message should be redirected to.
1194 Static or Dynamic
1196 Specifies whether a route entry was statically configured, or
1197 dynamically discovered.
1199 Expiration time
1201 Specifies the time which a dynamically discovered route table
1202 entry expires.
1204 It is important to note that Diameter agents MUST support at least
1205 one of the LOCAL, RELAY, PROXY or REDIRECT modes of operation.
1206 Agents do not need to support all modes of operation in order to
1207 conform with the protocol specification, but MUST follow the protocol
1208 compliance guidelines in Section 2. Relay agents MUST NOT reorder
1209 AVPs, and proxies MUST NOT reorder AVPs.
1211 The routing table MAY include a default entry that MUST be used for
1212 any requests not matching any of the other entries. The routing
1213 table MAY consist of only such an entry.
1215 When a request is routed, the target server MUST have advertised the
1216 Application Id (see Section 2.4) for the given message, or have
1217 advertised itself as a relay or proxy agent. Otherwise, an error is
1218 returned with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER.
1220 2.8. Role of Diameter Agents
1222 In addition to client and servers, the Diameter protocol introduces
1223 relay, proxy, redirect, and translation agents, each of which is
1224 defined in Section 1.3. These Diameter agents are useful for several
1225 reasons:
1227 o They can distribute administration of systems to a configurable
1228 grouping, including the maintenance of security associations.
1230 o They can be used for concentration of requests from an number of
1231 co-located or distributed NAS equipment sets to a set of like user
1232 groups.
1234 o They can do value-added processing to the requests or responses.
1236 o They can be used for load balancing.
1238 o A complex network will have multiple authentication sources, they
1239 can sort requests and forward towards the correct target.
1241 The Diameter protocol requires that agents maintain transaction
1242 state, which is used for failover purposes. Transaction state
1243 implies that upon forwarding a request, its Hop-by-Hop identifier is
1244 saved; the field is replaced with a locally unique identifier, which
1245 is restored to its original value when the corresponding answer is
1246 received. The request's state is released upon receipt of the
1247 answer. A stateless agent is one that only maintains transaction
1248 state.
1250 The Proxy-Info AVP allows stateless agents to add local state to a
1251 Diameter request, with the guarantee that the same state will be
1252 present in the answer. However, the protocol's failover procedures
1253 require that agents maintain a copy of pending requests.
1255 A stateful agent is one that maintains session state information; by
1256 keeping track of all authorized active sessions. Each authorized
1257 session is bound to a particular service, and its state is considered
1258 active either until it is notified otherwise, or by expiration. Each
1259 authorized session has an expiration, which is communicated by
1260 Diameter servers via the Session-Timeout AVP.
1262 Maintaining session state MAY be useful in certain applications, such
1263 as:
1265 o Protocol translation (e.g., RADIUS <-> Diameter)
1267 o Limiting resources authorized to a particular user
1269 o Per user or transaction auditing
1271 A Diameter agent MAY act in a stateful manner for some requests and
1272 be stateless for others. A Diameter implementation MAY act as one
1273 type of agent for some requests, and as another type of agent for
1274 others.
1276 2.8.1. Relay Agents
1278 Relay Agents are Diameter agents that accept requests and route
1279 messages to other Diameter nodes based on information found in the
1280 messages (e.g., Destination-Realm). This routing decision is
1281 performed using a list of supported realms, and known peers. This is
1282 known as the Routing Table, as is defined further in Section 2.7.
1284 Relays MAY be used to aggregate requests from multiple Network Access
1285 Servers (NASes) within a common geographical area (POP). The use of
1286 Relays is advantageous since it eliminates the need for NASes to be
1287 configured with the necessary security information they would
1288 otherwise require to communicate with Diameter servers in other
1289 realms. Likewise, this reduces the configuration load on Diameter
1290 servers that would otherwise be necessary when NASes are added,
1291 changed or deleted.
1293 Relays modify Diameter messages by inserting and removing routing
1294 information, but do not modify any other portion of a message.
1295 Relays SHOULD NOT maintain session state but MUST maintain
1296 transaction state.
1298 +------+ ---------> +------+ ---------> +------+
1299 | | 1. Request | | 2. Request | |
1300 | NAS | | DRL | | HMS |
1301 | | 4. Answer | | 3. Answer | |
1302 +------+ <--------- +------+ <--------- +------+
1303 example.net example.net example.com
1305 Figure 2: Relaying of Diameter messages
1307 The example provided in Figure 2 depicts a request issued from NAS,
1308 which is an access device, for the user bob@example.com. Prior to
1309 issuing the request, NAS performs a Diameter route lookup, using
1310 "example.com" as the key, and determines that the message is to be
1311 relayed to DRL, which is a Diameter Relay. DRL performs the same
1312 route lookup as NAS, and relays the message to HMS, which is
1313 example.com's Home Diameter Server. HMS identifies that the request
1314 can be locally supported (via the realm), processes the
1315 authentication and/or authorization request, and replies with an
1316 answer, which is routed back to NAS using saved transaction state.
1318 Since Relays do not perform any application level processing, they
1319 provide relaying services for all Diameter applications, and
1320 therefore MUST advertise the Relay Application Id.
1322 2.8.2. Proxy Agents
1324 Similarly to relays, proxy agents route Diameter messages using the
1325 Diameter Routing Table. However, they differ since they modify
1326 messages to implement policy enforcement. This requires that proxies
1327 maintain the state of their downstream peers (e.g., access devices)
1328 to enforce resource usage, provide admission control, and
1329 provisioning.
1331 Proxies MAY be used in call control centers or access ISPs that
1332 provide outsourced connections, they can monitor the number and types
1333 of ports in use, and make allocation and admission decisions
1334 according to their configuration.
1336 Proxies that wish to limit resources MUST maintain session state.
1337 All proxies MUST maintain transaction state.
1339 Since enforcing policies requires an understanding of the service
1340 being provided, Proxies MUST only advertise the Diameter applications
1341 they support.
1343 2.8.3. Redirect Agents
1345 Redirect agents are useful in scenarios where the Diameter routing
1346 configuration needs to be centralized. An example is a redirect
1347 agent that provides services to all members of a consortium, but does
1348 not wish to be burdened with relaying all messages between realms.
1349 This scenario is advantageous since it does not require that the
1350 consortium provide routing updates to its members when changes are
1351 made to a member's infrastructure.
1353 Since redirect agents do not relay messages, and only return an
1354 answer with the information necessary for Diameter agents to
1355 communicate directly, they do not modify messages. Since redirect
1356 agents do not receive answer messages, they cannot maintain session
1357 state. Further, since redirect agents never relay requests, they are
1358 not required to maintain transaction state.
1360 The example provided in Figure 3 depicts a request issued from the
1361 access device, NAS, for the user bob@example.com. The message is
1362 forwarded by the NAS to its relay, DRL, which does not have a routing
1363 entry in its Diameter Routing Table for example.com. DRL has a
1364 default route configured to DRD, which is a redirect agent that
1365 returns a redirect notification to DRL, as well as HMS' contact
1366 information. Upon receipt of the redirect notification, DRL
1367 establishes a transport connection with HMS, if one doesn't already
1368 exist, and forwards the request to it.
1370 +------+
1371 | |
1372 | DRD |
1373 | |
1374 +------+
1375 ^ |
1376 2. Request | | 3. Redirection
1377 | | Notification
1378 | v
1379 +------+ ---------> +------+ ---------> +------+
1380 | | 1. Request | | 4. Request | |
1381 | NAS | | DRL | | HMS |
1382 | | 6. Answer | | 5. Answer | |
1383 +------+ <--------- +------+ <--------- +------+
1384 example.net example.net example.com
1386 Figure 3: Redirecting a Diameter Message
1388 Since redirect agents do not perform any application level
1389 processing, they provide relaying services for all Diameter
1390 applications, and therefore MUST advertise the Relay Application
1391 Identifier.
1393 2.8.4. Translation Agents
1395 A translation agent is a device that provides translation between two
1396 protocols (e.g., RADIUS<->Diameter, TACACS+<->Diameter). Translation
1397 agents are likely to be used as aggregation servers to communicate
1398 with a Diameter infrastructure, while allowing for the embedded
1399 systems to be migrated at a slower pace.
1401 Given that the Diameter protocol introduces the concept of long-lived
1402 authorized sessions, translation agents MUST be session stateful and
1403 MUST maintain transaction state.
1405 Translation of messages can only occur if the agent recognizes the
1406 application of a particular request, and therefore translation agents
1407 MUST only advertise their locally supported applications.
1409 +------+ ---------> +------+ ---------> +------+
1410 | | RADIUS Request | | Diameter Request | |
1411 | NAS | | TLA | | HMS |
1412 | | RADIUS Answer | | Diameter Answer | |
1413 +------+ <--------- +------+ <--------- +------+
1414 example.net example.net example.com
1416 Figure 4: Translation of RADIUS to Diameter
1418 2.9. Diameter Path Authorization
1420 As noted in Section 2.2, Diameter provides transmission level
1421 security for each connection using TLS. Therefore, each connection
1422 can be authenticated, replay and integrity protected.
1424 In addition to authenticating each connection, each connection as
1425 well as the entire session MUST also be authorized. Before
1426 initiating a connection, a Diameter Peer MUST check that its peers
1427 are authorized to act in their roles. For example, a Diameter peer
1428 may be authentic, but that does not mean that it is authorized to act
1429 as a Diameter Server advertising a set of Diameter applications.
1431 Prior to bringing up a connection, authorization checks are performed
1432 at each connection along the path. Diameter capabilities negotiation
1433 (CER/CEA) also MUST be carried out, in order to determine what
1434 Diameter applications are supported by each peer. Diameter sessions
1435 MUST be routed only through authorized nodes that have advertised
1436 support for the Diameter application required by the session.
1438 As noted in Section 6.1.9, a relay or proxy agent MUST append a
1439 Route-Record AVP to all requests forwarded. The AVP contains the
1440 identity of the peer the request was received from.
1442 The home Diameter server, prior to authorizing a session, MUST check
1443 the Route-Record AVPs to make sure that the route traversed by the
1444 request is acceptable. For example, administrators within the home
1445 realm may not wish to honor requests that have been routed through an
1446 untrusted realm. By authorizing a request, the home Diameter server
1447 is implicitly indicating its willingness to engage in the business
1448 transaction as specified by the contractual relationship between the
1449 server and the previous hop. A DIAMETER_AUTHORIZATION_REJECTED error
1450 message (see Section 7.1.5) is sent if the route traversed by the
1451 request is unacceptable.
1453 A home realm may also wish to check that each accounting request
1454 message corresponds to a Diameter response authorizing the session.
1455 Accounting requests without corresponding authorization responses
1456 SHOULD be subjected to further scrutiny, as should accounting
1457 requests indicating a difference between the requested and provided
1458 service.
1460 Forwarding of an authorization response is considered evidence of a
1461 willingness to take on financial risk relative to the session. A
1462 local realm may wish to limit this exposure, for example, by
1463 establishing credit limits for intermediate realms and refusing to
1464 accept responses which would violate those limits. By issuing an
1465 accounting request corresponding to the authorization response, the
1466 local realm implicitly indicates its agreement to provide the service
1467 indicated in the authorization response. If the service cannot be
1468 provided by the local realm, then a DIAMETER_UNABLE_TO_COMPLY error
1469 message MUST be sent within the accounting request; a Diameter client
1470 receiving an authorization response for a service that it cannot
1471 perform MUST NOT substitute an alternate service, and then send
1472 accounting requests for the alternate service instead.
1474 3. Diameter Header
1476 A summary of the Diameter header format is shown below. The fields
1477 are transmitted in network byte order.
1479 0 1 2 3
1480 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1481 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1482 | Version | Message Length |
1483 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1484 | command flags | Command-Code |
1485 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1486 | Application-ID |
1487 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1488 | Hop-by-Hop Identifier |
1489 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1490 | End-to-End Identifier |
1491 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1492 | AVPs ...
1493 +-+-+-+-+-+-+-+-+-+-+-+-+-
1495 Version
1497 This Version field MUST be set to 1 to indicate Diameter Version
1498 1.
1500 Message Length
1502 The Message Length field is three octets and indicates the length
1503 of the Diameter message including the header fields.
1505 Command Flags
1507 The Command Flags field is eight bits. The following bits are
1508 assigned:
1510 0 1 2 3 4 5 6 7
1511 +-+-+-+-+-+-+-+-+
1512 |R P E T r r r r|
1513 +-+-+-+-+-+-+-+-+
1515 R(equest)
1517 If set, the message is a request. If cleared, the message is
1518 an answer.
1520 P(roxiable)
1522 If set, the message MAY be proxied, relayed or redirected. If
1523 cleared, the message MUST be locally processed.
1525 E(rror)
1527 If set, the message contains a protocol error, and the message
1528 will not conform to the ABNF described for this command.
1529 Messages with the 'E' bit set are commonly referred to as error
1530 messages. This bit MUST NOT be set in request messages. See
1531 Section 7.2.
1533 T(Potentially re-transmitted message)
1535 This flag is set after a link failover procedure, to aid the
1536 removal of duplicate requests. It is set when resending
1537 requests not yet acknowledged, as an indication of a possible
1538 duplicate due to a link failure. This bit MUST be cleared when
1539 sending a request for the first time, otherwise the sender MUST
1540 set this flag. Diameter agents only need to be concerned about
1541 the number of requests they send based on a single received
1542 request; retransmissions by other entities need not be tracked.
1543 Diameter agents that receive a request with the T flag set,
1544 MUST keep the T flag set in the forwarded request. This flag
1545 MUST NOT be set if an error answer message (e.g., a protocol
1546 error) has been received for the earlier message. It can be
1547 set only in cases where no answer has been received from the
1548 server for a request and the request is sent again. This flag
1549 MUST NOT be set in answer messages.
1551 r(eserved)
1553 These flag bits are reserved for future use, and MUST be set to
1554 zero, and ignored by the receiver.
1556 Command-Code
1558 The Command-Code field is three octets, and is used in order to
1559 communicate the command associated with the message. The 24-bit
1560 address space is managed by IANA (see Section 11.2.1).
1562 Command-Code values 16,777,214 and 16,777,215 (hexadecimal values
1563 FFFFFE -FFFFFF) are reserved for experimental use (See Section
1564 11.3).
1566 Application-ID
1568 Application-ID is four octets and is used to identify to which
1569 application the message is applicable for. The application can be
1570 an authentication application, an accounting application or a
1571 vendor specific application. See Section 11.3 for the possible
1572 values that the application-id may use.
1574 The application-id in the header MUST be the same as what is
1575 contained in any relevant application-id AVPs contained in the
1576 message.
1578 Hop-by-Hop Identifier
1580 The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in
1581 network byte order) and aids in matching requests and replies.
1582 The sender MUST ensure that the Hop-by-Hop identifier in a request
1583 is unique on a given connection at any given time, and MAY attempt
1584 to ensure that the number is unique across reboots. The sender of
1585 an Answer message MUST ensure that the Hop-by-Hop Identifier field
1586 contains the same value that was found in the corresponding
1587 request. The Hop-by-Hop identifier is normally a monotonically
1588 increasing number, whose start value was randomly generated. An
1589 answer message that is received with an unknown Hop-by-Hop
1590 Identifier MUST be discarded.
1592 End-to-End Identifier
1594 The End-to-End Identifier is an unsigned 32-bit integer field (in
1595 network byte order) and is used to detect duplicate messages.
1596 Upon reboot implementations MAY set the high order 12 bits to
1597 contain the low order 12 bits of current time, and the low order
1598 20 bits to a random value. Senders of request messages MUST
1599 insert a unique identifier on each message. The identifier MUST
1600 remain locally unique for a period of at least 4 minutes, even
1601 across reboots. The originator of an Answer message MUST ensure
1602 that the End-to-End Identifier field contains the same value that
1603 was found in the corresponding request. The End-to-End Identifier
1604 MUST NOT be modified by Diameter agents of any kind. The
1605 combination of the Origin-Host (see Section 6.3) and this field is
1606 used to detect duplicates. Duplicate requests SHOULD cause the
1607 same answer to be transmitted (modulo the hop-by-hop Identifier
1608 field and any routing AVPs that may be present), and MUST NOT
1609 affect any state that was set when the original request was
1610 processed. Duplicate answer messages that are to be locally
1611 consumed (see Section 6.2) SHOULD be silently discarded.
1613 AVPs
1615 AVPs are a method of encapsulating information relevant to the
1616 Diameter message. See Section 4 for more information on AVPs.
1618 3.1. Command Codes
1620 Each command Request/Answer pair is assigned a command code, and the
1621 sub-type (i.e., request or answer) is identified via the 'R' bit in
1622 the Command Flags field of the Diameter header.
1624 Every Diameter message MUST contain a command code in its header's
1625 Command-Code field, which is used to determine the action that is to
1626 be taken for a particular message. The following Command Codes are
1627 defined in the Diameter base protocol:
1629 Command-Name Abbrev. Code Reference
1630 --------------------------------------------------------
1631 Abort-Session-Request ASR 274 8.5.1
1632 Abort-Session-Answer ASA 274 8.5.2
1633 Accounting-Request ACR 271 9.7.1
1634 Accounting-Answer ACA 271 9.7.2
1635 Capabilities-Exchange- CER 257 5.3.1
1636 Request
1637 Capabilities-Exchange- CEA 257 5.3.2
1638 Answer
1639 Device-Watchdog-Request DWR 280 5.5.1
1640 Device-Watchdog-Answer DWA 280 5.5.2
1641 Disconnect-Peer-Request DPR 282 5.4.1
1642 Disconnect-Peer-Answer DPA 282 5.4.2
1643 Re-Auth-Request RAR 258 8.3.1
1644 Re-Auth-Answer RAA 258 8.3.2
1645 Session-Termination- STR 275 8.4.1
1646 Request
1647 Session-Termination- STA 275 8.4.2
1648 Answer
1650 3.2. Command Code ABNF specification
1652 Every Command Code defined MUST include a corresponding ABNF
1653 specification, which is used to define the AVPs that MUST or MAY be
1654 present. The following format is used in the definition:
1656 command-def = command-name "::=" diameter-message
1658 command-name = diameter-name
1659 diameter-name = ALPHA *(ALPHA / DIGIT / "-")
1661 diameter-message = header [ *fixed] [ *required] [ *optional]
1663 header = "<" "Diameter Header:" command-id
1664 [r-bit] [p-bit] [e-bit] [application-id] ">"
1666 application-id = 1*DIGIT
1668 command-id = 1*DIGIT
1669 ; The Command Code assigned to the command
1671 r-bit = ", REQ"
1672 ; If present, the 'R' bit in the Command
1673 ; Flags is set, indicating that the message
1674 ; is a request, as opposed to an answer.
1676 p-bit = ", PXY"
1677 ; If present, the 'P' bit in the Command
1678 ; Flags is set, indicating that the message
1679 ; is proxiable.
1681 e-bit = ", ERR"
1682 ; If present, the 'E' bit in the Command
1683 ; Flags is set, indicating that the answer
1684 ; message contains a Result-Code AVP in
1685 ; the "protocol error" class.
1687 fixed = [qual] "<" avp-spec ">"
1688 ; Defines the fixed position of an AVP
1690 required = [qual] "{" avp-spec "}"
1691 ; The AVP MUST be present and can appear
1692 ; anywhere in the message.
1694 optional = [qual] "[" avp-name "]"
1695 ; The avp-name in the 'optional' rule cannot
1696 ; evaluate to any AVP Name which is included
1697 ; in a fixed or required rule. The AVP can
1698 ; appear anywhere in the message.
1700 qual = [min] "*" [max]
1701 ; See ABNF conventions, RFC 4234 Section 6.6.
1702 ; The absence of any qualifiers depends on
1703 ; whether it precedes a fixed, required, or
1704 ; optional rule. If a fixed or required rule has
1705 ; no qualifier, then exactly one such AVP MUST
1706 ; be present. If an optional rule has no
1707 ; qualifier, then 0 or 1 such AVP may be
1708 ; present. If an optional rule has a qualifier,
1709 ; then the value of min MUST be 0 if present.
1710 ;
1711 ; NOTE: "[" and "]" have a different meaning
1712 ; than in ABNF (see the optional rule, above).
1713 ; These braces cannot be used to express
1714 ; optional fixed rules (such as an optional
1715 ; ICV at the end). To do this, the convention
1716 ; is '0*1fixed'.
1718 min = 1*DIGIT
1719 ; The minimum number of times the element may
1720 ; be present. The default value is zero.
1722 max = 1*DIGIT
1723 ; The maximum number of times the element may
1724 ; be present. The default value is infinity. A
1725 ; value of zero implies the AVP MUST NOT be
1726 ; present.
1728 avp-spec = diameter-name
1729 ; The avp-spec has to be an AVP Name, defined
1730 ; in the base or extended Diameter
1731 ; specifications.
1733 avp-name = avp-spec / "AVP"
1734 ; The string "AVP" stands for *any* arbitrary AVP
1735 ; Name, not otherwise listed in that command code
1736 ; definition. Addition this AVP is recommended for
1737 ; all command ABNFs to allow for extensibility.
1739 The following is a definition of a fictitious command code:
1741 Example-Request ::= < Diameter Header: 9999999, REQ, PXY >
1742 { User-Name }
1743 * { Origin-Host }
1744 * [ AVP ]
1746 3.3. Diameter Command Naming Conventions
1748 Diameter command names typically includes one or more English words
1749 followed by the verb Request or Answer. Each English word is
1750 delimited by a hyphen. A three-letter acronym for both the request
1751 and answer is also normally provided.
1753 An example is a message set used to terminate a session. The command
1754 name is Session-Terminate-Request and Session-Terminate-Answer, while
1755 the acronyms are STR and STA, respectively.
1757 Both the request and the answer for a given command share the same
1758 command code. The request is identified by the R(equest) bit in the
1759 Diameter header set to one (1), to ask that a particular action be
1760 performed, such as authorizing a user or terminating a session. Once
1761 the receiver has completed the request it issues the corresponding
1762 answer, which includes a result code that communicates one of the
1763 following:
1765 o The request was successful
1767 o The request failed
1769 o An additional request MUST be sent to provide information the peer
1770 requires prior to returning a successful or failed answer.
1772 o The receiver could not process the request, but provides
1773 information about a Diameter peer that is able to satisfy the
1774 request, known as redirect.
1776 Additional information, encoded within AVPs, MAY also be included in
1777 answer messages.
1779 4. Diameter AVPs
1781 Diameter AVPs carry specific authentication, accounting,
1782 authorization and routing information as well as configuration
1783 details for the request and reply.
1785 Some AVPs MAY be listed more than once. The effect of such an AVP is
1786 specific, and is specified in each case by the AVP description.
1788 Each AVP of type OctetString MUST be padded to align on a 32-bit
1789 boundary, while other AVP types align naturally. A number of zero-
1790 valued bytes are added to the end of the AVP Data field till a word
1791 boundary is reached. The length of the padding is not reflected in
1792 the AVP Length field.
1794 4.1. AVP Header
1796 The fields in the AVP header MUST be sent in network byte order. The
1797 format of the header is:
1799 0 1 2 3
1800 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1801 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1802 | AVP Code |
1803 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1804 |V M P r r r r r| AVP Length |
1805 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1806 | Vendor-ID (opt) |
1807 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1808 | Data ...
1809 +-+-+-+-+-+-+-+-+
1811 AVP Code
1813 The AVP Code, combined with the Vendor-Id field, identifies the
1814 attribute uniquely. AVP numbers 1 through 255 are reserved for
1815 backward compatibility with RADIUS, without setting the Vendor-Id
1816 field. AVP numbers 256 and above are used for Diameter, which are
1817 allocated by IANA (see Section 11.1).
1819 AVP Flags
1821 The AVP Flags field informs the receiver how each attribute must
1822 be handled. The 'r' (reserved) bits are unused and SHOULD be set
1823 to 0. Note that subsequent Diameter applications MAY define
1824 additional bits within the AVP Header, and an unrecognized bit
1825 SHOULD be considered an error. The 'P' bit indicates the need for
1826 encryption for end-to-end security. Note that the 'P' bit has
1827 been deprecated and MUST be to zero(0) when sending an AVP and
1828 ingnored on receipt of an AVP.
1830 The 'M' Bit, known as the Mandatory bit, indicates whether support
1831 of the AVP is required. If an AVP with the 'M' bit set is
1832 received by a Diameter client, server or translation agent and
1833 either the AVP or its value is unrecognized, the message MUST be
1834 rejected. An exception to this rule applies when the AVP is
1835 embedded within a Grouped AVP. See Section 4.4 for details.
1836 Diameter Relay and redirect agents MUST NOT reject messages with
1837 unrecognized AVPs.
1839 The 'M' bit MUST be set according to the rules defined within the
1840 Application/Command carrying this AVP.
1842 AVPs with the 'M' bit cleared are informational only and a
1843 receiver that receives a message with such an AVP that is not
1844 supported, or whose value is not supported, MAY simply ignore the
1845 AVP.
1847 The 'V' bit, known as the Vendor-Specific bit, indicates whether
1848 the optional Vendor-ID field is present in the AVP header. When
1849 set the AVP Code belongs to the specific vendor code address
1850 space.
1852 AVP Length
1854 The AVP Length field is three octets, and indicates the number of
1855 octets in this AVP including the AVP Code, AVP Length, AVP Flags,
1856 Vendor-ID field (if present) and the AVP data. If a message is
1857 received with an invalid attribute length, the message SHOULD be
1858 rejected.
1860 4.1.1. Optional Header Elements
1862 The AVP Header contains one optional field. This field is only
1863 present if the respective bit-flag is enabled.
1865 Vendor-ID
1867 The Vendor-ID field is present if the 'V' bit is set in the AVP
1868 Flags field. The optional four-octet Vendor-ID field contains the
1869 IANA assigned "SMI Network Management Private Enterprise Codes"
1870 [RFC3232] value, encoded in network byte order. Any vendor
1871 wishing to implement a vendor-specific Diameter AVP MUST use their
1872 own Vendor-ID along with their privately managed AVP address
1873 space, guaranteeing that they will not collide with any other
1874 vendor's vendor-specific AVP(s), nor with future IETF
1875 applications.
1877 A vendor ID value of zero (0) corresponds to the IETF adopted AVP
1878 values, as managed by the IANA. Since the absence of the vendor
1879 ID field implies that the AVP in question is not vendor specific,
1880 implementations MUST NOT use the zero (0) vendor ID.
1882 4.2. Basic AVP Data Formats
1884 The Data field is zero or more octets and contains information
1885 specific to the Attribute. The format and length of the Data field
1886 is determined by the AVP Code and AVP Length fields. The format of
1887 the Data field MUST be one of the following base data types or a data
1888 type derived from the base data types. In the event that a new Basic
1889 AVP Data Format is needed, a new version of this RFC MUST be created.
1891 OctetString
1893 The data contains arbitrary data of variable length. Unless
1894 otherwise noted, the AVP Length field MUST be set to at least 8
1895 (12 if the 'V' bit is enabled). AVP Values of this type that are
1896 not a multiple of four-octets in length is followed by the
1897 necessary padding so that the next AVP (if any) will start on a
1898 32-bit boundary.
1900 Integer32
1902 32 bit signed value, in network byte order. The AVP Length field
1903 MUST be set to 12 (16 if the 'V' bit is enabled).
1905 Integer64
1907 64 bit signed value, in network byte order. The AVP Length field
1908 MUST be set to 16 (20 if the 'V' bit is enabled).
1910 Unsigned32
1912 32 bit unsigned value, in network byte order. The AVP Length
1913 field MUST be set to 12 (16 if the 'V' bit is enabled).
1915 Unsigned64
1917 64 bit unsigned value, in network byte order. The AVP Length
1918 field MUST be set to 16 (20 if the 'V' bit is enabled).
1920 Float32
1922 This represents floating point values of single precision as
1923 described by [FLOATPOINT]. The 32-bit value is transmitted in
1924 network byte order. The AVP Length field MUST be set to 12 (16 if
1925 the 'V' bit is enabled).
1927 Float64
1929 This represents floating point values of double precision as
1930 described by [FLOATPOINT]. The 64-bit value is transmitted in
1931 network byte order. The AVP Length field MUST be set to 16 (20 if
1932 the 'V' bit is enabled).
1934 Grouped
1936 The Data field is specified as a sequence of AVPs. Each of these
1937 AVPs follows - in the order in which they are specified -
1938 including their headers and padding. The AVP Length field is set
1939 to 8 (12 if the 'V' bit is enabled) plus the total length of all
1940 included AVPs, including their headers and padding. Thus the AVP
1941 length field of an AVP of type Grouped is always a multiple of 4.
1943 4.3. Derived AVP Data Formats
1945 In addition to using the Basic AVP Data Formats, applications may
1946 define data formats derived from the Basic AVP Data Formats. An
1947 application that defines new AVP Derived Data Formats MUST include
1948 them in a section entitled "AVP Derived Data Formats", using the same
1949 format as the definitions below. Each new definition MUST be either
1950 defined or listed with a reference to the RFC that defines the
1951 format.
1953 The below AVP Derived Data Formats are commonly used by applications.
1955 Address
1957 The Address format is derived from the OctetString AVP Base
1958 Format. It is a discriminated union, representing, for example a
1959 32-bit (IPv4) [RFC791] or 128-bit (IPv6) [RFC4291] address, most
1960 significant octet first. The first two octets of the Address AVP
1961 represents the AddressType, which contains an Address Family
1962 defined in [IANAADFAM]. The AddressType is used to discriminate
1963 the content and format of the remaining octets.
1965 Time
1967 The Time format is derived from the OctetString AVP Base Format.
1968 The string MUST contain four octets, in the same format as the
1969 first four bytes are in the NTP timestamp format. The NTP
1970 Timestamp format is defined in chapter 3 of [RFC4330].
1972 This represents the number of seconds since 0h on 1 January 1900
1973 with respect to the Coordinated Universal Time (UTC).
1975 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow.
1976 SNTP [RFC4330] describes a procedure to extend the time to 2104.
1977 This procedure MUST be supported by all DIAMETER nodes.
1979 UTF8String
1981 The UTF8String format is derived from the OctetString AVP Base
1982 Format. This is a human readable string represented using the
1983 ISO/IEC IS 10646-1 character set, encoded as an OctetString using
1984 the UTF-8 [RFC3629] transformation format described in RFC 3629.
1986 Since additional code points are added by amendments to the 10646
1987 standard from time to time, implementations MUST be prepared to
1988 encounter any code point from 0x00000001 to 0x7fffffff. Byte
1989 sequences that do not correspond to the valid encoding of a code
1990 point into UTF-8 charset or are outside this range are prohibited.
1992 The use of control codes SHOULD be avoided. When it is necessary
1993 to represent a new line, the control code sequence CR LF SHOULD be
1994 used.
1996 The use of leading or trailing white space SHOULD be avoided.
1998 For code points not directly supported by user interface hardware
1999 or software, an alternative means of entry and display, such as
2000 hexadecimal, MAY be provided.
2002 For information encoded in 7-bit US-ASCII, the UTF-8 charset is
2003 identical to the US-ASCII charset.
2005 UTF-8 may require multiple bytes to represent a single character /
2006 code point; thus the length of an UTF8String in octets may be
2007 different from the number of characters encoded.
2009 Note that the AVP Length field of an UTF8String is measured in
2010 octets, not characters.
2012 DiameterIdentity
2014 The DiameterIdentity format is derived from the OctetString AVP
2015 Base Format.
2017 DiameterIdentity = FQDN
2019 DiameterIdentity value is used to uniquely identify a Diameter
2020 node for purposes of duplicate connection and routing loop
2021 detection.
2023 The contents of the string MUST be the FQDN of the Diameter node.
2024 If multiple Diameter nodes run on the same host, each Diameter
2025 node MUST be assigned a unique DiameterIdentity. If a Diameter
2026 node can be identified by several FQDNs, a single FQDN should be
2027 picked at startup, and used as the only DiameterIdentity for that
2028 node, whatever the connection it is sent on. Note that in this
2029 document, DiameterIdentity is in ASCII form in order to be
2030 compatible with existing DNS infrastructure. See Appendix D for
2031 interactions between the Diameter protocol and Internationalized
2032 Domain Name (IDNs).
2034 DiameterURI
2036 The DiameterURI MUST follow the Uniform Resource Identifiers (URI)
2037 syntax [RFC3986] rules specified below:
2039 "aaa://" FQDN [ port ] [ transport ] [ protocol ]
2041 ; No transport security
2043 "aaas://" FQDN [ port ] [ transport ] [ protocol ]
2045 ; Transport security used
2047 FQDN = Fully Qualified Host Name
2049 port = ":" 1*DIGIT
2051 ; One of the ports used to listen for
2052 ; incoming connections.
2053 ; If absent,
2054 ; the default Diameter port (3868) is
2055 ; assumed.
2057 transport = ";transport=" transport-protocol
2059 ; One of the transports used to listen
2060 ; for incoming connections. If absent,
2061 ; the default SCTP [RFC2960] protocol is
2062 ; assumed. UDP MUST NOT be used when
2063 ; the aaa-protocol field is set to
2064 ; diameter.
2066 transport-protocol = ( "tcp" / "sctp" / "udp" )
2068 protocol = ";protocol=" aaa-protocol
2070 ; If absent, the default AAA protocol
2071 ; is diameter.
2073 aaa-protocol = ( "diameter" / "radius" / "tacacs+" )
2075 The following are examples of valid Diameter host identities:
2077 aaa://host.example.com;transport=tcp
2078 aaa://host.example.com:6666;transport=tcp
2079 aaa://host.example.com;protocol=diameter
2080 aaa://host.example.com:6666;protocol=diameter
2081 aaa://host.example.com:6666;transport=tcp;protocol=diameter
2082 aaa://host.example.com:1813;transport=udp;protocol=radius
2084 Enumerated
2086 Enumerated is derived from the Integer32 AVP Base Format. The
2087 definition contains a list of valid values and their
2088 interpretation and is described in the Diameter application
2089 introducing the AVP.
2091 IPFilterRule
2093 The IPFilterRule format is derived from the OctetString AVP Base
2094 Format and uses the ASCII charset. The rule syntax is a modified
2095 subset of ipfw(8) from FreeBSD. Packets may be filtered based on
2096 the following information that is associated with it:
2098 Direction (in or out)
2099 Source and destination IP address (possibly masked)
2100 Protocol
2101 Source and destination port (lists or ranges)
2102 TCP flags
2103 IP fragment flag
2104 IP options
2105 ICMP types
2107 Rules for the appropriate direction are evaluated in order, with
2108 the first matched rule terminating the evaluation. Each packet is
2109 evaluated once. If no rule matches, the packet is dropped if the
2110 last rule evaluated was a permit, and passed if the last rule was
2111 a deny.
2113 IPFilterRule filters MUST follow the format:
2115 action dir proto from src to dst [options]
2117 action permit - Allow packets that match the rule.
2118 deny - Drop packets that match the rule.
2120 dir "in" is from the terminal, "out" is to the
2121 terminal.
2123 proto An IP protocol specified by number. The "ip"
2124 keyword means any protocol will match.
2126 src and dst
[ports]
2128 The may be specified as:
2129 ipno An IPv4 or IPv6 number in dotted-
2130 quad or canonical IPv6 form. Only
2131 this exact IP number will match the
2132 rule.
2133 ipno/bits An IP number as above with a mask
2134 width of the form 1.2.3.4/24. In
2135 this case, all IP numbers from
2136 1.2.3.0 to 1.2.3.255 will match.
2137 The bit width MUST be valid for the
2138 IP version and the IP number MUST
2139 NOT have bits set beyond the mask.
2140 For a match to occur, the same IP
2141 version must be present in the
2142 packet that was used in describing
2143 the IP address. To test for a
2144 particular IP version, the bits part
2145 can be set to zero. The keyword
2146 "any" is 0.0.0.0/0 or the IPv6
2147 equivalent. The keyword "assigned"
2148 is the address or set of addresses
2149 assigned to the terminal. For IPv4,
2150 a typical first rule is often "deny
2151 in ip! assigned"
2153 The sense of the match can be inverted by
2154 preceding an address with the not modifier (!),
2155 causing all other addresses to be matched
2156 instead. This does not affect the selection of
2157 port numbers.
2159 With the TCP, UDP and SCTP protocols, optional
2160 ports may be specified as:
2162 {port/port-port}[,ports[,...]]
2164 The '-' notation specifies a range of ports
2165 (including boundaries).
2167 Fragmented packets that have a non-zero offset
2168 (i.e., not the first fragment) will never match
2169 a rule that has one or more port
2170 specifications. See the frag option for
2171 details on matching fragmented packets.
2173 options:
2174 frag Match if the packet is a fragment and this is not
2175 the first fragment of the datagram. frag may not
2176 be used in conjunction with either tcpflags or
2177 TCP/UDP port specifications.
2179 ipoptions spec
2180 Match if the IP header contains the comma
2181 separated list of options specified in spec. The
2182 supported IP options are:
2184 ssrr (strict source route), lsrr (loose source
2185 route), rr (record packet route) and ts
2186 (timestamp). The absence of a particular option
2187 may be denoted with a '!'.
2189 tcpoptions spec
2190 Match if the TCP header contains the comma
2191 separated list of options specified in spec. The
2192 supported TCP options are:
2194 mss (maximum segment size), window (tcp window
2195 advertisement), sack (selective ack), ts (rfc1323
2196 timestamp) and cc (rfc1644 t/tcp connection
2197 count). The absence of a particular option may
2198 be denoted with a '!'.
2200 established
2201 TCP packets only. Match packets that have the RST
2202 or ACK bits set.
2204 setup TCP packets only. Match packets that have the SYN
2205 bit set but no ACK bit.
2207 tcpflags spec
2208 TCP packets only. Match if the TCP header
2209 contains the comma separated list of flags
2210 specified in spec. The supported TCP flags are:
2212 fin, syn, rst, psh, ack and urg. The absence of a
2213 particular flag may be denoted with a '!'. A rule
2214 that contains a tcpflags specification can never
2215 match a fragmented packet that has a non-zero
2216 offset. See the frag option for details on
2217 matching fragmented packets.
2219 icmptypes types
2220 ICMP packets only. Match if the ICMP type is in
2221 the list types. The list may be specified as any
2222 combination of ranges or individual types
2223 separated by commas. Both the numeric values and
2224 the symbolic values listed below can be used. The
2225 supported ICMP types are:
2227 echo reply (0), destination unreachable (3),
2228 source quench (4), redirect (5), echo request
2229 (8), router advertisement (9), router
2230 solicitation (10), time-to-live exceeded (11), IP
2231 header bad (12), timestamp request (13),
2232 timestamp reply (14), information request (15),
2233 information reply (16), address mask request (17)
2234 and address mask reply (18).
2236 There is one kind of packet that the access device MUST always
2237 discard, that is an IP fragment with a fragment offset of one.
2238 This is a valid packet, but it only has one use, to try to
2239 circumvent firewalls.
2241 An access device that is unable to interpret or apply a deny rule
2242 MUST terminate the session. An access device that is unable to
2243 interpret or apply a permit rule MAY apply a more restrictive
2244 rule. An access device MAY apply deny rules of its own before the
2245 supplied rules, for example to protect the access device owner's
2246 infrastructure.
2248 4.4. Grouped AVP Values
2250 The Diameter protocol allows AVP values of type 'Grouped'. This
2251 implies that the Data field is actually a sequence of AVPs. It is
2252 possible to include an AVP with a Grouped type within a Grouped type,
2253 that is, to nest them. AVPs within an AVP of type Grouped have the
2254 same padding requirements as non-Grouped AVPs, as defined in Section
2255 4.
2257 The AVP Code numbering space of all AVPs included in a Grouped AVP is
2258 the same as for non-grouped AVPs. Receivers of a Grouped AVP that
2259 does not have the 'M' (mandatory) bit set and one or more of the
2260 encapsulated AVPs within the group has the 'M' (mandatory) bit set
2261 MAY simply be ignored if the Grouped AVP itself is unrecognized.
2262 However, the encapsulated AVPs with 'M' (mandatory) bit set MUST
2263 belong to the Diameter application the Grouped APV is used in. The
2264 rule applies even if the encapsulated AVP with its 'M' (mandatory)
2265 bit set is further encapsulated within other sub-groups; i.e. other
2266 Grouped AVPs embedded within the Grouped AVP.
2268 Every Grouped AVP defined MUST include a corresponding grammar, using
2269 ABNF [RFC4234] (with modifications), as defined below.
2271 grouped-avp-def = name "::=" avp
2273 name-fmt = ALPHA *(ALPHA / DIGIT / "-")
2275 name = name-fmt
2276 ; The name has to be the name of an AVP,
2277 ; defined in the base or extended Diameter
2278 ; specifications.
2280 avp = header [ *fixed] [ *required] [ *optional]
2282 header = "<" "AVP-Header:" avpcode [vendor] ">"
2284 avpcode = 1*DIGIT
2285 ; The AVP Code assigned to the Grouped AVP
2287 vendor = 1*DIGIT
2288 ; The Vendor-ID assigned to the Grouped AVP.
2289 ; If absent, the default value of zero is
2290 ; used.
2292 4.4.1. Example AVP with a Grouped Data type
2294 The Example-AVP (AVP Code 999999) is of type Grouped and is used to
2295 clarify how Grouped AVP values work. The Grouped Data field has the
2296 following ABNF grammar:
2298 Example-AVP ::= < AVP Header: 999999 >
2299 { Origin-Host }
2300 1*{ Session-Id }
2301 *[ AVP ]
2303 An Example-AVP with Grouped Data follows.
2305 The Origin-Host AVP is required (Section 6.3). In this case:
2307 Origin-Host = "example.com".
2309 One or more Session-Ids must follow. Here there are two:
2311 Session-Id =
2312 "grump.example.com:33041;23432;893;0AF3B81"
2314 Session-Id =
2315 "grump.example.com:33054;23561;2358;0AF3B82"
2317 optional AVPs included are
2319 Recovery-Policy =
2320 2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35
2321 2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5
2322 c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd
2323 f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a
2324 cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119
2325 26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c
2326 1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92
2328 Futuristic-Acct-Record =
2329 fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0
2330 57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8
2331 17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c
2332 41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067
2333 d3427475e49968f841
2335 The data for the optional AVPs is represented in hex since the format
2336 of these AVPs is neither known at the time of definition of the
2337 Example-AVP group, nor (likely) at the time when the example instance
2338 of this AVP is interpreted - except by Diameter implementations which
2339 support the same set of AVPs. The encoding example illustrates how
2340 padding is used and how length fields are calculated. Also note that
2341 AVPs may be present in the Grouped AVP value which the receiver
2342 cannot interpret (here, the Recover-Policy and Futuristic-Acct-Record
2343 AVPs). The length of the Example-AVP is the sum of all the length of
2344 the member AVPs including their padding plus the Example-AVP header
2345 size.
2347 This AVP would be encoded as follows:
2349 0 1 2 3 4 5 6 7
2350 +-------+-------+-------+-------+-------+-------+-------+-------+
2351 0 | Example AVP Header (AVP Code = 999999), Length = 496 |
2352 +-------+-------+-------+-------+-------+-------+-------+-------+
2353 8 | Origin-Host AVP Header (AVP Code = 264), Length = 19 |
2354 +-------+-------+-------+-------+-------+-------+-------+-------+
2355 16 | 'e' | 'x' | 'a' | 'm' | 'p' | 'l' | 'e' | '.' |
2356 +-------+-------+-------+-------+-------+-------+-------+-------+
2357 24 | 'c' | 'o' | 'm' |Padding| Session-Id AVP Header |
2358 +-------+-------+-------+-------+-------+-------+-------+-------+
2359 32 | (AVP Code = 263), Length = 49 | 'g' | 'r' | 'u' | 'm' |
2360 +-------+-------+-------+-------+-------+-------+-------+-------+
2361 . . .
2362 +-------+-------+-------+-------+-------+-------+-------+-------+
2363 72 | 'F' | '3' | 'B' | '8' | '1' |Padding|Padding|Padding|
2364 +-------+-------+-------+-------+-------+-------+-------+-------+
2365 80 | Session-Id AVP Header (AVP Code = 263), Length = 50 |
2366 +-------+-------+-------+-------+-------+-------+-------+-------+
2367 88 | 'g' | 'r' | 'u' | 'm' | 'p' | '.' | 'e' | 'x' |
2368 +-------+-------+-------+-------+-------+-------+-------+-------+
2369 . . .
2370 +-------+-------+-------+-------+-------+-------+-------+-------+
2371 120| '5' | '8' | ';' | '0' | 'A' | 'F' | '3' | 'B' |
2372 +-------+-------+-------+-------+-------+-------+-------+-------+
2373 128| '8' | '2' |Padding|Padding| Recovery-Policy Header (AVP |
2374 +-------+-------+-------+-------+-------+-------+-------+-------+
2375 136| Code = 8341), Length = 223 | 0x21 | 0x63 | 0xbc | 0x1d |
2376 +-------+-------+-------+-------+-------+-------+-------+-------+
2377 144| 0x0a | 0xd8 | 0x23 | 0x71 | 0xf6 | 0xbc | 0x09 | 0x48 |
2378 +-------+-------+-------+-------+-------+-------+-------+-------+
2379 . . .
2380 +-------+-------+-------+-------+-------+-------+-------+-------+
2381 352| 0x8c | 0x7f | 0x92 |Padding| Futuristic-Acct-Record Header |
2382 +-------+-------+-------+-------+-------+-------+-------+-------+
2383 328|(AVP Code = 15930),Length = 137| 0xfe | 0x19 | 0xda | 0x58 |
2384 +-------+-------+-------+-------+-------+-------+-------+-------+
2385 336| 0x02 | 0xac | 0xd9 | 0x8b | 0x07 | 0xa5 | 0xb8 | 0xc6 |
2386 +-------+-------+-------+-------+-------+-------+-------+-------+
2387 . . .
2388 +-------+-------+-------+-------+-------+-------+-------+-------+
2389 488| 0xe4 | 0x99 | 0x68 | 0xf8 | 0x41 |Padding|Padding|Padding|
2390 +-------+-------+-------+-------+-------+-------+-------+-------+
2392 4.5. Diameter Base Protocol AVPs
2394 The following table describes the Diameter AVPs defined in the base
2395 protocol, their AVP Code values, types, possible flag values.
2397 Due to space constraints, the short form DiamIdent is used to
2398 represent DiameterIdentity.
2400 +----------------+
2401 | AVP Flag rules |
2402 |----+-----+-----|
2403 AVP Section | | |MUST |
2404 Attribute Name Code Defined Data Type |MUST| MAY | NOT |
2405 -----------------------------------------|----+-----+-----|
2406 Acct- 85 9.8.2 Unsigned32 | M | | V |
2407 Interim-Interval | | | |
2408 Accounting- 483 9.8.7 Enumerated | M | | V |
2409 Realtime-Required | | | |
2410 Acct- 50 9.8.5 UTF8String | M | | V |
2411 Multi-Session-Id | | | |
2412 Accounting- 485 9.8.3 Unsigned32 | M | | V |
2413 Record-Number | | | |
2414 Accounting- 480 9.8.1 Enumerated | M | | V |
2415 Record-Type | | | |
2416 Accounting- 44 9.8.4 OctetString| M | | V |
2417 Session-Id | | | |
2418 Accounting- 287 9.8.6 Unsigned64 | M | | V |
2419 Sub-Session-Id | | | |
2420 Acct- 259 6.9 Unsigned32 | M | | V |
2421 Application-Id | | | |
2422 Auth- 258 6.8 Unsigned32 | M | | V |
2423 Application-Id | | | |
2424 Auth-Request- 274 8.7 Enumerated | M | | V |
2425 Type | | | |
2426 Authorization- 291 8.9 Unsigned32 | M | | V |
2427 Lifetime | | | |
2428 Auth-Grace- 276 8.10 Unsigned32 | M | | V |
2429 Period | | | |
2430 Auth-Session- 277 8.11 Enumerated | M | | V |
2431 State | | | |
2432 Re-Auth-Request- 285 8.12 Enumerated | M | | V |
2433 Type | | | |
2434 Class 25 8.20 OctetString| M | | V |
2435 Destination-Host 293 6.5 DiamIdent | M | | V |
2436 Destination- 283 6.6 DiamIdent | M | | V |
2437 Realm | | | |
2438 Disconnect-Cause 273 5.4.3 Enumerated | M | | V |
2439 Error-Message 281 7.3 UTF8String | | | V,M |
2440 Error-Reporting- 294 7.4 DiamIdent | | | V,M |
2441 Host | | | |
2442 Event-Timestamp 55 8.21 Time | M | | V |
2443 Experimental- 297 7.6 Grouped | M | | V |
2444 Result | | | |
2445 -----------------------------------------|----+-----+-----|
2446 +----------------+
2447 | AVP Flag rules |
2448 |----+-----+-----|
2449 AVP Section | | | MUST|
2450 Attribute Name Code Defined Data Type |MUST| MAY | NOT|
2451 -----------------------------------------|----+-----+-----|
2452 Experimental- 298 7.7 Unsigned32 | M | | V |
2453 Result-Code | | | |
2454 Failed-AVP 279 7.5 Grouped | M | | V |
2455 Firmware- 267 5.3.4 Unsigned32 | | | V,M |
2456 Revision | | | |
2457 Host-IP-Address 257 5.3.5 Address | M | | V |
2458 Inband-Security | M | | V |
2459 -Id 299 6.10 Unsigned32 | | | |
2460 Multi-Round- 272 8.19 Unsigned32 | M | | V |
2461 Time-Out | | | |
2462 Origin-Host 264 6.3 DiamIdent | M | | V |
2463 Origin-Realm 296 6.4 DiamIdent | M | | V |
2464 Origin-State-Id 278 8.16 Unsigned32 | M | | V |
2465 Product-Name 269 5.3.7 UTF8String | | | V,M |
2466 Proxy-Host 280 6.7.3 DiamIdent | M | | V |
2467 Proxy-Info 284 6.7.2 Grouped | M | | V |
2468 Proxy-State 33 6.7.4 OctetString| M | | V |
2469 Redirect-Host 292 6.12 DiamURI | M | | V |
2470 Redirect-Host- 261 6.13 Enumerated | M | | V |
2471 Usage | | | |
2472 Redirect-Max- 262 6.14 Unsigned32 | M | | V |
2473 Cache-Time | | | |
2474 Result-Code 268 7.1 Unsigned32 | M | | V |
2475 Route-Record 282 6.7.1 DiamIdent | M | | V |
2476 Session-Id 263 8.8 UTF8String | M | | V |
2477 Session-Timeout 27 8.13 Unsigned32 | M | | V |
2478 Session-Binding 270 8.17 Unsigned32 | M | | V |
2479 Session-Server- 271 8.18 Enumerated | M | | V |
2480 Failover | | | |
2481 Supported- 265 5.3.6 Unsigned32 | M | | V |
2482 Vendor-Id | | | |
2483 Termination- 295 8.15 Enumerated | M | | V |
2484 Cause | | | |
2485 User-Name 1 8.14 UTF8String | M | | V |
2486 Vendor-Id 266 5.3.3 Unsigned32 | M | | V |
2487 Vendor-Specific- 260 6.11 Grouped | M | | V |
2488 Application-Id | | | |
2489 -----------------------------------------|----+-----+-----|
2491 5. Diameter Peers
2493 This section describes how Diameter nodes establish connections and
2494 communicate with peers.
2496 5.1. Peer Connections
2498 Although a Diameter node may have many possible peers that it is able
2499 to communicate with, it may not be economical to have an established
2500 connection to all of them. At a minimum, a Diameter node SHOULD have
2501 an established connection with two peers per realm, known as the
2502 primary and secondary peers. Of course, a node MAY have additional
2503 connections, if it is deemed necessary. Typically, all messages for
2504 a realm are sent to the primary peer, but in the event that failover
2505 procedures are invoked, any pending requests are sent to the
2506 secondary peer. However, implementations are free to load balance
2507 requests between a set of peers.
2509 Note that a given peer MAY act as a primary for a given realm, while
2510 acting as a secondary for another realm.
2512 When a peer is deemed suspect, which could occur for various reasons,
2513 including not receiving a DWA within an allotted timeframe, no new
2514 requests should be forwarded to the peer, but failover procedures are
2515 invoked. When an active peer is moved to this mode, additional
2516 connections SHOULD be established to ensure that the necessary number
2517 of active connections exists.
2519 There are two ways that a peer is removed from the suspect peer list:
2521 1. The peer is no longer reachable, causing the transport connection
2522 to be shutdown. The peer is moved to the closed state.
2524 2. Three watchdog messages are exchanged with accepted round trip
2525 times, and the connection to the peer is considered stabilized.
2527 In the event the peer being removed is either the primary or
2528 secondary, an alternate peer SHOULD replace the deleted peer, and
2529 assume the role of either primary or secondary.
2531 5.2. Diameter Peer Discovery
2533 Allowing for dynamic Diameter agent discovery will make it possible
2534 for simpler and more robust deployment of Diameter services. In
2535 order to promote interoperable implementations of Diameter peer
2536 discovery, the following mechanisms are described. These are based
2537 on existing IETF standards. The first option (manual configuration)
2538 MUST be supported by all DIAMETER nodes, while the latter option
2539 (DNS) MAY be supported.
2541 There are two cases where Diameter peer discovery may be performed.
2542 The first is when a Diameter client needs to discover a first-hop
2543 Diameter agent. The second case is when a Diameter agent needs to
2544 discover another agent - for further handling of a Diameter
2545 operation. In both cases, the following 'search order' is
2546 recommended:
2548 1. The Diameter implementation consults its list of static
2549 (manually) configured Diameter agent locations. These will be
2550 used if they exist and respond.
2552 2. The Diameter implementation performs a NAPTR query for a server
2553 in a particular realm. The Diameter implementation has to know
2554 in advance which realm to look for a Diameter agent in. This
2555 could be deduced, for example, from the 'realm' in a NAI that a
2556 Diameter implementation needed to perform a Diameter operation
2557 on.
2559 * The services relevant for the task of transport protocol
2560 selection are those with NAPTR service fields with values
2561 "AAA+D2x", where x is a letter that corresponds to a transport
2562 protocol supported by the domain. This specification defines
2563 D2T for TCP and D2S for SCTP. We also establish an IANA
2564 registry for NAPTR service name to transport protocol
2565 mappings.
2567 These NAPTR records provide a mapping from a domain, to the
2568 SRV record for contacting a server with the specific transport
2569 protocol in the NAPTR services field. The resource record
2570 will contain an empty regular expression and a replacement
2571 value, which is the SRV record for that particular transport
2572 protocol. If the server supports multiple transport
2573 protocols, there will be multiple NAPTR records, each with a
2574 different service value. As per [RFC3403], the client
2575 discards any records whose services fields are not applicable.
2576 For the purposes of this specification, several rules are
2577 defined.
2579 * A client MUST discard any service fields that identify a
2580 resolution service whose value is not "D2X", for values of X
2581 that indicate transport protocols supported by the client.
2582 The NAPTR processing as described in [RFC3403] will result in
2583 discovery of the most preferred transport protocol of the
2584 server that is supported by the client, as well as an SRV
2585 record for the server.
2587 The domain suffixes in the NAPTR replacement field SHOULD
2588 match the domain of the original query.
2590 3. If no NAPTR records are found, the requester queries for those
2591 address records for the destination address,
2592 '_diameter._sctp'.realm or '_diameter._tcp'.realm. Address
2593 records include A RR's, AAAA RR's or other similar records,
2594 chosen according to the requestor's network protocol
2595 capabilities. If the DNS server returns no address records, the
2596 requestor gives up.
2598 If the server is using a site certificate, the domain name in the
2599 query and the domain name in the replacement field MUST both be
2600 valid based on the site certificate handed out by the server in
2601 the TLS or IKE exchange. Similarly, the domain name in the SRV
2602 query and the domain name in the target in the SRV record MUST
2603 both be valid based on the same site certificate. Otherwise, an
2604 attacker could modify the DNS records to contain replacement
2605 values in a different domain, and the client could not validate
2606 that this was the desired behavior, or the result of an attack
2608 Also, the Diameter Peer MUST check to make sure that the
2609 discovered peers are authorized to act in its role.
2610 Authentication via IKE or TLS, or validation of DNS RRs via
2611 DNSSEC is not sufficient to conclude this. For example, a web
2612 server may have obtained a valid TLS certificate, and secured RRs
2613 may be included in the DNS, but this does not imply that it is
2614 authorized to act as a Diameter Server.
2616 Authorization can be achieved for example, by configuration of a
2617 Diameter Server CA. Alternatively this can be achieved by
2618 definition of OIDs within TLS or IKE certificates so as to
2619 signify Diameter Server authorization.
2621 A dynamically discovered peer causes an entry in the Peer Table (see
2622 Section 2.6) to be created. Note that entries created via DNS MUST
2623 expire (or be refreshed) within the DNS TTL. If a peer is discovered
2624 outside of the local realm, a routing table entry (see Section 2.7)
2625 for the peer's realm is created. The routing table entry's
2626 expiration MUST match the peer's expiration value.
2628 5.3. Capabilities Exchange
2630 When two Diameter peers establish a transport connection, they MUST
2631 exchange the Capabilities Exchange messages, as specified in the peer
2632 state machine (see Section 5.6). This message allows the discovery
2633 of a peer's identity and its capabilities (protocol version number,
2634 supported Diameter applications, security mechanisms, etc.)
2636 The receiver only issues commands to its peers that have advertised
2637 support for the Diameter application that defines the command. A
2638 Diameter node MUST cache the supported applications in order to
2639 ensure that unrecognized commands and/or AVPs are not unnecessarily
2640 sent to a peer.
2642 A receiver of a Capabilities-Exchange-Req (CER) message that does not
2643 have any applications in common with the sender MUST return a
2644 Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to
2645 DIAMETER_NO_COMMON_APPLICATION, and SHOULD disconnect the transport
2646 layer connection. Note that receiving a CER or CEA from a peer
2647 advertising itself as a Relay (see Section 2.4) MUST be interpreted
2648 as having common applications with the peer.
2650 The receiver of the Capabilities-Exchange-Request (CER) MUST
2651 determine common applications by computing the intersection of its
2652 own set of supported Application Id against all of the application
2653 indentifier AVPs (Auth-Application-Id, Acct-Application-Id and
2654 Vendor-Specific-Application-Id) present in the CER. The value of the
2655 Vendor-Id AVP in the Vendor-Specific-Application-Id MUST NOT be used
2656 during computation. The sender of the Capabilities-Exchange-Answer
2657 (CEA) SHOULD include all of its supported applications as a hint to
2658 the receiver regarding all of its application capabilities.
2660 Similarly, a receiver of a Capabilities-Exchange-Req (CER) message
2661 that does not have any security mechanisms in common with the sender
2662 MUST return a Capabilities-Exchange-Answer (CEA) with the Result-Code
2663 AVP set to DIAMETER_NO_COMMON_SECURITY, and SHOULD disconnect the
2664 transport layer connection.
2666 CERs received from unknown peers MAY be silently discarded, or a CEA
2667 MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER.
2668 In both cases, the transport connection is closed. If the local
2669 policy permits receiving CERs from unknown hosts, a successful CEA
2670 MAY be returned. If a CER from an unknown peer is answered with a
2671 successful CEA, the lifetime of the peer entry is equal to the
2672 lifetime of the transport connection. In case of a transport
2673 failure, all the pending transactions destined to the unknown peer
2674 can be discarded.
2676 The CER and CEA messages MUST NOT be proxied, redirected or relayed.
2678 Since the CER/CEA messages cannot be proxied, it is still possible
2679 that an upstream agent receives a message for which it has no
2680 available peers to handle the application that corresponds to the
2681 Command-Code. In such instances, the 'E' bit is set in the answer
2682 message (see Section 7.) with the Result-Code AVP set to
2683 DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action
2684 (e.g., re-routing request to an alternate peer).
2686 With the exception of the Capabilities-Exchange-Request message, a
2687 message of type Request that includes the Auth-Application-Id or
2688 Acct-Application-Id AVPs, or a message with an application-specific
2689 command code, MAY only be forwarded to a host that has explicitly
2690 advertised support for the application (or has advertised the Relay
2691 Application Id).
2693 5.3.1. Capabilities-Exchange-Request
2695 The Capabilities-Exchange-Request (CER), indicated by the Command-
2696 Code set to 257 and the Command Flags' 'R' bit set, is sent to
2697 exchange local capabilities. Upon detection of a transport failure,
2698 this message MUST NOT be sent to an alternate peer.
2700 When Diameter is run over SCTP [RFC2960], which allows for
2701 connections to span multiple interfaces and multiple IP addresses,
2702 the Capabilities-Exchange-Request message MUST contain one Host-IP-
2703 Address AVP for each potential IP address that MAY be locally used
2704 when transmitting Diameter messages.
2706 Message Format
2708 ::= < Diameter Header: 257, REQ >
2709 { Origin-Host }
2710 { Origin-Realm }
2711 1* { Host-IP-Address }
2712 { Vendor-Id }
2713 { Product-Name }
2714 [ Origin-State-Id ]
2715 * [ Supported-Vendor-Id ]
2716 * [ Auth-Application-Id ]
2717 * [ Inband-Security-Id ]
2718 * [ Acct-Application-Id ]
2719 * [ Vendor-Specific-Application-Id ]
2720 [ Firmware-Revision ]
2721 * [ AVP ]
2723 5.3.2. Capabilities-Exchange-Answer
2725 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code
2726 set to 257 and the Command Flags' 'R' bit cleared, is sent in
2727 response to a CER message.
2729 When Diameter is run over SCTP [RFC2960], which allows connections to
2730 span multiple interfaces, hence, multiple IP addresses, the
2731 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address
2732 AVP for each potential IP address that MAY be locally used when
2733 transmitting Diameter messages.
2735 Message Format
2737 ::= < Diameter Header: 257 >
2738 { Result-Code }
2739 { Origin-Host }
2740 { Origin-Realm }
2741 1* { Host-IP-Address }
2742 { Vendor-Id }
2743 { Product-Name }
2744 [ Origin-State-Id ]
2745 [ Error-Message ]
2746 [ Failed-AVP ]
2747 * [ Supported-Vendor-Id ]
2748 * [ Auth-Application-Id ]
2749 * [ Inband-Security-Id ]
2750 * [ Acct-Application-Id ]
2751 * [ Vendor-Specific-Application-Id ]
2752 [ Firmware-Revision ]
2753 * [ AVP ]
2755 5.3.3. Vendor-Id AVP
2757 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains
2758 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232]
2759 value assigned to the vendor of the Diameter device. It is
2760 envisioned that the combination of the Vendor-Id, Product-Name
2761 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may
2762 provide useful debugging information.
2764 A Vendor-Id value of zero in the CER or CEA messages is reserved and
2765 indicates that this field is ignored.
2767 5.3.4. Firmware-Revision AVP
2769 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is
2770 used to inform a Diameter peer of the firmware revision of the
2771 issuing device.
2773 For devices that do not have a firmware revision (general purpose
2774 computers running Diameter software modules, for instance), the
2775 revision of the Diameter software module may be reported instead.
2777 5.3.5. Host-IP-Address AVP
2779 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used
2780 to inform a Diameter peer of the sender's IP address. All source
2781 addresses that a Diameter node expects to use with SCTP [RFC2960]
2782 MUST be advertised in the CER and CEA messages by including a
2783 Host-IP- Address AVP for each address. This AVP MUST ONLY be used in
2784 the CER and CEA messages.
2786 5.3.6. Supported-Vendor-Id AVP
2788 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and
2789 contains the IANA "SMI Network Management Private Enterprise Codes"
2790 [RFC3232] value assigned to a vendor other than the device vendor but
2791 including the application vendor. This is used in the CER and CEA
2792 messages in order to inform the peer that the sender supports (a
2793 subset of) the vendor-specific AVPs defined by the vendor identified
2794 in this AVP. The value of this AVP SHOULD NOT be set to zero.
2795 Multiple instances of this AVP containing the same value SHOULD NOT
2796 be sent.
2798 5.3.7. Product-Name AVP
2800 The Product-Name AVP (AVP Code 269) is of type UTF8String, and
2801 contains the vendor assigned name for the product. The Product-Name
2802 AVP SHOULD remain constant across firmware revisions for the same
2803 product.
2805 5.4. Disconnecting Peer connections
2807 When a Diameter node disconnects one of its transport connections,
2808 its peer cannot know the reason for the disconnect, and will most
2809 likely assume that a connectivity problem occurred, or that the peer
2810 has rebooted. In these cases, the peer may periodically attempt to
2811 reconnect, as stated in Section 2.1. In the event that the
2812 disconnect was a result of either a shortage of internal resources,
2813 or simply that the node in question has no intentions of forwarding
2814 any Diameter messages to the peer in the foreseeable future, a
2815 periodic connection request would not be welcomed. The
2816 Disconnection-Reason AVP contains the reason the Diameter node issued
2817 the Disconnect-Peer-Request message.
2819 The Disconnect-Peer-Request message is used by a Diameter node to
2820 inform its peer of its intent to disconnect the transport layer, and
2821 that the peer shouldn't reconnect unless it has a valid reason to do
2822 so (e.g., message to be forwarded). Upon receipt of the message, the
2823 Disconnect-Peer-Answer is returned, which SHOULD contain an error if
2824 messages have recently been forwarded, and are likely in flight,
2825 which would otherwise cause a race condition.
2827 The receiver of the Disconnect-Peer-Answer initiates the transport
2828 disconnect. The sender of the Disconnect-Peer-Answer should be able
2829 to detect the transport closure and cleanup the connection.
2831 5.4.1. Disconnect-Peer-Request
2833 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set
2834 to 282 and the Command Flags' 'R' bit set, is sent to a peer to
2835 inform its intentions to shutdown the transport connection. Upon
2836 detection of a transport failure, this message MUST NOT be sent to an
2837 alternate peer.
2839 Message Format
2841 ::= < Diameter Header: 282, REQ >
2842 { Origin-Host }
2843 { Origin-Realm }
2844 { Disconnect-Cause }
2845 * [ AVP ]
2847 5.4.2. Disconnect-Peer-Answer
2849 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set
2850 to 282 and the Command Flags' 'R' bit cleared, is sent as a response
2851 to the Disconnect-Peer-Request message. Upon receipt of this
2852 message, the transport connection is shutdown.
2854 Message Format
2856 ::= < Diameter Header: 282 >
2857 { Result-Code }
2858 { Origin-Host }
2859 { Origin-Realm }
2860 [ Error-Message ]
2861 [ Failed-AVP ]
2862 * [ AVP ]
2864 5.4.3. Disconnect-Cause AVP
2866 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A
2867 Diameter node MUST include this AVP in the Disconnect-Peer-Request
2868 message to inform the peer of the reason for its intention to
2869 shutdown the transport connection. The following values are
2870 supported:
2872 REBOOTING 0
2873 A scheduled reboot is imminent. Receiver of DPR with above result
2874 code MAY attempt reconnection.
2876 BUSY 1
2877 The peer's internal resources are constrained, and it has
2878 determined that the transport connection needs to be closed.
2879 Receiver of DPR with above result code SHOULD NOT attempt
2880 reconnection.
2882 DO_NOT_WANT_TO_TALK_TO_YOU 2
2883 The peer has determined that it does not see a need for the
2884 transport connection to exist, since it does not expect any
2885 messages to be exchanged in the near future. Receiver of DPR
2886 with above result code SHOULD NOT attempt reconnection.
2888 5.5. Transport Failure Detection
2890 Given the nature of the Diameter protocol, it is recommended that
2891 transport failures be detected as soon as possible. Detecting such
2892 failures will minimize the occurrence of messages sent to unavailable
2893 agents, resulting in unnecessary delays, and will provide better
2894 failover performance. The Device-Watchdog-Request and Device-
2895 Watchdog-Answer messages, defined in this section, are used to pro-
2896 actively detect transport failures.
2898 5.5.1. Device-Watchdog-Request
2900 The Device-Watchdog-Request (DWR), indicated by the Command-Code set
2901 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no
2902 traffic has been exchanged between two peers (see Section 5.5.3).
2903 Upon detection of a transport failure, this message MUST NOT be sent
2904 to an alternate peer.
2906 Message Format
2908 ::= < Diameter Header: 280, REQ >
2909 { Origin-Host }
2910 { Origin-Realm }
2911 [ Origin-State-Id ]
2913 * [ AVP ]
2915 5.5.2. Device-Watchdog-Answer
2917 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set
2918 to 280 and the Command Flags' 'R' bit cleared, is sent as a response
2919 to the Device-Watchdog-Request message.
2921 Message Format
2923 ::= < Diameter Header: 280 >
2924 { Result-Code }
2925 { Origin-Host }
2926 { Origin-Realm }
2927 [ Error-Message ]
2928 [ Failed-AVP ]
2929 [ Origin-State-Id ]
2930 * [ AVP ]
2932 5.5.3. Transport Failure Algorithm
2934 The transport failure algorithm is defined in [RFC3539]. All
2935 Diameter implementations MUST support the algorithm defined in the
2936 specification in order to be compliant to the Diameter base protocol.
2938 5.5.4. Failover and Failback Procedures
2940 In the event that a transport failure is detected with a peer, it is
2941 necessary for all pending request messages to be forwarded to an
2942 alternate agent, if possible. This is commonly referred to as
2943 failover.
2945 In order for a Diameter node to perform failover procedures, it is
2946 necessary for the node to maintain a pending message queue for a
2947 given peer. When an answer message is received, the corresponding
2948 request is removed from the queue. The Hop-by-Hop Identifier field
2949 is used to match the answer with the queued request.
2951 When a transport failure is detected, if possible all messages in the
2952 queue are sent to an alternate agent with the T flag set. On booting
2953 a Diameter client or agent, the T flag is also set on any records
2954 still remaining to be transmitted in non-volatile storage. An
2955 example of a case where it is not possible to forward the message to
2956 an alternate server is when the message has a fixed destination, and
2957 the unavailable peer is the message's final destination (see
2958 Destination-Host AVP). Such an error requires that the agent return
2959 an answer message with the 'E' bit set and the Result-Code AVP set to
2960 DIAMETER_UNABLE_TO_DELIVER.
2962 It is important to note that multiple identical requests or answers
2963 MAY be received as a result of a failover. The End-to-End Identifier
2964 field in the Diameter header along with the Origin-Host AVP MUST be
2965 used to identify duplicate messages.
2967 As described in Section 2.1, a connection request should be
2968 periodically attempted with the failed peer in order to re-establish
2969 the transport connection. Once a connection has been successfully
2970 established, messages can once again be forwarded to the peer. This
2971 is commonly referred to as failback.
2973 5.6. Peer State Machine
2975 This section contains a finite state machine that MUST be observed by
2976 all Diameter implementations. Each Diameter node MUST follow the
2977 state machine described below when communicating with each peer.
2978 Multiple actions are separated by commas, and may continue on
2979 succeeding lines, as space requires. Similarly, state and next state
2980 may also span multiple lines, as space requires.
2982 This state machine is closely coupled with the state machine
2983 described in [RFC3539], which is used to open, close, failover,
2984 probe, and reopen transport connections. Note in particular that
2985 [RFC3539] requires the use of watchdog messages to probe connections.
2986 For Diameter, DWR and DWA messages are to be used.
2988 I- is used to represent the initiator (connecting) connection, while
2989 the R- is used to represent the responder (listening) connection.
2990 The lack of a prefix indicates that the event or action is the same
2991 regardless of the connection on which the event occurred.
2993 The stable states that a state machine may be in are Closed, I-Open
2994 and R-Open; all other states are intermediate. Note that I-Open and
2995 R-Open are equivalent except for whether the initiator or responder
2996 transport connection is used for communication.
2998 A CER message is always sent on the initiating connection immediately
2999 after the connection request is successfully completed. In the case
3000 of an election, one of the two connections will shut down. The
3001 responder connection will survive if the Origin-Host of the local
3002 Diameter entity is higher than that of the peer; the initiator
3003 connection will survive if the peer's Origin-Host is higher. All
3004 subsequent messages are sent on the surviving connection. Note that
3005 the results of an election on one peer are guaranteed to be the
3006 inverse of the results on the other.
3008 For TLS usage, a TLS handshake will begin when both ends are in the
3009 open state. If the TLS handshake is successful, all further messages
3010 will be sent via TLS. If the handshake fails, both ends move to the
3011 closed state.
3013 The state machine constrains only the behavior of a Diameter
3014 implementation as seen by Diameter peers through events on the wire.
3016 Any implementation that produces equivalent results is considered
3017 compliant.
3019 state event action next state
3020 -----------------------------------------------------------------
3021 Closed Start I-Snd-Conn-Req Wait-Conn-Ack
3022 R-Conn-CER R-Accept, R-Open
3023 Process-CER,
3024 R-Snd-CEA
3026 Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA
3027 I-Rcv-Conn-Nack Cleanup Closed
3028 R-Conn-CER R-Accept, Wait-Conn-Ack/
3029 Process-CER Elect
3030 Timeout Error Closed
3032 Wait-I-CEA I-Rcv-CEA Process-CEA I-Open
3033 R-Conn-CER R-Accept, Wait-Returns
3034 Process-CER,
3035 Elect
3036 I-Peer-Disc I-Disc Closed
3037 I-Rcv-Non-CEA Error Closed
3038 Timeout Error Closed
3040 Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns
3041 Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open
3042 R-Peer-Disc R-Disc Wait-Conn-Ack
3043 R-Conn-CER R-Reject Wait-Conn-Ack/
3044 Elect
3045 Timeout Error Closed
3047 Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open
3048 I-Peer-Disc I-Disc, R-Open
3049 R-Snd-CEA
3050 I-Rcv-CEA R-Disc I-Open
3051 R-Peer-Disc R-Disc Wait-I-CEA
3052 R-Conn-CER R-Reject Wait-Returns
3053 Timeout Error Closed
3055 R-Open Send-Message R-Snd-Message R-Open
3056 R-Rcv-Message Process R-Open
3057 R-Rcv-DWR Process-DWR, R-Open
3058 R-Snd-DWA
3059 R-Rcv-DWA Process-DWA R-Open
3060 R-Conn-CER R-Reject R-Open
3061 Stop R-Snd-DPR Closing
3062 R-Rcv-DPR R-Snd-DPA, Closed
3063 R-Disc
3065 R-Peer-Disc R-Disc Closed
3066 R-Rcv-CER R-Snd-CEA R-Open
3067 R-Rcv-CEA Process-CEA R-Open
3069 I-Open Send-Message I-Snd-Message I-Open
3070 I-Rcv-Message Process I-Open
3071 I-Rcv-DWR Process-DWR, I-Open
3072 I-Snd-DWA
3073 I-Rcv-DWA Process-DWA I-Open
3074 R-Conn-CER R-Reject I-Open
3075 Stop I-Snd-DPR Closing
3076 I-Rcv-DPR I-Snd-DPA, Closed
3077 I-Disc
3078 I-Peer-Disc I-Disc Closed
3079 I-Rcv-CER I-Snd-CEA I-Open
3080 I-Rcv-CEA Process-CEA I-Open
3082 Closing I-Rcv-DPA I-Disc Closed
3083 R-Rcv-DPA R-Disc Closed
3084 Timeout Error Closed
3085 I-Peer-Disc I-Disc Closed
3086 R-Peer-Disc R-Disc Closed
3088 5.6.1. Incoming connections
3090 When a connection request is received from a Diameter peer, it is
3091 not, in the general case, possible to know the identity of that peer
3092 until a CER is received from it. This is because host and port
3093 determine the identity of a Diameter peer; and the source port of an
3094 incoming connection is arbitrary. Upon receipt of CER, the identity
3095 of the connecting peer can be uniquely determined from Origin-Host.
3097 For this reason, a Diameter peer must employ logic separate from the
3098 state machine to receive connection requests, accept them, and await
3099 CER. Once CER arrives on a new connection, the Origin-Host that
3100 identifies the peer is used to locate the state machine associated
3101 with that peer, and the new connection and CER are passed to the
3102 state machine as an R-Conn-CER event.
3104 The logic that handles incoming connections SHOULD close and discard
3105 the connection if any message other than CER arrives, or if an
3106 implementation-defined timeout occurs prior to receipt of CER.
3108 Because handling of incoming connections up to and including receipt
3109 of CER requires logic, separate from that of any individual state
3110 machine associated with a particular peer, it is described separately
3111 in this section rather than in the state machine above.
3113 5.6.2. Events
3115 Transitions and actions in the automaton are caused by events. In
3116 this section, we will ignore the -I and -R prefix, since the actual
3117 event would be identical, but would occur on one of two possible
3118 connections.
3120 Start The Diameter application has signaled that a
3121 connection should be initiated with the peer.
3123 R-Conn-CER An acknowledgement is received stating that the
3124 transport connection has been established, and the
3125 associated CER has arrived.
3127 Rcv-Conn-Ack A positive acknowledgement is received confirming that
3128 the transport connection is established.
3130 Rcv-Conn-Nack A negative acknowledgement was received stating that
3131 the transport connection was not established.
3133 Timeout An application-defined timer has expired while waiting
3134 for some event.
3136 Rcv-CER A CER message from the peer was received.
3138 Rcv-CEA A CEA message from the peer was received.
3140 Rcv-Non-CEA A message other than CEA from the peer was received.
3142 Peer-Disc A disconnection indication from the peer was received.
3144 Rcv-DPR A DPR message from the peer was received.
3146 Rcv-DPA A DPA message from the peer was received.
3148 Win-Election An election was held, and the local node was the
3149 winner.
3151 Send-Message A message is to be sent.
3153 Rcv-Message A message other than CER, CEA, DPR, DPA, DWR or DWA
3154 was received.
3156 Stop The Diameter application has signaled that a
3157 connection should be terminated (e.g., on system
3158 shutdown).
3160 5.6.3. Actions
3162 Actions in the automaton are caused by events and typically indicate
3163 the transmission of packets and/or an action to be taken on the
3164 connection. In this section we will ignore the I- and R-prefix,
3165 since the actual action would be identical, but would occur on one of
3166 two possible connections.
3168 Snd-Conn-Req A transport connection is initiated with the peer.
3170 Accept The incoming connection associated with the R-Conn-CER
3171 is accepted as the responder connection.
3173 Reject The incoming connection associated with the R-Conn-CER
3174 is disconnected.
3176 Process-CER The CER associated with the R-Conn-CER is processed.
3177 Snd-CER A CER message is sent to the peer.
3179 Snd-CEA A CEA message is sent to the peer.
3181 Cleanup If necessary, the connection is shutdown, and any
3182 local resources are freed.
3184 Error The transport layer connection is disconnected, either
3185 politely or abortively, in response to an error
3186 condition. Local resources are freed.
3188 Process-CEA A received CEA is processed.
3190 Snd-DPR A DPR message is sent to the peer.
3192 Snd-DPA A DPA message is sent to the peer.
3194 Disc The transport layer connection is disconnected, and
3195 local resources are freed.
3197 Elect An election occurs (see Section 5.6.4 for more
3198 information).
3200 Snd-Message A message is sent.
3202 Snd-DWR A DWR message is sent.
3204 Snd-DWA A DWA message is sent.
3206 Process-DWR The DWR message is serviced.
3208 Process-DWA The DWA message is serviced.
3210 Process A message is serviced.
3212 5.6.4. The Election Process
3214 The election is performed on the responder. The responder compares
3215 the Origin-Host received in the CER with its own Origin-Host as two
3216 streams of octets. If the local Origin-Host lexicographically
3217 succeeds the received Origin-Host a Win-Election event is issued
3218 locally. Diameter identities are in ASCII form therefore the lexical
3219 comparison is consistent with DNS case insensitivity where octets
3220 that fall in the ASCII range 'a' through 'z' MUST compare equally to
3221 their upper-case counterparts between 'A' and 'Z'. See Appendix D
3222 for interactions between the Diameter protocol and Internationalized
3223 Domain Name (IDNs).
3225 The winner of the election MUST close the connection it initiated.
3226 Historically, maintaining the responder side of a connection was more
3227 efficient than maintaining the initiator side. However, current
3228 practices makes this distinction irrelevant.
3230 5.6.5. Capabilities Update
3232 A Diameter node MUST initiate peer capabilities update by sending a
3233 Capabilities-Exchange-Req (CER) to all its peers which supports peer
3234 capabilities update and is in OPEN state. The receiver of CER in
3235 open state MUST process and reply to the CER as a described in
3236 Section 5.3. The CEA which the receiver sends MUST contain its
3237 latest capabilities. Note that peers which successfully process the
3238 peer capabilities update SHOULD also update their routing tables to
3239 reflect the change. The receiver of the CEA, with a Result-Code AVP
3240 other than DIAMETER_SUCCESS, initiates the transport disconnect. The
3241 peer may periodically attempt to reconnect, as stated in Section 2.1.
3243 Peer capabilities update in the open state SHOULD be limited to the
3244 advertisement of the new list of supported applications and MUST
3245 preclude re-negotiation of security mechanism or other capabilities.
3246 If any capabilities change happens in the node (e.g. change in
3247 security mechanisms), other than a change in the supported
3248 applications, the node SHOULD gracefully terminate (setting the
3249 Disconnect-Cause AVP value to REBOOTING) and re-establish the
3250 diameter connections to all the peers.
3252 6. Diameter message processing
3254 This section describes how Diameter requests and answers are created
3255 and processed.
3257 6.1. Diameter Request Routing Overview
3259 A request is sent towards its final destination using a combination
3260 of the Destination-Realm and Destination-Host AVPs, in one of these
3261 three combinations:
3263 o a request that is not able to be proxied (such as CER) MUST NOT
3264 contain either Destination-Realm or Destination-Host AVPs.
3266 o a request that needs to be sent to a home server serving a
3267 specific realm, but not to a specific server (such as the first
3268 request of a series of round-trips), MUST contain a Destination-
3269 Realm AVP, but MUST NOT contain a Destination-Host AVP.
3271 o otherwise, a request that needs to be sent to a specific home
3272 server among those serving a given realm, MUST contain both the
3273 Destination-Realm and Destination-Host AVPs.
3275 The Destination-Host AVP is used as described above when the
3276 destination of the request is fixed, which includes:
3278 o Authentication requests that span multiple round trips
3280 o A Diameter message that uses a security mechanism that makes use
3281 of a pre-established session key shared between the source and the
3282 final destination of the message.
3284 o Server initiated messages that MUST be received by a specific
3285 Diameter client (e.g., access device), such as the Abort-Session-
3286 Request message, which is used to request that a particular user's
3287 session be terminated.
3289 Note that an agent can forward a request to a host described in the
3290 Destination-Host AVP only if the host in question is included in its
3291 peer table (see Section 2.7). Otherwise, the request is routed based
3292 on the Destination-Realm only (see Sections 6.1.6).
3294 The Destination-Realm AVP MUST be present if the message is
3295 proxiable. A message that MUST NOT be forwarded by Diameter agents
3296 (proxies, redirects or relays) MUST NOT include the Destination-Realm
3297 in its ABNF. For Diameter clients, the value of the Destination-
3298 Realm AVP MAY be extracted from the User-Name AVP, or other
3299 application-specific methods.
3301 When a message is received, the message is processed in the following
3302 order:
3304 o If the message is destined for the local host, the procedures
3305 listed in Section 6.1.4 are followed.
3307 o If the message is intended for a Diameter peer with whom the local
3308 host is able to directly communicate, the procedures listed in
3309 Section 6.1.5 are followed. This is known as Request Forwarding.
3311 o The procedures listed in Section 6.1.6 are followed, which is
3312 known as Request Routing.
3314 o If none of the above is successful, an answer is returned with the
3315 Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the E-bit set.
3317 For routing of Diameter messages to work within an administrative
3318 domain, all Diameter nodes within the realm MUST be peers.
3320 Note the processing rules contained in this section are intended to
3321 be used as general guidelines to Diameter developers. Certain
3322 implementations MAY use different methods than the ones described
3323 here, and still comply with the protocol specification. See Section
3324 7 for more detail on error handling.
3326 6.1.1. Originating a Request
3328 When creating a request, in addition to any other procedures
3329 described in the application definition for that specific request,
3330 the following procedures MUST be followed:
3332 o the Command-Code is set to the appropriate value
3334 o the 'R' bit is set
3336 o the End-to-End Identifier is set to a locally unique value
3338 o the Origin-Host and Origin-Realm AVPs MUST be set to the
3339 appropriate values, used to identify the source of the message
3341 o the Destination-Host and Destination-Realm AVPs MUST be set to the
3342 appropriate values as described in Section 6.1.
3344 6.1.2. Sending a Request
3346 When sending a request, originated either locally, or as the result
3347 of a forwarding or routing operation, the following procedures MUST
3348 be followed:
3350 o the Hop-by-Hop Identifier should be set to a locally unique value.
3352 o The message should be saved in the list of pending requests.
3354 Other actions to perform on the message based on the particular role
3355 the agent is playing are described in the following sections.
3357 6.1.3. Receiving Requests
3359 A relay or proxy agent MUST check for forwarding loops when receiving
3360 requests. A loop is detected if the server finds its own identity in
3361 a Route-Record AVP. When such an event occurs, the agent MUST answer
3362 with the Result-Code AVP set to DIAMETER_LOOP_DETECTED.
3364 6.1.4. Processing Local Requests
3366 A request is known to be for local consumption when one of the
3367 following conditions occur:
3369 o The Destination-Host AVP contains the local host's identity,
3371 o The Destination-Host AVP is not present, the Destination-Realm AVP
3372 contains a realm the server is configured to process locally, and
3373 the Diameter application is locally supported, or
3375 o Both the Destination-Host and the Destination-Realm are not
3376 present.
3378 When a request is locally processed, the rules in Section 6.2 should
3379 be used to generate the corresponding answer.
3381 6.1.5. Request Forwarding
3383 Request forwarding is done using the Diameter Peer Table. The
3384 Diameter peer table contains all of the peers that the local node is
3385 able to directly communicate with.
3387 When a request is received, and the host encoded in the Destination-
3388 Host AVP is one that is present in the peer table, the message SHOULD
3389 be forwarded to the peer.
3391 6.1.6. Request Routing
3393 Diameter request message routing is done via realms and applications.
3394 A Diameter message that may be forwarded by Diameter agents (proxies,
3395 redirects or relays) MUST include the target realm in the
3396 Destination-Realm AVP. Request routing SHOULD rely on the
3397 Destination-Realm AVP and the Application Id present in the request
3398 message header to aid in the routing decision. The realm MAY be
3399 retrieved from the User-Name AVP, which is in the form of a Network
3400 Access Identifier (NAI). The realm portion of the NAI is inserted in
3401 the Destination-Realm AVP.
3403 Diameter agents MAY have a list of locally supported realms and
3404 applications, and MAY have a list of externally supported realms and
3405 applications. When a request is received that includes a realm
3406 and/or application that is not locally supported, the message is
3407 routed to the peer configured in the Routing Table (see Section 2.7).
3409 Realm names and Application Ids are the minimum supported routing
3410 criteria, additional routing information maybe needed to support
3411 redirect semantics.
3413 6.1.7. Predictive Loop Avoidance
3415 Before forwarding or routing a request, Diameter agents, in addition
3416 to processing done in Section 6.1.3, SHOULD check for the presence of
3417 candidate route's peer identity in any of the Route-Record AVPs. In
3418 an event of the agent detecting the presence of a candidate route's
3419 peer identity in a Route-Record AVP, the agent MUST ignore such route
3420 for the Diameter request message and attempt alternate routes if any.
3421 In case all the candidate routes are eliminated by the above
3422 criteria, the agent SHOULD return DIAMETER_UNABLE_TO_DELIVER message.
3424 6.1.8. Redirecting requests
3426 When a redirect agent receives a request whose routing entry is set
3427 to REDIRECT, it MUST reply with an answer message with the 'E' bit
3428 set, while maintaining the Hop-by-Hop Identifier in the header, and
3429 include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of
3430 the servers associated with the routing entry are added in separate
3431 Redirect-Host AVP.
3433 +------------------+
3434 | Diameter |
3435 | Redirect Agent |
3436 +------------------+
3437 ^ | 2. command + 'E' bit
3438 1. Request | | Result-Code =
3439 joe@example.com | | DIAMETER_REDIRECT_INDICATION +
3440 | | Redirect-Host AVP(s)
3441 | v
3442 +-------------+ 3. Request +-------------+
3443 | example.com |------------->| example.net |
3444 | Relay | | Diameter |
3445 | Agent |<-------------| Server |
3446 +-------------+ 4. Answer +-------------+
3448 Figure 5: Diameter Redirect Agent
3450 The receiver of the answer message with the 'E' bit set, and the
3451 Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-by-
3452 hop field in the Diameter header to identify the request in the
3453 pending message queue (see Section 5.3) that is to be redirected. If
3454 no transport connection exists with the new agent, one is created,
3455 and the request is sent directly to it.
3457 Multiple Redirect-Host AVPs are allowed. The receiver of the answer
3458 message with the 'E' bit set selects exactly one of these hosts as
3459 the destination of the redirected message.
3461 When the Redirect-Host-Usage AVP included in the answer message has a
3462 non-zero value, a route entry for the redirect indications is created
3463 and cached by the receiver. The redirect usage for such route entry
3464 is set by the value of Redirect-Host-Usage AVP and the lifetime of
3465 the cached route entry is set by Redirect-Max-Cache-Time AVP value.
3467 It is possible that multiple redirect indications can create multiple
3468 cached route entries differing only in their redirect usage and the
3469 peer to forward messages to. As an example, two(2) route entries
3470 that are created by two(2) redirect indications results in two(2)
3471 cached routes for the same realm and Application Id. However, one
3472 has a redirect usage of ALL_SESSION where matching request will be
3473 forwarded to one peer and the other has a redirect usage of ALL_REALM
3474 where request are forwarded to another peer. Therefore, an incoming
3475 request that matches the realm and Application Id of both routes will
3476 need additional resolution. In such a case, a routing precedence
3477 rule MUST be used againt the redirect usage value to resolve the
3478 contention. The precedence rule can be found in Section 6.13.
3480 6.1.9. Relaying and Proxying Requests
3482 A relay or proxy agent MUST append a Route-Record AVP to all requests
3483 forwarded. The AVP contains the identity of the peer the request was
3484 received from.
3486 The Hop-by-Hop identifier in the request is saved, and replaced with
3487 a locally unique value. The source of the request is also saved,
3488 which includes the IP address, port and protocol.
3490 A relay or proxy agent MAY include the Proxy-Info AVP in requests if
3491 it requires access to any local state information when the
3492 corresponding response is received. Proxy-Info AVP has certain
3493 security implications and SHOULD contain an embedded HMAC with a
3494 node-local key. Alternatively, it MAY simply use local storage to
3495 store state information.
3497 The message is then forwarded to the next hop, as identified in the
3498 Routing Table.
3500 Figure 6 provides an example of message routing using the procedures
3501 listed in these sections.
3503 (Origin-Host=nas.mno.net) (Origin-Host=nas.mno.net)
3504 (Origin-Realm=mno.net) (Origin-Realm=mno.net)
3505 (Destination-Realm=example.com) (Destination-
3506 Realm=example.com)
3507 (Route-Record=nas.example.net)
3508 +------+ ------> +------+ ------> +------+
3509 | | (Request) | | (Request) | |
3510 | NAS +-------------------+ DRL +-------------------+ HMS |
3511 | | | | | |
3512 +------+ <------ +------+ <------ +------+
3513 example.net (Answer) example.net (Answer) example.com
3514 (Origin-Host=hms.example.com) (Origin-Host=hms.example.com)
3515 (Origin-Realm=example.com) (Origin-Realm=example.com)
3517 Figure 6: Routing of Diameter messages
3519 Relay and proxy agents are not required to perform full validation of
3520 incoming messages. At a minimum, validation of the message header
3521 and relevant routing AVPs has to be done when relaying messages.
3522 Proxy agents may optionally perform more in-depth message validation
3523 for applications it is interested in.
3525 6.2. Diameter Answer Processing
3527 When a request is locally processed, the following procedures MUST be
3528 applied to create the associated answer, in addition to any
3529 additional procedures that MAY be discussed in the Diameter
3530 application defining the command:
3532 o The same Hop-by-Hop identifier in the request is used in the
3533 answer.
3535 o The local host's identity is encoded in the Origin-Host AVP.
3537 o The Destination-Host and Destination-Realm AVPs MUST NOT be
3538 present in the answer message.
3540 o The Result-Code AVP is added with its value indicating success or
3541 failure.
3543 o If the Session-Id is present in the request, it MUST be included
3544 in the answer.
3546 o Any Proxy-Info AVPs in the request MUST be added to the answer
3547 message, in the same order they were present in the request.
3549 o The 'P' bit is set to the same value as the one in the request.
3551 o The same End-to-End identifier in the request is used in the
3552 answer.
3554 Note that the error messages (see Section 7.3) are also subjected to
3555 the above processing rules.
3557 6.2.1. Processing received Answers
3559 A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an
3560 answer received against the list of pending requests. The
3561 corresponding message should be removed from the list of pending
3562 requests. It SHOULD ignore answers received that do not match a
3563 known Hop-by-Hop Identifier.
3565 6.2.2. Relaying and Proxying Answers
3567 If the answer is for a request which was proxied or relayed, the
3568 agent MUST restore the original value of the Diameter header's Hop-
3569 by-Hop Identifier field.
3571 If the last Proxy-Info AVP in the message is targeted to the local
3572 Diameter server, the AVP MUST be removed before the answer is
3573 forwarded.
3575 If a relay or proxy agent receives an answer with a Result-Code AVP
3576 indicating a failure, it MUST NOT modify the contents of the AVP.
3577 Any additional local errors detected SHOULD be logged, but not
3578 reflected in the Result-Code AVP. If the agent receives an answer
3579 message with a Result-Code AVP indicating success, and it wishes to
3580 modify the AVP to indicate an error, it MUST modify the Result-Code
3581 AVP to contain the appropriate error in the message destined towards
3582 the access device as well as include the Error-Reporting-Host AVP and
3583 it MUST issue an STR on behalf of the access device.
3585 The agent MUST then send the answer to the host that it received the
3586 original request from.
3588 6.3. Origin-Host AVP
3590 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and
3591 MUST be present in all Diameter messages. This AVP identifies the
3592 endpoint that originated the Diameter message. Relay agents MUST NOT
3593 modify this AVP.
3595 The value of the Origin-Host AVP is guaranteed to be unique within a
3596 single host.
3598 Note that the Origin-Host AVP may resolve to more than one address as
3599 the Diameter peer may support more than one address.
3601 This AVP SHOULD be placed as close to the Diameter header as
3602 possible.
3604 6.4. Origin-Realm AVP
3606 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity.
3607 This AVP contains the Realm of the originator of any Diameter message
3608 and MUST be present in all messages.
3610 This AVP SHOULD be placed as close to the Diameter header as
3611 possible.
3613 6.5. Destination-Host AVP
3615 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity.
3616 This AVP MUST be present in all unsolicited agent initiated messages,
3617 MAY be present in request messages, and MUST NOT be present in Answer
3618 messages.
3620 The absence of the Destination-Host AVP will cause a message to be
3621 sent to any Diameter server supporting the application within the
3622 realm specified in Destination-Realm AVP.
3624 This AVP SHOULD be placed as close to the Diameter header as
3625 possible.
3627 6.6. Destination-Realm AVP
3629 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity,
3630 and contains the realm the message is to be routed to. The
3631 Destination-Realm AVP MUST NOT be present in Answer messages.
3632 Diameter Clients insert the realm portion of the User-Name AVP.
3633 Diameter servers initiating a request message use the value of the
3634 Origin-Realm AVP from a previous message received from the intended
3635 target host (unless it is known a priori). When present, the
3636 Destination-Realm AVP is used to perform message routing decisions.
3638 Request messages whose ABNF does not list the Destination-Realm AVP
3639 as a mandatory AVP are inherently non-routable messages.
3641 This AVP SHOULD be placed as close to the Diameter header as
3642 possible.
3644 6.7. Routing AVPs
3646 The AVPs defined in this section are Diameter AVPs used for routing
3647 purposes. These AVPs change as Diameter messages are processed by
3648 agents.
3650 6.7.1. Route-Record AVP
3652 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The
3653 identity added in this AVP MUST be the same as the one received in
3654 the Origin-Host of the Capabilities Exchange message.
3656 6.7.2. Proxy-Info AVP
3658 The Proxy-Info AVP (AVP Code 284) is of type Grouped. The Grouped
3659 Data field has the following ABNF grammar:
3661 Proxy-Info ::= < AVP Header: 284 >
3662 { Proxy-Host }
3663 { Proxy-State }
3664 * [ AVP ]
3666 6.7.3. Proxy-Host AVP
3668 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This
3669 AVP contains the identity of the host that added the Proxy-Info AVP.
3671 6.7.4. Proxy-State AVP
3673 The Proxy-State AVP (AVP Code 33) is of type OctetString, and
3674 contains state local information, and MUST be treated as opaque data.
3676 6.8. Auth-Application-Id AVP
3678 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and
3679 is used in order to advertise support of the Authentication and
3680 Authorization portion of an application (see Section 2.4). If
3681 present in a message other than CER and CEA, the value of the Auth-
3682 Application-Id AVP MUST match the Application Id present in the
3683 Diameter message header.
3685 6.9. Acct-Application-Id AVP
3687 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and
3688 is used in order to advertise support of the Accounting portion of an
3689 application (see Section 2.4). If present in a message other than
3690 CER and CEA, the value of the Acct-Application-Id AVP MUST match the
3691 Application Id present in the Diameter message header.
3693 6.10. Inband-Security-Id AVP
3695 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and
3696 is used in order to advertise support of the Security portion of the
3697 application.
3699 Currently, the following values are supported, but there is ample
3700 room to add new security Ids.
3702 NO_INBAND_SECURITY 0
3704 This peer does not support TLS. This is the default value, if the
3705 AVP is omitted.
3707 TLS 1
3709 This node supports TLS security, as defined by [RFC4346].
3711 6.11. Vendor-Specific-Application-Id AVP
3713 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type
3714 Grouped and is used to advertise support of a vendor-specific
3715 Diameter Application. Exactly one instance of either Auth-
3716 Application-Id or Acct-Application-Id AVP MUST be present. The
3717 Application Id carried by either Auth-Application-Id or Acct-
3718 Application-Id AVP MUST comply with vendor specific Application Id
3719 assignment described in Sec 11.3. It MUST also match the Application
3720 Id present in the diameter header except when used in a CER or CEA
3721 messages.
3723 The Vendor-Id AVP is an informational AVP pertaining to the vendor
3724 who may have authorship of the vendor-specific Diameter application.
3725 It MUST NOT be used as a means of defining a completely separate
3726 vendor-specific Application Id space.
3728 This AVP MUST also be present as the first AVP in all experimental
3729 commands defined in the vendor-specific application.
3731 This AVP SHOULD be placed as close to the Diameter header as
3732 possible.
3734 AVP Format
3736 ::= < AVP Header: 260 >
3737 { Vendor-Id }
3738 [ Auth-Application-Id ]
3739 [ Acct-Application-Id ]
3741 A Vendor-Specific-Application-Id AVP MUST contain exactly one of
3742 either Auth-Application-Id or Acct-Application-Id. If a Vendor-
3743 Specific-Application-Id is received without any of these two AVPs,
3744 then the recipient SHOULD issue an answer with a Result-Code set to
3745 DIAMETER_MISSING_AVP. The answer SHOULD also include a Failed-AVP
3746 which MUST contain an example of an Auth-Application-Id AVP and an
3747 Acct-Application-Id AVP.
3749 If a Vendor-Specific-Application-Id is received that contains both
3750 Auth-Application-Id and Acct-Application-Id, then the recipient
3751 SHOULD issue an answer with Result-Code set to
3752 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. The answer SHOULD also include a
3753 Failed-AVP which MUST contain the received Auth-Application-Id AVP
3754 and Acct-Application-Id AVP.
3756 6.12. Redirect-Host AVP
3758 One or more of instances of this AVP MUST be present if the answer
3759 message's 'E' bit is set and the Result-Code AVP is set to
3760 DIAMETER_REDIRECT_INDICATION.
3762 Upon receiving the above, the receiving Diameter node SHOULD forward
3763 the request directly to one of the hosts identified in these AVPs.
3764 The server contained in the selected Redirect-Host AVP SHOULD be used
3765 for all messages pertaining to this session.
3767 6.13. Redirect-Host-Usage AVP
3769 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated.
3770 This AVP MAY be present in answer messages whose 'E' bit is set and
3771 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION.
3773 When present, this AVP dictates how the routing entry resulting from
3774 the Redirect-Host is to be used. The following values are supported:
3776 DONT_CACHE 0
3778 The host specified in the Redirect-Host AVP should not be cached.
3779 This is the default value.
3781 ALL_SESSION 1
3783 All messages within the same session, as defined by the same value
3784 of the Session-ID AVP MAY be sent to the host specified in the
3785 Redirect-Host AVP.
3787 ALL_REALM 2
3789 All messages destined for the realm requested MAY be sent to the
3790 host specified in the Redirect-Host AVP.
3792 REALM_AND_APPLICATION 3
3794 All messages for the application requested to the realm specified
3795 MAY be sent to the host specified in the Redirect-Host AVP.
3797 ALL_APPLICATION 4
3799 All messages for the application requested MAY be sent to the host
3800 specified in the Redirect-Host AVP.
3802 ALL_HOST 5
3804 All messages that would be sent to the host that generated the
3805 Redirect-Host MAY be sent to the host specified in the Redirect-
3806 Host AVP.
3808 ALL_USER 6
3810 All messages for the user requested MAY be sent to the host
3811 specified in the Redirect-Host AVP.
3813 When multiple cached routes are created by redirect indications and
3814 they differ only in redirect usage and peers to forward requests to
3815 (see Section 6.1.8), a precedence rule MUST be applied to the
3816 redirect usage values of the cached routes during normal routing to
3817 resolve contentions that may occur. The precedence rule is the order
3818 that dictate which redirect usage should be considered before any
3819 other as they appear. The order is as follows:
3821 1. ALL_SESSION
3823 2. ALL_USER
3825 3. REALM_AND_APPLICATION
3827 4. ALL_REALM
3829 5. ALL_APPLICATION
3831 6. ALL_HOST
3833 6.14. Redirect-Max-Cache-Time AVP
3835 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32.
3836 This AVP MUST be present in answer messages whose 'E' bit is set, the
3837 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the
3838 Redirect-Host-Usage AVP set to a non-zero value.
3840 This AVP contains the maximum number of seconds the peer and route
3841 table entries, created as a result of the Redirect-Host, will be
3842 cached. Note that once a host created due to a redirect indication
3843 is no longer reachable, any associated peer and routing table entries
3844 MUST be deleted.
3846 7. Error Handling
3848 There are two different types of errors in Diameter; protocol and
3849 application errors. A protocol error is one that occurs at the base
3850 protocol level, and MAY require per hop attention (e.g., message
3851 routing error). Application errors, on the other hand, generally
3852 occur due to a problem with a function specified in a Diameter
3853 application (e.g., user authentication, Missing AVP).
3855 Result-Code AVP values that are used to report protocol errors MUST
3856 only be present in answer messages whose 'E' bit is set. When a
3857 request message is received that causes a protocol error, an answer
3858 message is returned with the 'E' bit set, and the Result-Code AVP is
3859 set to the appropriate protocol error value. As the answer is sent
3860 back towards the originator of the request, each proxy or relay agent
3861 MAY take action on the message.
3863 1. Request +---------+ Link Broken
3864 +-------------------------->|Diameter |----///----+
3865 | +---------------------| | v
3866 +------+--+ | 2. answer + 'E' set | Relay 2 | +--------+
3867 |Diameter |<-+ (Unable to Forward) +---------+ |Diameter|
3868 | | | Home |
3869 | Relay 1 |--+ +---------+ | Server |
3870 +---------+ | 3. Request |Diameter | +--------+
3871 +-------------------->| | ^
3872 | Relay 3 |-----------+
3873 +---------+
3875 Figure 7: Example of Protocol Error causing answer message
3877 Figure 7 provides an example of a message forwarded upstream by a
3878 Diameter relay. When the message is received by Relay 2, and it
3879 detects that it cannot forward the request to the home server, an
3880 answer message is returned with the 'E' bit set and the Result-Code
3881 AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls
3882 within the protocol error category, Relay 1 would take special
3883 action, and given the error, attempt to route the message through its
3884 alternate Relay 3.
3886 +---------+ 1. Request +---------+ 2. Request +---------+
3887 | Access |------------>|Diameter |------------>|Diameter |
3888 | | | | | Home |
3889 | Device |<------------| Relay |<------------| Server |
3890 +---------+ 4. Answer +---------+ 3. Answer +---------+
3891 (Missing AVP) (Missing AVP)
3893 Figure 8: Example of Application Error Answer message
3895 Figure 8 provides an example of a Diameter message that caused an
3896 application error. When application errors occur, the Diameter
3897 entity reporting the error clears the 'R' bit in the Command Flags,
3898 and adds the Result-Code AVP with the proper value. Application
3899 errors do not require any proxy or relay agent involvement, and
3900 therefore the message would be forwarded back to the originator of
3901 the request.
3903 There are certain Result-Code AVP application errors that require
3904 additional AVPs to be present in the answer. In these cases, the
3905 Diameter node that sets the Result-Code AVP to indicate the error
3906 MUST add the AVPs. Examples are:
3908 o An unrecognized AVP is received with the 'M' bit (Mandatory bit)
3909 set, causes an answer to be sent with the Result-Code AVP set to
3910 DIAMETER_AVP_UNSUPPORTED, and the Failed-AVP AVP containing the
3911 offending AVP.
3913 o An AVP that is received with an unrecognized value causes an
3914 answer to be returned with the Result-Code AVP set to
3915 DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the
3916 AVP causing the error.
3918 o A command is received with an AVP that is omitted, yet is
3919 mandatory according to the command's ABNF. The receiver issues an
3920 answer with the Result-Code set to DIAMETER_MISSING_AVP, and
3921 creates an AVP with the AVP Code and other fields set as expected
3922 in the missing AVP. The created AVP is then added to the Failed-
3923 AVP AVP.
3925 The Result-Code AVP describes the error that the Diameter node
3926 encountered in its processing. In case there are multiple errors,
3927 the Diameter node MUST report only the first error it encountered
3928 (detected possibly in some implementation dependent order). The
3929 specific errors that can be described by this AVP are described in
3930 the following section.
3932 7.1. Result-Code AVP
3934 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and
3935 indicates whether a particular request was completed successfully or
3936 whether an error occurred. All Diameter answer messages defined in
3937 IETF applications MUST include one Result-Code AVP. A non-successful
3938 Result-Code AVP (one containing a non 2xxx value other than
3939 DIAMETER_REDIRECT_INDICATION) MUST include the Error-Reporting-Host
3940 AVP if the host setting the Result-Code AVP is different from the
3941 identity encoded in the Origin-Host AVP.
3943 The Result-Code data field contains an IANA-managed 32-bit address
3944 space representing errors (see Section 11.4). Diameter provides the
3945 following classes of errors, all identified by the thousands digit in
3946 the decimal notation:
3948 o 1xxx (Informational)
3950 o 2xxx (Success)
3952 o 3xxx (Protocol Errors)
3954 o 4xxx (Transient Failures)
3956 o 5xxx (Permanent Failure)
3958 A non-recognized class (one whose first digit is not defined in this
3959 section) MUST be handled as a permanent failure.
3961 7.1.1. Informational
3963 Errors that fall within this category are used to inform the
3964 requester that a request could not be satisfied, and additional
3965 action is required on its part before access is granted.
3967 DIAMETER_MULTI_ROUND_AUTH 1001
3969 This informational error is returned by a Diameter server to
3970 inform the access device that the authentication mechanism being
3971 used requires multiple round trips, and a subsequent request needs
3972 to be issued in order for access to be granted.
3974 7.1.2. Success
3976 Errors that fall within the Success category are used to inform a
3977 peer that a request has been successfully completed.
3979 DIAMETER_SUCCESS 2001
3981 The Request was successfully completed.
3983 DIAMETER_LIMITED_SUCCESS 2002
3985 When returned, the request was successfully completed, but
3986 additional processing is required by the application in order to
3987 provide service to the user.
3989 7.1.3. Protocol Errors
3991 Errors that fall within the Protocol Error category SHOULD be treated
3992 on a per-hop basis, and Diameter proxies MAY attempt to correct the
3993 error, if it is possible. Note that these errors MUST only be used
3994 in answer messages whose 'E' bit is set. To provide backward
3995 compatibility with existing implementations that follow [RFC3588],
3996 some of the error values that have previously been used in this
3997 category by [RFC3588] will not be re-used. Therefore the error
3998 values enumerated here may be non-sequential.
4000 DIAMETER_UNABLE_TO_DELIVER 3002
4002 This error is given when Diameter can not deliver the message to
4003 the destination, either because no host within the realm
4004 supporting the required application was available to process the
4005 request, or because Destination-Host AVP was given without the
4006 associated Destination-Realm AVP.
4008 DIAMETER_REALM_NOT_SERVED 3003
4010 The intended realm of the request is not recognized.
4012 DIAMETER_TOO_BUSY 3004
4014 When returned, a Diameter node SHOULD attempt to send the message
4015 to an alternate peer. This error MUST only be used when a
4016 specific server is requested, and it cannot provide the requested
4017 service.
4019 DIAMETER_LOOP_DETECTED 3005
4021 An agent detected a loop while trying to get the message to the
4022 intended recipient. The message MAY be sent to an alternate peer,
4023 if one is available, but the peer reporting the error has
4024 identified a configuration problem.
4026 DIAMETER_REDIRECT_INDICATION 3006
4028 A redirect agent has determined that the request could not be
4029 satisfied locally and the initiator of the request should direct
4030 the request directly to the server, whose contact information has
4031 been added to the response. When set, the Redirect-Host AVP MUST
4032 be present.
4034 DIAMETER_APPLICATION_UNSUPPORTED 3007
4036 A request was sent for an application that is not supported.
4038 DIAMETER_INVALID_BIT_IN_HEADER 3011
4040 This error is returned when a reserved bit in the Diameter header
4041 is set to one (1) or the bits in the Diameter header defined in
4042 Sec 3 are set incorrectly.
4044 DIAMETER_INVALID_MESSAGE_LENGTH 3012
4046 This error is returned when a request is received with an invalid
4047 message length.
4049 7.1.4. Transient Failures
4051 Errors that fall within the transient failures category are used to
4052 inform a peer that the request could not be satisfied at the time it
4053 was received, but MAY be able to satisfy the request in the future.
4054 Note that these errors MUST be used in answer messages whose 'E' bit
4055 is not set.
4057 DIAMETER_AUTHENTICATION_REJECTED 4001
4059 The authentication process for the user failed, most likely due to
4060 an invalid password used by the user. Further attempts MUST only
4061 be tried after prompting the user for a new password.
4063 DIAMETER_OUT_OF_SPACE 4002
4065 A Diameter node received the accounting request but was unable to
4066 commit it to stable storage due to a temporary lack of space.
4068 ELECTION_LOST 4003
4070 The peer has determined that it has lost the election process and
4071 has therefore disconnected the transport connection.
4073 7.1.5. Permanent Failures
4075 Errors that fall within the permanent failures category are used to
4076 inform the peer that the request failed, and should not be attempted
4077 again. Note that these errors SHOULD be used in answer messages
4078 whose 'E' bit is not set. In error conditions where it is not
4079 possible or efficient to compose application specific answer grammar
4080 then answer messages with E-bit set and complying to the grammar
4081 described in 7.2 MAY also be used for permanent errors.
4083 To provide backward compatibility with existing implementations that
4084 follow [RFC3588], some of the error values that have previously been
4085 used in this category by [RFC3588] will not be re-used. Therefore
4086 the error values enumerated here maybe non-sequential.
4088 DIAMETER_AVP_UNSUPPORTED 5001
4090 The peer received a message that contained an AVP that is not
4091 recognized or supported and was marked with the Mandatory bit. A
4092 Diameter message with this error MUST contain one or more Failed-
4093 AVP AVP containing the AVPs that caused the failure.
4095 DIAMETER_UNKNOWN_SESSION_ID 5002
4097 The request contained an unknown Session-Id.
4099 DIAMETER_AUTHORIZATION_REJECTED 5003
4101 A request was received for which the user could not be authorized.
4102 This error could occur if the service requested is not permitted
4103 to the user.
4105 DIAMETER_INVALID_AVP_VALUE 5004
4107 The request contained an AVP with an invalid value in its data
4108 portion. A Diameter message indicating this error MUST include
4109 the offending AVPs within a Failed-AVP AVP.
4111 DIAMETER_MISSING_AVP 5005
4113 The request did not contain an AVP that is required by the Command
4114 Code definition. If this value is sent in the Result-Code AVP, a
4115 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP
4116 AVP MUST contain an example of the missing AVP complete with the
4117 Vendor-Id if applicable. The value field of the missing AVP
4118 should be of correct minimum length and contain zeroes.
4120 DIAMETER_RESOURCES_EXCEEDED 5006
4122 A request was received that cannot be authorized because the user
4123 has already expended allowed resources. An example of this error
4124 condition is a user that is restricted to one dial-up PPP port,
4125 attempts to establish a second PPP connection.
4127 DIAMETER_CONTRADICTING_AVPS 5007
4129 The Home Diameter server has detected AVPs in the request that
4130 contradicted each other, and is not willing to provide service to
4131 the user. The Failed-AVP AVPs MUST be present which contains the
4132 AVPs that contradicted each other.
4134 DIAMETER_AVP_NOT_ALLOWED 5008
4136 A message was received with an AVP that MUST NOT be present. The
4137 Failed-AVP AVP MUST be included and contain a copy of the
4138 offending AVP.
4140 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009
4142 A message was received that included an AVP that appeared more
4143 often than permitted in the message definition. The Failed-AVP
4144 AVP MUST be included and contain a copy of the first instance of
4145 the offending AVP that exceeded the maximum number of occurrences
4147 DIAMETER_NO_COMMON_APPLICATION 5010
4149 This error is returned by a Diameter node that is not acting as a
4150 relay when it receives a CER which advertises a set of
4151 applications that it does not support.
4153 DIAMETER_UNSUPPORTED_VERSION 5011
4155 This error is returned when a request was received, whose version
4156 number is unsupported.
4158 DIAMETER_UNABLE_TO_COMPLY 5012
4160 This error is returned when a request is rejected for unspecified
4161 reasons.
4163 DIAMETER_INVALID_AVP_LENGTH 5014
4165 The request contained an AVP with an invalid length. A Diameter
4166 message indicating this error MUST include the offending AVPs
4167 within a Failed-AVP AVP. In cases where the erroneous avp length
4168 value exceeds the message length or is less than the minimum AVP
4169 header length, it is sufficient to include the offending AVP
4170 header and a zero filled payload of the minimum required length
4171 for the payloads data type. If the AVP is a grouped AVP, the
4172 grouped AVP header with an empty payload would be sufficient to
4173 indicate the offending AVP. In the case where the offending AVP
4174 header cannot be fully decoded when avp length is less than the
4175 minimum AVP header length, it is sufficient to include an
4176 offending AVP header that is formulated by padding the incomplete
4177 AVP header with zero up to the minimum AVP header length.
4179 DIAMETER_NO_COMMON_SECURITY 5017
4181 This error is returned when a CER message is received, and there
4182 are no common security mechanisms supported between the peers. A
4183 Capabilities-Exchange-Answer (CEA) MUST be returned with the
4184 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY.
4186 DIAMETER_UNKNOWN_PEER 5018
4188 A CER was received from an unknown peer.
4190 DIAMETER_COMMAND_UNSUPPORTED 5019
4192 The Request contained a Command-Code that the receiver did not
4193 recognize or support. This MUST be used when a Diameter node
4194 receives an experimental command that it does not understand.
4196 DIAMETER_INVALID_HDR_BITS 5020
4198 A request was received whose bits in the Diameter header were
4199 either set to an invalid combination, or to a value that is
4200 inconsistent with the command code's definition.
4202 DIAMETER_INVALID_AVP_BITS 5021
4204 A request was received that included an AVP whose flag bits are
4205 set to an unrecognized value, or that is inconsistent with the
4206 AVP's definition.
4208 7.2. Error Bit
4210 The 'E' (Error Bit) in the Diameter header is set when the request
4211 caused a protocol-related error (see Section 7.1.3). A message with
4212 the 'E' bit MUST NOT be sent as a response to an answer message.
4213 Note that a message with the 'E' bit set is still subjected to the
4214 processing rules defined in Section 6.2. When set, the answer
4215 message will not conform to the ABNF specification for the command,
4216 and will instead conform to the following ABNF:
4218 Message Format
4220 ::= < Diameter Header: code, ERR [PXY] >
4221 0*1< Session-Id >
4222 { Origin-Host }
4223 { Origin-Realm }
4224 { Result-Code }
4225 [ Origin-State-Id ]
4226 [ Error-Message ]
4227 [ Error-Reporting-Host ]
4228 [ Failed-AVP ]
4229 * [ Proxy-Info ]
4230 * [ AVP ]
4232 Note that the code used in the header is the same than the one found
4233 in the request message, but with the 'R' bit cleared and the 'E' bit
4234 set. The 'P' bit in the header is set to the same value as the one
4235 found in the request message.
4237 7.3. Error-Message AVP
4239 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY
4240 accompany a Result-Code AVP as a human readable error message. The
4241 Error-Message AVP is not intended to be useful in real-time, and
4242 SHOULD NOT be expected to be parsed by network entities.
4244 7.4. Error-Reporting-Host AVP
4246 The Error-Reporting-Host AVP (AVP Code 294) is of type
4247 DiameterIdentity. This AVP contains the identity of the Diameter
4248 host that sent the Result-Code AVP to a value other than 2001
4249 (Success), only if the host setting the Result-Code is different from
4250 the one encoded in the Origin-Host AVP. This AVP is intended to be
4251 used for troubleshooting purposes, and MUST be set when the Result-
4252 Code AVP indicates a failure.
4254 7.5. Failed-AVP AVP
4256 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides
4257 debugging information in cases where a request is rejected or not
4258 fully processed due to erroneous information in a specific AVP. The
4259 value of the Result-Code AVP will provide information on the reason
4260 for the Failed-AVP AVP. A Diameter message SHOULD contain only one
4261 Failed-AVP that corresponds to the error indicated by the Result-Code
4262 AVP. For practical purposes, this Failed-AVP would typically refer
4263 to the first AVP processing error that a Diameter node encounters.
4265 The possible reasons for this AVP are the presence of an improperly
4266 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP
4267 value, the omission of a required AVP, the presence of an explicitly
4268 excluded AVP (see tables in Section 10), or the presence of two or
4269 more occurrences of an AVP which is restricted to 0, 1, or 0-1
4270 occurrences.
4272 A Diameter message SHOULD contain one Failed-AVP AVP, containing the
4273 entire AVP that could not be processed successfully. If the failure
4274 reason is omission of a required AVP, an AVP with the missing AVP
4275 code, the missing vendor id, and a zero filled payload of the minimum
4276 required length for the omitted AVP will be added. If the failure
4277 reason is an invalid AVP length where the reported length is less
4278 than the minimum AVP header length or greater than the reported
4279 message length, a copy of the offending AVP header and a zero filled
4280 payload of the minimum required length SHOULD be added.
4282 In the case where the offending AVP is embedded within a grouped AVP,
4283 the Failed-AVP MAY contain the grouped AVP which in turn contains the
4284 single offending AVP. The same method MAY be employed if the grouped
4285 AVP itself is embedded in yet another grouped AVP and so on. In this
4286 case, the Failed-AVP MAY contain the grouped AVP heirarchy up to the
4287 single offending AVP. This enables the recipient to detect the
4288 location of the offending AVP when embedded in a group.
4290 AVP Format
4292 ::= < AVP Header: 279 >
4293 1* {AVP}
4295 7.6. Experimental-Result AVP
4297 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and
4298 indicates whether a particular vendor-specific request was completed
4299 successfully or whether an error occurred. Its Data field has the
4300 following ABNF grammar:
4302 AVP Format
4304 Experimental-Result ::= < AVP Header: 297 >
4305 { Vendor-Id }
4306 { Experimental-Result-Code }
4308 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies
4309 the vendor responsible for the assignment of the result code which
4310 follows. All Diameter answer messages defined in vendor-specific
4311 applications MUST include either one Result-Code AVP or one
4312 Experimental-Result AVP.
4314 7.7. Experimental-Result-Code AVP
4316 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32
4317 and contains a vendor-assigned value representing the result of
4318 processing the request.
4320 It is recommended that vendor-specific result codes follow the same
4321 conventions given for the Result-Code AVP regarding the different
4322 types of result codes and the handling of errors (for non 2xxx
4323 values).
4325 8. Diameter User Sessions
4327 In general, Diameter can provide two different types of services to
4328 applications. The first involves authentication and authorization,
4329 and can optionally make use of accounting. The second only makes use
4330 of accounting.
4332 When a service makes use of the authentication and/or authorization
4333 portion of an application, and a user requests access to the network,
4334 the Diameter client issues an auth request to its local server. The
4335 auth request is defined in a service specific Diameter application
4336 (e.g., NASREQ). The request contains a Session-Id AVP, which is used
4337 in subsequent messages (e.g., subsequent authorization, accounting,
4338 etc) relating to the user's session. The Session-Id AVP is a means
4339 for the client and servers to correlate a Diameter message with a
4340 user session.
4342 When a Diameter server authorizes a user to use network resources for
4343 a finite amount of time, and it is willing to extend the
4344 authorization via a future request, it MUST add the Authorization-
4345 Lifetime AVP to the answer message. The Authorization-Lifetime AVP
4346 defines the maximum number of seconds a user MAY make use of the
4347 resources before another authorization request is expected by the
4348 server. The Auth-Grace-Period AVP contains the number of seconds
4349 following the expiration of the Authorization-Lifetime, after which
4350 the server will release all state information related to the user's
4351 session. Note that if payment for services is expected by the
4352 serving realm from the user's home realm, the Authorization-Lifetime
4353 AVP, combined with the Auth-Grace-Period AVP, implies the maximum
4354 length of the session the home realm is willing to be fiscally
4355 responsible for. Services provided past the expiration of the
4356 Authorization-Lifetime and Auth-Grace-Period AVPs are the
4357 responsibility of the access device. Of course, the actual cost of
4358 services rendered is clearly outside the scope of the protocol.
4360 An access device that does not expect to send a re-authorization or a
4361 session termination request to the server MAY include the Auth-
4362 Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint
4363 to the server. If the server accepts the hint, it agrees that since
4364 no session termination message will be received once service to the
4365 user is terminated, it cannot maintain state for the session. If the
4366 answer message from the server contains a different value in the
4367 Auth-Session-State AVP (or the default value if the AVP is absent),
4368 the access device MUST follow the server's directives. Note that the
4369 value NO_STATE_MAINTAINED MUST NOT be set in subsequent re-
4370 authorization requests and answers.
4372 The base protocol does not include any authorization request
4373 messages, since these are largely application-specific and are
4374 defined in a Diameter application document. However, the base
4375 protocol does define a set of messages that is used to terminate user
4376 sessions. These are used to allow servers that maintain state
4377 information to free resources.
4379 When a service only makes use of the Accounting portion of the
4380 Diameter protocol, even in combination with an application, the
4381 Session-Id is still used to identify user sessions. However, the
4382 session termination messages are not used, since a session is
4383 signaled as being terminated by issuing an accounting stop message.
4385 Diameter may also be used for services that cannot be easily
4386 categorized as authentication, authorization or accounting (e.g.,
4387 certain 3GPP IMS interfaces). In such cases, the finite state
4388 machine defined in subsequent sections may not be applicable.
4389 Therefore, the applications itself MAY need to define its own finite
4390 state machine. However, such application specific state machines
4391 MUST comply with general Diameter user session requirements such co-
4392 relating all message exchanges via Session-Id AVP.
4394 8.1. Authorization Session State Machine
4396 This section contains a set of finite state machines, representing
4397 the life cycle of Diameter sessions, and which MUST be observed by
4398 all Diameter implementations that make use of the authentication
4399 and/or authorization portion of a Diameter application. The term
4400 Service-Specific below refers to a message defined in a Diameter
4401 application (e.g., Mobile IPv4, NASREQ).
4403 There are four different authorization session state machines
4404 supported in the Diameter base protocol. The first two describe a
4405 session in which the server is maintaining session state, indicated
4406 by the value of the Auth-Session-State AVP (or its absence). One
4407 describes the session from a client perspective, the other from a
4408 server perspective. The second two state machines are used when the
4409 server does not maintain session state. Here again, one describes
4410 the session from a client perspective, the other from a server
4411 perspective.
4413 When a session is moved to the Idle state, any resources that were
4414 allocated for the particular session must be released. Any event not
4415 listed in the state machines MUST be considered as an error
4416 condition, and an answer, if applicable, MUST be returned to the
4417 originator of the message.
4419 In the case that an application does not support re-auth, the state
4420 transitions related to server-initiated re-auth when both client and
4421 server sessions maintains state (e.g., Send RAR, Pending, Receive
4422 RAA) MAY be ignored.
4424 In the state table, the event 'Failure to send X' means that the
4425 Diameter agent is unable to send command X to the desired
4426 destination. This could be due to the peer being down, or due to the
4427 peer sending back a transient failure or temporary protocol error
4428 notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the
4429 Result-Code AVP of the corresponding Answer command. The event 'X
4430 successfully sent' is the complement of 'Failure to send X'.
4432 The following state machine is observed by a client when state is
4433 maintained on the server:
4435 CLIENT, STATEFUL
4436 State Event Action New State
4437 -------------------------------------------------------------
4438 Idle Client or Device Requests Send Pending
4439 access service
4440 specific
4441 auth req
4443 Idle ASR Received Send ASA Idle
4444 for unknown session with
4445 Result-Code
4446 = UNKNOWN_
4447 SESSION_ID
4449 Idle RAR Received Send RAA Idle
4450 for unknown session with
4451 Result-Code
4452 = UNKNOWN_
4453 SESSION_ID
4455 Pending Successful Service-specific Grant Open
4456 authorization answer Access
4457 received with default
4458 Auth-Session-State value
4460 Pending Successful Service-specific Sent STR Discon
4461 authorization answer received
4462 but service not provided
4464 Pending Error processing successful Sent STR Discon
4465 Service-specific authorization
4466 answer
4468 Pending Failed Service-specific Cleanup Idle
4469 authorization answer received
4471 Open User or client device Send Open
4472 requests access to service service
4473 specific
4474 auth req
4476 Open Successful Service-specific Provide Open
4477 authorization answer received Service
4479 Open Failed Service-specific Discon. Idle
4480 authorization answer user/device
4481 received.
4483 Open RAR received and client will Send RAA Open
4484 perform subsequent re-auth with
4485 Result-Code
4486 = SUCCESS
4488 Open RAR received and client will Send RAA Idle
4489 not perform subsequent with
4490 re-auth Result-Code
4491 != SUCCESS,
4492 Discon.
4493 user/device
4495 Open Session-Timeout Expires on Send STR Discon
4496 Access Device
4498 Open ASR Received, Send ASA Discon
4499 client will comply with with
4500 request to end the session Result-Code
4501 = SUCCESS,
4502 Send STR.
4504 Open ASR Received, Send ASA Open
4505 client will not comply with with
4506 request to end the session Result-Code
4507 != SUCCESS
4509 Open Authorization-Lifetime + Send STR Discon
4510 Auth-Grace-Period expires on
4511 access device
4513 Discon ASR Received Send ASA Discon
4515 Discon STA Received Discon. Idle
4516 user/device
4518 The following state machine is observed by a server when it is
4519 maintaining state for the session:
4521 SERVER, STATEFUL
4522 State Event Action New State
4523 -------------------------------------------------------------
4524 Idle Service-specific authorization Send Open
4525 request received, and successful
4526 user is authorized serv.
4527 specific
4528 answer
4530 Idle Service-specific authorization Send Idle
4531 request received, and failed serv.
4532 user is not authorized specific
4533 answer
4535 Open Service-specific authorization Send Open
4536 request received, and user successful
4537 is authorized serv. specific
4538 answer
4540 Open Service-specific authorization Send Idle
4541 request received, and user failed serv.
4542 is not authorized specific
4543 answer,
4544 Cleanup
4546 Open Home server wants to confirm Send RAR Pending
4547 authentication and/or
4548 authorization of the user
4550 Pending Received RAA with a failed Cleanup Idle
4551 Result-Code
4553 Pending Received RAA with Result-Code Update Open
4554 = SUCCESS session
4556 Open Home server wants to Send ASR Discon
4557 terminate the service
4559 Open Authorization-Lifetime (and Cleanup Idle
4560 Auth-Grace-Period) expires
4561 on home server.
4563 Open Session-Timeout expires on Cleanup Idle
4564 home server
4566 Discon Failure to send ASR Wait, Discon
4567 resend ASR
4569 Discon ASR successfully sent and Cleanup Idle
4570 ASA Received with Result-Code
4572 Not ASA Received None No Change.
4573 Discon
4575 Any STR Received Send STA, Idle
4576 Cleanup.
4578 The following state machine is observed by a client when state is not
4579 maintained on the server:
4581 CLIENT, STATELESS
4582 State Event Action New State
4583 -------------------------------------------------------------
4584 Idle Client or Device Requests Send Pending
4585 access service
4586 specific
4587 auth req
4589 Pending Successful Service-specific Grant Open
4590 authorization answer Access
4591 received with Auth-Session-
4592 State set to
4593 NO_STATE_MAINTAINED
4595 Pending Failed Service-specific Cleanup Idle
4596 authorization answer
4597 received
4599 Open Session-Timeout Expires on Discon. Idle
4600 Access Device user/device
4602 Open Service to user is terminated Discon. Idle
4603 user/device
4605 The following state machine is observed by a server when it is not
4606 maintaining state for the session:
4608 SERVER, STATELESS
4609 State Event Action New State
4610 -------------------------------------------------------------
4611 Idle Service-specific authorization Send serv. Idle
4612 request received, and specific
4613 successfully processed answer
4615 8.2. Accounting Session State Machine
4617 The following state machines MUST be supported for applications that
4618 have an accounting portion or that require only accounting services.
4619 The first state machine is to be observed by clients.
4621 See Section 9.7 for Accounting Command Codes and Section 9.8 for
4622 Accounting AVPs.
4624 The server side in the accounting state machine depends in some cases
4625 on the particular application. The Diameter base protocol defines a
4626 default state machine that MUST be followed by all applications that
4627 have not specified other state machines. This is the second state
4628 machine in this section described below.
4630 The default server side state machine requires the reception of
4631 accounting records in any order and at any time, and does not place
4632 any standards requirement on the processing of these records.
4633 Implementations of Diameter MAY perform checking, ordering,
4634 correlation, fraud detection, and other tasks based on these records.
4635 Both base Diameter AVPs as well as application specific AVPs MAY be
4636 inspected as a part of these tasks. The tasks can happen either
4637 immediately after record reception or in a post-processing phase.
4638 However, as these tasks are typically application or even policy
4639 dependent, they are not standardized by the Diameter specifications.
4640 Applications MAY define requirements on when to accept accounting
4641 records based on the used value of Accounting-Realtime-Required AVP,
4642 credit limits checks, and so on.
4644 However, the Diameter base protocol defines one optional server side
4645 state machine that MAY be followed by applications that require
4646 keeping track of the session state at the accounting server. Note
4647 that such tracking is incompatible with the ability to sustain long
4648 duration connectivity problems. Therefore, the use of this state
4649 machine is recommended only in applications where the value of the
4650 Accounting-Realtime-Required AVP is DELIVER_AND_GRANT, and hence
4651 accounting connectivity problems are required to cause the serviced
4652 user to be disconnected. Otherwise, records produced by the client
4653 may be lost by the server which no longer accepts them after the
4654 connectivity is re-established. This state machine is the third
4655 state machine in this section. The state machine is supervised by a
4656 supervision session timer Ts, which the value should be reasonably
4657 higher than the Acct_Interim_Interval value. Ts MAY be set to two
4658 times the value of the Acct_Interim_Interval so as to avoid the
4659 accounting session in the Diameter server to change to Idle state in
4660 case of short transient network failure.
4662 Any event not listed in the state machines MUST be considered as an
4663 error condition, and a corresponding answer, if applicable, MUST be
4664 returned to the originator of the message.
4666 In the state table, the event 'Failure to send' means that the
4667 Diameter client is unable to communicate with the desired
4668 destination. This could be due to the peer being down, or due to the
4669 peer sending back a transient failure or temporary protocol error
4670 notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or
4671 DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting
4672 Answer command.
4674 The event 'Failed answer' means that the Diameter client received a
4675 non-transient failure notification in the Accounting Answer command.
4677 Note that the action 'Disconnect user/dev' MUST have an effect also
4678 to the authorization session state table, e.g., cause the STR message
4679 to be sent, if the given application has both authentication/
4680 authorization and accounting portions.
4682 The states PendingS, PendingI, PendingL, PendingE and PendingB stand
4683 for pending states to wait for an answer to an accounting request
4684 related to a Start, Interim, Stop, Event or buffered record,
4685 respectively.
4687 CLIENT, ACCOUNTING
4688 State Event Action New State
4689 -------------------------------------------------------------
4690 Idle Client or device requests Send PendingS
4691 access accounting
4692 start req.
4694 Idle Client or device requests Send PendingE
4695 a one-time service accounting
4696 event req
4698 Idle Records in storage Send PendingB
4699 record
4701 PendingS Successful accounting Open
4702 start answer received
4704 PendingS Failure to send and buffer Store Open
4705 space available and realtime Start
4706 not equal to DELIVER_AND_GRANT Record
4708 PendingS Failure to send and no buffer Open
4709 space available and realtime
4710 equal to GRANT_AND_LOSE
4712 PendingS Failure to send and no buffer Disconnect Idle
4713 space available and realtime user/dev
4714 not equal to
4715 GRANT_AND_LOSE
4717 PendingS Failed accounting start answer Open
4718 received and realtime equal
4719 to GRANT_AND_LOSE
4721 PendingS Failed accounting start answer Disconnect Idle
4722 received and realtime not user/dev
4723 equal to GRANT_AND_LOSE
4725 PendingS User service terminated Store PendingS
4726 stop
4727 record
4729 Open Interim interval elapses Send PendingI
4730 accounting
4731 interim
4732 record
4733 Open User service terminated Send PendingL
4734 accounting
4735 stop req.
4737 PendingI Successful accounting interim Open
4738 answer received
4740 PendingI Failure to send and (buffer Store Open
4741 space available or old record interim
4742 can be overwritten) and record
4743 realtime not equal to
4744 DELIVER_AND_GRANT
4746 PendingI Failure to send and no buffer Open
4747 space available and realtime
4748 equal to GRANT_AND_LOSE
4750 PendingI Failure to send and no buffer Disconnect Idle
4751 space available and realtime user/dev
4752 not equal to GRANT_AND_LOSE
4754 PendingI Failed accounting interim Open
4755 answer received and realtime
4756 equal to GRANT_AND_LOSE
4758 PendingI Failed accounting interim Disconnect Idle
4759 answer received and realtime user/dev
4760 not equal to GRANT_AND_LOSE
4762 PendingI User service terminated Store PendingI
4763 stop
4764 record
4765 PendingE Successful accounting Idle
4766 event answer received
4768 PendingE Failure to send and buffer Store Idle
4769 space available event
4770 record
4772 PendingE Failure to send and no buffer Idle
4773 space available
4775 PendingE Failed accounting event answer Idle
4776 received
4778 PendingB Successful accounting answer Delete Idle
4779 received record
4781 PendingB Failure to send Idle
4783 PendingB Failed accounting answer Delete Idle
4784 received record
4786 PendingL Successful accounting Idle
4787 stop answer received
4789 PendingL Failure to send and buffer Store Idle
4790 space available stop
4791 record
4793 PendingL Failure to send and no buffer Idle
4794 space available
4796 PendingL Failed accounting stop answer Idle
4797 received
4799 SERVER, STATELESS ACCOUNTING
4800 State Event Action New State
4801 -------------------------------------------------------------
4803 Idle Accounting start request Send Idle
4804 received, and successfully accounting
4805 processed. start
4806 answer
4808 Idle Accounting event request Send Idle
4809 received, and successfully accounting
4810 processed. event
4811 answer
4813 Idle Interim record received, Send Idle
4814 and successfully processed. accounting
4815 interim
4816 answer
4818 Idle Accounting stop request Send Idle
4819 received, and successfully accounting
4820 processed stop answer
4822 Idle Accounting request received, Send Idle
4823 no space left to store accounting
4824 records answer,
4825 Result-Code
4826 = OUT_OF_
4827 SPACE
4829 SERVER, STATEFUL ACCOUNTING
4830 State Event Action New State
4831 -------------------------------------------------------------
4833 Idle Accounting start request Send Open
4834 received, and successfully accounting
4835 processed. start
4836 answer,
4837 Start Ts
4839 Idle Accounting event request Send Idle
4840 received, and successfully accounting
4841 processed. event
4842 answer
4844 Idle Accounting request received, Send Idle
4845 no space left to store accounting
4846 records answer,
4847 Result-Code
4848 = OUT_OF_
4849 SPACE
4851 Open Interim record received, Send Open
4852 and successfully processed. accounting
4853 interim
4854 answer,
4855 Restart Ts
4857 Open Accounting stop request Send Idle
4858 received, and successfully accounting
4859 processed stop answer,
4860 Stop Ts
4862 Open Accounting request received, Send Idle
4863 no space left to store accounting
4864 records answer,
4865 Result-Code
4866 = OUT_OF_
4867 SPACE,
4868 Stop Ts
4870 Open Session supervision timer Ts Stop Ts Idle
4871 expired
4873 8.3. Server-Initiated Re-Auth
4875 A Diameter server may initiate a re-authentication and/or re-
4876 authorization service for a particular session by issuing a Re-Auth-
4877 Request (RAR).
4879 For example, for pre-paid services, the Diameter server that
4880 originally authorized a session may need some confirmation that the
4881 user is still using the services.
4883 An access device that receives a RAR message with Session-Id equal to
4884 a currently active session MUST initiate a re-auth towards the user,
4885 if the service supports this particular feature. Each Diameter
4886 application MUST state whether service-initiated re-auth is
4887 supported, since some applications do not allow access devices to
4888 prompt the user for re-auth.
4890 8.3.1. Re-Auth-Request
4892 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258
4893 and the message flags' 'R' bit set, may be sent by any server to the
4894 access device that is providing session service, to request that the
4895 user be re-authenticated and/or re-authorized.
4897 Message Format
4899 ::= < Diameter Header: 258, REQ, PXY >
4900 < Session-Id >
4901 { Origin-Host }
4902 { Origin-Realm }
4903 { Destination-Realm }
4904 { Destination-Host }
4905 { Auth-Application-Id }
4906 { Re-Auth-Request-Type }
4907 [ User-Name ]
4908 [ Origin-State-Id ]
4909 * [ Proxy-Info ]
4910 * [ Route-Record ]
4911 * [ AVP ]
4913 8.3.2. Re-Auth-Answer
4915 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258
4916 and the message flags' 'R' bit clear, is sent in response to the RAR.
4917 The Result-Code AVP MUST be present, and indicates the disposition of
4918 the request.
4920 A successful RAA message MUST be followed by an application-specific
4921 authentication and/or authorization message.
4923 Message Format
4925 ::= < Diameter Header: 258, PXY >
4926 < Session-Id >
4927 { Result-Code }
4928 { Origin-Host }
4929 { Origin-Realm }
4930 [ User-Name ]
4931 [ Origin-State-Id ]
4932 [ Error-Message ]
4933 [ Error-Reporting-Host ]
4934 [ Failed-AVP ]
4935 * [ Redirect-Host ]
4936 [ Redirect-Host-Usage ]
4937 [ Redirect-Max-Cache-Time ]
4938 * [ Proxy-Info ]
4939 * [ AVP ]
4941 8.4. Session Termination
4943 It is necessary for a Diameter server that authorized a session, for
4944 which it is maintaining state, to be notified when that session is no
4945 longer active, both for tracking purposes as well as to allow
4946 stateful agents to release any resources that they may have provided
4947 for the user's session. For sessions whose state is not being
4948 maintained, this section is not used.
4950 When a user session that required Diameter authorization terminates,
4951 the access device that provided the service MUST issue a Session-
4952 Termination-Request (STR) message to the Diameter server that
4953 authorized the service, to notify it that the session is no longer
4954 active. An STR MUST be issued when a user session terminates for any
4955 reason, including user logoff, expiration of Session-Timeout,
4956 administrative action, termination upon receipt of an Abort-Session-
4957 Request (see below), orderly shutdown of the access device, etc.
4959 The access device also MUST issue an STR for a session that was
4960 authorized but never actually started. This could occur, for
4961 example, due to a sudden resource shortage in the access device, or
4962 because the access device is unwilling to provide the type of service
4963 requested in the authorization, or because the access device does not
4964 support a mandatory AVP returned in the authorization, etc.
4966 It is also possible that a session that was authorized is never
4967 actually started due to action of a proxy. For example, a proxy may
4968 modify an authorization answer, converting the result from success to
4969 failure, prior to forwarding the message to the access device. If
4970 the answer did not contain an Auth-Session-State AVP with the value
4971 NO_STATE_MAINTAINED, a proxy that causes an authorized session not to
4972 be started MUST issue an STR to the Diameter server that authorized
4973 the session, since the access device has no way of knowing that the
4974 session had been authorized.
4976 A Diameter server that receives an STR message MUST clean up
4977 resources (e.g., session state) associated with the Session-Id
4978 specified in the STR, and return a Session-Termination-Answer.
4980 A Diameter server also MUST clean up resources when the Session-
4981 Timeout expires, or when the Authorization-Lifetime and the Auth-
4982 Grace-Period AVPs expires without receipt of a re-authorization
4983 request, regardless of whether an STR for that session is received.
4984 The access device is not expected to provide service beyond the
4985 expiration of these timers; thus, expiration of either of these
4986 timers implies that the access device may have unexpectedly shut
4987 down.
4989 8.4.1. Session-Termination-Request
4991 The Session-Termination-Request (STR), indicated by the Command-Code
4992 set to 275 and the Command Flags' 'R' bit set, is sent by the access
4993 device to inform the Diameter Server that an authenticated and/or
4994 authorized session is being terminated.
4996 Message Format
4998 ::= < Diameter Header: 275, REQ, PXY >
4999 < Session-Id >
5000 { Origin-Host }
5001 { Origin-Realm }
5002 { Destination-Realm }
5003 { Auth-Application-Id }
5004 { Termination-Cause }
5005 [ User-Name ]
5006 [ Destination-Host ]
5007 * [ Class ]
5008 [ Origin-State-Id ]
5009 * [ Proxy-Info ]
5010 * [ Route-Record ]
5011 * [ AVP ]
5013 8.4.2. Session-Termination-Answer
5015 The Session-Termination-Answer (STA), indicated by the Command-Code
5016 set to 275 and the message flags' 'R' bit clear, is sent by the
5017 Diameter Server to acknowledge the notification that the session has
5018 been terminated. The Result-Code AVP MUST be present, and MAY
5019 contain an indication that an error occurred while servicing the STR.
5021 Upon sending or receipt of the STA, the Diameter Server MUST release
5022 all resources for the session indicated by the Session-Id AVP. Any
5023 intermediate server in the Proxy-Chain MAY also release any
5024 resources, if necessary.
5026 Message Format
5028 ::= < Diameter Header: 275, PXY >
5029 < Session-Id >
5030 { Result-Code }
5031 { Origin-Host }
5032 { Origin-Realm }
5033 [ User-Name ]
5034 * [ Class ]
5035 [ Error-Message ]
5036 [ Error-Reporting-Host ]
5037 [ Failed-AVP ]
5038 [ Origin-State-Id ]
5039 * [ Redirect-Host ]
5040 [ Redirect-Host-Usage ]
5041 [ Redirect-Max-Cache-Time ]
5042 * [ Proxy-Info ]
5043 * [ AVP ]
5045 8.5. Aborting a Session
5047 A Diameter server may request that the access device stop providing
5048 service for a particular session by issuing an Abort-Session-Request
5049 (ASR).
5051 For example, the Diameter server that originally authorized the
5052 session may be required to cause that session to be stopped for
5053 credit or other reasons that were not anticipated when the session
5054 was first authorized. On the other hand, an operator may maintain a
5055 management server for the purpose of issuing ASRs to administratively
5056 remove users from the network.
5058 An access device that receives an ASR with Session-ID equal to a
5059 currently active session MAY stop the session. Whether the access
5060 device stops the session or not is implementation- and/or
5061 configuration-dependent. For example, an access device may honor
5062 ASRs from certain agents only. In any case, the access device MUST
5063 respond with an Abort-Session-Answer, including a Result-Code AVP to
5064 indicate what action it took.
5066 Note that if the access device does stop the session upon receipt of
5067 an ASR, it issues an STR to the authorizing server (which may or may
5068 not be the agent issuing the ASR) just as it would if the session
5069 were terminated for any other reason.
5071 8.5.1. Abort-Session-Request
5073 The Abort-Session-Request (ASR), indicated by the Command-Code set to
5074 274 and the message flags' 'R' bit set, may be sent by any server to
5075 the access device that is providing session service, to request that
5076 the session identified by the Session-Id be stopped.
5078 Message Format
5080 ::= < Diameter Header: 274, REQ, PXY >
5081 < Session-Id >
5082 { Origin-Host }
5083 { Origin-Realm }
5084 { Destination-Realm }
5085 { Destination-Host }
5086 { Auth-Application-Id }
5087 [ User-Name ]
5088 [ Origin-State-Id ]
5089 * [ Proxy-Info ]
5090 * [ Route-Record ]
5091 * [ AVP ]
5093 8.5.2. Abort-Session-Answer
5095 The Abort-Session-Answer (ASA), indicated by the Command-Code set to
5096 274 and the message flags' 'R' bit clear, is sent in response to the
5097 ASR. The Result-Code AVP MUST be present, and indicates the
5098 disposition of the request.
5100 If the session identified by Session-Id in the ASR was successfully
5101 terminated, Result-Code is set to DIAMETER_SUCCESS. If the session
5102 is not currently active, Result-Code is set to
5103 DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the
5104 session for any other reason, Result-Code is set to
5105 DIAMETER_UNABLE_TO_COMPLY.
5107 Message Format
5109 ::= < Diameter Header: 274, PXY >
5110 < Session-Id >
5111 { Result-Code }
5112 { Origin-Host }
5113 { Origin-Realm }
5114 [ User-Name ]
5115 [ Origin-State-Id ]
5116 [ Error-Message ]
5117 [ Error-Reporting-Host ]
5118 [ Failed-AVP ]
5119 * [ Redirect-Host ]
5120 [ Redirect-Host-Usage ]
5121 [ Redirect-Max-Cache-Time ]
5122 * [ Proxy-Info ]
5123 * [ AVP ]
5125 8.6. Inferring Session Termination from Origin-State-Id
5127 Origin-State-Id is used to allow rapid detection of terminated
5128 sessions for which no STR would have been issued, due to
5129 unanticipated shutdown of an access device.
5131 By including Origin-State-Id in CER/CEA messages, an access device
5132 allows a next-hop server to determine immediately upon connection
5133 whether the device has lost its sessions since the last connection.
5135 By including Origin-State-Id in request messages, an access device
5136 also allows a server with which it communicates via proxy to make
5137 such a determination. However, a server that is not directly
5138 connected with the access device will not discover that the access
5139 device has been restarted unless and until it receives a new request
5140 from the access device. Thus, use of this mechanism across proxies
5141 is opportunistic rather than reliable, but useful nonetheless.
5143 When a Diameter server receives an Origin-State-Id that is greater
5144 than the Origin-State-Id previously received from the same issuer, it
5145 may assume that the issuer has lost state since the previous message
5146 and that all sessions that were active under the lower Origin-State-
5147 Id have been terminated. The Diameter server MAY clean up all
5148 session state associated with such lost sessions, and MAY also issues
5149 STRs for all such lost sessions that were authorized on upstream
5150 servers, to allow session state to be cleaned up globally.
5152 8.7. Auth-Request-Type AVP
5154 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is
5155 included in application-specific auth requests to inform the peers
5156 whether a user is to be authenticated only, authorized only or both.
5157 Note any value other than both MAY cause RADIUS interoperability
5158 issues. The following values are defined:
5160 AUTHENTICATE_ONLY 1
5162 The request being sent is for authentication only, and MUST
5163 contain the relevant application specific authentication AVPs that
5164 are needed by the Diameter server to authenticate the user.
5166 AUTHORIZE_ONLY 2
5168 The request being sent is for authorization only, and MUST contain
5169 the application specific authorization AVPs that are necessary to
5170 identify the service being requested/offered.
5172 AUTHORIZE_AUTHENTICATE 3
5174 The request contains a request for both authentication and
5175 authorization. The request MUST include both the relevant
5176 application specific authentication information, and authorization
5177 information necessary to identify the service being requested/
5178 offered.
5180 8.8. Session-Id AVP
5182 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used
5183 to identify a specific session (see Section 8). All messages
5184 pertaining to a specific session MUST include only one Session-Id AVP
5185 and the same value MUST be used throughout the life of a session.
5186 When present, the Session-Id SHOULD appear immediately following the
5187 Diameter Header (see Section 3).
5189 The Session-Id MUST be globally and eternally unique, as it is meant
5190 to uniquely identify a user session without reference to any other
5191 information, and may be needed to correlate historical authentication
5192 information with accounting information. The Session-Id includes a
5193 mandatory portion and an implementation-defined portion; a
5194 recommended format for the implementation-defined portion is outlined
5195 below.
5197 The Session-Id MUST begin with the sender's identity encoded in the
5198 DiameterIdentity type (see Section 4.4). The remainder of the
5199 Session-Id is delimited by a ";" character, and MAY be any sequence
5200 that the client can guarantee to be eternally unique; however, the
5201 following format is recommended, (square brackets [] indicate an
5202 optional element):
5204 ;;[;]
5206 and are decimal representations of the
5207 high and low 32 bits of a monotonically increasing 64-bit value. The
5208 64-bit value is rendered in two part to simplify formatting by 32-bit
5209 processors. At startup, the high 32 bits of the 64-bit value MAY be
5210 initialized to the time in NTP format [RFC4330], and the low 32 bits
5211 MAY be initialized to zero. This will for practical purposes
5212 eliminate the possibility of overlapping Session-Ids after a reboot,
5213 assuming the reboot process takes longer than a second.
5214 Alternatively, an implementation MAY keep track of the increasing
5215 value in non-volatile memory.
5217 is implementation specific but may include a modem's
5218 device Id, a layer 2 address, timestamp, etc.
5220 Example, in which there is no optional value:
5222 accesspoint7.acme.com;1876543210;523
5224 Example, in which there is an optional value:
5226 accesspoint7.acme.com;1876543210;523;mobile@200.1.1.88
5228 The Session-Id is created by the Diameter application initiating the
5229 session, which in most cases is done by the client. Note that a
5230 Session-Id MAY be used for both the authorization and accounting
5231 commands of a given application.
5233 8.9. Authorization-Lifetime AVP
5235 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32
5236 and contains the maximum number of seconds of service to be provided
5237 to the user before the user is to be re-authenticated and/or re-
5238 authorized. Great care should be taken when the Authorization-
5239 Lifetime value is determined, since a low, non-zero, value could
5240 create significant Diameter traffic, which could congest both the
5241 network and the agents.
5243 A value of zero (0) means that immediate re-auth is necessary by the
5244 access device. This is typically used in cases where multiple
5245 authentication methods are used, and a successful auth response with
5246 this AVP set to zero is used to signal that the next authentication
5247 method is to be immediately initiated. The absence of this AVP, or a
5248 value of all ones (meaning all bits in the 32 bit field are set to
5249 one) means no re-auth is expected.
5251 If both this AVP and the Session-Timeout AVP are present in a
5252 message, the value of the latter MUST NOT be smaller than the
5253 Authorization-Lifetime AVP.
5255 An Authorization-Lifetime AVP MAY be present in re-authorization
5256 messages, and contains the number of seconds the user is authorized
5257 to receive service from the time the re-auth answer message is
5258 received by the access device.
5260 This AVP MAY be provided by the client as a hint of the maximum
5261 lifetime that it is willing to accept. However, the server MAY
5262 return a value that is equal to, or smaller, than the one provided by
5263 the client.
5265 8.10. Auth-Grace-Period AVP
5267 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and
5268 contains the number of seconds the Diameter server will wait
5269 following the expiration of the Authorization-Lifetime AVP before
5270 cleaning up resources for the session.
5272 8.11. Auth-Session-State AVP
5274 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and
5275 specifies whether state is maintained for a particular session. The
5276 client MAY include this AVP in requests as a hint to the server, but
5277 the value in the server's answer message is binding. The following
5278 values are supported:
5280 STATE_MAINTAINED 0
5282 This value is used to specify that session state is being
5283 maintained, and the access device MUST issue a session termination
5284 message when service to the user is terminated. This is the
5285 default value.
5287 NO_STATE_MAINTAINED 1
5289 This value is used to specify that no session termination messages
5290 will be sent by the access device upon expiration of the
5291 Authorization-Lifetime.
5293 8.12. Re-Auth-Request-Type AVP
5295 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and
5296 is included in application-specific auth answers to inform the client
5297 of the action expected upon expiration of the Authorization-Lifetime.
5298 If the answer message contains an Authorization-Lifetime AVP with a
5299 positive value, the Re-Auth-Request-Type AVP MUST be present in an
5300 answer message. The following values are defined:
5302 AUTHORIZE_ONLY 0
5304 An authorization only re-auth is expected upon expiration of the
5305 Authorization-Lifetime. This is the default value if the AVP is
5306 not present in answer messages that include the Authorization-
5307 Lifetime.
5309 AUTHORIZE_AUTHENTICATE 1
5311 An authentication and authorization re-auth is expected upon
5312 expiration of the Authorization-Lifetime.
5314 8.13. Session-Timeout AVP
5316 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32
5317 and contains the maximum number of seconds of service to be provided
5318 to the user before termination of the session. When both the
5319 Session-Timeout and the Authorization-Lifetime AVPs are present in an
5320 answer message, the former MUST be equal to or greater than the value
5321 of the latter.
5323 A session that terminates on an access device due to the expiration
5324 of the Session-Timeout MUST cause an STR to be issued, unless both
5325 the access device and the home server had previously agreed that no
5326 session termination messages would be sent (see Section 8.11).
5328 A Session-Timeout AVP MAY be present in a re-authorization answer
5329 message, and contains the remaining number of seconds from the
5330 beginning of the re-auth.
5332 A value of zero, or the absence of this AVP, means that this session
5333 has an unlimited number of seconds before termination.
5335 This AVP MAY be provided by the client as a hint of the maximum
5336 timeout that it is willing to accept. However, the server MAY return
5337 a value that is equal to, or smaller, than the one provided by the
5338 client.
5340 8.14. User-Name AVP
5342 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which
5343 contains the User-Name, in a format consistent with the NAI
5344 specification [RFC4282].
5346 8.15. Termination-Cause AVP
5348 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and
5349 is used to indicate the reason why a session was terminated on the
5350 access device. The following values are defined:
5352 DIAMETER_LOGOUT 1
5354 The user initiated a disconnect
5356 DIAMETER_SERVICE_NOT_PROVIDED 2
5358 This value is used when the user disconnected prior to the receipt
5359 of the authorization answer message.
5361 DIAMETER_BAD_ANSWER 3
5363 This value indicates that the authorization answer received by the
5364 access device was not processed successfully.
5366 DIAMETER_ADMINISTRATIVE 4
5368 The user was not granted access, or was disconnected, due to
5369 administrative reasons, such as the receipt of a Abort-Session-
5370 Request message.
5372 DIAMETER_LINK_BROKEN 5
5374 The communication to the user was abruptly disconnected.
5376 DIAMETER_AUTH_EXPIRED 6
5378 The user's access was terminated since its authorized session time
5379 has expired.
5381 DIAMETER_USER_MOVED 7
5383 The user is receiving services from another access device.
5385 DIAMETER_SESSION_TIMEOUT 8
5387 The user's session has timed out, and service has been terminated.
5389 8.16. Origin-State-Id AVP
5391 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a
5392 monotonically increasing value that is advanced whenever a Diameter
5393 entity restarts with loss of previous state, for example upon reboot.
5394 Origin-State-Id MAY be included in any Diameter message, including
5395 CER.
5397 A Diameter entity issuing this AVP MUST create a higher value for
5398 this AVP each time its state is reset. A Diameter entity MAY set
5399 Origin-State-Id to the time of startup, or it MAY use an incrementing
5400 counter retained in non-volatile memory across restarts.
5402 The Origin-State-Id, if present, MUST reflect the state of the entity
5403 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST
5404 either remove Origin-State-Id or modify it appropriately as well.
5405 Typically, Origin-State-Id is used by an access device that always
5406 starts up with no active sessions; that is, any session active prior
5407 to restart will have been lost. By including Origin-State-Id in a
5408 message, it allows other Diameter entities to infer that sessions
5409 associated with a lower Origin-State-Id are no longer active. If an
5410 access device does not intend for such inferences to be made, it MUST
5411 either not include Origin-State-Id in any message, or set its value
5412 to 0.
5414 8.17. Session-Binding AVP
5416 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY
5417 be present in application-specific authorization answer messages. If
5418 present, this AVP MAY inform the Diameter client that all future
5419 application-specific re-auth messages for this session MUST be sent
5420 to the same authorization server. This AVP MAY also specify that a
5421 Session-Termination-Request message for this session MUST be sent to
5422 the same authorizing server.
5424 This field is a bit mask, and the following bits have been defined:
5426 RE_AUTH 1
5428 When set, future re-auth messages for this session MUST NOT
5429 include the Destination-Host AVP. When cleared, the default
5430 value, the Destination-Host AVP MUST be present in all re-auth
5431 messages for this session.
5433 STR 2
5435 When set, the STR message for this session MUST NOT include the
5436 Destination-Host AVP. When cleared, the default value, the
5437 Destination-Host AVP MUST be present in the STR message for this
5438 session.
5440 ACCOUNTING 4
5442 When set, all accounting messages for this session MUST NOT
5443 include the Destination-Host AVP. When cleared, the default
5444 value, the Destination-Host AVP, if known, MUST be present in all
5445 accounting messages for this session.
5447 8.18. Session-Server-Failover AVP
5449 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated,
5450 and MAY be present in application-specific authorization answer
5451 messages that either do not include the Session-Binding AVP or
5452 include the Session-Binding AVP with any of the bits set to a zero
5453 value. If present, this AVP MAY inform the Diameter client that if a
5454 re-auth or STR message fails due to a delivery problem, the Diameter
5455 client SHOULD issue a subsequent message without the Destination-Host
5456 AVP. When absent, the default value is REFUSE_SERVICE.
5458 The following values are supported:
5460 REFUSE_SERVICE 0
5462 If either the re-auth or the STR message delivery fails, terminate
5463 service with the user, and do not attempt any subsequent attempts.
5465 TRY_AGAIN 1
5467 If either the re-auth or the STR message delivery fails, resend
5468 the failed message without the Destination-Host AVP present.
5470 ALLOW_SERVICE 2
5472 If re-auth message delivery fails, assume that re-authorization
5473 succeeded. If STR message delivery fails, terminate the session.
5475 TRY_AGAIN_ALLOW_SERVICE 3
5477 If either the re-auth or the STR message delivery fails, resend
5478 the failed message without the Destination-Host AVP present. If
5479 the second delivery fails for re-auth, assume re-authorization
5480 succeeded. If the second delivery fails for STR, terminate the
5481 session.
5483 8.19. Multi-Round-Time-Out AVP
5485 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32,
5486 and SHOULD be present in application-specific authorization answer
5487 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH.
5488 This AVP contains the maximum number of seconds that the access
5489 device MUST provide the user in responding to an authentication
5490 request.
5492 8.20. Class AVP
5494 The Class AVP (AVP Code 25) is of type OctetString and is used to by
5495 Diameter servers to return state information to the access device.
5496 When one or more Class AVPs are present in application-specific
5497 authorization answer messages, they MUST be present in subsequent re-
5498 authorization, session termination and accounting messages. Class
5499 AVPs found in a re-authorization answer message override the ones
5500 found in any previous authorization answer message. Diameter server
5501 implementations SHOULD NOT return Class AVPs that require more than
5502 4096 bytes of storage on the Diameter client. A Diameter client that
5503 receives Class AVPs whose size exceeds local available storage MUST
5504 terminate the session.
5506 8.21. Event-Timestamp AVP
5508 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be
5509 included in an Accounting-Request and Accounting-Answer messages to
5510 record the time that the reported event occurred, in seconds since
5511 January 1, 1900 00:00 UTC.
5513 9. Accounting
5515 This accounting protocol is based on a server directed model with
5516 capabilities for real-time delivery of accounting information.
5517 Several fault resilience methods [RFC2975] have been built in to the
5518 protocol in order minimize loss of accounting data in various fault
5519 situations and under different assumptions about the capabilities of
5520 the used devices.
5522 9.1. Server Directed Model
5524 The server directed model means that the device generating the
5525 accounting data gets information from either the authorization server
5526 (if contacted) or the accounting server regarding the way accounting
5527 data shall be forwarded. This information includes accounting record
5528 timeliness requirements.
5530 As discussed in [RFC2975], real-time transfer of accounting records
5531 is a requirement, such as the need to perform credit limit checks and
5532 fraud detection. Note that batch accounting is not a requirement,
5533 and is therefore not supported by Diameter. Should batched
5534 accounting be required in the future, a new Diameter application will
5535 need to be created, or it could be handled using another protocol.
5536 Note, however, that even if at the Diameter layer accounting requests
5537 are processed one by one, transport protocols used under Diameter
5538 typically batch several requests in the same packet under heavy
5539 traffic conditions. This may be sufficient for many applications.
5541 The authorization server (chain) directs the selection of proper
5542 transfer strategy, based on its knowledge of the user and
5543 relationships of roaming partnerships. The server (or agents) uses
5544 the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to
5545 control the operation of the Diameter peer operating as a client.
5546 The Acct-Interim-Interval AVP, when present, instructs the Diameter
5547 node acting as a client to produce accounting records continuously
5548 even during a session. Accounting-Realtime-Required AVP is used to
5549 control the behavior of the client when the transfer of accounting
5550 records from the Diameter client is delayed or unsuccessful.
5552 The Diameter accounting server MAY override the interim interval or
5553 the realtime requirements by including the Acct-Interim-Interval or
5554 Accounting-Realtime-Required AVP in the Accounting-Answer message.
5555 When one of these AVPs is present, the latest value received SHOULD
5556 be used in further accounting activities for the same session.
5558 9.2. Protocol Messages
5560 A Diameter node that receives a successful authentication and/or
5561 authorization messages from the Home AAA server MUST collect
5562 accounting information for the session. The Accounting-Request
5563 message is used to transmit the accounting information to the Home
5564 AAA server, which MUST reply with the Accounting-Answer message to
5565 confirm reception. The Accounting-Answer message includes the
5566 Result-Code AVP, which MAY indicate that an error was present in the
5567 accounting message. A rejected Accounting-Request message MAY cause
5568 the user's session to be terminated, depending on the value of the
5569 Accounting-Realtime-Required AVP received earlier for the session in
5570 question.
5572 Each Diameter Accounting protocol message MAY be compressed, in order
5573 to reduce network bandwidth usage. If TLS is used to secure the
5574 Diameter session, then TLS compression [RFC4346] MAY be used.
5576 9.3. Accounting Application Extension and Requirements
5578 Each Diameter application (e.g., NASREQ, MobileIP), MUST define their
5579 Service-Specific AVPs that MUST be present in the Accounting-Request
5580 message in a section entitled "Accounting AVPs". The application
5581 MUST assume that the AVPs described in this document will be present
5582 in all Accounting messages, so only their respective service-specific
5583 AVPs need to be defined in this section.
5585 Applications have the option of using one or both of the following
5586 accounting application extension models:
5588 Split Accounting Service
5590 The accounting message will carry the Application Id of the
5591 Diameter base accounting application (see Section 2.4).
5592 Accounting messages maybe routed to Diameter nodes other than the
5593 corresponding Diameter application. These nodes might be
5594 centralized accounting servers that provide accounting service for
5595 multiple different Diameter applications. These nodes MUST
5596 advertise the Diameter base accounting Application Id during
5597 capabilities exchange.
5599 Coupled Accounting Service
5601 The accounting messages will carry the Application Id of the
5602 application that is using it. The application itself will process
5603 the received accounting records or forward them to an accounting
5604 server. There is no accounting application advertisement required
5605 during capabilities exchange and the accounting messages will be
5606 routed the same as any of the other application messages.
5608 In cases where an application does not define its own accounting
5609 service, it is preferred that the split accounting model be used.
5611 9.4. Fault Resilience
5613 Diameter Base protocol mechanisms are used to overcome small message
5614 loss and network faults of temporary nature.
5616 Diameter peers acting as clients MUST implement the use of failover
5617 to guard against server failures and certain network failures.
5618 Diameter peers acting as agents or related off-line processing
5619 systems MUST detect duplicate accounting records caused by the
5620 sending of same record to several servers and duplication of messages
5621 in transit. This detection MUST be based on the inspection of the
5622 Session-Id and Accounting-Record-Number AVP pairs. Appendix C
5623 discusses duplicate detection needs and implementation issues.
5625 Diameter clients MAY have non-volatile memory for the safe storage of
5626 accounting records over reboots or extended network failures, network
5627 partitions, and server failures. If such memory is available, the
5628 client SHOULD store new accounting records there as soon as the
5629 records are created and until a positive acknowledgement of their
5630 reception from the Diameter Server has been received. Upon a reboot,
5631 the client MUST starting sending the records in the non-volatile
5632 memory to the accounting server with appropriate modifications in
5633 termination cause, session length, and other relevant information in
5634 the records.
5636 A further application of this protocol may include AVPs to control
5637 how many accounting records may at most be stored in the Diameter
5638 client without committing them to the non-volatile memory or
5639 transferring them to the Diameter server.
5641 The client SHOULD NOT remove the accounting data from any of its
5642 memory areas before the correct Accounting-Answer has been received.
5643 The client MAY remove oldest, undelivered or yet unacknowledged
5644 accounting data if it runs out of resources such as memory. It is an
5645 implementation dependent matter for the client to accept new sessions
5646 under this condition.
5648 9.5. Accounting Records
5650 In all accounting records, the Session-Id AVP MUST be present; the
5651 User-Name AVP MUST be present if it is available to the Diameter
5652 client.
5654 Different types of accounting records are sent depending on the
5655 actual type of accounted service and the authorization server's
5656 directions for interim accounting. If the accounted service is a
5657 one-time event, meaning that the start and stop of the event are
5658 simultaneous, then the Accounting-Record-Type AVP MUST be present and
5659 set to the value EVENT_RECORD.
5661 If the accounted service is of a measurable length, then the AVP MUST
5662 use the values START_RECORD, STOP_RECORD, and possibly,
5663 INTERIM_RECORD. If the authorization server has not directed interim
5664 accounting to be enabled for the session, two accounting records MUST
5665 be generated for each service of type session. When the initial
5666 Accounting-Request for a given session is sent, the Accounting-
5667 Record-Type AVP MUST be set to the value START_RECORD. When the last
5668 Accounting-Request is sent, the value MUST be STOP_RECORD.
5670 If the authorization server has directed interim accounting to be
5671 enabled, the Diameter client MUST produce additional records between
5672 the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The
5673 production of these records is directed by Acct-Interim-Interval as
5674 well as any re-authentication or re-authorization of the session.
5675 The Diameter client MUST overwrite any previous interim accounting
5676 records that are locally stored for delivery, if a new record is
5677 being generated for the same session. This ensures that only one
5678 pending interim record can exist on an access device for any given
5679 session.
5681 A particular value of Accounting-Sub-Session-Id MUST appear only in
5682 one sequence of accounting records from a DIAMETER client, except for
5683 the purposes of retransmission. The one sequence that is sent MUST
5684 be either one record with Accounting-Record-Type AVP set to the value
5685 EVENT_RECORD, or several records starting with one having the value
5686 START_RECORD, followed by zero or more INTERIM_RECORD and a single
5687 STOP_RECORD. A particular Diameter application specification MUST
5688 define the type of sequences that MUST be used.
5690 9.6. Correlation of Accounting Records
5692 The Diameter protocol's Session-Id AVP, which is globally unique (see
5693 Section 8.8), is used during the authorization phase to identify a
5694 particular session. Services that do not require any authorization
5695 still use the Session-Id AVP to identify sessions. Accounting
5696 messages MAY use a different Session-Id from that sent in
5697 authorization messages. Specific applications MAY require different
5698 a Session-ID for accounting messages.
5700 However, there are certain applications that require multiple
5701 accounting sub-sessions. Such applications would send messages with
5702 a constant Session-Id AVP, but a different Accounting-Sub-Session-Id
5703 AVP. In these cases, correlation is performed using the Session-Id.
5704 It is important to note that receiving a STOP_RECORD with no
5705 Accounting-Sub-Session-Id AVP when sub-sessions were originally used
5706 in the START_RECORD messages implies that all sub-sessions are
5707 terminated.
5709 Furthermore, there are certain applications where a user receives
5710 service from different access devices (e.g., Mobile IPv4), each with
5711 their own unique Session-Id. In such cases, the Acct-Multi-Session-
5712 Id AVP is used for correlation. During authorization, a server that
5713 determines that a request is for an existing session SHOULD include
5714 the Acct-Multi-Session-Id AVP, which the access device MUST include
5715 in all subsequent accounting messages.
5717 The Acct-Multi-Session-Id AVP MAY include the value of the original
5718 Session-Id. It's contents are implementation specific, but MUST be
5719 globally unique across other Acct-Multi-Session-Id, and MUST NOT
5720 change during the life of a session.
5722 A Diameter application document MUST define the exact concept of a
5723 session that is being accounted, and MAY define the concept of a
5724 multi-session. For instance, the NASREQ DIAMETER application treats
5725 a single PPP connection to a Network Access Server as one session,
5726 and a set of Multilink PPP sessions as one multi-session.
5728 9.7. Accounting Command-Codes
5730 This section defines Command-Code values that MUST be supported by
5731 all Diameter implementations that provide Accounting services.
5733 9.7.1. Accounting-Request
5735 The Accounting-Request (ACR) command, indicated by the Command-Code
5736 field set to 271 and the Command Flags' 'R' bit set, is sent by a
5737 Diameter node, acting as a client, in order to exchange accounting
5738 information with a peer.
5740 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs
5741 MUST be present. If the Vendor-Specific-Application-Id grouped AVP
5742 is present, it MUST include an Acct-Application-Id AVP.
5744 The AVP listed below SHOULD include service specific accounting AVPs,
5745 as described in Section 9.3.
5747 Message Format
5749 ::= < Diameter Header: 271, REQ, PXY >
5750 < Session-Id >
5751 { Origin-Host }
5752 { Origin-Realm }
5753 { Destination-Realm }
5754 { Accounting-Record-Type }
5755 { Accounting-Record-Number }
5756 [ Acct-Application-Id ]
5757 [ Vendor-Specific-Application-Id ]
5758 [ User-Name ]
5759 [ Destination-Host ]
5760 [ Accounting-Sub-Session-Id ]
5761 [ Acct-Session-Id ]
5762 [ Acct-Multi-Session-Id ]
5763 [ Acct-Interim-Interval ]
5764 [ Accounting-Realtime-Required ]
5765 [ Origin-State-Id ]
5766 [ Event-Timestamp ]
5767 * [ Proxy-Info ]
5768 * [ Route-Record ]
5769 * [ AVP ]
5771 9.7.2. Accounting-Answer
5773 The Accounting-Answer (ACA) command, indicated by the Command-Code
5774 field set to 271 and the Command Flags' 'R' bit cleared, is used to
5775 acknowledge an Accounting-Request command. The Accounting-Answer
5776 command contains the same Session-Id as the corresponding request.
5778 Only the target Diameter Server, known as the home Diameter Server,
5779 SHOULD respond with the Accounting-Answer command.
5781 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs
5782 MUST be present. If the Vendor-Specific-Application-Id grouped AVP
5783 is present, it MUST contain an Acct-Application-Id AVP.
5785 The AVP listed below SHOULD include service specific accounting AVPs,
5786 as described in Section 9.3.
5788 Message Format
5790 ::= < Diameter Header: 271, PXY >
5791 < Session-Id >
5792 { Result-Code }
5793 { Origin-Host }
5794 { Origin-Realm }
5795 { Accounting-Record-Type }
5796 { Accounting-Record-Number }
5797 [ Acct-Application-Id ]
5798 [ Vendor-Specific-Application-Id ]
5799 [ User-Name ]
5800 [ Accounting-Sub-Session-Id ]
5801 [ Acct-Session-Id ]
5802 [ Acct-Multi-Session-Id ]
5803 [ Error-Message ]
5804 [ Error-Reporting-Host ]
5805 [ Failed-AVP ]
5806 [ Acct-Interim-Interval ]
5807 [ Accounting-Realtime-Required ]
5808 [ Origin-State-Id ]
5809 [ Event-Timestamp ]
5810 * [ Proxy-Info ]
5811 * [ AVP ]
5813 9.8. Accounting AVPs
5815 This section contains AVPs that describe accounting usage information
5816 related to a specific session.
5818 9.8.1. Accounting-Record-Type AVP
5820 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated
5821 and contains the type of accounting record being sent. The following
5822 values are currently defined for the Accounting-Record-Type AVP:
5824 EVENT_RECORD 1
5826 An Accounting Event Record is used to indicate that a one-time
5827 event has occurred (meaning that the start and end of the event
5828 are simultaneous). This record contains all information relevant
5829 to the service, and is the only record of the service.
5831 START_RECORD 2
5833 An Accounting Start, Interim, and Stop Records are used to
5834 indicate that a service of a measurable length has been given. An
5835 Accounting Start Record is used to initiate an accounting session,
5836 and contains accounting information that is relevant to the
5837 initiation of the session.
5839 INTERIM_RECORD 3
5841 An Interim Accounting Record contains cumulative accounting
5842 information for an existing accounting session. Interim
5843 Accounting Records SHOULD be sent every time a re-authentication
5844 or re-authorization occurs. Further, additional interim record
5845 triggers MAY be defined by application-specific Diameter
5846 applications. The selection of whether to use INTERIM_RECORD
5847 records is done by the Acct-Interim-Interval AVP.
5849 STOP_RECORD 4
5851 An Accounting Stop Record is sent to terminate an accounting
5852 session and contains cumulative accounting information relevant to
5853 the existing session.
5855 9.8.2. Acct-Interim-Interval AVP
5857 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and
5858 is sent from the Diameter home authorization server to the Diameter
5859 client. The client uses information in this AVP to decide how and
5860 when to produce accounting records. With different values in this
5861 AVP, service sessions can result in one, two, or two+N accounting
5862 records, based on the needs of the home-organization. The following
5863 accounting record production behavior is directed by the inclusion of
5864 this AVP:
5866 1. The omission of the Acct-Interim-Interval AVP or its inclusion
5867 with Value field set to 0 means that EVENT_RECORD, START_RECORD,
5868 and STOP_RECORD are produced, as appropriate for the service.
5870 2. The inclusion of the AVP with Value field set to a non-zero value
5871 means that INTERIM_RECORD records MUST be produced between the
5872 START_RECORD and STOP_RECORD records. The Value field of this
5873 AVP is the nominal interval between these records in seconds.
5875 The Diameter node that originates the accounting information,
5876 known as the client, MUST produce the first INTERIM_RECORD record
5877 roughly at the time when this nominal interval has elapsed from
5878 the START_RECORD, the next one again as the interval has elapsed
5879 once more, and so on until the session ends and a STOP_RECORD
5880 record is produced.
5882 The client MUST ensure that the interim record production times
5883 are randomized so that large accounting message storms are not
5884 created either among records or around a common service start
5885 time.
5887 9.8.3. Accounting-Record-Number AVP
5889 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32
5890 and identifies this record within one session. As Session-Id AVPs
5891 are globally unique, the combination of Session-Id and Accounting-
5892 Record-Number AVPs is also globally unique, and can be used in
5893 matching accounting records with confirmations. An easy way to
5894 produce unique numbers is to set the value to 0 for records of type
5895 EVENT_RECORD and START_RECORD, and set the value to 1 for the first
5896 INTERIM_RECORD, 2 for the second, and so on until the value for
5897 STOP_RECORD is one more than for the last INTERIM_RECORD.
5899 9.8.4. Acct-Session-Id AVP
5901 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only
5902 used when RADIUS/Diameter translation occurs. This AVP contains the
5903 contents of the RADIUS Acct-Session-Id attribute.
5905 9.8.5. Acct-Multi-Session-Id AVP
5907 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String,
5908 following the format specified in Section 8.8. The Acct-Multi-
5909 Session-Id AVP is used to link together multiple related accounting
5910 sessions, where each session would have a unique Session-Id, but the
5911 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the
5912 Diameter server in an authorization answer, and MUST be used in all
5913 accounting messages for the given session.
5915 9.8.6. Accounting-Sub-Session-Id AVP
5917 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type
5918 Unsigned64 and contains the accounting sub-session identifier. The
5919 combination of the Session-Id and this AVP MUST be unique per sub-
5920 session, and the value of this AVP MUST be monotonically increased by
5921 one for all new sub-sessions. The absence of this AVP implies no
5922 sub-sessions are in use, with the exception of an Accounting-Request
5923 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD
5924 message with no Accounting-Sub-Session-Id AVP present will signal the
5925 termination of all sub-sessions for a given Session-Id.
5927 9.8.7. Accounting-Realtime-Required AVP
5929 The Accounting-Realtime-Required AVP (AVP Code 483) is of type
5930 Enumerated and is sent from the Diameter home authorization server to
5931 the Diameter client or in the Accounting-Answer from the accounting
5932 server. The client uses information in this AVP to decide what to do
5933 if the sending of accounting records to the accounting server has
5934 been temporarily prevented due to, for instance, a network problem.
5936 DELIVER_AND_GRANT 1
5938 The AVP with Value field set to DELIVER_AND_GRANT means that the
5939 service MUST only be granted as long as there is a connection to
5940 an accounting server. Note that the set of alternative accounting
5941 servers are treated as one server in this sense. Having to move
5942 the accounting record stream to a backup server is not a reason to
5943 discontinue the service to the user.
5945 GRANT_AND_STORE 2
5947 The AVP with Value field set to GRANT_AND_STORE means that service
5948 SHOULD be granted if there is a connection, or as long as records
5949 can still be stored as described in Section 9.4.
5951 This is the default behavior if the AVP isn't included in the
5952 reply from the authorization server.
5954 GRANT_AND_LOSE 3
5956 The AVP with Value field set to GRANT_AND_LOSE means that service
5957 SHOULD be granted even if the records can not be delivered or
5958 stored.
5960 10. AVP Occurrence Table
5962 The following tables presents the AVPs defined in this document, and
5963 specifies in which Diameter messages they MAY be present or not.
5964 AVPs that occur only inside a Grouped AVP are not shown in this
5965 table.
5967 The table uses the following symbols:
5969 0 The AVP MUST NOT be present in the message.
5971 0+ Zero or more instances of the AVP MAY be present in the
5972 message.
5974 0-1 Zero or one instance of the AVP MAY be present in the message.
5975 It is considered an error if there are more than one instance of
5976 the AVP.
5978 1 One instance of the AVP MUST be present in the message.
5980 1+ At least one instance of the AVP MUST be present in the
5981 message.
5983 10.1. Base Protocol Command AVP Table
5985 The table in this section is limited to the non-accounting Command
5986 Codes defined in this specification.
5988 +-----------------------------------------------+
5989 | Command-Code |
5990 +---+---+---+---+---+---+---+---+---+---+---+---+
5991 Attribute Name |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA|
5992 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+
5993 Acct-Interim- |0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 |
5994 Interval | | | | | | | | | | | | |
5995 Accounting-Realtime-|0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 |
5996 Required | | | | | | | | | | | | |
5997 Acct-Application-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
5998 Auth-Application-Id |0+ |0+ |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 |
5999 Auth-Grace-Period |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6000 Auth-Request-Type |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6001 Auth-Session-State |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6002 Authorization- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6003 Lifetime | | | | | | | | | | | | |
6004 Class |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0+ |0+ |
6005 Destination-Host |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0-1|0 |
6006 Destination-Realm |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 |
6007 Disconnect-Cause |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6008 Error-Message |0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|
6009 Error-Reporting-Host|0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1|
6010 Failed-AVP |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |
6011 Firmware-Revision |0-1|0-1|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6012 Host-IP-Address |1+ |1+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6013 Inband-Security-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6014 Multi-Round-Time-Out|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6015 Origin-Host |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |
6016 Origin-Realm |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |
6017 Origin-State-Id |0-1|0-1|0 |0 |0-1|0-1|0-1|0-1|0-1|0-1|0-1|0-1|
6018 Product-Name |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6019 Proxy-Info |0 |0 |0 |0 |0 |0 |0+ |0+ |0+ |0+ |0+ |0+ |
6020 Redirect-Host |0 |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |
6021 Redirect-Host-Usage |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1|
6022 Redirect-Max-Cache- |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1|
6023 Time | | | | | | | | | | | | |
6024 Result-Code |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |
6025 Re-Auth-Request-Type|0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 |
6026 Route-Record |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |0 |
6027 Session-Binding |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6028 Session-Id |0 |0 |0 |0 |0 |0 |1 |1 |1 |1 |1 |1 |
6029 Session-Server- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6030 Failover | | | | | | | | | | | | |
6031 Session-Timeout |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6032 Supported-Vendor-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6033 Termination-Cause |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |1 |0 |
6034 User-Name |0 |0 |0 |0 |0 |0 |0-1|0-1|0-1|0-1|0-1|0-1|
6035 Vendor-Id |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6036 Vendor-Specific- |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6037 Application-Id | | | | | | | | | | | | |
6038 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+
6040 10.2. Accounting AVP Table
6042 The table in this section is used to represent which AVPs defined in
6043 this document are to be present in the Accounting messages. These
6044 AVP occurrence requirements are guidelines, which may be expanded,
6045 and/or overridden by application-specific requirements in the
6046 Diameter applications documents.
6048 +-----------+
6049 | Command |
6050 | Code |
6051 +-----+-----+
6052 Attribute Name | ACR | ACA |
6053 ------------------------------+-----+-----+
6054 Acct-Interim-Interval | 0-1 | 0-1 |
6055 Acct-Multi-Session-Id | 0-1 | 0-1 |
6056 Accounting-Record-Number | 1 | 1 |
6057 Accounting-Record-Type | 1 | 1 |
6058 Acct-Session-Id | 0-1 | 0-1 |
6059 Accounting-Sub-Session-Id | 0-1 | 0-1 |
6060 Accounting-Realtime-Required | 0-1 | 0-1 |
6061 Acct-Application-Id | 0-1 | 0-1 |
6062 Auth-Application-Id | 0 | 0 |
6063 Class | 0+ | 0+ |
6064 Destination-Host | 0-1 | 0 |
6065 Destination-Realm | 1 | 0 |
6066 Error-Reporting-Host | 0 | 0+ |
6067 Event-Timestamp | 0-1 | 0-1 |
6068 Origin-Host | 1 | 1 |
6069 Origin-Realm | 1 | 1 |
6070 Proxy-Info | 0+ | 0+ |
6071 Route-Record | 0+ | 0 |
6072 Result-Code | 0 | 1 |
6073 Session-Id | 1 | 1 |
6074 Termination-Cause | 0 | 0 |
6075 User-Name | 0-1 | 0-1 |
6076 Vendor-Specific-Application-Id| 0-1 | 0-1 |
6077 ------------------------------+-----+-----+
6079 11. IANA Considerations
6081 This section provides guidance to the Internet Assigned Numbers
6082 Authority (IANA) regarding registration of values related to the
6083 Diameter protocol, in accordance with BCP 26 [RFC2434]. The
6084 following policies are used here with the meanings defined in BCP 26:
6085 "Private Use", "First Come First Served", "Expert Review",
6086 "Specification Required", "IETF Review", "Standards Action".
6088 This section explains the criteria to be used by the IANA for
6089 assignment of numbers within namespaces defined within this document.
6091 Diameter is not intended as a general purpose protocol, and
6092 allocations SHOULD NOT be made for purposes unrelated to
6093 authentication, authorization or accounting.
6095 For registration requests where a Designated Expert should be
6096 consulted, the responsible IESG area director should appoint the
6097 Designated Expert. For Designated Expert with Specification
6098 Required, the request is posted to the DIME WG mailing list (or, if
6099 it has been disbanded, a successor designated by the Area Director)
6100 for comment and review, and MUST include a pointer to a public
6101 specification. Before a period of 30 days has passed, the Designated
6102 Expert will either approve or deny the registration request and
6103 publish a notice of the decision to the DIME WG mailing list or its
6104 successor. A denial notice MUST be justified by an explanation and,
6105 in the cases where it is possible, concrete suggestions on how the
6106 request can be modified so as to become acceptable.
6108 11.1. AVP Header
6110 As defined in Section 4, the AVP header contains three fields that
6111 requires IANA namespace management; the AVP Code, Vendor-ID and Flags
6112 field.
6114 11.1.1. AVP Codes
6116 The AVP Code namespace is used to identify attributes. There are
6117 multiple namespaces. Vendors can have their own AVP Codes namespace
6118 which will be identified by their Vendor-ID (also known as
6119 Enterprise-Number) and they control the assignments of their vendor-
6120 specific AVP codes within their own namespace. The absence of a
6121 Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA
6122 controlled AVP Codes namespace. The AVP Codes and sometimes also
6123 possible values in an AVP are controlled and maintained by IANA.
6125 AVP Code 0 is not used. AVP Codes 1-255 are managed separately as
6126 RADIUS Attribute Types [RADTYPE]. This document defines the AVP
6127 Codes 257-274, 276-285, 287, 291-300, 480, 483 and 485-486. See
6128 Section 4.5 for the assignment of the namespace in this
6129 specification.
6131 AVPs may be allocated following Designated Expert with Specification
6132 Required [RFC2434]. Release of blocks of AVPs (more than 3 at a time
6133 for a given purpose) should require IETF Review.
6135 Note that Diameter defines a mechanism for Vendor-Specific AVPs,
6136 where the Vendor-Id field in the AVP header is set to a non-zero
6137 value. Vendor-Specific AVPs codes are for Private Use and should be
6138 encouraged instead of allocation of global attribute types, for
6139 functions specific only to one vendor's implementation of Diameter,
6140 where no interoperability is deemed useful. Where a Vendor-Specific
6141 AVP is implemented by more than one vendor, allocation of global AVPs
6142 should be encouraged instead.
6144 11.1.2. AVP Flags
6146 There are 8 bits in the AVP Flags field of the AVP header, defined in
6147 Section 4. This document assigns bit 0 ('V'endor Specific), bit 1
6148 ('M'andatory) and bit 2 ('P'rotected). The remaining bits should
6149 only be assigned via a Standards Action [RFC2434].
6151 11.2. Diameter Header
6153 As defined in Section 3, the Diameter header contains two fields that
6154 require IANA namespace management; Command Code and Command Flags.
6156 11.2.1. Command Codes
6158 The Command Code namespace is used to identify Diameter commands.
6159 The values 0-255 (0x00-0xff) are reserved for RADIUS backward
6160 compatibility, and are defined as "RADIUS Packet Type Codes" in
6161 [RADTYPE]. Values 256 - 8,388,607 (0x100 to 0x7fffff) are for
6162 permanent, standard commands, allocated by IETF Review [RFC2434].
6163 This document defines the Command Codes 257, 258, 271, 274-275, 280
6164 and 282. See Section 3.1 for the assignment of the namespace in this
6165 specification.
6167 The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved
6168 for vendor-specific command codes, to be allocated on a First Come,
6169 First Served basis by IANA [RFC2434]. The request to IANA for a
6170 Vendor-Specific Command Code SHOULD include a reference to a publicly
6171 available specification which documents the command in sufficient
6172 detail to aid in interoperability between independent
6173 implementations. If the specification cannot be made publicly
6174 available, the request for a vendor-specific command code MUST
6175 include the contact information of persons and/or entities
6176 responsible for authoring and maintaining the command.
6178 The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe -
6179 0xffffff) are reserved for experimental commands. As these codes are
6180 only for experimental and testing purposes, no guarantee is made for
6181 interoperability between Diameter peers using experimental commands,
6182 as outlined in [IANA-EXP].
6184 11.2.2. Command Flags
6186 There are eight bits in the Command Flags field of the Diameter
6187 header. This document assigns bit 0 ('R'equest), bit 1 ('P'roxy),
6188 bit 2 ('E'rror) and bit 3 ('T'). Bits 4 through 7 MUST only be
6189 assigned via a Standards Action [RFC2434].
6191 11.3. Application Identifiers
6193 As defined in Section 2.4, the Application Id is used to identify a
6194 specific Diameter Application. There are standards-track Application
6195 Ids and vendor specific Application Ids.
6197 IANA [RFC2434] has assigned the range 0x00000001 to 0x00ffffff for
6198 standards-track applications; and 0x01000000 - 0xfffffffe for vendor
6199 specific applications, on a first-come, first-served basis. The
6200 following values are allocated.
6202 Diameter Common Messages 0
6203 NASREQ 1 [RFC4005]
6204 Mobile-IP 2 [RFC4004]
6205 Diameter Base Accounting 3
6206 Relay 0xffffffff
6208 Assignment of standards-track Application Ids are by Designated
6209 Expert with Specification Required [RFC2434].
6211 Both Auth-Application-Id and Acct-Application-Id AVPs use the same
6212 Application Id space. A diameter node advertising itself as a relay
6213 agent MUST set either Application-Id or Acct-Application-Id to
6214 0xffffffff.
6216 Vendor-Specific Application Ids, are for Private Use. Vendor-Specific
6217 Application Ids are assigned on a First Come, First Served basis by
6218 IANA.
6220 11.4. AVP Values
6222 Certain AVPs in Diameter define a list of values with various
6223 meanings. For attributes other than those specified in this section,
6224 adding additional values to the list can be done on a First Come,
6225 First Served basis by IANA.
6227 11.4.1. Result-Code AVP Values
6229 As defined in Section 7.1, the Result-Code AVP (AVP Code 268) defines
6230 the values 1001, 2001-2002, 3001-3012, 4001-4003 and 5001-5021.
6232 All remaining values are available for assignment via IETF Review
6233 [RFC2434].
6235 11.4.2. Accounting-Record-Type AVP Values
6237 As defined in Section 9.8.1, the Accounting-Record-Type AVP (AVP Code
6238 480) defines the values 1-4. All remaining values are available for
6239 assignment via IETF Review [RFC2434].
6241 11.4.3. Termination-Cause AVP Values
6243 As defined in Section 8.15, the Termination-Cause AVP (AVP Code 295)
6244 defines the values 1-8. All remaining values are available for
6245 assignment via IETF Review [RFC2434].
6247 11.4.4. Redirect-Host-Usage AVP Values
6249 As defined in Section 6.13, the Redirect-Host-Usage AVP (AVP Code
6250 261) defines the values 0-5. All remaining values are available for
6251 assignment via IETF Review [RFC2434].
6253 11.4.5. Session-Server-Failover AVP Values
6255 As defined in Section 8.18, the Session-Server-Failover AVP (AVP Code
6256 271) defines the values 0-3. All remaining values are available for
6257 assignment via IETF Review [RFC2434].
6259 11.4.6. Session-Binding AVP Values
6261 As defined in Section 8.17, the Session-Binding AVP (AVP Code 270)
6262 defines the bits 1-4. All remaining bits are available for
6263 assignment via IETF Review [RFC2434].
6265 11.4.7. Disconnect-Cause AVP Values
6267 As defined in Section 5.4.3, the Disconnect-Cause AVP (AVP Code 273)
6268 defines the values 0-2. All remaining values are available for
6269 assignment via IETF Review [RFC2434].
6271 11.4.8. Auth-Request-Type AVP Values
6273 As defined in Section 8.7, the Auth-Request-Type AVP (AVP Code 274)
6274 defines the values 1-3. All remaining values are available for
6275 assignment via IETF Review [RFC2434].
6277 11.4.9. Auth-Session-State AVP Values
6279 As defined in Section 8.11, the Auth-Session-State AVP (AVP Code 277)
6280 defines the values 0-1. All remaining values are available for
6281 assignment via IETF Review [RFC2434].
6283 11.4.10. Re-Auth-Request-Type AVP Values
6285 As defined in Section 8.12, the Re-Auth-Request-Type AVP (AVP Code
6286 285) defines the values 0-1. All remaining values are available for
6287 assignment via IETF Review [RFC2434].
6289 11.4.11. Accounting-Realtime-Required AVP Values
6291 As defined in Section 9.8.7, the Accounting-Realtime-Required AVP
6292 (AVP Code 483) defines the values 1-3. All remaining values are
6293 available for assignment via IETF Review [RFC2434].
6295 11.4.12. Inband-Security-Id AVP (code 299)
6297 As defined in Section 6.10, the Inband-Security-Id AVP (AVP Code 299)
6298 defines the values 0-1. All remaining values are available for
6299 assignment via IETF Review [RFC2434].
6301 11.5. Diameter TCP/SCTP Port Numbers
6303 The IANA has assigned TCP and SCTP port number 3868 to Diameter.
6305 11.6. NAPTR Service Fields
6307 The registration in the RFC MUST include the following information:
6309 Service Field: The service field being registered. An example for a
6310 new fictitious transport protocol called NCTP might be "AAA+D2N".
6312 Protocol: The specific transport protocol associated with that
6313 service field. This MUST include the name and acronym for the
6314 protocol, along with reference to a document that describes the
6315 transport protocol. For example - "New Connectionless Transport
6316 Protocol (NCTP), RFC XYZ".
6318 Name and Contact Information: The name, address, email address and
6319 telephone number for the person performing the registration.
6321 The following values have been placed into the registry:
6323 Services Field Protocol
6325 AAA+D2T TCP
6326 AAA+D2S SCTP
6328 12. Diameter protocol related configurable parameters
6330 This section contains the configurable parameters that are found
6331 throughout this document:
6333 Diameter Peer
6335 A Diameter entity MAY communicate with peers that are statically
6336 configured. A statically configured Diameter peer would require
6337 that either the IP address or the fully qualified domain name
6338 (FQDN) be supplied, which would then be used to resolve through
6339 DNS.
6341 Routing Table
6343 A Diameter proxy server routes messages based on the realm portion
6344 of a Network Access Identifier (NAI). The server MUST have a
6345 table of Realm Names, and the address of the peer to which the
6346 message must be forwarded to. The routing table MAY also include
6347 a "default route", which is typically used for all messages that
6348 cannot be locally processed.
6350 Tc timer
6352 The Tc timer controls the frequency that transport connection
6353 attempts are done to a peer with whom no active transport
6354 connection exists. The recommended value is 30 seconds.
6356 13. Security Considerations
6358 The Diameter base protocol messages SHOULD be secured by using TLS
6359 [RFC4346]. Additional security measures that are transparent to and
6360 independent of Diameter, such as IPSec [RFC4301], can also be
6361 deployed to secure connections between peers.
6363 During deployment, connections between Diameter nodes SHOULD be
6364 protected by TLS. All Diameter base protocol implementations MUST
6365 support the use of TLS. The Diameter protocol MUST NOT be used
6366 without any security mechanism.
6368 If a Diameter connection is to be protected via TLS, then the CER/CEA
6369 exchange MUST include an Inband-Security-ID AVP with a value of TLS.
6370 For TLS usage, a TLS handshake will begin when both ends are in the
6371 open state, after completion of the CER/CEA exchange. If the TLS
6372 handshake is successful, all further messages will be sent via TLS.
6373 If the handshake fails, both ends move to the closed state. See
6374 Sections 13.1 for more details.
6376 13.1. TLS Usage
6378 A Diameter node that initiates a connection to another Diameter node
6379 acts as a TLS client according to [RFC4346], and a Diameter node that
6380 accepts a connection acts as a TLS server. Diameter nodes
6381 implementing TLS for security MUST mutually authenticate as part of
6382 TLS session establishment. In order to ensure mutual authentication,
6383 the Diameter node acting as TLS server MUST request a certificate
6384 from the Diameter node acting as TLS client, and the Diameter node
6385 acting as TLS client MUST be prepared to supply a certificate on
6386 request.
6388 Diameter nodes MUST be able to negotiate the following TLS cipher
6389 suites:
6391 TLS_RSA_WITH_RC4_128_MD5
6392 TLS_RSA_WITH_RC4_128_SHA
6393 TLS_RSA_WITH_3DES_EDE_CBC_SHA
6395 Diameter nodes SHOULD be able to negotiate the following TLS cipher
6396 suite:
6398 TLS_RSA_WITH_AES_128_CBC_SHA
6400 Diameter nodes MAY negotiate other TLS cipher suites.
6402 Upon receiving the peers certificate, Diameter nodes SHOULD further
6403 validate the identity of the peer by matching the received Origin-
6404 Host and/or Origin-Realm in the CER and CEA exchange against the
6405 content of the peers certificate. Diameter peer hostname and/or
6406 realm validation can be performed in the following order:
6408 o If one ore more 'Subject Alternate Name (subjectAltName)'
6409 extension of type dNSName is present in the certificate (See
6410 [RFC3280]), then the Origin-Host value can be used to find a
6411 matching extension.
6413 o If there are no matches found, then the Origin-Realm value can be
6414 used to find a matching subjectAltName extension.
6416 o Otherwise, the Origin-Host value should be found within the
6417 'Common Name (CN)' field in the Subject field of the certificate
6418 (See [RFC3280]).
6420 Identity validation MAY be omitted by a Diameter node if the
6421 information contained in the certificate cannot be co-related or
6422 mapped to the Origin-Host and Origin-Realm presented by a peer.
6423 However, the Diameter node SHOULD have external information or other
6424 means to validate the identity of a peer.
6426 13.2. Peer-to-Peer Considerations
6428 As with any peer-to-peer protocol, proper configuration of the trust
6429 model within a Diameter peer is essential to security. When
6430 certificates are used, it is necessary to configure the root
6431 certificate authorities trusted by the Diameter peer. These root CAs
6432 are likely to be unique to Diameter usage and distinct from the root
6433 CAs that might be trusted for other purposes such as Web browsing.
6434 In general, it is expected that those root CAs will be configured so
6435 as to reflect the business relationships between the organization
6436 hosting the Diameter peer and other organizations. As a result, a
6437 Diameter peer will typically not be configured to allow connectivity
6438 with any arbitrary peer. With certificate authentication, Diameter
6439 peers may not be known beforehand and therefore peer discovery may be
6440 required.
6442 14. References
6444 14.1. Normative References
6446 [FLOATPOINT]
6447 Institute of Electrical and Electronics Engineers, "IEEE
6448 Standard for Binary Floating-Point Arithmetic, ANSI/IEEE
6449 Standard 754-1985", August 1985.
6451 [IANAADFAM]
6452 IANA,, "Address Family Numbers",
6453 http://www.iana.org/assignments/address-family-numbers.
6455 [RADTYPE] IANA,, "RADIUS Types",
6456 http://www.iana.org/assignments/radius-types.
6458 [RFC791] Postel, J., "Internet Protocol", RFC 791, September 1981.
6460 [RFC793] Postel, J., "Transmission Control Protocol", RFC 793,
6461 January 1981.
6463 [RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and
6464 Accounting (AAA) Transport Profile", RFC 3539, June 2003.
6466 [RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and
6467 P. McCann, "Diameter Mobile IPv4 Application", RFC 4004,
6468 August 2005.
6470 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton,
6471 "Diameter Network Access Server Application", RFC 4005,
6472 August 2005.
6474 [RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J.
6475 Loughney, "Diameter Credit-Control Application", RFC 4006,
6476 August 2005.
6478 [RFC4072] Eronen, P., Hiller, T., and G. Zorn, "Diameter Extensible
6479 Authentication Protocol (EAP) Application", RFC 4072,
6480 August 2005.
6482 [RFC4740] Garcia-Martin, M., Belinchon, M., Pallares-Lopez, M.,
6483 Canales-Valenzuela, C., and K. Tammi, "Diameter Session
6484 Initiation Protocol (SIP) Application", RFC 4740,
6485 November 2006.
6487 [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
6488 Specifications: ABNF", RFC 4234, October 2005.
6490 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J.
6491 Arkko, "Diameter Base Protocol", RFC 3588, September 2003.
6493 [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an
6494 IANA Considerations Section in RFCs", BCP 26, RFC 2434,
6495 October 1998.
6497 [RFC4306] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol",
6498 RFC 4306, December 2005.
6500 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing
6501 Architecture", RFC 4291, February 2006.
6503 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
6504 Requirement Levels", BCP 14, RFC 2119, March 1997.
6506 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The
6507 Network Access Identifier", RFC 4282, December 2005.
6509 [RFC3403] Mealling, M., "Dynamic Delegation Discovery System (DDDS)
6510 Part Three: The Domain Name System (DNS) Database",
6511 RFC 3403, October 2002.
6513 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston,
6514 A., Peterson, J., Sparks, R., Handley, M., and E.
6515 Schooler, "SIP: Session Initiation Protocol", RFC 3261,
6516 June 2002.
6518 [RFC2960] Stewart, R., Xie, Q., Morneault, K., Sharp, C.,
6519 Schwarzbauer, H., Taylor, T., Rytina, I., Kalla, M.,
6520 Zhang, L., and V. Paxson, "Stream Control Transmission
6521 Protocol", RFC 2960, October 2000.
6523 [RFC4346] Dierks, T. and E. Rescorla, "The Transport Layer Security
6524 (TLS) Protocol Version 1.1", RFC 4346, April 2006.
6526 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
6527 Resource Identifier (URI): Generic Syntax", STD 66,
6528 RFC 3986, January 2005.
6530 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
6531 10646", STD 63, RFC 3629, November 2003.
6533 [RFC3280] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet
6534 X.509 Public Key Infrastructure Certificate and
6535 Certificate Revocation List (CRL) Profile", RFC 3280,
6536 April 2002.
6538 [RFC3490] Faltstrom, P., Hoffman, P., and A. Costello,
6539 "Internationalizing Domain Names in Applications (IDNA)",
6540 RFC 3490, March 2003.
6542 [RFC3491] Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep
6543 Profile for Internationalized Domain Names (IDN)",
6544 RFC 3491, March 2003.
6546 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode
6547 for Internationalized Domain Names in Applications
6548 (IDNA)", RFC 3492, March 2003.
6550 14.2. Informational References
6552 [RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P.,
6553 Shiino, H., Zorn, G., Dommety, G., C.Perkins, B.Patil,
6554 D.Mitton, S.Manning, M.Beadles, P.Walsh, X.Chen,
6555 S.Sivalingham, A.Hameed, M.Munson, S.Jacobs, B.Lim,
6556 B.Hirschman, R.Hsu, Y.Xu, E.Campell, S.Baba, and E.Jaques,
6557 "Criteria for Evaluating AAA Protocols for Network
6558 Access", RFC 2989, November 2000.
6560 [RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to
6561 Accounting Management", RFC 2975, October 2000.
6563 [RFC3232] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by
6564 an On-line Database", RFC 3232, January 2002.
6566 [RFC3576] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B.
6567 Aboba, "Dynamic Authorization Extensions to Remote
6568 Authentication Dial In User Service (RADIUS)", RFC 3576,
6569 July 2003.
6571 [RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51,
6572 RFC 1661, July 1994.
6574 [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000.
6576 [RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS
6577 Extensions", RFC 2869, June 2000.
6579 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson,
6580 "Remote Authentication Dial In User Service (RADIUS)",
6581 RFC 2865, June 2000.
6583 [RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6",
6584 RFC 3162, August 2001.
6586 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the
6587 Internet Protocol", RFC 4301, December 2005.
6589 [RFC4330] Mills, D., "Simple Network Time Protocol (SNTP) Version 4
6590 for IPv4, IPv6 and OSI", RFC 4330, January 2006.
6592 [RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called
6593 TACACS", RFC 1492, July 1993.
6595 [RFC4690] Klensin, J., Faltstrom, P., Karp, C., and IAB, "Review and
6596 Recommendations for Internationalized Domain Names
6597 (IDNs)", RFC 4690, September 2006.
6599 [IANA-EXP]
6600 Narten, T., "Assigning Experimental and Testing Numbers
6601 Considered Useful, Work in Progress.".
6603 Appendix A. Acknowledgements
6605 The authors would like to thank the following people that have
6606 provided proposals and contributions to this document:
6608 To Vishnu Ram and Satendra Gera for their contributions on
6609 Capabilities Updates, Predictive Loop Avoidance as well as many other
6610 technical proposals. To Tolga Asveren for his insights and
6611 contributions on almost all of the proposed solutions incorporated
6612 into this document. To Timothy Smith for helping on the Capabilities
6613 Updates and other topics. To Tony Zhang for providing fixes to loop
6614 holes on composing Failed-AVPs as well as many other issues and
6615 topics. To Jan Nordqvist for clearly stating the usage of
6616 Application Ids. To Anders Kristensen for providing needed technical
6617 opinions. To David Frascone for providing invaluable review of the
6618 document. To Mark Jones for providing clarifying text on vendor
6619 command codes and other vendor specific indicators.
6621 Special thanks also to people who have provided invaluable comments
6622 and inputs especially in resolving controversial issues:
6624 Glen Zorn, Yoshihiro Ohba, Marco Stura, and Pasi Eronen.
6626 Finally, we would like to thank the original authors of this
6627 document:
6629 Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman and Glen Zorn.
6631 Their invaluable knowledge and experience has given us a robust and
6632 flexible AAA protocol that many people have seen great value in
6633 adopting. We greatly appreciate their support and stewardship for
6634 the continued improvements of Diameter as a protocol. We would also
6635 like to extend our gratitude to folks aside from the authors who have
6636 assisted and contributed to the original version of this document.
6637 Their efforts significantly contributed to the success of Diameter.
6639 Appendix B. NAPTR Example
6641 As an example, consider a client that wishes to resolve aaa:ex.com.
6642 The client performs a NAPTR query for that domain, and the following
6643 NAPTR records are returned:
6645 ;; order pref flags service regexp replacement
6646 IN NAPTR 50 50 "s" "AAA+D2S" "" _diameter._sctp.example.com
6647 IN NAPTR 100 50 "s" "AAA+D2T" "" _aaa._tcp.example.com
6649 This indicates that the server supports SCTP, and TCP, in that order.
6650 If the client supports over SCTP, SCTP will be used, targeted to a
6651 host determined by an SRV lookup of _diameter._sctp.ex.com. That
6652 lookup would return:
6654 ;; Priority Weight Port Target
6655 IN SRV 0 1 5060 server1.example.com
6656 IN SRV 0 2 5060 server2.example.com
6658 Appendix C. Duplicate Detection
6660 As described in Section 9.4, accounting record duplicate detection is
6661 based on session identifiers. Duplicates can appear for various
6662 reasons:
6664 o Failover to an alternate server. Where close to real-time
6665 performance is required, failover thresholds need to be kept low
6666 and this may lead to an increased likelihood of duplicates.
6667 Failover can occur at the client or within Diameter agents.
6669 o Failure of a client or agent after sending of a record from non-
6670 volatile memory, but prior to receipt of an application layer ACK
6671 and deletion of the record. record to be sent. This will result
6672 in retransmission of the record soon after the client or agent has
6673 rebooted.
6675 o Duplicates received from RADIUS gateways. Since the
6676 retransmission behavior of RADIUS is not defined within [RFC2865],
6677 the likelihood of duplication will vary according to the
6678 implementation.
6680 o Implementation problems and misconfiguration.
6682 The T flag is used as an indication of an application layer
6683 retransmission event, e.g., due to failover to an alternate server.
6684 It is defined only for request messages sent by Diameter clients or
6685 agents. For instance, after a reboot, a client may not know whether
6686 it has already tried to send the accounting records in its non-
6687 volatile memory before the reboot occurred. Diameter servers MAY use
6688 the T flag as an aid when processing requests and detecting duplicate
6689 messages. However, servers that do this MUST ensure that duplicates
6690 are found even when the first transmitted request arrives at the
6691 server after the retransmitted request. It can be used only in cases
6692 where no answer has been received from the Server for a request and
6693 the request is sent again, (e.g., due to a failover to an alternate
6694 peer, due to a recovered primary peer or due to a client re-sending a
6695 stored record from non-volatile memory such as after reboot of a
6696 client or agent).
6698 In some cases the Diameter accounting server can delay the duplicate
6699 detection and accounting record processing until a post-processing
6700 phase takes place. At that time records are likely to be sorted
6701 according to the included User-Name and duplicate elimination is easy
6702 in this case. In other situations it may be necessary to perform
6703 real-time duplicate detection, such as when credit limits are imposed
6704 or real-time fraud detection is desired.
6706 In general, only generation of duplicates due to failover or re-
6707 sending of records in non-volatile storage can be reliably detected
6708 by Diameter clients or agents. In such cases the Diameter client or
6709 agents can mark the message as possible duplicate by setting the T
6710 flag. Since the Diameter server is responsible for duplicate
6711 detection, it can choose to make use of the T flag or not, in order
6712 to optimize duplicate detection. Since the T flag does not affect
6713 interoperability, and may not be needed by some servers, generation
6714 of the T flag is REQUIRED for Diameter clients and agents, but MAY be
6715 implemented by Diameter servers.
6717 As an example, it can be usually be assumed that duplicates appear
6718 within a time window of longest recorded network partition or device
6719 fault, perhaps a day. So only records within this time window need
6720 to be looked at in the backward direction. Secondly, hashing
6721 techniques or other schemes, such as the use of the T flag in the
6722 received messages, may be used to eliminate the need to do a full
6723 search even in this set except for rare cases.
6725 The following is an example of how the T flag may be used by the
6726 server to detect duplicate requests.
6728 A Diameter server MAY check the T flag of the received message to
6729 determine if the record is a possible duplicate. If the T flag is
6730 set in the request message, the server searches for a duplicate
6731 within a configurable duplication time window backward and
6732 forward. This limits database searching to those records where
6733 the T flag is set. In a well run network, network partitions and
6734 device faults will presumably be rare events, so this approach
6735 represents a substantial optimization of the duplicate detection
6736 process. During failover, it is possible for the original record
6737 to be received after the T flag marked record, due to differences
6738 in network delays experienced along the path by the original and
6739 duplicate transmissions. The likelihood of this occurring
6740 increases as the failover interval is decreased. In order to be
6741 able to detect out of order duplicates, the Diameter server should
6742 use backward and forward time windows when performing duplicate
6743 checking for the T flag marked request. For example, in order to
6744 allow time for the original record to exit the network and be
6745 recorded by the accounting server, the Diameter server can delay
6746 processing records with the T flag set until a time period
6747 TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing
6748 of the original transport connection. After this time period has
6749 expired, then it may check the T flag marked records against the
6750 database with relative assurance that the original records, if
6751 sent, have been received and recorded.
6753 Appendix D. Internationalized Domain Names
6755 To be compatible with the existing DNS infrastructure and simplify
6756 host and domain name comparison, Diameter identities (FQDNs) are
6757 represented in ASCII form. This allows the Diameter protocol to fall
6758 in-line with the DNS strategy of being transparent from the effects
6759 of Internationalized Domain Names (IDNs) by following the
6760 recommnedations in [RFC4690] and [RFC3490]. Applications that
6761 provide support for IDNs outside of the Diameter protocol but
6762 interacting with it SHOULD use the representation and conversion
6763 framework described in [RFC3490], [RFC3491] and [RFC3492].
6765 Authors' Addresses
6767 Victor Fajardo (editor)
6768 Toshiba America Research
6769 One Telcordia Drive, 1S-222
6770 Piscataway, NJ 08854
6771 USA
6773 Phone: 1 908-421-1845
6774 Email: vfajardo@tari.toshiba.com
6776 Jari Arkko
6777 Ericsson Research
6778 02420 Jorvas
6779 Finland
6781 Phone: +358 40 5079256
6782 Email: jari.arkko@ericsson.com
6784 John Loughney
6785 Nokia Research Center
6786 955 Page Mill Road
6787 Palo Alto, CA 94304
6788 US
6790 Phone: 1-650-283-8068
6791 Email: john.loughney@nokia.com
6793 Glenn Zorn
6794 NetCube
6795 1310 East Thomas Street, #306
6796 Seattle, WA 98102
6797 US
6799 Phone:
6800 Email: glenzorn@comcast.net
6802 Full Copyright Statement
6804 Copyright (C) The IETF Trust (2008).
6806 This document is subject to the rights, licenses and restrictions
6807 contained in BCP 78, and except as set forth therein, the authors
6808 retain all their rights.
6810 This document and the information contained herein are provided on an
6811 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
6812 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
6813 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
6814 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
6815 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
6816 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
6818 Intellectual Property
6820 The IETF takes no position regarding the validity or scope of any
6821 Intellectual Property Rights or other rights that might be claimed to
6822 pertain to the implementation or use of the technology described in
6823 this document or the extent to which any license under such rights
6824 might or might not be available; nor does it represent that it has
6825 made any independent effort to identify any such rights. Information
6826 on the procedures with respect to rights in RFC documents can be
6827 found in BCP 78 and BCP 79.
6829 Copies of IPR disclosures made to the IETF Secretariat and any
6830 assurances of licenses to be made available, or the result of an
6831 attempt made to obtain a general license or permission for the use of
6832 such proprietary rights by implementers or users of this
6833 specification can be obtained from the IETF on-line IPR repository at
6834 http://www.ietf.org/ipr.
6836 The IETF invites any interested party to bring to its attention any
6837 copyrights, patents or patent applications, or other proprietary
6838 rights that may cover technology that may be required to implement
6839 this standard. Please address the information to the IETF at
6840 ietf-ipr@ietf.org.
6842 Acknowledgment
6844 Funding for the RFC Editor function is provided by the IETF
6845 Administrative Support Activity (IASA).