idnits 2.17.1
draft-ietf-dime-rfc3588bis-09.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 18.
-- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on
line 6843.
-- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 6854.
-- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 6861.
-- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 6867.
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.
Miscellaneous warnings:
----------------------------------------------------------------------------
== The copyright year in the IETF Trust Copyright Line does not match the
current year
== Line 4521 has weird spacing: '...ly with wit...'
== Line 4729 has weird spacing: '...ealtime user...'
== Line 4757 has weird spacing: '... record inter...'
== Line 4767 has weird spacing: '...ealtime user...'
== Line 4775 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 (November 16, 2007) is 6006 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 4236, 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 (ref. 'TCP') (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 (==), 12 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 Intended status: Standards Track J. Arkko
5 Expires: May 19, 2008 Ericsson Research
6 J. Loughney
7 Nokia Research Center
8 November 16, 2007
10 Diameter Base Protocol
11 draft-ietf-dime-rfc3588bis-09.txt
13 Status of this Memo
15 By submitting this Internet-Draft, each author represents that any
16 applicable patent or other IPR claims of which he or she is aware
17 have been or will be disclosed, and any of which he or she becomes
18 aware will be disclosed, in accordance with Section 6 of BCP 79.
20 Internet-Drafts are working documents of the Internet Engineering
21 Task Force (IETF), its areas, and its working groups. Note that
22 other groups may also distribute working documents as Internet-
23 Drafts.
25 Internet-Drafts are draft documents valid for a maximum of six months
26 and may be updated, replaced, or obsoleted by other documents at any
27 time. It is inappropriate to use Internet-Drafts as reference
28 material or to cite them other than as "work in progress."
30 The list of current Internet-Drafts can be accessed at
31 http://www.ietf.org/ietf/1id-abstracts.txt.
33 The list of Internet-Draft Shadow Directories can be accessed at
34 http://www.ietf.org/shadow.html.
36 This Internet-Draft will expire on May 19, 2008.
38 Copyright Notice
40 Copyright (C) The IETF Trust (2007).
42 Abstract
44 The Diameter base protocol is intended to provide an Authentication,
45 Authorization and Accounting (AAA) framework for applications such as
46 network access or IP mobility. Diameter is also intended to work in
47 both local Authentication, Authorization & Accounting and roaming
48 situations. This document specifies the message format, transport,
49 error reporting, accounting and security services to be used by all
50 Diameter applications. The Diameter base application needs to be
51 supported by all Diameter implementations.
53 Table of Contents
55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7
56 1.1. Diameter Protocol . . . . . . . . . . . . . . . . . . . . 10
57 1.1.1. Description of the Document Set . . . . . . . . . . 11
58 1.1.2. Conventions Used in This Document . . . . . . . . . 12
59 1.2. Approach to Extensibility . . . . . . . . . . . . . . . . 12
60 1.2.1. Defining New AVP Values . . . . . . . . . . . . . . 13
61 1.2.2. Creating New AVPs . . . . . . . . . . . . . . . . . 13
62 1.2.3. Creating New Commands . . . . . . . . . . . . . . . 13
63 1.2.4. Creating New Authentication Applications . . . . . . 13
64 1.2.5. Creating New Accounting Applications . . . . . . . . 14
65 1.2.6. Application Authentication Procedures . . . . . . . 15
66 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 16
67 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 22
68 2.1. Transport . . . . . . . . . . . . . . . . . . . . . . . . 23
69 2.1.1. SCTP Guidelines . . . . . . . . . . . . . . . . . . 24
70 2.2. Securing Diameter Messages . . . . . . . . . . . . . . . 24
71 2.3. Diameter Application Compliance . . . . . . . . . . . . . 24
72 2.4. Application Identifiers . . . . . . . . . . . . . . . . . 24
73 2.5. Connections vs. Sessions . . . . . . . . . . . . . . . . 25
74 2.6. Peer Table . . . . . . . . . . . . . . . . . . . . . . . 26
75 2.7. Routing Table . . . . . . . . . . . . . . . . . . . . . . 27
76 2.8. Role of Diameter Agents . . . . . . . . . . . . . . . . . 28
77 2.8.1. Relay Agents . . . . . . . . . . . . . . . . . . . . 30
78 2.8.2. Proxy Agents . . . . . . . . . . . . . . . . . . . . 31
79 2.8.3. Redirect Agents . . . . . . . . . . . . . . . . . . 31
80 2.8.4. Translation Agents . . . . . . . . . . . . . . . . . 32
81 2.9. Diameter Path Authorization . . . . . . . . . . . . . . . 33
82 3. Diameter Header . . . . . . . . . . . . . . . . . . . . . . . 35
83 3.1. Command Codes . . . . . . . . . . . . . . . . . . . . . . 38
84 3.2. Command Code ABNF specification . . . . . . . . . . . . . 38
85 3.3. Diameter Command Naming Conventions . . . . . . . . . . . 40
86 4. Diameter AVPs . . . . . . . . . . . . . . . . . . . . . . . . 42
87 4.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 42
88 4.1.1. Optional Header Elements . . . . . . . . . . . . . . 44
90 4.2. Basic AVP Data Formats . . . . . . . . . . . . . . . . . 44
91 4.3. Derived AVP Data Formats . . . . . . . . . . . . . . . . 46
92 4.4. Grouped AVP Values . . . . . . . . . . . . . . . . . . . 53
93 4.4.1. Example AVP with a Grouped Data type . . . . . . . . 54
94 4.5. Diameter Base Protocol AVPs . . . . . . . . . . . . . . . 57
95 5. Diameter Peers . . . . . . . . . . . . . . . . . . . . . . . 60
96 5.1. Peer Connections . . . . . . . . . . . . . . . . . . . . 60
97 5.2. Diameter Peer Discovery . . . . . . . . . . . . . . . . . 60
98 5.3. Capabilities Exchange . . . . . . . . . . . . . . . . . . 63
99 5.3.1. Capabilities-Exchange-Request . . . . . . . . . . . 64
100 5.3.2. Capabilities-Exchange-Answer . . . . . . . . . . . . 65
101 5.3.3. Vendor-Id AVP . . . . . . . . . . . . . . . . . . . 65
102 5.3.4. Firmware-Revision AVP . . . . . . . . . . . . . . . 65
103 5.3.5. Host-IP-Address AVP . . . . . . . . . . . . . . . . 66
104 5.3.6. Supported-Vendor-Id AVP . . . . . . . . . . . . . . 66
105 5.3.7. Product-Name AVP . . . . . . . . . . . . . . . . . . 66
106 5.4. Disconnecting Peer connections . . . . . . . . . . . . . 66
107 5.4.1. Disconnect-Peer-Request . . . . . . . . . . . . . . 67
108 5.4.2. Disconnect-Peer-Answer . . . . . . . . . . . . . . . 67
109 5.4.3. Disconnect-Cause AVP . . . . . . . . . . . . . . . . 67
110 5.5. Transport Failure Detection . . . . . . . . . . . . . . . 68
111 5.5.1. Device-Watchdog-Request . . . . . . . . . . . . . . 68
112 5.5.2. Device-Watchdog-Answer . . . . . . . . . . . . . . . 69
113 5.5.3. Transport Failure Algorithm . . . . . . . . . . . . 69
114 5.5.4. Failover and Failback Procedures . . . . . . . . . . 69
115 5.6. Peer State Machine . . . . . . . . . . . . . . . . . . . 70
116 5.6.1. Incoming connections . . . . . . . . . . . . . . . . 72
117 5.6.2. Events . . . . . . . . . . . . . . . . . . . . . . . 73
118 5.6.3. Actions . . . . . . . . . . . . . . . . . . . . . . 74
119 5.6.4. The Election Process . . . . . . . . . . . . . . . . 76
120 5.6.5. Capabilities Update . . . . . . . . . . . . . . . . 76
121 6. Diameter message processing . . . . . . . . . . . . . . . . . 77
122 6.1. Diameter Request Routing Overview . . . . . . . . . . . . 77
123 6.1.1. Originating a Request . . . . . . . . . . . . . . . 78
124 6.1.2. Sending a Request . . . . . . . . . . . . . . . . . 78
125 6.1.3. Receiving Requests . . . . . . . . . . . . . . . . . 79
126 6.1.4. Processing Local Requests . . . . . . . . . . . . . 79
127 6.1.5. Request Forwarding . . . . . . . . . . . . . . . . . 79
128 6.1.6. Request Routing . . . . . . . . . . . . . . . . . . 79
129 6.1.7. Predictive Loop Avoidance . . . . . . . . . . . . . 80
130 6.1.8. Redirecting requests . . . . . . . . . . . . . . . . 80
131 6.1.9. Relaying and Proxying Requests . . . . . . . . . . . 82
132 6.2. Diameter Answer Processing . . . . . . . . . . . . . . . 82
133 6.2.1. Processing received Answers . . . . . . . . . . . . 83
134 6.2.2. Relaying and Proxying Answers . . . . . . . . . . . 83
135 6.3. Origin-Host AVP . . . . . . . . . . . . . . . . . . . . . 84
136 6.4. Origin-Realm AVP . . . . . . . . . . . . . . . . . . . . 84
137 6.5. Destination-Host AVP . . . . . . . . . . . . . . . . . . 84
138 6.6. Destination-Realm AVP . . . . . . . . . . . . . . . . . . 85
139 6.7. Routing AVPs . . . . . . . . . . . . . . . . . . . . . . 85
140 6.7.1. Route-Record AVP . . . . . . . . . . . . . . . . . . 85
141 6.7.2. Proxy-Info AVP . . . . . . . . . . . . . . . . . . . 85
142 6.7.3. Proxy-Host AVP . . . . . . . . . . . . . . . . . . . 85
143 6.7.4. Proxy-State AVP . . . . . . . . . . . . . . . . . . 85
144 6.8. Auth-Application-Id AVP . . . . . . . . . . . . . . . . . 86
145 6.9. Acct-Application-Id AVP . . . . . . . . . . . . . . . . . 86
146 6.10. Inband-Security-Id AVP . . . . . . . . . . . . . . . . . 86
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 . . . . . . . . . . . . . . . 89
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 . . . . . . . . . . . . . . . . . . . 124
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 . . . . . . . . . . . . . . . . . . . 126
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 . . . . . . . . . . . . . . . . . . . 131
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 . . . . . . . . . . . . . . . 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
235 11.5. Diameter TCP/SCTP Port Numbers . . . . . . . . . . . . . 145
236 11.6. NAPTR Service Fields . . . . . . . . . . . . . . . . . . 145
237 12. Diameter protocol related configurable parameters . . . . . . 147
238 13. Security Considerations . . . . . . . . . . . . . . . . . . . 148
239 13.1. TLS Usage . . . . . . . . . . . . . . . . . . . . . . . . 148
240 13.2. Peer-to-Peer Considerations . . . . . . . . . . . . . . . 149
241 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 150
242 14.1. Normative References . . . . . . . . . . . . . . . . . . 150
243 14.2. Informational References . . . . . . . . . . . . . . . . 152
244 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 154
245 Appendix B. NAPTR Example . . . . . . . . . . . . . . . . . . . 155
246 Appendix C. Duplicate Detection . . . . . . . . . . . . . . . . 156
247 Appendix D. Internationalized Domain Names . . . . . . . . . . . 158
248 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 159
249 Intellectual Property and Copyright Statements . . . . . . . . . 160
251 1. Introduction
253 Authentication, Authorization and Accounting (AAA) protocols such as
254 TACACS [RFC1492] and RADIUS [RFC2865] were initially deployed to
255 provide dial-up PPP [RFC1661] and terminal server access. Over time,
256 with the growth of the Internet and the introduction of new access
257 technologies, including wireless, DSL, Mobile IP and Ethernet,
258 routers and network access servers (NAS) have increased in complexity
259 and density, putting new demands on 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 also
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 Auditability
325 RADIUS does not define data-object security mechanisms, and as a
326 result, untrusted proxies may modify attributes or even packet
327 headers without being detected. Combined with lack of support for
328 capabilities negotiation, this makes it very difficult to
329 determine what occurred in the event of a dispute.
331 Transition support
333 While Diameter does not share a common protocol data unit (PDU)
334 with RADIUS, considerable effort has been expended in enabling
335 backward compatibility with RADIUS, so that the two protocols may
336 be deployed in the same network. Initially, it is expected that
337 Diameter will be deployed within new network devices, as well as
338 within gateways enabling communication between legacy RADIUS
339 devices and Diameter agents. This capability, described in
341 [RFC4005], enables Diameter support to be added to legacy
342 networks, by addition of a gateway or server speaking both RADIUS
343 and Diameter.
345 In addition to addressing the above requirements, Diameter also
346 provides support for the following:
348 Capability negotiation
350 RADIUS does not support error messages, capability negotiation, or
351 a mandatory/non-mandatory flag for attributes. Since RADIUS
352 clients and servers are not aware of each other's capabilities,
353 they may not be able to successfully negotiate a mutually
354 acceptable service, or in some cases, even be aware of what
355 service has been implemented. Diameter includes support for error
356 handling (Section 7), capability negotiation (Section 5.3), and
357 mandatory/non-mandatory attribute-value pairs (AVPs) (Section
358 4.1).
360 Peer discovery and configuration
362 RADIUS implementations typically require that the name or address
363 of servers or clients be manually configured, along with the
364 corresponding shared secrets. This results in a large
365 administrative burden, and creates the temptation to reuse the
366 RADIUS shared secret, which can result in major security
367 vulnerabilities if the Request Authenticator is not globally and
368 temporally unique as required in [RFC2865]. Through DNS, Diameter
369 enables dynamic discovery of peers. Derivation of dynamic session
370 keys is enabled via transmission-level security.
372 Roaming support
374 The ROAMOPS WG provided a survey of roaming implementations
375 [RFC2194], detailed roaming requirements [RFC2477], defined the
376 Network Access Identifier (NAI)[RFC4282], and documented existing
377 implementations (and imitations) of RADIUS-based roaming
378 [RFC2607]. In order to improve scalability, [RFC2607] introduced
379 the concept of proxy chaining via an intermediate server,
380 facilitating roaming between providers. However, since RADIUS
381 does not provide explicit support for proxies, and lacks
382 auditability and transmission-level security features, RADIUS-
383 based roaming is vulnerable to attack from external parties as
384 well as susceptible to fraud perpetrated by the roaming partners
385 themselves. As a result, it is not suitable for wide-scale
386 deployment on the Internet [RFC2607]. By providing explicit
387 support for inter-domain roaming and message routing (Sections 2.7
388 and 6), and transmission-layer security (Section 13) features,
389 Diameter addresses these limitations and provides for secure and
390 scalable roaming.
392 In the decade since AAA protocols were first introduced, the
393 capabilities of Network Access Server (NAS) devices have increased
394 substantially. As a result, while Diameter is a considerably more
395 sophisticated protocol than RADIUS, it remains feasible to implement
396 within embedded devices, given improvements in processor speeds and
397 the widespread availability of embedded TLS implementations.
399 1.1. Diameter Protocol
401 The Diameter base protocol provides the following facilities:
403 o Delivery of AVPs (attribute value pairs)
405 o Capabilities negotiation
407 o Error notification
409 o Extensibility, through addition of new commands and AVPs (required
410 in [RFC2989]).
412 o Basic services necessary for applications, such as handling of
413 user sessions or accounting
415 All data delivered by the protocol is in the form of an AVP. Some of
416 these AVP values are used by the Diameter protocol itself, while
417 others deliver data associated with particular applications that
418 employ Diameter. AVPs may be added arbitrarily to Diameter messages,
419 so long as the requirements of a message's ABNF are met and the ABNF
420 allows for it. AVPs are used by the base Diameter protocol to
421 support the following required features:
423 o Transporting of user authentication information, for the purposes
424 of enabling the Diameter server to authenticate the user.
426 o Transporting of service specific authorization information,
427 between client and servers, allowing the peers to decide whether a
428 user's access request should be granted.
430 o Exchanging resource usage information, which MAY be used for
431 accounting purposes, capacity planning, etc.
433 o Relaying, proxying and redirecting of Diameter messages through a
434 server hierarchy.
436 The Diameter base protocol provides the minimum requirements needed
437 for a AAA protocol, as required by [RFC2989]. The base protocol may
438 be used by itself for accounting purposes only, or it may be used
439 with a Diameter application, such as Mobile IPv4 [RFC4004], or
440 network access [RFC4005]. It is also possible for the base protocol
441 to be extended for use in new applications, via the addition of new
442 commands or AVPs. At this time the focus of Diameter is network
443 access and accounting applications. A truly generic AAA protocol
444 used by many applications might provide functionality not provided by
445 Diameter. Therefore, it is imperative that the designers of new
446 applications understand their requirements before using Diameter.
447 See Section 2.4 for more information on Diameter applications.
449 Any node can initiate a request. In that sense, Diameter is a peer-
450 to-peer protocol. In this document, a Diameter Client is a device at
451 the edge of the network that performs access control, such as a
452 Network Access Server (NAS) or a Foreign Agent (FA). A Diameter
453 client generates Diameter messages to request authentication,
454 authorization, and accounting services for the user. A Diameter
455 agent is a node that does not authenticate and/or authorize messages
456 locally; agents include proxies, redirects and relay agents. A
457 Diameter server performs authentication and/or authorization of the
458 user. A Diameter node MAY act as an agent for certain requests while
459 acting as a server for others.
461 The Diameter protocol also supports server-initiated messages, such
462 as a request to abort service to a particular user.
464 1.1.1. Description of the Document Set
466 Currently, the Diameter specification consists of a base
467 specification (this document), Transport Profile [RFC3539] and
468 applications: Mobile IPv4 [RFC4004], NASREQ [RFC4005], Credit Control
469 [RFC4006], EAP [RFC4072] and SIP [RFC4740].
471 The Transport Profile document [RFC3539] discusses transport layer
472 issues that arise with AAA protocols and recommendations on how to
473 overcome these issues. This document also defines the Diameter
474 failover algorithm and state machine.
476 The Mobile IPv4 [RFC4004] application defines a Diameter application
477 that allows a Diameter server to perform AAA functions for Mobile
478 IPv4 services to a mobile node.
480 The NASREQ [RFC4005] application defines a Diameter Application that
481 allows a Diameter server to be used in a PPP/SLIP Dial-Up and
482 Terminal Server Access environment. Consideration was given for
483 servers that need to perform protocol conversion between Diameter and
484 RADIUS.
486 The Credit Control [RFC4006] application defines a Diameter
487 Application that can be used to implement real-time credit-control
488 for a variety of end user services such as network access, SIP
489 services, messaging services, and download services. It provides a
490 general solution to real-time cost and credit-control.
492 The EAP [RFC4072] application defines a Diameter Application that can
493 be used to carry EAP packets between the Network Access Server (NAS)
494 working as an EAP authenticator and a back-end authentication server.
495 The Diameter EAP application is based on NASREQ and intended for a
496 similar environment.
498 The SIP [RFC4740] application defines a Diameter Application that
499 allows a Diameter client to request authentication and authorization
500 information to a Diameter server for SIP-based IP multimedia services
501 (see SIP [RFC3261]).
503 In summary, this document defines the base protocol specification for
504 AAA, which includes support for accounting. The applications
505 documents describe applications that use this base specification for
506 Authentication, Authorization and Accounting.
508 1.1.2. Conventions Used in This Document
510 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
511 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
512 document are to be interpreted as described in [RFC2119].
514 1.2. Approach to Extensibility
516 The Diameter protocol is designed to be extensible, using several
517 mechanisms, including:
519 o Defining new AVP values
521 o Creating new AVPs
523 o Creating new commands
525 o Creating new authentication/authorization applications
527 o Creating new accounting applications
528 o Application authentication procedures
530 Reuse of existing AVP values, AVPs, commands and Diameter
531 applications are strongly recommended. Reuse simplifies
532 standardization and implementation and avoids potential
533 interoperability issues.
535 1.2.1. Defining New AVP Values
537 New applications should attempt to reuse AVPs defined in existing
538 applications when possible, as opposed to creating new AVPs. For
539 AVPs of type Enumerated, an application may require a new value to
540 communicate some service-specific information.
542 In order to allocate a new AVP value for a standards track AVP, a
543 request MUST be sent to IANA [RFC2434], along with an explanation of
544 the new AVP value. IANA considerations for AVP values are discussed
545 in Section 11.4.
547 1.2.2. Creating New AVPs
549 When no existing AVP can be reused, a new AVP should be created. The
550 new AVP being defined MUST use one of the data types listed in
551 Section 4.2 or 4.3. If an appropriate derived data type is already
552 defined, it MAY be used instead of the base data type.
554 In the event that a logical grouping of AVPs is necessary, and
555 multiple "groups" are possible in a given command, it is recommended
556 that a Grouped AVP be used (see Section 4.4).
558 In order to create a new standards track AVP, a request MUST be sent
559 to IANA with a reference to the specification that defines the AVP.
560 IANA considerations for AVPs are discussed in Section 11.1.1.
562 1.2.3. Creating New Commands
564 A new command should only be created when no suitable command can be
565 reused from an existing application. A new command MUST result in
566 the defintion of a new application. In order to create a new
567 command, a request MUST be sent to IANA. The IANA considerations for
568 commands are discussed in Section 11.2.1.
570 1.2.4. Creating New Authentication Applications
572 Every Diameter application specification MUST have an IANA assigned
573 Application Identifier (see Section 2.4 and Section 11.3).
575 Should a new Diameter usage scenario find itself unable to fit within
576 an existing application without requiring major changes to the
577 specification, it may be desirable to create a new Diameter
578 application. Major changes to an application include:
580 o Adding new AVPs to the command, which have the "M" bit set.
582 o Requiring a command that has a different number of round trips to
583 satisfy a request (e.g., application foo has a command that
584 requires one round trip, but new application bar has a command
585 that requires two round trips to complete).
587 o Adding support for an authentication method requiring definition
588 of new AVPs for use with the application. Since a new EAP
589 authentication method can be supported within Diameter without
590 requiring new AVPs, addition of EAP methods does not require the
591 creation of a new authentication application.
593 Creation of a new application should be viewed as a last resort. An
594 implementation MAY add arbitrary non-mandatory AVPs to any command
595 defined in an application, including vendor-specific AVPs without
596 needing to define a new application. Please refer to Section 11.1.1
597 for details.
599 In order to justify allocation of a new application identifier,
600 Diameter applications MUST define one Command Code, add new mandatory
601 AVPs to the ABNF or significantly change the state machine or
602 processing rules of an existing application.
604 The expected AVPs MUST be defined in an ABNF [RFC4234] grammar (see
605 Section 3.2). If the Diameter application has accounting
606 requirements, it MUST also specify the AVPs that are to be present in
607 the Diameter Accounting messages (see Section 9.3). However, just
608 because a new authentication application id is required, does not
609 imply that a new accounting application id is required.
611 When possible, a new Diameter application SHOULD reuse existing
612 Diameter AVPs, in order to avoid defining multiple AVPs that carry
613 similar information.
615 1.2.5. Creating New Accounting Applications
617 There are services that only require Diameter accounting. Such
618 services need to define the AVPs carried in the Accounting-Request
619 (ACR)/ Accounting-Answer (ACA) messages, but do not need to define
620 new command codes. An implementation MAY add arbitrary non-mandatory
621 AVPs (AVPs with the "M" bit not set) to any command defined in an
622 application, including vendor-specific AVPs, without needing to
623 define a new accounting application. Please refer to Section 11.1.1
624 for details.
626 Application Identifiers are still required for Diameter capability
627 exchange. Every Diameter accounting application specification MUST
628 have an IANA assigned Application Identifier (see Section 2.4) or a
629 vendor specific Application Identifier.
631 Every Diameter implementation MUST support accounting. Basic
632 accounting support is sufficient to handle any application that uses
633 the ACR/ACA commands defined in this document, as long as no new
634 mandatory AVPs are added. A mandatory AVP is defined as one which
635 has the "M" bit set when sent within an accounting command,
636 regardless of whether it is required or optional within the ABNF for
637 the accounting application.
639 The creation of a new accounting application should be viewed as a
640 last resort and MUST NOT be used unless a new command or additional
641 mechanisms (e.g., application defined state machine) is defined
642 within the application, or new mandatory AVPs are added to the ABNF.
644 Within an accounting command, setting the "M" bit implies that a
645 backend server (e.g., billing server) or the accounting server itself
646 MUST understand the AVP in order to compute a correct bill. If the
647 AVP is not relevant to the billing process, when the AVP is included
648 within an accounting command, it MUST NOT have the "M" bit set, even
649 if the "M" bit is set when the same AVP is used within other Diameter
650 commands (i.e., authentication/authorization commands).
652 A DIAMETER base accounting implementation MUST be configurable to
653 advertise supported accounting applications in order to prevent the
654 accounting server from accepting accounting requests for unbillable
655 services. The combination of the home domain and the accounting
656 application Id can be used in order to route the request to the
657 appropriate accounting server.
659 When possible, a new Diameter accounting application SHOULD attempt
660 to reuse existing AVPs, in order to avoid defining multiple AVPs that
661 carry similar information.
663 If the base accounting is used without any mandatory AVPs, new
664 commands or additional mechanisms (e.g., application defined state
665 machine), then the base protocol defined standard accounting
666 application Id (Section 2.4) MUST be used in ACR/ACA commands.
668 1.2.6. Application Authentication Procedures
670 When possible, applications SHOULD be designed such that new
671 authentication methods MAY be added without requiring changes to the
672 application. This MAY require that new AVP values be assigned to
673 represent the new authentication transform, or any other scheme that
674 produces similar results. When possible, authentication frameworks,
675 such as Extensible Authentication Protocol [RFC3748], SHOULD be used.
677 1.3. Terminology
679 AAA
681 Authentication, Authorization and Accounting.
683 Accounting
685 The act of collecting information on resource usage for the
686 purpose of capacity planning, auditing, billing or cost
687 allocation.
689 Accounting Record
691 An accounting record represents a summary of the resource
692 consumption of a user over the entire session. Accounting servers
693 creating the accounting record may do so by processing interim
694 accounting events or accounting events from several devices
695 serving the same user.
697 Authentication
699 The act of verifying the identity of an entity (subject).
701 Authorization
703 The act of determining whether a requesting entity (subject) will
704 be allowed access to a resource (object).
706 AVP
708 The Diameter protocol consists of a header followed by one or more
709 Attribute-Value-Pairs (AVPs). An AVP includes a header and is
710 used to encapsulate protocol-specific data (e.g., routing
711 information) as well as authentication, authorization or
712 accounting information.
714 Broker
716 A broker is a business term commonly used in AAA infrastructures.
717 A broker is either a relay, proxy or redirect agent, and MAY be
718 operated by roaming consortiums. Depending on the business model,
719 a broker may either choose to deploy relay agents or proxy agents.
721 Diameter Agent
723 A Diameter Agent is a Diameter node that provides either relay,
724 proxy, redirect or translation services.
726 Diameter Client
728 A Diameter Client is a device at the edge of the network that
729 performs access control. An example of a Diameter client is a
730 Network Access Server (NAS) or a Foreign Agent (FA). By its very
731 nature, a Diameter Client MUST support Diameter client
732 applications in addition to the base protocol.
734 Diameter Node
736 A Diameter node is a host process that implements the Diameter
737 protocol, and acts either as a Client, Agent or Server.
739 Diameter Peer
741 A Diameter Peer is a Diameter Node to which a given Diameter Node
742 has a direct transport connection.
744 Diameter Server
746 A Diameter Server is one that handles authentication,
747 authorization and accounting requests for a particular realm. By
748 its very nature, a Diameter Server MUST support Diameter server
749 applications in addition to the base protocol.
751 Downstream
753 Downstream is used to identify the direction of a particular
754 Diameter message from the home server towards the access device.
756 Home Realm
758 A Home Realm is the administrative domain with which the user
759 maintains an account relationship.
761 Home Server
763 A Diameter Server which serves the Home Realm.
765 Interim accounting
767 An interim accounting message provides a snapshot of usage during
768 a user's session. It is typically implemented in order to provide
769 for partial accounting of a user's session in the case of a device
770 reboot or other network problem prevents the reception of a
771 session summary message or session record.
773 Local Realm
775 A local realm is the administrative domain providing services to a
776 user. An administrative domain MAY act as a local realm for
777 certain users, while being a home realm for others.
779 Multi-session
781 A multi-session represents a logical linking of several sessions.
782 Multi-sessions are tracked by using the Acct-Multi-Session-Id. An
783 example of a multi-session would be a Multi-link PPP bundle. Each
784 leg of the bundle would be a session while the entire bundle would
785 be a multi-session.
787 Network Access Identifier
789 The Network Access Identifier, or NAI [RFC4282], is used in the
790 Diameter protocol to extract a user's identity and realm. The
791 identity is used to identify the user during authentication and/or
792 authorization, while the realm is used for message routing
793 purposes.
795 Proxy Agent or Proxy
797 In addition to forwarding requests and responses, proxies make
798 policy decisions relating to resource usage and provisioning.
799 This is typically accomplished by tracking the state of NAS
800 devices. While proxies typically do not respond to client
801 Requests prior to receiving a Response from the server, they may
802 originate Reject messages in cases where policies are violated.
803 As a result, proxies need to understand the semantics of the
804 messages passing through them, and may not support all Diameter
805 applications.
807 Realm
809 The string in the NAI that immediately follows the '@' character.
810 NAI realm names are required to be unique, and are piggybacked on
811 the administration of the DNS namespace. Diameter makes use of
812 the realm, also loosely referred to as domain, to determine
813 whether messages can be satisfied locally, or whether they must be
814 routed or redirected. In RADIUS, realm names are not necessarily
815 piggybacked on the DNS namespace but may be independent of it.
817 Real-time Accounting
819 Real-time accounting involves the processing of information on
820 resource usage within a defined time window. Time constraints are
821 typically imposed in order to limit financial risk.
823 Relay Agent or Relay
825 Relays forward requests and responses based on routing-related
826 AVPs and routing table entries. Since relays do not make policy
827 decisions, they do not examine or alter non-routing AVPs. As a
828 result, relays never originate messages, do not need to understand
829 the semantics of messages or non-routing AVPs, and are capable of
830 handling any Diameter application or message type. Since relays
831 make decisions based on information in routing AVPs and realm
832 forwarding tables they do not keep state on NAS resource usage or
833 sessions in progress.
835 Redirect Agent
837 Rather than forwarding requests and responses between clients and
838 servers, redirect agents refer clients to servers and allow them
839 to communicate directly. Since redirect agents do not sit in the
840 forwarding path, they do not alter any AVPs transiting between
841 client and server. Redirect agents do not originate messages and
842 are capable of handling any message type, although they may be
843 configured only to redirect messages of certain types, while
844 acting as relay or proxy agents for other types. As with proxy
845 agents, redirect agents do not keep state with respect to sessions
846 or NAS resources.
848 Roaming Relationships
850 Roaming relationships include relationships between companies and
851 ISPs, relationships among peer ISPs within a roaming consortium,
852 and relationships between an ISP and a roaming consortium.
854 Session
856 A session is a related progression of events devoted to a
857 particular activity. Each application SHOULD provide guidelines
858 as to when a session begins and ends. All Diameter packets with
859 the same Session-Identifier are considered to be part of the same
860 session.
862 Session state
864 A stateful agent is one that maintains session state information,
865 by keeping track of all authorized active sessions. Each
866 authorized session is bound to a particular service, and its state
867 is considered active either until it is notified otherwise, or by
868 expiration.
870 Sub-session
872 A sub-session represents a distinct service (e.g., QoS or data
873 characteristics) provided to a given session. These services may
874 happen concurrently (e.g., simultaneous voice and data transfer
875 during the same session) or serially. These changes in sessions
876 are tracked with the Accounting-Sub-Session-Id.
878 Transaction state
880 The Diameter protocol requires that agents maintain transaction
881 state, which is used for failover purposes. Transaction state
882 implies that upon forwarding a request, the Hop-by-Hop identifier
883 is saved; the field is replaced with a locally unique identifier,
884 which is restored to its original value when the corresponding
885 answer is received. The request's state is released upon receipt
886 of the answer. A stateless agent is one that only maintains
887 transaction state.
889 Translation Agent
891 A translation agent is a stateful Diameter node that performs
892 protocol translation between Diameter and another AAA protocol,
893 such as RADIUS.
895 Transport Connection
897 A transport connection is a TCP or SCTP connection existing
898 directly between two Diameter peers, otherwise known as a Peer-
899 to-Peer Connection.
901 Upstream
903 Upstream is used to identify the direction of a particular
904 Diameter message from the access device towards the home server.
906 User
908 The entity requesting or using some resource, in support of which
909 a Diameter client has generated a request.
911 2. Protocol Overview
913 The base Diameter protocol may be used by itself for accounting
914 applications, but for use in authentication and authorization it is
915 always extended for a particular application. Two Diameter
916 applications are defined by companion documents: NASREQ [RFC4005],
917 Mobile IPv4 [RFC4004]. These applications are introduced in this
918 document but specified elsewhere. Additional Diameter applications
919 MAY be defined in the future (see Section 11.3).
921 Diameter Clients MUST support the base protocol, which includes
922 accounting. In addition, they MUST fully support each Diameter
923 application that is needed to implement the client's service, e.g.,
924 NASREQ and/or Mobile IPv4. A Diameter Client that does not support
925 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X
926 Client" where X is the application which it supports, and not a
927 "Diameter Client".
929 Diameter Servers MUST support the base protocol, which includes
930 accounting. In addition, they MUST fully support each Diameter
931 application that is needed to implement the intended service, e.g.,
932 NASREQ and/or Mobile IPv4. A Diameter Server that does not support
933 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X
934 Server" where X is the application which it supports, and not a
935 "Diameter Server".
937 Diameter Relays and redirect agents are, by definition, protocol
938 transparent, and MUST transparently support the Diameter base
939 protocol, which includes accounting, and all Diameter applications.
941 Diameter proxies MUST support the base protocol, which includes
942 accounting. In addition, they MUST fully support each Diameter
943 application that is needed to implement proxied services, e.g.,
944 NASREQ and/or Mobile IPv4. A Diameter proxy which does not support
945 also both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X
946 Proxy" where X is the application which it supports, and not a
947 "Diameter Proxy".
949 The base Diameter protocol concerns itself with capabilities
950 negotiation, how messages are sent and how peers may eventually be
951 abandoned. The base protocol also defines certain rules that apply
952 to all exchanges of messages between Diameter nodes.
954 Communication between Diameter peers begins with one peer sending a
955 message to another Diameter peer. The set of AVPs included in the
956 message is determined by a particular Diameter application. One AVP
957 that is included to reference a user's session is the Session-Id.
959 The initial request for authentication and/or authorization of a user
960 would include the Session-Id. The Session-Id is then used in all
961 subsequent messages to identify the user's session (see Section 8 for
962 more information). The communicating party may accept the request,
963 or reject it by returning an answer message with the Result-Code AVP
964 set to indicate an error occurred. The specific behavior of the
965 Diameter server or client receiving a request depends on the Diameter
966 application employed.
968 Session state (associated with a Session-Id) MUST be freed upon
969 receipt of the Session-Termination-Request, Session-Termination-
970 Answer, expiration of authorized service time in the Session-Timeout
971 AVP, and according to rules established in a particular Diameter
972 application.
974 2.1. Transport
976 Transport profile is defined in [RFC3539].
978 The base Diameter protocol is run on port 3868 of both TCP [TCP] and
979 SCTP [RFC2960] transport protocols.
981 Diameter clients MUST support either TCP or SCTP, while agents and
982 servers MUST support both. Future versions of this specification MAY
983 mandate that clients support SCTP.
985 A Diameter node MAY initiate connections from a source port other
986 than the one that it declares it accepts incoming connections on, and
987 MUST be prepared to receive connections on port 3868. A given
988 Diameter instance of the peer state machine MUST NOT use more than
989 one transport connection to communicate with a given peer, unless
990 multiple instances exist on the peer in which case a separate
991 connection per process is allowed.
993 When no transport connection exists with a peer, an attempt to
994 connect SHOULD be periodically made. This behavior is handled via
995 the Tc timer, whose recommended value is 30 seconds. There are
996 certain exceptions to this rule, such as when a peer has terminated
997 the transport connection stating that it does not wish to
998 communicate.
1000 When connecting to a peer and either zero or more transports are
1001 specified, SCTP SHOULD be tried first, followed by TCP. See Section
1002 5.2 for more information on peer discovery.
1004 Diameter implementations SHOULD be able to interpret ICMP protocol
1005 port unreachable messages as explicit indications that the server is
1006 not reachable, subject to security policy on trusting such messages.
1008 Diameter implementations SHOULD also be able to interpret a reset
1009 from the transport and timed-out connection attempts. If Diameter
1010 receives data up from TCP that cannot be parsed or identified as a
1011 Diameter error made by the peer, the stream is compromised and cannot
1012 be recovered. The transport connection MUST be closed using a RESET
1013 call (send a TCP RST bit) or an SCTP ABORT message (graceful closure
1014 is compromised).
1016 2.1.1. SCTP Guidelines
1018 The following are guidelines for Diameter implementations that
1019 support SCTP:
1021 1. For interoperability: All Diameter nodes MUST be prepared to
1022 receive Diameter messages on any SCTP stream in the association.
1024 2. To prevent blocking: All Diameter nodes SHOULD utilize all SCTP
1025 streams available to the association to prevent head-of-the-line
1026 blocking.
1028 2.2. Securing Diameter Messages
1030 Connections between Diameter peers SHOULD be protected by TLS. All
1031 Diameter base protocol implementations MUST support the use of TLS.
1032 If desired, additional security measures that are transparent to and
1033 independent of Diameter, such as IPSec [RFC4301], can be deployed to
1034 secure connections between peers. The Diameter protocol SHOULD NOT
1035 be used without any security mechanism.
1037 2.3. Diameter Application Compliance
1039 Application Identifiers are advertised during the capabilities
1040 exchange phase (see Section 5.3). For a given application,
1041 advertising support of an application implies that the sender
1042 supports all command codes, and the AVPs specified in the associated
1043 ABNFs, described in the specification.
1045 An implementation MAY add arbitrary non-mandatory AVPs to any command
1046 defined in an application, including vendor-specific AVPs. Please
1047 refer to Section 11.1.1 for details.
1049 2.4. Application Identifiers
1051 Each Diameter application MUST have an IANA assigned Application
1052 Identifier (see Section 11.3). The base protocol does not require an
1053 Application Identifier since its support is mandatory. During the
1054 capabilities exchange, Diameter nodes inform their peers of locally
1055 supported applications. Furthermore, all Diameter messages contain
1056 an Application Identifier, which is used in the message forwarding
1057 process.
1059 The following Application Identifier values are defined:
1061 Diameter Common Messages 0
1062 NASREQ 1 [RFC4005]
1063 Mobile-IP 2 [RFC4004]
1064 Diameter Base Accounting 3
1065 Relay 0xffffffff
1067 Relay and redirect agents MUST advertise the Relay Application
1068 Identifier, while all other Diameter nodes MUST advertise locally
1069 supported applications. The receiver of a Capabilities Exchange
1070 message advertising Relay service MUST assume that the sender
1071 supports all current and future applications.
1073 Diameter relay and proxy agents are responsible for finding an
1074 upstream server that supports the application of a particular
1075 message. If none can be found, an error message is returned with the
1076 Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER.
1078 2.5. Connections vs. Sessions
1080 This section attempts to provide the reader with an understanding of
1081 the difference between connection and session, which are terms used
1082 extensively throughout this document.
1084 A connection is a transport level connection between two peers, used
1085 to send and receive Diameter messages. A session is a logical
1086 concept at the application layer, and is shared between an access
1087 device and a server, and is identified via the Session-Id AVP.
1089 +--------+ +-------+ +--------+
1090 | Client | | Relay | | Server |
1091 +--------+ +-------+ +--------+
1092 <----------> <---------->
1093 peer connection A peer connection B
1095 <----------------------------->
1096 User session x
1098 Figure 1: Diameter connections and sessions
1100 In the example provided in Figure 1, peer connection A is established
1101 between the Client and its local Relay. Peer connection B is
1102 established between the Relay and the Server. User session X spans
1103 from the Client via the Relay to the Server. Each "user" of a
1104 service causes an auth request to be sent, with a unique session
1105 identifier. Once accepted by the server, both the client and the
1106 server are aware of the session.
1108 It is important to note that there is no relationship between a
1109 connection and a session, and that Diameter messages for multiple
1110 sessions are all multiplexed through a single connection. Also note
1111 that Diameter messages pertaining to the session, both application
1112 specific and those that are defined in this document such as ASR/ASA,
1113 RAR/RAA and STR/STA MUST carry the application identifier of the
1114 application. Diameter messages pertaining to peer connection
1115 establishment and maintenance such as CER/CEA, DWR/DWA and DPR/DPA
1116 MUST carry an application id of zero (0).
1118 2.6. Peer Table
1120 The Diameter Peer Table is used in message forwarding, and referenced
1121 by the Routing Table. A Peer Table entry contains the following
1122 fields:
1124 Host identity
1126 Following the conventions described for the DiameterIdentity
1127 derived AVP data format in Section 4.4. This field contains the
1128 contents of the Origin-Host (Section 6.3) AVP found in the CER or
1129 CEA message.
1131 StatusT
1133 This is the state of the peer entry, and MUST match one of the
1134 values listed in Section 5.6.
1136 Static or Dynamic
1138 Specifies whether a peer entry was statically configured, or
1139 dynamically discovered.
1141 Expiration time
1143 Specifies the time at which dynamically discovered peer table
1144 entries are to be either refreshed, or expired.
1146 TLS Enabled
1148 Specifies whether TLS is to be used when communicating with the
1149 peer.
1151 Additional security information, when needed (e.g., keys,
1152 certificates)
1154 2.7. Routing Table
1156 All Realm-Based routing lookups are performed against what is
1157 commonly known as the Routing Table (see Section 12). A Routing
1158 Table Entry contains the following fields:
1160 Realm Name
1162 This is the field that is typically used as a primary key in the
1163 routing table lookups. Note that some implementations perform
1164 their lookups based on longest-match-from-the-right on the realm
1165 rather than requiring an exact match.
1167 Application Identifier
1169 An application is identified by an application id. A route entry
1170 can have a different destination based on the application
1171 identification in the message header. This field MUST be used as
1172 a secondary key field in routing table lookups.
1174 Local Action
1176 The Local Action field is used to identify how a message should be
1177 treated. The following actions are supported:
1179 1. LOCAL - Diameter messages that resolve to a route entry with
1180 the Local Action set to Local can be satisfied locally, and do
1181 not need to be routed to another server.
1183 2. RELAY - All Diameter messages that fall within this category
1184 MUST be routed to a next hop server, without modifying any
1185 non-routing AVPs. See Section 6.1.9 for relaying guidelines
1187 3. PROXY - All Diameter messages that fall within this category
1188 MUST be routed to a next hop server. The local server MAY
1189 apply its local policies to the message by including new AVPs
1190 to the message prior to routing. See Section 6.1.9 for
1191 proxying guidelines.
1193 4. REDIRECT - Diameter messages that fall within this category
1194 MUST have the identity of the home Diameter server(s)
1195 appended, and returned to the sender of the message. See
1196 Section 6.1.9 for redirect guidelines.
1198 Server Identifier
1200 One or more servers the message is to be routed to. These servers
1201 MUST also be present in the Peer table. When the Local Action is
1202 set to RELAY or PROXY, this field contains the identity of the
1203 server(s) the message must be routed to. When the Local Action
1204 field is set to REDIRECT, this field contains the identity of one
1205 or more servers the message should be redirected to.
1207 Static or Dynamic
1209 Specifies whether a route entry was statically configured, or
1210 dynamically discovered.
1212 Expiration time
1214 Specifies the time which a dynamically discovered route table
1215 entry expires.
1217 It is important to note that Diameter agents MUST support at least
1218 one of the LOCAL, RELAY, PROXY or REDIRECT modes of operation.
1219 Agents do not need to support all modes of operation in order to
1220 conform with the protocol specification, but MUST follow the protocol
1221 compliance guidelines in Section 2. Relay agents MUST NOT reorder
1222 AVPs, and proxies MUST NOT reorder AVPs.
1224 The routing table MAY include a default entry that MUST be used for
1225 any requests not matching any of the other entries. The routing
1226 table MAY consist of only such an entry.
1228 When a request is routed, the target server MUST have advertised the
1229 Application Identifier (see Section 2.4) for the given message, or
1230 have advertised itself as a relay or proxy agent. Otherwise, an
1231 error is returned with the Result-Code AVP set to
1232 DIAMETER_UNABLE_TO_DELIVER.
1234 2.8. Role of Diameter Agents
1236 In addition to client and servers, the Diameter protocol introduces
1237 relay, proxy, redirect, and translation agents, each of which is
1238 defined in Section 1.3. These Diameter agents are useful for several
1239 reasons:
1241 o They can distribute administration of systems to a configurable
1242 grouping, including the maintenance of security associations.
1244 o They can be used for concentration of requests from an number of
1245 co-located or distributed NAS equipment sets to a set of like user
1246 groups.
1248 o They can do value-added processing to the requests or responses.
1250 o They can be used for load balancing.
1252 o A complex network will have multiple authentication sources, they
1253 can sort requests and forward towards the correct target.
1255 The Diameter protocol requires that agents maintain transaction
1256 state, which is used for failover purposes. Transaction state
1257 implies that upon forwarding a request, its Hop-by-Hop identifier is
1258 saved; the field is replaced with a locally unique identifier, which
1259 is restored to its original value when the corresponding answer is
1260 received. The request's state is released upon receipt of the
1261 answer. A stateless agent is one that only maintains transaction
1262 state.
1264 The Proxy-Info AVP allows stateless agents to add local state to a
1265 Diameter request, with the guarantee that the same state will be
1266 present in the answer. However, the protocol's failover procedures
1267 require that agents maintain a copy of pending requests.
1269 A stateful agent is one that maintains session state information; by
1270 keeping track of all authorized active sessions. Each authorized
1271 session is bound to a particular service, and its state is considered
1272 active either until it is notified otherwise, or by expiration. Each
1273 authorized session has an expiration, which is communicated by
1274 Diameter servers via the Session-Timeout AVP.
1276 Maintaining session state MAY be useful in certain applications, such
1277 as:
1279 o Protocol translation (e.g., RADIUS <-> Diameter)
1281 o Limiting resources authorized to a particular user
1283 o Per user or transaction auditing
1285 A Diameter agent MAY act in a stateful manner for some requests and
1286 be stateless for others. A Diameter implementation MAY act as one
1287 type of agent for some requests, and as another type of agent for
1288 others.
1290 2.8.1. Relay Agents
1292 Relay Agents are Diameter agents that accept requests and route
1293 messages to other Diameter nodes based on information found in the
1294 messages (e.g., Destination-Realm). This routing decision is
1295 performed using a list of supported realms, and known peers. This is
1296 known as the Routing Table, as is defined further in Section 2.7.
1298 Relays MAY be used to aggregate requests from multiple Network Access
1299 Servers (NASes) within a common geographical area (POP). The use of
1300 Relays is advantageous since it eliminates the need for NASes to be
1301 configured with the necessary security information they would
1302 otherwise require to communicate with Diameter servers in other
1303 realms. Likewise, this reduces the configuration load on Diameter
1304 servers that would otherwise be necessary when NASes are added,
1305 changed or deleted.
1307 Relays modify Diameter messages by inserting and removing routing
1308 information, but do not modify any other portion of a message.
1309 Relays SHOULD NOT maintain session state but MUST maintain
1310 transaction state.
1312 +------+ ---------> +------+ ---------> +------+
1313 | | 1. Request | | 2. Request | |
1314 | NAS | | DRL | | HMS |
1315 | | 4. Answer | | 3. Answer | |
1316 +------+ <--------- +------+ <--------- +------+
1317 example.net example.net example.com
1319 Figure 2: Relaying of Diameter messages
1321 The example provided in Figure 2 depicts a request issued from NAS,
1322 which is an access device, for the user bob@example.com. Prior to
1323 issuing the request, NAS performs a Diameter route lookup, using
1324 "example.com" as the key, and determines that the message is to be
1325 relayed to DRL, which is a Diameter Relay. DRL performs the same
1326 route lookup as NAS, and relays the message to HMS, which is
1327 example.com's Home Diameter Server. HMS identifies that the request
1328 can be locally supported (via the realm), processes the
1329 authentication and/or authorization request, and replies with an
1330 answer, which is routed back to NAS using saved transaction state.
1332 Since Relays do not perform any application level processing, they
1333 provide relaying services for all Diameter applications, and
1334 therefore MUST advertise the Relay Application Identifier.
1336 2.8.2. Proxy Agents
1338 Similarly to relays, proxy agents route Diameter messages using the
1339 Diameter Routing Table. However, they differ since they modify
1340 messages to implement policy enforcement. This requires that proxies
1341 maintain the state of their downstream peers (e.g., access devices)
1342 to enforce resource usage, provide admission control, and
1343 provisioning.
1345 Proxies MAY be used in call control centers or access ISPs that
1346 provide outsourced connections, they can monitor the number and types
1347 of ports in use, and make allocation and admission decisions
1348 according to their configuration.
1350 Proxies that wish to limit resources MUST maintain session state.
1351 All proxies MUST maintain transaction state.
1353 Since enforcing policies requires an understanding of the service
1354 being provided, Proxies MUST only advertise the Diameter applications
1355 they support.
1357 2.8.3. Redirect Agents
1359 Redirect agents are useful in scenarios where the Diameter routing
1360 configuration needs to be centralized. An example is a redirect
1361 agent that provides services to all members of a consortium, but does
1362 not wish to be burdened with relaying all messages between realms.
1363 This scenario is advantageous since it does not require that the
1364 consortium provide routing updates to its members when changes are
1365 made to a member's infrastructure.
1367 Since redirect agents do not relay messages, and only return an
1368 answer with the information necessary for Diameter agents to
1369 communicate directly, they do not modify messages. Since redirect
1370 agents do not receive answer messages, they cannot maintain session
1371 state. Further, since redirect agents never relay requests, they are
1372 not required to maintain transaction state.
1374 The example provided in Figure 3 depicts a request issued from the
1375 access device, NAS, for the user bob@example.com. The message is
1376 forwarded by the NAS to its relay, DRL, which does not have a routing
1377 entry in its Diameter Routing Table for example.com. DRL has a
1378 default route configured to DRD, which is a redirect agent that
1379 returns a redirect notification to DRL, as well as HMS' contact
1380 information. Upon receipt of the redirect notification, DRL
1381 establishes a transport connection with HMS, if one doesn't already
1382 exist, and forwards the request to it.
1384 +------+
1385 | |
1386 | DRD |
1387 | |
1388 +------+
1389 ^ |
1390 2. Request | | 3. Redirection
1391 | | Notification
1392 | v
1393 +------+ ---------> +------+ ---------> +------+
1394 | | 1. Request | | 4. Request | |
1395 | NAS | | DRL | | HMS |
1396 | | 6. Answer | | 5. Answer | |
1397 +------+ <--------- +------+ <--------- +------+
1398 example.net example.net example.com
1400 Figure 3: Redirecting a Diameter Message
1402 Since redirect agents do not perform any application level
1403 processing, they provide relaying services for all Diameter
1404 applications, and therefore MUST advertise the Relay Application
1405 Identifier.
1407 2.8.4. Translation Agents
1409 A translation agent is a device that provides translation between two
1410 protocols (e.g., RADIUS<->Diameter, TACACS+<->Diameter). Translation
1411 agents are likely to be used as aggregation servers to communicate
1412 with a Diameter infrastructure, while allowing for the embedded
1413 systems to be migrated at a slower pace.
1415 Given that the Diameter protocol introduces the concept of long-lived
1416 authorized sessions, translation agents MUST be session stateful and
1417 MUST maintain transaction state.
1419 Translation of messages can only occur if the agent recognizes the
1420 application of a particular request, and therefore translation agents
1421 MUST only advertise their locally supported applications.
1423 +------+ ---------> +------+ ---------> +------+
1424 | | RADIUS Request | | Diameter Request | |
1425 | NAS | | TLA | | HMS |
1426 | | RADIUS Answer | | Diameter Answer | |
1427 +------+ <--------- +------+ <--------- +------+
1428 example.net example.net example.com
1429 Figure 4: Translation of RADIUS to Diameter
1431 2.9. Diameter Path Authorization
1433 As noted in Section 2.2, Diameter provides transmission level
1434 security for each connection using TLS. Therefore, each connection
1435 can be authenticated, replay and integrity protected.
1437 In addition to authenticating each connection, each connection as
1438 well as the entire session MUST also be authorized. Before
1439 initiating a connection, a Diameter Peer MUST check that its peers
1440 are authorized to act in their roles. For example, a Diameter peer
1441 may be authentic, but that does not mean that it is authorized to act
1442 as a Diameter Server advertising a set of Diameter applications.
1444 Prior to bringing up a connection, authorization checks are performed
1445 at each connection along the path. Diameter capabilities negotiation
1446 (CER/CEA) also MUST be carried out, in order to determine what
1447 Diameter applications are supported by each peer. Diameter sessions
1448 MUST be routed only through authorized nodes that have advertised
1449 support for the Diameter application required by the session.
1451 As noted in Section 6.1.9, a relay or proxy agent MUST append a
1452 Route-Record AVP to all requests forwarded. The AVP contains the
1453 identity of the peer the request was received from.
1455 The home Diameter server, prior to authorizing a session, MUST check
1456 the Route-Record AVPs to make sure that the route traversed by the
1457 request is acceptable. For example, administrators within the home
1458 realm may not wish to honor requests that have been routed through an
1459 untrusted realm. By authorizing a request, the home Diameter server
1460 is implicitly indicating its willingness to engage in the business
1461 transaction as specified by the contractual relationship between the
1462 server and the previous hop. A DIAMETER_AUTHORIZATION_REJECTED error
1463 message (see Section 7.1.5) is sent if the route traversed by the
1464 request is unacceptable.
1466 A home realm may also wish to check that each accounting request
1467 message corresponds to a Diameter response authorizing the session.
1468 Accounting requests without corresponding authorization responses
1469 SHOULD be subjected to further scrutiny, as should accounting
1470 requests indicating a difference between the requested and provided
1471 service.
1473 Forwarding of an authorization response is considered evidence of a
1474 willingness to take on financial risk relative to the session. A
1475 local realm may wish to limit this exposure, for example, by
1476 establishing credit limits for intermediate realms and refusing to
1477 accept responses which would violate those limits. By issuing an
1478 accounting request corresponding to the authorization response, the
1479 local realm implicitly indicates its agreement to provide the service
1480 indicated in the authorization response. If the service cannot be
1481 provided by the local realm, then a DIAMETER_UNABLE_TO_COMPLY error
1482 message MUST be sent within the accounting request; a Diameter client
1483 receiving an authorization response for a service that it cannot
1484 perform MUST NOT substitute an alternate service, and then send
1485 accounting requests for the alternate service instead.
1487 3. Diameter Header
1489 A summary of the Diameter header format is shown below. The fields
1490 are transmitted in network byte order.
1492 0 1 2 3
1493 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
1494 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1495 | Version | Message Length |
1496 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1497 | command flags | Command-Code |
1498 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1499 | Application-ID |
1500 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1501 | Hop-by-Hop Identifier |
1502 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1503 | End-to-End Identifier |
1504 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1505 | AVPs ...
1506 +-+-+-+-+-+-+-+-+-+-+-+-+-
1508 Version
1510 This Version field MUST be set to 1 to indicate Diameter Version
1511 1.
1513 Message Length
1515 The Message Length field is three octets and indicates the length
1516 of the Diameter message including the header fields.
1518 Command Flags
1520 The Command Flags field is eight bits. The following bits are
1521 assigned:
1523 0 1 2 3 4 5 6 7
1524 +-+-+-+-+-+-+-+-+
1525 |R P E T r r r r|
1526 +-+-+-+-+-+-+-+-+
1528 R(equest)
1530 If set, the message is a request. If cleared, the message is
1531 an answer.
1533 P(roxiable)
1535 If set, the message MAY be proxied, relayed or redirected. If
1536 cleared, the message MUST be locally processed.
1538 E(rror)
1540 If set, the message contains a protocol error, and the message
1541 will not conform to the ABNF described for this command.
1542 Messages with the 'E' bit set are commonly referred to as error
1543 messages. This bit MUST NOT be set in request messages. See
1544 Section 7.2.
1546 T(Potentially re-transmitted message)
1548 This flag is set after a link failover procedure, to aid the
1549 removal of duplicate requests. It is set when resending
1550 requests not yet acknowledged, as an indication of a possible
1551 duplicate due to a link failure. This bit MUST be cleared when
1552 sending a request for the first time, otherwise the sender MUST
1553 set this flag. Diameter agents only need to be concerned about
1554 the number of requests they send based on a single received
1555 request; retransmissions by other entities need not be tracked.
1556 Diameter agents that receive a request with the T flag set,
1557 MUST keep the T flag set in the forwarded request. This flag
1558 MUST NOT be set if an error answer message (e.g., a protocol
1559 error) has been received for the earlier message. It can be
1560 set only in cases where no answer has been received from the
1561 server for a request and the request is sent again. This flag
1562 MUST NOT be set in answer messages.
1564 r(eserved)
1566 These flag bits are reserved for future use, and MUST be set to
1567 zero, and ignored by the receiver.
1569 Command-Code
1571 The Command-Code field is three octets, and is used in order to
1572 communicate the command associated with the message. The 24-bit
1573 address space is managed by IANA (see Section 11.2.1).
1575 Command-Code values 16,777,214 and 16,777,215 (hexadecimal values
1576 FFFFFE -FFFFFF) are reserved for experimental use (See Section
1577 11.3).
1579 Application-ID
1581 Application-ID is four octets and is used to identify to which
1582 application the message is applicable for. The application can be
1583 an authentication application, an accounting application or a
1584 vendor specific application. See Section 11.3 for the possible
1585 values that the application-id may use.
1587 The application-id in the header MUST be the same as what is
1588 contained in any relevant application-id AVPs contained in the
1589 message.
1591 Hop-by-Hop Identifier
1593 The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in
1594 network byte order) and aids in matching requests and replies.
1595 The sender MUST ensure that the Hop-by-Hop identifier in a request
1596 is unique on a given connection at any given time, and MAY attempt
1597 to ensure that the number is unique across reboots. The sender of
1598 an Answer message MUST ensure that the Hop-by-Hop Identifier field
1599 contains the same value that was found in the corresponding
1600 request. The Hop-by-Hop identifier is normally a monotonically
1601 increasing number, whose start value was randomly generated. An
1602 answer message that is received with an unknown Hop-by-Hop
1603 Identifier MUST be discarded.
1605 End-to-End Identifier
1607 The End-to-End Identifier is an unsigned 32-bit integer field (in
1608 network byte order) and is used to detect duplicate messages.
1609 Upon reboot implementations MAY set the high order 12 bits to
1610 contain the low order 12 bits of current time, and the low order
1611 20 bits to a random value. Senders of request messages MUST
1612 insert a unique identifier on each message. The identifier MUST
1613 remain locally unique for a period of at least 4 minutes, even
1614 across reboots. The originator of an Answer message MUST ensure
1615 that the End-to-End Identifier field contains the same value that
1616 was found in the corresponding request. The End-to-End Identifier
1617 MUST NOT be modified by Diameter agents of any kind. The
1618 combination of the Origin-Host (see Section 6.3) and this field is
1619 used to detect duplicates. Duplicate requests SHOULD cause the
1620 same answer to be transmitted (modulo the hop-by-hop Identifier
1621 field and any routing AVPs that may be present), and MUST NOT
1622 affect any state that was set when the original request was
1623 processed. Duplicate answer messages that are to be locally
1624 consumed (see Section 6.2) SHOULD be silently discarded.
1626 AVPs
1628 AVPs are a method of encapsulating information relevant to the
1629 Diameter message. See Section 4 for more information on AVPs.
1631 3.1. Command Codes
1633 Each command Request/Answer pair is assigned a command code, and the
1634 sub-type (i.e., request or answer) is identified via the 'R' bit in
1635 the Command Flags field of the Diameter header.
1637 Every Diameter message MUST contain a command code in its header's
1638 Command-Code field, which is used to determine the action that is to
1639 be taken for a particular message. The following Command Codes are
1640 defined in the Diameter base protocol:
1642 Command-Name Abbrev. Code Reference
1643 --------------------------------------------------------
1644 Abort-Session-Request ASR 274 8.5.1
1645 Abort-Session-Answer ASA 274 8.5.2
1646 Accounting-Request ACR 271 9.7.1
1647 Accounting-Answer ACA 271 9.7.2
1648 Capabilities-Exchange- CER 257 5.3.1
1649 Request
1650 Capabilities-Exchange- CEA 257 5.3.2
1651 Answer
1652 Device-Watchdog-Request DWR 280 5.5.1
1653 Device-Watchdog-Answer DWA 280 5.5.2
1654 Disconnect-Peer-Request DPR 282 5.4.1
1655 Disconnect-Peer-Answer DPA 282 5.4.2
1656 Re-Auth-Request RAR 258 8.3.1
1657 Re-Auth-Answer RAA 258 8.3.2
1658 Session-Termination- STR 275 8.4.1
1659 Request
1660 Session-Termination- STA 275 8.4.2
1661 Answer
1663 3.2. Command Code ABNF specification
1665 Every Command Code defined MUST include a corresponding ABNF
1666 specification, which is used to define the AVPs that MUST or MAY be
1667 present. The following format is used in the definition:
1669 command-def = command-name "::=" diameter-message
1671 command-name = diameter-name
1672 diameter-name = ALPHA *(ALPHA / DIGIT / "-")
1674 diameter-message = header [ *fixed] [ *required] [ *optional]
1676 header = "<" "Diameter Header:" command-id
1677 [r-bit] [p-bit] [e-bit] [application-id] ">"
1679 application-id = 1*DIGIT
1681 command-id = 1*DIGIT
1682 ; The Command Code assigned to the command
1684 r-bit = ", REQ"
1685 ; If present, the 'R' bit in the Command
1686 ; Flags is set, indicating that the message
1687 ; is a request, as opposed to an answer.
1689 p-bit = ", PXY"
1690 ; If present, the 'P' bit in the Command
1691 ; Flags is set, indicating that the message
1692 ; is proxiable.
1694 e-bit = ", ERR"
1695 ; If present, the 'E' bit in the Command
1696 ; Flags is set, indicating that the answer
1697 ; message contains a Result-Code AVP in
1698 ; the "protocol error" class.
1700 fixed = [qual] "<" avp-spec ">"
1701 ; Defines the fixed position of an AVP
1703 required = [qual] "{" avp-spec "}"
1704 ; The AVP MUST be present and can appear
1705 ; anywhere in the message.
1707 optional = [qual] "[" avp-name "]"
1708 ; The avp-name in the 'optional' rule cannot
1709 ; evaluate to any AVP Name which is included
1710 ; in a fixed or required rule. The AVP can
1711 ; appear anywhere in the message.
1713 qual = [min] "*" [max]
1714 ; See ABNF conventions, RFC 4234 Section 6.6.
1715 ; The absence of any qualifiers depends on
1716 ; whether it precedes a fixed, required, or
1717 ; optional rule. If a fixed or required rule has
1718 ; no qualifier, then exactly one such AVP MUST
1719 ; be present. If an optional rule has no
1720 ; qualifier, then 0 or 1 such AVP may be
1721 ; present. If an optional rule has a qualifier,
1722 ; then the value of min MUST be 0 if present.
1723 ;
1724 ; NOTE: "[" and "]" have a different meaning
1725 ; than in ABNF (see the optional rule, above).
1726 ; These braces cannot be used to express
1727 ; optional fixed rules (such as an optional
1728 ; ICV at the end). To do this, the convention
1729 ; is '0*1fixed'.
1731 min = 1*DIGIT
1732 ; The minimum number of times the element may
1733 ; be present. The default value is zero.
1735 max = 1*DIGIT
1736 ; The maximum number of times the element may
1737 ; be present. The default value is infinity. A
1738 ; value of zero implies the AVP MUST NOT be
1739 ; present.
1741 avp-spec = diameter-name
1742 ; The avp-spec has to be an AVP Name, defined
1743 ; in the base or extended Diameter
1744 ; specifications.
1746 avp-name = avp-spec / "AVP"
1747 ; The string "AVP" stands for *any* arbitrary AVP
1748 ; Name, not otherwise listed in that command code
1749 ; definition.
1751 The following is a definition of a fictitious command code:
1753 Example-Request ::= < Diameter Header: 9999999, REQ, PXY >
1754 { User-Name }
1755 * { Origin-Host }
1756 * [ AVP
1758 3.3. Diameter Command Naming Conventions
1760 Diameter command names typically includes one or more English words
1761 followed by the verb Request or Answer. Each English word is
1762 delimited by a hyphen. A three-letter acronym for both the request
1763 and answer is also normally provided.
1765 An example is a message set used to terminate a session. The command
1766 name is Session-Terminate-Request and Session-Terminate-Answer, while
1767 the acronyms are STR and STA, respectively.
1769 Both the request and the answer for a given command share the same
1770 command code. The request is identified by the R(equest) bit in the
1771 Diameter header set to one (1), to ask that a particular action be
1772 performed, such as authorizing a user or terminating a session. Once
1773 the receiver has completed the request it issues the corresponding
1774 answer, which includes a result code that communicates one of the
1775 following:
1777 o The request was successful
1779 o The request failed
1781 o An additional request must be sent to provide information the peer
1782 requires prior to returning a successful or failed answer.
1784 o The receiver could not process the request, but provides
1785 information about a Diameter peer that is able to satisfy the
1786 request, known as redirect.
1788 Additional information, encoded within AVPs, MAY also be included in
1789 answer messages.
1791 4. Diameter AVPs
1793 Diameter AVPs carry specific authentication, accounting,
1794 authorization and routing information as well as configuration
1795 details for the request and reply.
1797 Some AVPs MAY be listed more than once. The effect of such an AVP is
1798 specific, and is specified in each case by the AVP description.
1800 Each AVP of type OctetString MUST be padded to align on a 32-bit
1801 boundary, while other AVP types align naturally. A number of zero-
1802 valued bytes are added to the end of the AVP Data field till a word
1803 boundary is reached. The length of the padding is not reflected in
1804 the AVP Length field.
1806 4.1. AVP Header
1808 The fields in the AVP header MUST be sent in network byte order. The
1809 format of the header is:
1811 0 1 2 3
1812 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
1813 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1814 | AVP Code |
1815 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1816 |V M r r r r r r| AVP Length |
1817 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1818 | Vendor-ID (opt) |
1819 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1820 | Data ...
1821 +-+-+-+-+-+-+-+-+
1823 AVP Code
1825 The AVP Code, combined with the Vendor-Id field, identifies the
1826 attribute uniquely. AVP numbers 1 through 255 are reserved for
1827 backward compatibility with RADIUS, without setting the Vendor-Id
1828 field. AVP numbers 256 and above are used for Diameter, which are
1829 allocated by IANA (see Section 11.1).
1831 AVP Flags
1833 The AVP Flags field informs the receiver how each attribute must
1834 be handled. The 'r' (reserved) bits are unused and SHOULD be set
1835 to 0. Note that subsequent Diameter applications MAY define
1836 additional bits within the AVP Header, and an unrecognized bit
1837 SHOULD be considered an error.
1839 The 'M' Bit, known as the Mandatory bit, indicates whether support
1840 of the AVP is required. If an AVP with the 'M' bit set is
1841 received by a Diameter client, server, proxy, or translation agent
1842 and either the AVP or its value is unrecognized, the message MUST
1843 be rejected. An exception to this rule applies when the AVP is
1844 embedded within a Grouped AVP. See Section 4.4 for details.
1845 Diameter Relay and redirect agents MUST NOT reject messages with
1846 unrecognized AVPs.
1848 The 'M' bit MUST be set according to the rules defined for the AVP
1849 containing it. In order to preserve interoperability, a Diameter
1850 implementation MUST be able to exclude from a Diameter message any
1851 Mandatory AVP which is neither defined in the base Diameter
1852 protocol nor in any of the Diameter Application specifications
1853 governing the message in which it appears. It MAY do this in one
1854 of the following ways:
1856 1. If a message is rejected because it contains a Mandatory AVP
1857 which is neither defined in the base Diameter standard nor in
1858 any of the Diameter Application specifications governing the
1859 message in which it appears, the implementation may resend the
1860 message without the AVP, possibly inserting additional
1861 standard AVPs instead.
1863 2. A configuration option may be provided on a system wide, per
1864 peer, or per realm basis that would allow/prevent particular
1865 Mandatory AVPs to be sent. Thus an administrator could change
1866 the configuration to avoid interoperability problems.
1868 Diameter implementations are required to support all Mandatory
1869 AVPs which are allowed by the message's formal syntax and defined
1870 either in the base Diameter standard or in one of the Diameter
1871 Application specifications governing the message.
1873 AVPs with the 'M' bit cleared are informational only and a
1874 receiver that receives a message with such an AVP that is not
1875 supported, or whose value is not supported, MAY simply ignore the
1876 AVP.
1878 The 'V' bit, known as the Vendor-Specific bit, indicates whether
1879 the optional Vendor-ID field is present in the AVP header. When
1880 set the AVP Code belongs to the specific vendor code address
1881 space.
1883 Unless otherwise noted, AVPs will have the following default AVP
1884 Flags field settings:
1886 The 'M' bit MUST be set. The 'V' bit MUST NOT be set.
1888 AVP Length
1890 The AVP Length field is three octets, and indicates the number of
1891 octets in this AVP including the AVP Code, AVP Length, AVP Flags,
1892 Vendor-ID field (if present) and the AVP data. If a message is
1893 received with an invalid attribute length, the message SHOULD be
1894 rejected.
1896 4.1.1. Optional Header Elements
1898 The AVP Header contains one optional field. This field is only
1899 present if the respective bit-flag is enabled.
1901 Vendor-ID
1903 The Vendor-ID field is present if the 'V' bit is set in the AVP
1904 Flags field. The optional four-octet Vendor-ID field contains the
1905 IANA assigned "SMI Network Management Private Enterprise Codes"
1906 [RFC3232] value, encoded in network byte order. Any vendor
1907 wishing to implement a vendor-specific Diameter AVP MUST use their
1908 own Vendor-ID along with their privately managed AVP address
1909 space, guaranteeing that they will not collide with any other
1910 vendor's vendor-specific AVP(s), nor with future IETF
1911 applications.
1913 A vendor ID value of zero (0) corresponds to the IETF adopted AVP
1914 values, as managed by the IANA. Since the absence of the vendor
1915 ID field implies that the AVP in question is not vendor specific,
1916 implementations MUST NOT use the zero (0) vendor ID.
1918 4.2. Basic AVP Data Formats
1920 The Data field is zero or more octets and contains information
1921 specific to the Attribute. The format and length of the Data field
1922 is determined by the AVP Code and AVP Length fields. The format of
1923 the Data field MUST be one of the following base data types or a data
1924 type derived from the base data types. In the event that a new Basic
1925 AVP Data Format is needed, a new version of this RFC must be created.
1927 OctetString
1929 The data contains arbitrary data of variable length. Unless
1930 otherwise noted, the AVP Length field MUST be set to at least 8
1931 (12 if the 'V' bit is enabled). AVP Values of this type that are
1932 not a multiple of four-octets in length is followed by the
1933 necessary padding so that the next AVP (if any) will start on a
1934 32-bit boundary.
1936 Integer32
1938 32 bit signed value, in network byte order. The AVP Length field
1939 MUST be set to 12 (16 if the 'V' bit is enabled).
1941 Integer64
1943 64 bit signed value, in network byte order. The AVP Length field
1944 MUST be set to 16 (20 if the 'V' bit is enabled).
1946 Unsigned32
1948 32 bit unsigned value, in network byte order. The AVP Length
1949 field MUST be set to 12 (16 if the 'V' bit is enabled).
1951 Unsigned64
1953 64 bit unsigned value, in network byte order. The AVP Length
1954 field MUST be set to 16 (20 if the 'V' bit is enabled).
1956 Float32
1958 This represents floating point values of single precision as
1959 described by [FLOATPOINT]. The 32-bit value is transmitted in
1960 network byte order. The AVP Length field MUST be set to 12 (16 if
1961 the 'V' bit is enabled).
1963 Float64
1965 This represents floating point values of double precision as
1966 described by [FLOATPOINT]. The 64-bit value is transmitted in
1967 network byte order. The AVP Length field MUST be set to 16 (20 if
1968 the 'V' bit is enabled).
1970 Grouped
1972 The Data field is specified as a sequence of AVPs. Each of these
1973 AVPs follows - in the order in which they are specified -
1974 including their headers and padding. The AVP Length field is set
1975 to 8 (12 if the 'V' bit is enabled) plus the total length of all
1976 included AVPs, including their headers and padding. Thus the AVP
1977 length field of an AVP of type Grouped is always a multiple of 4.
1979 4.3. Derived AVP Data Formats
1981 In addition to using the Basic AVP Data Formats, applications may
1982 define data formats derived from the Basic AVP Data Formats. An
1983 application that defines new AVP Derived Data Formats MUST include
1984 them in a section entitled "AVP Derived Data Formats", using the same
1985 format as the definitions below. Each new definition must be either
1986 defined or listed with a reference to the RFC that defines the
1987 format.
1989 The below AVP Derived Data Formats are commonly used by applications.
1991 Address
1993 The Address format is derived from the OctetString AVP Base
1994 Format. It is a discriminated union, representing, for example a
1995 32-bit (IPv4) [IPV4] or 128-bit (IPv6) [RFC4291] address, most
1996 significant octet first. The first two octets of the Address AVP
1997 represents the AddressType, which contains an Address Family
1998 defined in [IANAADFAM]. The AddressType is used to discriminate
1999 the content and format of the remaining octets.
2001 Time
2003 The Time format is derived from the OctetString AVP Base Format.
2004 The string MUST contain four octets, in the same format as the
2005 first four bytes are in the NTP timestamp format. The NTP
2006 Timestamp format is defined in chapter 3 of [RFC4330].
2008 This represents the number of seconds since 0h on 1 January 1900
2009 with respect to the Coordinated Universal Time (UTC).
2011 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow.
2012 SNTP [RFC4330] describes a procedure to extend the time to 2104.
2013 This procedure MUST be supported by all DIAMETER nodes.
2015 UTF8String
2017 The UTF8String format is derived from the OctetString AVP Base
2018 Format. This is a human readable string represented using the
2019 ISO/IEC IS 10646-1 character set, encoded as an OctetString using
2020 the UTF-8 [RFC3629] transformation format described in RFC 3629.
2022 Since additional code points are added by amendments to the 10646
2023 standard from time to time, implementations MUST be prepared to
2024 encounter any code point from 0x00000001 to 0x7fffffff. Byte
2025 sequences that do not correspond to the valid encoding of a code
2026 point into UTF-8 charset or are outside this range are prohibited.
2028 The use of control codes SHOULD be avoided. When it is necessary
2029 to represent a new line, the control code sequence CR LF SHOULD be
2030 used.
2032 The use of leading or trailing white space SHOULD be avoided.
2034 For code points not directly supported by user interface hardware
2035 or software, an alternative means of entry and display, such as
2036 hexadecimal, MAY be provided.
2038 For information encoded in 7-bit US-ASCII, the UTF-8 charset is
2039 identical to the US-ASCII charset.
2041 UTF-8 may require multiple bytes to represent a single character /
2042 code point; thus the length of an UTF8String in octets may be
2043 different from the number of characters encoded.
2045 Note that the AVP Length field of an UTF8String is measured in
2046 octets, not characters.
2048 DiameterIdentity
2050 The DiameterIdentity format is derived from the OctetString AVP
2051 Base Format.
2053 DiameterIdentity = FQDN
2055 DiameterIdentity value is used to uniquely identify a Diameter
2056 node for purposes of duplicate connection and routing loop
2057 detection.
2059 The contents of the string MUST be the FQDN of the Diameter node.
2060 If multiple Diameter nodes run on the same host, each Diameter
2061 node MUST be assigned a unique DiameterIdentity. If a Diameter
2062 node can be identified by several FQDNs, a single FQDN should be
2063 picked at startup, and used as the only DiameterIdentity for that
2064 node, whatever the connection it is sent on. Note that in this
2065 document, DiameterIdentity is in ASCII form in order to be
2066 compatible with existing DNS infrastructure. See Appendix D for
2067 interactions between the Diameter protocol and Internationalized
2068 Domain Name (IDNs).
2070 DiameterURI
2072 The DiameterURI MUST follow the Uniform Resource Identifiers (URI)
2073 syntax [RFC3986] rules specified below:
2075 "aaa://" FQDN [ port ] [ transport ] [ protocol ]
2077 ; No transport security
2079 "aaas://" FQDN [ port ] [ transport ] [ protocol ]
2081 ; Transport security used
2083 FQDN = Fully Qualified Host Name
2085 port = ":" 1*DIGIT
2087 ; One of the ports used to listen for
2088 ; incoming connections.
2089 ; If absent,
2090 ; the default Diameter port (3868) is
2091 ; assumed.
2093 transport = ";transport=" transport-protocol
2095 ; One of the transports used to listen
2096 ; for incoming connections. If absent,
2097 ; the default SCTP [RFC2960] protocol is
2098 ; assumed. UDP MUST NOT be used when
2099 ; the aaa-protocol field is set to
2100 ; diameter.
2102 transport-protocol = ( "tcp" / "sctp" / "udp" )
2104 protocol = ";protocol=" aaa-protocol
2106 ; If absent, the default AAA protocol
2107 ; is diameter.
2109 aaa-protocol = ( "diameter" / "radius" / "tacacs+" )
2111 The following are examples of valid Diameter host identities:
2113 aaa://host.example.com;transport=tcp
2114 aaa://host.example.com:6666;transport=tcp
2115 aaa://host.example.com;protocol=diameter
2116 aaa://host.example.com:6666;protocol=diameter
2117 aaa://host.example.com:6666;transport=tcp;protocol=diameter
2118 aaa://host.example.com:1813;transport=udp;protocol=radius
2120 Enumerated
2122 Enumerated is derived from the Integer32 AVP Base Format. The
2123 definition contains a list of valid values and their
2124 interpretation and is described in the Diameter application
2125 introducing the AVP.
2127 IPFilterRule
2129 The IPFilterRule format is derived from the OctetString AVP Base
2130 Format. It uses the ASCII charset. Packets may be filtered based
2131 on the following information that is associated with it:
2133 Direction (in or out)
2134 Source and destination IP address (possibly masked)
2135 Protocol
2136 Source and destination port (lists or ranges)
2137 TCP flags
2138 IP fragment flag
2139 IP options
2140 ICMP types
2142 Rules for the appropriate direction are evaluated in order, with
2143 the first matched rule terminating the evaluation. Each packet is
2144 evaluated once. If no rule matches, the packet is dropped if the
2145 last rule evaluated was a permit, and passed if the last rule was
2146 a deny.
2148 IPFilterRule filters MUST follow the format:
2150 action dir proto from src to dst [options]
2152 action permit - Allow packets that match the rule.
2153 deny - Drop packets that match the rule.
2155 dir "in" is from the terminal, "out" is to the
2156 terminal.
2158 proto An IP protocol specified by number. The "ip"
2159 keyword means any protocol will match.
2161 src and dst
[ports]
2163 The may be specified as:
2164 ipno An IPv4 or IPv6 number in dotted-
2165 quad or canonical IPv6 form. Only
2166 this exact IP number will match the
2167 rule.
2168 ipno/bits An IP number as above with a mask
2169 width of the form 1.2.3.4/24. In
2170 this case, all IP numbers from
2171 1.2.3.0 to 1.2.3.255 will match.
2172 The bit width MUST be valid for the
2173 IP version and the IP number MUST
2174 NOT have bits set beyond the mask.
2175 For a match to occur, the same IP
2176 version must be present in the
2177 packet that was used in describing
2178 the IP address. To test for a
2179 particular IP version, the bits part
2180 can be set to zero. The keyword
2181 "any" is 0.0.0.0/0 or the IPv6
2182 equivalent. The keyword "assigned"
2183 is the address or set of addresses
2184 assigned to the terminal. For IPv4,
2185 a typical first rule is often "deny
2186 in ip! assigned"
2188 The sense of the match can be inverted by
2189 preceding an address with the not modifier (!),
2190 causing all other addresses to be matched
2191 instead. This does not affect the selection of
2192 port numbers.
2194 With the TCP, UDP and SCTP protocols, optional
2195 ports may be specified as:
2197 {port/port-port}[,ports[,...]]
2199 The '-' notation specifies a range of ports
2200 (including boundaries).
2202 Fragmented packets that have a non-zero offset
2203 (i.e., not the first fragment) will never match
2204 a rule that has one or more port
2205 specifications. See the frag option for
2206 details on matching fragmented packets.
2208 options:
2209 frag Match if the packet is a fragment and this is not
2210 the first fragment of the datagram. frag may not
2211 be used in conjunction with either tcpflags or
2212 TCP/UDP port specifications.
2214 ipoptions spec
2215 Match if the IP header contains the comma
2216 separated list of options specified in spec. The
2217 supported IP options are:
2219 ssrr (strict source route), lsrr (loose source
2220 route), rr (record packet route) and ts
2221 (timestamp). The absence of a particular option
2222 may be denoted with a '!'.
2224 tcpoptions spec
2225 Match if the TCP header contains the comma
2226 separated list of options specified in spec. The
2227 supported TCP options are:
2229 mss (maximum segment size), window (tcp window
2230 advertisement), sack (selective ack), ts (rfc1323
2231 timestamp) and cc (rfc1644 t/tcp connection
2232 count). The absence of a particular option may
2233 be denoted with a '!'.
2235 established
2236 TCP packets only. Match packets that have the RST
2237 or ACK bits set.
2239 setup TCP packets only. Match packets that have the SYN
2240 bit set but no ACK bit.
2242 tcpflags spec
2243 TCP packets only. Match if the TCP header
2244 contains the comma separated list of flags
2245 specified in spec. The supported TCP flags are:
2247 fin, syn, rst, psh, ack and urg. The absence of a
2248 particular flag may be denoted with a '!'. A rule
2249 that contains a tcpflags specification can never
2250 match a fragmented packet that has a non-zero
2251 offset. See the frag option for details on
2252 matching fragmented packets.
2254 icmptypes types
2255 ICMP packets only. Match if the ICMP type is in
2256 the list types. The list may be specified as any
2257 combination of ranges or individual types
2258 separated by commas. Both the numeric values and
2259 the symbolic values listed below can be used. The
2260 supported ICMP types are:
2262 echo reply (0), destination unreachable (3),
2263 source quench (4), redirect (5), echo request
2264 (8), router advertisement (9), router
2265 solicitation (10), time-to-live exceeded (11), IP
2266 header bad (12), timestamp request (13),
2267 timestamp reply (14), information request (15),
2268 information reply (16), address mask request (17)
2269 and address mask reply (18).
2271 There is one kind of packet that the access device MUST always
2272 discard, that is an IP fragment with a fragment offset of one.
2273 This is a valid packet, but it only has one use, to try to
2274 circumvent firewalls.
2276 An access device that is unable to interpret or apply a deny rule
2277 MUST terminate the session. An access device that is unable to
2278 interpret or apply a permit rule MAY apply a more restrictive
2279 rule. An access device MAY apply deny rules of its own before the
2280 supplied rules, for example to protect the access device owner's
2281 infrastructure.
2283 The rule syntax is a modified subset of ipfw(8) from FreeBSD, and
2284 the ipfw.c code may provide a useful base for implementations.
2286 4.4. Grouped AVP Values
2288 The Diameter protocol allows AVP values of type 'Grouped.' This
2289 implies that the Data field is actually a sequence of AVPs. It is
2290 possible to include an AVP with a Grouped type within a Grouped type,
2291 that is, to nest them. AVPs within an AVP of type Grouped have the
2292 same padding requirements as non-Grouped AVPs, as defined in Section
2293 4.
2295 The AVP Code numbering space of all AVPs included in a Grouped AVP is
2296 the same as for non-grouped AVPs. Receivers of a Grouped AVP that
2297 does not have the 'M' (mandatory) bit set and one or more of the
2298 encapsulated AVPs within the group has the 'M' (mandatory) bit set
2299 MAY simply be ignored if the Grouped AVP itself is unrecognized. The
2300 rule applies even if the encapsulated AVP with its 'M' (mandatory)
2301 bit set is further encapsulated within other sub-groups; i.e. other
2302 Grouped AVPs embedded within the Grouped AVP.
2304 Every Grouped AVP defined MUST include a corresponding grammar, using
2305 ABNF [RFC4234] (with modifications), as defined below.
2307 grouped-avp-def = name "::=" avp
2309 name-fmt = ALPHA *(ALPHA / DIGIT / "-")
2311 name = name-fmt
2312 ; The name has to be the name of an AVP,
2313 ; defined in the base or extended Diameter
2314 ; specifications.
2316 avp = header [ *fixed] [ *required] [ *optional]
2317 [ *fixed]
2319 header = "<" "AVP-Header:" avpcode [vendor] ">"
2321 avpcode = 1*DIGIT
2322 ; The AVP Code assigned to the Grouped AVP
2324 vendor = 1*DIGIT
2325 ; The Vendor-ID assigned to the Grouped AVP.
2326 ; If absent, the default value of zero is
2327 ; used.
2329 4.4.1. Example AVP with a Grouped Data type
2331 The Example-AVP (AVP Code 999999) is of type Grouped and is used to
2332 clarify how Grouped AVP values work. The Grouped Data field has the
2333 following ABNF grammar:
2335 Example-AVP ::= < AVP Header: 999999 >
2336 { Origin-Host }
2337 1*{ Session-Id }
2338 *[ AVP ]
2340 An Example-AVP with Grouped Data follows.
2342 The Origin-Host AVP is required (Section 6.3). In this case:
2344 Origin-Host = "example.com".
2346 One or more Session-Ids must follow. Here there are two:
2348 Session-Id =
2349 "grump.example.com:33041;23432;893;0AF3B81"
2351 Session-Id =
2352 "grump.example.com:33054;23561;2358;0AF3B82"
2354 optional AVPs included are
2356 Recovery-Policy =
2357 2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35
2358 2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5
2359 c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd
2360 f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a
2361 cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119
2362 26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c
2363 1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92
2365 Futuristic-Acct-Record =
2366 fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0
2367 57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8
2368 17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c
2369 41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067
2370 d3427475e49968f841
2372 The data for the optional AVPs is represented in hex since the format
2373 of these AVPs is neither known at the time of definition of the
2374 Example-AVP group, nor (likely) at the time when the example instance
2375 of this AVP is interpreted - except by Diameter implementations which
2376 support the same set of AVPs. The encoding example illustrates how
2377 padding is used and how length fields are calculated. Also note that
2378 AVPs may be present in the Grouped AVP value which the receiver
2379 cannot interpret (here, the Recover-Policy and Futuristic-Acct-Record
2380 AVPs). The length of the Example-AVP is the sum of all the length of
2381 the member AVPs including their padding plus the Example-AVP header
2382 size.
2384 This AVP would be encoded as follows:
2386 0 1 2 3 4 5 6 7
2387 +-------+-------+-------+-------+-------+-------+-------+-------+
2388 0 | Example AVP Header (AVP Code = 999999), Length = 496 |
2389 +-------+-------+-------+-------+-------+-------+-------+-------+
2390 8 | Origin-Host AVP Header (AVP Code = 264), Length = 19 |
2391 +-------+-------+-------+-------+-------+-------+-------+-------+
2392 16 | 'e' | 'x' | 'a' | 'm' | 'p' | 'l' | 'e' | '.' |
2393 +-------+-------+-------+-------+-------+-------+-------+-------+
2394 24 | 'c' | 'o' | 'm' |Padding| Session-Id AVP Header |
2395 +-------+-------+-------+-------+-------+-------+-------+-------+
2396 32 | (AVP Code = 263), Length = 49 | 'g' | 'r' | 'u' | 'm' |
2397 +-------+-------+-------+-------+-------+-------+-------+-------+
2398 . . .
2399 +-------+-------+-------+-------+-------+-------+-------+-------+
2400 72 | 'F' | '3' | 'B' | '8' | '1' |Padding|Padding|Padding|
2401 +-------+-------+-------+-------+-------+-------+-------+-------+
2402 80 | Session-Id AVP Header (AVP Code = 263), Length = 50 |
2403 +-------+-------+-------+-------+-------+-------+-------+-------+
2404 88 | 'g' | 'r' | 'u' | 'm' | 'p' | '.' | 'e' | 'x' |
2405 +-------+-------+-------+-------+-------+-------+-------+-------+
2406 . . .
2407 +-------+-------+-------+-------+-------+-------+-------+-------+
2408 120| '5' | '8' | ';' | '0' | 'A' | 'F' | '3' | 'B' |
2409 +-------+-------+-------+-------+-------+-------+-------+-------+
2410 128| '8' | '2' |Padding|Padding| Recovery-Policy Header (AVP |
2411 +-------+-------+-------+-------+-------+-------+-------+-------+
2412 136| Code = 8341), Length = 223 | 0x21 | 0x63 | 0xbc | 0x1d |
2413 +-------+-------+-------+-------+-------+-------+-------+-------+
2414 144| 0x0a | 0xd8 | 0x23 | 0x71 | 0xf6 | 0xbc | 0x09 | 0x48 |
2415 +-------+-------+-------+-------+-------+-------+-------+-------+
2416 . . .
2417 +-------+-------+-------+-------+-------+-------+-------+-------+
2418 352| 0x8c | 0x7f | 0x92 |Padding| Futuristic-Acct-Record Header |
2419 +-------+-------+-------+-------+-------+-------+-------+-------+
2420 328|(AVP Code = 15930),Length = 137| 0xfe | 0x19 | 0xda | 0x58 |
2421 +-------+-------+-------+-------+-------+-------+-------+-------+
2422 336| 0x02 | 0xac | 0xd9 | 0x8b | 0x07 | 0xa5 | 0xb8 | 0xc6 |
2423 +-------+-------+-------+-------+-------+-------+-------+-------+
2424 . . .
2425 +-------+-------+-------+-------+-------+-------+-------+-------+
2426 488| 0xe4 | 0x99 | 0x68 | 0xf8 | 0x41 |Padding|Padding|Padding|
2427 +-------+-------+-------+-------+-------+-------+-------+-------+
2429 4.5. Diameter Base Protocol AVPs
2431 The following table describes the Diameter AVPs defined in the base
2432 protocol, their AVP Code values, types, possible flag values.
2434 Due to space constraints, the short form DiamIdent is used to
2435 represent DiameterIdentity.
2437 +---------------------+
2438 | AVP Flag rules |
2439 |----+-----+----+-----|
2440 AVP Section | | |SHLD| MUST|
2441 Attribute Name Code Defined Data Type |MUST| MAY | NOT| NOT|
2442 -----------------------------------------|----+-----+----+-----|
2443 Acct- 85 9.8.2 Unsigned32 | M | | | V |
2444 Interim-Interval | | | | |
2445 Accounting- 483 9.8.7 Enumerated | M | | | V |
2446 Realtime-Required | | | | |
2447 Acct- 50 9.8.5 UTF8String | M | | | V |
2448 Multi-Session-Id | | | | |
2449 Accounting- 485 9.8.3 Unsigned32 | M | | | V |
2450 Record-Number | | | | |
2451 Accounting- 480 9.8.1 Enumerated | M | | | V |
2452 Record-Type | | | | |
2453 Accounting- 44 9.8.4 OctetString| M | | | V |
2454 Session-Id | | | | |
2455 Accounting- 287 9.8.6 Unsigned64 | M | | | V |
2456 Sub-Session-Id | | | | |
2457 Acct- 259 6.9 Unsigned32 | M | | | V |
2458 Application-Id | | | | |
2459 Auth- 258 6.8 Unsigned32 | M | | | V |
2460 Application-Id | | | | |
2461 Auth-Request- 274 8.7 Enumerated | M | | | V |
2462 Type | | | | |
2463 Authorization- 291 8.9 Unsigned32 | M | | | V |
2464 Lifetime | | | | |
2465 Auth-Grace- 276 8.10 Unsigned32 | M | | | V |
2466 Period | | | | |
2467 Auth-Session- 277 8.11 Enumerated | M | | | V |
2468 State | | | | |
2469 Re-Auth-Request- 285 8.12 Enumerated | M | | | V |
2470 Type | | | | |
2471 Class 25 8.20 OctetString| M | | | V |
2472 Destination-Host 293 6.5 DiamIdent | M | | | V |
2473 Destination- 283 6.6 DiamIdent | M | | | V |
2474 Realm | | | | |
2475 Disconnect-Cause 273 5.4.3 Enumerated | M | | | V |
2476 Error-Message 281 7.3 UTF8String | | | | V,M |
2477 Error-Reporting- 294 7.4 DiamIdent | | | | V,M |
2478 Host | | | | |
2479 Event-Timestamp 55 8.21 Time | M | | | V |
2480 Experimental- 297 7.6 Grouped | M | | | V |
2481 Result | | | | |
2482 -----------------------------------------|----+-----+----+-----|
2483 +---------------------+
2484 | AVP Flag rules |
2485 |----+-----+----+-----|
2486 AVP Section | | |SHLD| MUST|
2487 Attribute Name Code Defined Data Type |MUST| MAY | NOT| NOT|
2488 -----------------------------------------|----+-----+----+-----|
2489 Experimental- 298 7.7 Unsigned32 | M | | | V |
2490 Result-Code | | | | |
2491 Failed-AVP 279 7.5 Grouped | M | | | V |
2492 Firmware- 267 5.3.4 Unsigned32 | | | | V,M |
2493 Revision | | | | |
2494 Host-IP-Address 257 5.3.5 Address | M | | | V |
2495 Inband-Security | M | | | V |
2496 -Id 299 6.10 Unsigned32 | | | | |
2497 Multi-Round- 272 8.19 Unsigned32 | M | | | V |
2498 Time-Out | | | | |
2499 Origin-Host 264 6.3 DiamIdent | M | | | V |
2500 Origin-Realm 296 6.4 DiamIdent | M | | | V |
2501 Origin-State-Id 278 8.16 Unsigned32 | M | | | V |
2502 Product-Name 269 5.3.7 UTF8String | | | | V,M |
2503 Proxy-Host 280 6.7.3 DiamIdent | M | | | V |
2504 Proxy-Info 284 6.7.2 Grouped | M | | | V |
2505 Proxy-State 33 6.7.4 OctetString| M | | | V |
2506 Redirect-Host 292 6.12 DiamURI | M | | | V |
2507 Redirect-Host- 261 6.13 Enumerated | M | | | V |
2508 Usage | | | | |
2509 Redirect-Max- 262 6.14 Unsigned32 | M | | | V |
2510 Cache-Time | | | | |
2511 Result-Code 268 7.1 Unsigned32 | M | | | V |
2512 Route-Record 282 6.7.1 DiamIdent | M | | | V |
2513 Session-Id 263 8.8 UTF8String | M | | | V |
2514 Session-Timeout 27 8.13 Unsigned32 | M | | | V |
2515 Session-Binding 270 8.17 Unsigned32 | M | | | V |
2516 Session-Server- 271 8.18 Enumerated | M | | | V |
2517 Failover | | | | |
2518 Supported- 265 5.3.6 Unsigned32 | M | | | V |
2519 Vendor-Id | | | | |
2520 Termination- 295 8.15 Enumerated | M | | | V |
2521 Cause | | | | |
2522 User-Name 1 8.14 UTF8String | M | | | V |
2523 Vendor-Id 266 5.3.3 Unsigned32 | M | | | V |
2524 Vendor-Specific- 260 6.11 Grouped | M | | | V |
2525 Application-Id | | | | |
2526 -----------------------------------------|----+-----+----+-----|
2528 5. Diameter Peers
2530 This section describes how Diameter nodes establish connections and
2531 communicate with peers.
2533 5.1. Peer Connections
2535 Although a Diameter node may have many possible peers that it is able
2536 to communicate with, it may not be economical to have an established
2537 connection to all of them. At a minimum, a Diameter node SHOULD have
2538 an established connection with two peers per realm, known as the
2539 primary and secondary peers. Of course, a node MAY have additional
2540 connections, if it is deemed necessary. Typically, all messages for
2541 a realm are sent to the primary peer, but in the event that failover
2542 procedures are invoked, any pending requests are sent to the
2543 secondary peer. However, implementations are free to load balance
2544 requests between a set of peers.
2546 Note that a given peer MAY act as a primary for a given realm, while
2547 acting as a secondary for another realm.
2549 When a peer is deemed suspect, which could occur for various reasons,
2550 including not receiving a DWA within an allotted timeframe, no new
2551 requests should be forwarded to the peer, but failover procedures are
2552 invoked. When an active peer is moved to this mode, additional
2553 connections SHOULD be established to ensure that the necessary number
2554 of active connections exists.
2556 There are two ways that a peer is removed from the suspect peer list:
2558 1. The peer is no longer reachable, causing the transport connection
2559 to be shutdown. The peer is moved to the closed state.
2561 2. Three watchdog messages are exchanged with accepted round trip
2562 times, and the connection to the peer is considered stabilized.
2564 In the event the peer being removed is either the primary or
2565 secondary, an alternate peer SHOULD replace the deleted peer, and
2566 assume the role of either primary or secondary.
2568 5.2. Diameter Peer Discovery
2570 Allowing for dynamic Diameter agent discovery will make it possible
2571 for simpler and more robust deployment of Diameter services. In
2572 order to promote interoperable implementations of Diameter peer
2573 discovery, the following mechanisms are described. These are based
2574 on existing IETF standards. The first option (manual configuration)
2575 MUST be supported by all DIAMETER nodes, while the latter option
2576 (DNS) MAY be supported.
2578 There are two cases where Diameter peer discovery may be performed.
2579 The first is when a Diameter client needs to discover a first-hop
2580 Diameter agent. The second case is when a Diameter agent needs to
2581 discover another agent - for further handling of a Diameter
2582 operation. In both cases, the following 'search order' is
2583 recommended:
2585 1. The Diameter implementation consults its list of static
2586 (manually) configured Diameter agent locations. These will be
2587 used if they exist and respond.
2589 2. The Diameter implementation performs a NAPTR query for a server
2590 in a particular realm. The Diameter implementation has to know
2591 in advance which realm to look for a Diameter agent in. This
2592 could be deduced, for example, from the 'realm' in a NAI that a
2593 Diameter implementation needed to perform a Diameter operation
2594 on.
2596 * The services relevant for the task of transport protocol
2597 selection are those with NAPTR service fields with values
2598 "AAA+D2x", where x is a letter that corresponds to a transport
2599 protocol supported by the domain. This specification defines
2600 D2T for TCP and D2S for SCTP. We also establish an IANA
2601 registry for NAPTR service name to transport protocol
2602 mappings.
2604 These NAPTR records provide a mapping from a domain, to the
2605 SRV record for contacting a server with the specific transport
2606 protocol in the NAPTR services field. The resource record
2607 will contain an empty regular expression and a replacement
2608 value, which is the SRV record for that particular transport
2609 protocol. If the server supports multiple transport
2610 protocols, there will be multiple NAPTR records, each with a
2611 different service value. As per [RFC3403], the client
2612 discards any records whose services fields are not applicable.
2613 For the purposes of this specification, several rules are
2614 defined.
2616 * A client MUST discard any service fields that identify a
2617 resolution service whose value is not "D2X", for values of X
2618 that indicate transport protocols supported by the client.
2619 The NAPTR processing as described in [RFC3403] will result in
2620 discovery of the most preferred transport protocol of the
2621 server that is supported by the client, as well as an SRV
2622 record for the server.
2624 The domain suffixes in the NAPTR replacement field SHOULD
2625 match the domain of the original query.
2627 3. If no NAPTR records are found, the requester queries for those
2628 address records for the destination address,
2629 '_diameter._sctp'.realm or '_diameter._tcp'.realm. Address
2630 records include A RR's, AAAA RR's or other similar records,
2631 chosen according to the requestor's network protocol
2632 capabilities. If the DNS server returns no address records, the
2633 requestor gives up.
2635 If the server is using a site certificate, the domain name in the
2636 query and the domain name in the replacement field MUST both be
2637 valid based on the site certificate handed out by the server in
2638 the TLS or IKE exchange. Similarly, the domain name in the SRV
2639 query and the domain name in the target in the SRV record MUST
2640 both be valid based on the same site certificate. Otherwise, an
2641 attacker could modify the DNS records to contain replacement
2642 values in a different domain, and the client could not validate
2643 that this was the desired behavior, or the result of an attack
2645 Also, the Diameter Peer MUST check to make sure that the
2646 discovered peers are authorized to act in its role.
2647 Authentication via IKE or TLS, or validation of DNS RRs via
2648 DNSSEC is not sufficient to conclude this. For example, a web
2649 server may have obtained a valid TLS certificate, and secured RRs
2650 may be included in the DNS, but this does not imply that it is
2651 authorized to act as a Diameter Server.
2653 Authorization can be achieved for example, by configuration of a
2654 Diameter Server CA. Alternatively this can be achieved by
2655 definition of OIDs within TLS or IKE certificates so as to
2656 signify Diameter Server authorization.
2658 A dynamically discovered peer causes an entry in the Peer Table (see
2659 Section 2.6) to be created. Note that entries created via DNS MUST
2660 expire (or be refreshed) within the DNS TTL. If a peer is discovered
2661 outside of the local realm, a routing table entry (see Section 2.7)
2662 for the peer's realm is created. The routing table entry's
2663 expiration MUST match the peer's expiration value.
2665 5.3. Capabilities Exchange
2667 When two Diameter peers establish a transport connection, they MUST
2668 exchange the Capabilities Exchange messages, as specified in the peer
2669 state machine (see Section 5.6). This message allows the discovery
2670 of a peer's identity and its capabilities (protocol version number,
2671 supported Diameter applications, security mechanisms, etc.)
2673 The receiver only issues commands to its peers that have advertised
2674 support for the Diameter application that defines the command. A
2675 Diameter node MUST cache the supported applications in order to
2676 ensure that unrecognized commands and/or AVPs are not unnecessarily
2677 sent to a peer.
2679 A receiver of a Capabilities-Exchange-Req (CER) message that does not
2680 have any applications in common with the sender MUST return a
2681 Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to
2682 DIAMETER_NO_COMMON_APPLICATION, and SHOULD disconnect the transport
2683 layer connection. Note that receiving a CER or CEA from a peer
2684 advertising itself as a Relay (see Section 2.4) MUST be interpreted
2685 as having common applications with the peer.
2687 The receiver of the Capabilities-Exchange-Request (CER) MUST
2688 determine common applications by computing the intersection of its
2689 own set of supported application identifiers against all of the
2690 application indentifier AVPs (Auth-Application-Id,
2691 Acct-Application-Id and Vendor-Specific-Application-Id) present in
2692 the CER. The value of the Vendor-Id AVP in the Vendor-Specific-
2693 Application-Id MUST NOT be used during computation. The sender of
2694 the Capabilities-Exchange-Answer (CEA) SHOULD include all of its
2695 supported applications as a hint to the receiver regarding all of its
2696 application capabilities.
2698 Similarly, a receiver of a Capabilities-Exchange-Req (CER) message
2699 that does not have any security mechanisms in common with the sender
2700 MUST return a Capabilities-Exchange-Answer (CEA) with the Result-Code
2701 AVP set to DIAMETER_NO_COMMON_SECURITY, and SHOULD disconnect the
2702 transport layer connection.
2704 CERs received from unknown peers MAY be silently discarded, or a CEA
2705 MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER.
2706 In both cases, the transport connection is closed. If the local
2707 policy permits receiving CERs from unknown hosts, a successful CEA
2708 MAY be returned. If a CER from an unknown peer is answered with a
2709 successful CEA, the lifetime of the peer entry is equal to the
2710 lifetime of the transport connection. In case of a transport
2711 failure, all the pending transactions destined to the unknown peer
2712 can be discarded.
2714 The CER and CEA messages MUST NOT be proxied, redirected or relayed.
2716 Since the CER/CEA messages cannot be proxied, it is still possible
2717 that an upstream agent receives a message for which it has no
2718 available peers to handle the application that corresponds to the
2719 Command-Code. In such instances, the 'E' bit is set in the answer
2720 message (see Section 7.) with the Result-Code AVP set to
2721 DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action
2722 (e.g., re-routing request to an alternate peer).
2724 With the exception of the Capabilities-Exchange-Request message, a
2725 message of type Request that includes the Auth-Application-Id or
2726 Acct-Application-Id AVPs, or a message with an application-specific
2727 command code, MAY only be forwarded to a host that has explicitly
2728 advertised support for the application (or has advertised the Relay
2729 Application Identifier).
2731 5.3.1. Capabilities-Exchange-Request
2733 The Capabilities-Exchange-Request (CER), indicated by the Command-
2734 Code set to 257 and the Command Flags' 'R' bit set, is sent to
2735 exchange local capabilities. Upon detection of a transport failure,
2736 this message MUST NOT be sent to an alternate peer.
2738 When Diameter is run over SCTP [RFC2960], which allows for
2739 connections to span multiple interfaces and multiple IP addresses,
2740 the Capabilities-Exchange-Request message MUST contain one Host-IP-
2741 Address AVP for each potential IP address that MAY be locally used
2742 when transmitting Diameter messages.
2744 Message Format
2746 ::= < Diameter Header: 257, REQ >
2747 { Origin-Host }
2748 { Origin-Realm }
2749 1* { Host-IP-Address }
2750 { Vendor-Id }
2751 { Product-Name }
2752 [ Origin-State-Id ]
2753 * [ Supported-Vendor-Id ]
2754 * [ Auth-Application-Id ]
2755 * [ Inband-Security-Id ]
2756 * [ Acct-Application-Id ]
2757 * [ Vendor-Specific-Application-Id ]
2758 [ Firmware-Revision ]
2759 * [ AVP ]
2761 5.3.2. Capabilities-Exchange-Answer
2763 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code
2764 set to 257 and the Command Flags' 'R' bit cleared, is sent in
2765 response to a CER message.
2767 When Diameter is run over SCTP [RFC2960], which allows connections to
2768 span multiple interfaces, hence, multiple IP addresses, the
2769 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address
2770 AVP for each potential IP address that MAY be locally used when
2771 transmitting Diameter messages.
2773 Message Format
2775 ::= < Diameter Header: 257 >
2776 { Result-Code }
2777 { Origin-Host }
2778 { Origin-Realm }
2779 1* { Host-IP-Address }
2780 { Vendor-Id }
2781 { Product-Name }
2782 [ Origin-State-Id ]
2783 [ Error-Message ]
2784 [ Failed-AVP ]
2785 * [ Supported-Vendor-Id ]
2786 * [ Auth-Application-Id ]
2787 * [ Inband-Security-Id ]
2788 * [ Acct-Application-Id ]
2789 * [ Vendor-Specific-Application-Id ]
2790 [ Firmware-Revision ]
2791 * [ AVP ]
2793 5.3.3. Vendor-Id AVP
2795 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains
2796 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232]
2797 value assigned to the vendor of the Diameter device. It is
2798 envisioned that the combination of the Vendor-Id, Product-Name
2799 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may
2800 provide useful debugging information.
2802 A Vendor-Id value of zero in the CER or CEA messages is reserved and
2803 indicates that this field is ignored.
2805 5.3.4. Firmware-Revision AVP
2807 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is
2808 used to inform a Diameter peer of the firmware revision of the
2809 issuing device.
2811 For devices that do not have a firmware revision (general purpose
2812 computers running Diameter software modules, for instance), the
2813 revision of the Diameter software module may be reported instead.
2815 5.3.5. Host-IP-Address AVP
2817 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used
2818 to inform a Diameter peer of the sender's IP address. All source
2819 addresses that a Diameter node expects to use with SCTP [RFC2960]
2820 MUST be advertised in the CER and CEA messages by including a
2821 Host-IP- Address AVP for each address. This AVP MUST ONLY be used in
2822 the CER and CEA messages.
2824 5.3.6. Supported-Vendor-Id AVP
2826 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and
2827 contains the IANA "SMI Network Management Private Enterprise Codes"
2828 [RFC3232] value assigned to a vendor other than the device vendor but
2829 including the application vendor. This is used in the CER and CEA
2830 messages in order to inform the peer that the sender supports (a
2831 subset of) the vendor-specific AVPs defined by the vendor identified
2832 in this AVP. The value of this AVP SHOULD NOT be set to zero.
2833 Multiple instances of this AVP containing the same value SHOULD NOT
2834 be sent.
2836 5.3.7. Product-Name AVP
2838 The Product-Name AVP (AVP Code 269) is of type UTF8String, and
2839 contains the vendor assigned name for the product. The Product-Name
2840 AVP SHOULD remain constant across firmware revisions for the same
2841 product.
2843 5.4. Disconnecting Peer connections
2845 When a Diameter node disconnects one of its transport connections,
2846 its peer cannot know the reason for the disconnect, and will most
2847 likely assume that a connectivity problem occurred, or that the peer
2848 has rebooted. In these cases, the peer may periodically attempt to
2849 reconnect, as stated in Section 2.1. In the event that the
2850 disconnect was a result of either a shortage of internal resources,
2851 or simply that the node in question has no intentions of forwarding
2852 any Diameter messages to the peer in the foreseeable future, a
2853 periodic connection request would not be welcomed. The
2854 Disconnection-Reason AVP contains the reason the Diameter node issued
2855 the Disconnect-Peer-Request message.
2857 The Disconnect-Peer-Request message is used by a Diameter node to
2858 inform its peer of its intent to disconnect the transport layer, and
2859 that the peer shouldn't reconnect unless it has a valid reason to do
2860 so (e.g., message to be forwarded). Upon receipt of the message, the
2861 Disconnect-Peer-Answer is returned, which SHOULD contain an error if
2862 messages have recently been forwarded, and are likely in flight,
2863 which would otherwise cause a race condition.
2865 The receiver of the Disconnect-Peer-Answer initiates the transport
2866 disconnect. The sender of the Disconnect-Peer-Answer should be able
2867 to detect the transport closure and cleanup the connection.
2869 5.4.1. Disconnect-Peer-Request
2871 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set
2872 to 282 and the Command Flags' 'R' bit set, is sent to a peer to
2873 inform its intentions to shutdown the transport connection. Upon
2874 detection of a transport failure, this message MUST NOT be sent to an
2875 alternate peer.
2877 Message Format
2879 ::= < Diameter Header: 282, REQ >
2880 { Origin-Host }
2881 { Origin-Realm }
2882 { Disconnect-Cause }
2884 5.4.2. Disconnect-Peer-Answer
2886 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set
2887 to 282 and the Command Flags' 'R' bit cleared, is sent as a response
2888 to the Disconnect-Peer-Request message. Upon receipt of this
2889 message, the transport connection is shutdown.
2891 Message Format
2893 ::= < Diameter Header: 282 >
2894 { Result-Code }
2895 { Origin-Host }
2896 { Origin-Realm }
2897 [ Error-Message ]
2898 [ Failed-AVP ]
2900 5.4.3. Disconnect-Cause AVP
2902 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A
2903 Diameter node MUST include this AVP in the Disconnect-Peer-Request
2904 message to inform the peer of the reason for its intention to
2905 shutdown the transport connection. The following values are
2906 supported:
2908 REBOOTING 0
2909 A scheduled reboot is imminent. Receiver of DPR with above result
2910 code MAY attempt reconnection.
2912 BUSY 1
2913 The peer's internal resources are constrained, and it has
2914 determined that the transport connection needs to be closed.
2915 Receiver of DPR with above result code SHOULD NOT attempt
2916 reconnection.
2918 DO_NOT_WANT_TO_TALK_TO_YOU 2
2919 The peer has determined that it does not see a need for the
2920 transport connection to exist, since it does not expect any
2921 messages to be exchanged in the near future. Receiver of DPR
2922 with above result code SHOULD NOT attempt reconnection.
2924 5.5. Transport Failure Detection
2926 Given the nature of the Diameter protocol, it is recommended that
2927 transport failures be detected as soon as possible. Detecting such
2928 failures will minimize the occurrence of messages sent to unavailable
2929 agents, resulting in unnecessary delays, and will provide better
2930 failover performance. The Device-Watchdog-Request and Device-
2931 Watchdog-Answer messages, defined in this section, are used to pro-
2932 actively detect transport failures.
2934 5.5.1. Device-Watchdog-Request
2936 The Device-Watchdog-Request (DWR), indicated by the Command-Code set
2937 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no
2938 traffic has been exchanged between two peers (see Section 5.5.3).
2939 Upon detection of a transport failure, this message MUST NOT be sent
2940 to an alternate peer.
2942 Message Format
2944 ::= < Diameter Header: 280, REQ >
2945 { Origin-Host }
2946 { Origin-Realm }
2947 [ Origin-State-Id ]
2949 5.5.2. Device-Watchdog-Answer
2951 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set
2952 to 280 and the Command Flags' 'R' bit cleared, is sent as a response
2953 to the Device-Watchdog-Request message.
2955 Message Format
2957 ::= < Diameter Header: 280 >
2958 { Result-Code }
2959 { Origin-Host }
2960 { Origin-Realm }
2961 [ Error-Message ]
2962 [ Failed-AVP ]
2963 [ Origin-State-Id ]
2965 5.5.3. Transport Failure Algorithm
2967 The transport failure algorithm is defined in [RFC3539]. All
2968 Diameter implementations MUST support the algorithm defined in the
2969 specification in order to be compliant to the Diameter base protocol.
2971 5.5.4. Failover and Failback Procedures
2973 In the event that a transport failure is detected with a peer, it is
2974 necessary for all pending request messages to be forwarded to an
2975 alternate agent, if possible. This is commonly referred to as
2976 failover.
2978 In order for a Diameter node to perform failover procedures, it is
2979 necessary for the node to maintain a pending message queue for a
2980 given peer. When an answer message is received, the corresponding
2981 request is removed from the queue. The Hop-by-Hop Identifier field
2982 is used to match the answer with the queued request.
2984 When a transport failure is detected, if possible all messages in the
2985 queue are sent to an alternate agent with the T flag set. On booting
2986 a Diameter client or agent, the T flag is also set on any records
2987 still remaining to be transmitted in non-volatile storage. An
2988 example of a case where it is not possible to forward the message to
2989 an alternate server is when the message has a fixed destination, and
2990 the unavailable peer is the message's final destination (see
2991 Destination-Host AVP). Such an error requires that the agent return
2992 an answer message with the 'E' bit set and the Result-Code AVP set to
2993 DIAMETER_UNABLE_TO_DELIVER.
2995 It is important to note that multiple identical requests or answers
2996 MAY be received as a result of a failover. The End-to-End Identifier
2997 field in the Diameter header along with the Origin-Host AVP MUST be
2998 used to identify duplicate messages.
3000 As described in Section 2.1, a connection request should be
3001 periodically attempted with the failed peer in order to re-establish
3002 the transport connection. Once a connection has been successfully
3003 established, messages can once again be forwarded to the peer. This
3004 is commonly referred to as failback.
3006 5.6. Peer State Machine
3008 This section contains a finite state machine that MUST be observed by
3009 all Diameter implementations. Each Diameter node MUST follow the
3010 state machine described below when communicating with each peer.
3011 Multiple actions are separated by commas, and may continue on
3012 succeeding lines, as space requires. Similarly, state and next state
3013 may also span multiple lines, as space requires.
3015 This state machine is closely coupled with the state machine
3016 described in [RFC3539], which is used to open, close, failover,
3017 probe, and reopen transport connections. Note in particular that
3018 [RFC3539] requires the use of watchdog messages to probe connections.
3019 For Diameter, DWR and DWA messages are to be used.
3021 I- is used to represent the initiator (connecting) connection, while
3022 the R- is used to represent the responder (listening) connection.
3023 The lack of a prefix indicates that the event or action is the same
3024 regardless of the connection on which the event occurred.
3026 The stable states that a state machine may be in are Closed, I-Open
3027 and R-Open; all other states are intermediate. Note that I-Open and
3028 R-Open are equivalent except for whether the initiator or responder
3029 transport connection is used for communication.
3031 A CER message is always sent on the initiating connection immediately
3032 after the connection request is successfully completed. In the case
3033 of an election, one of the two connections will shut down. The
3034 responder connection will survive if the Origin-Host of the local
3035 Diameter entity is higher than that of the peer; the initiator
3036 connection will survive if the peer's Origin-Host is higher. All
3037 subsequent messages are sent on the surviving connection. Note that
3038 the results of an election on one peer are guaranteed to be the
3039 inverse of the results on the other.
3041 For TLS usage, a TLS handshake will begin when both ends are in the
3042 open state. If the TLS handshake is successful, all further messages
3043 will be sent via TLS. If the handshake fails, both ends move to the
3044 closed state.
3046 The state machine constrains only the behavior of a Diameter
3047 implementation as seen by Diameter peers through events on the wire.
3049 Any implementation that produces equivalent results is considered
3050 compliant.
3052 state event action next state
3053 -----------------------------------------------------------------
3054 Closed Start I-Snd-Conn-Req Wait-Conn-Ack
3055 R-Conn-CER R-Accept, R-Open
3056 Process-CER,
3057 R-Snd-CEA
3059 Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA
3060 I-Rcv-Conn-Nack Cleanup Closed
3061 R-Conn-CER R-Accept, Wait-Conn-Ack/
3062 Process-CER Elect
3063 Timeout Error Closed
3065 Wait-I-CEA I-Rcv-CEA Process-CEA I-Open
3066 R-Conn-CER R-Accept, Wait-Returns
3067 Process-CER,
3068 Elect
3069 I-Peer-Disc I-Disc Closed
3070 I-Rcv-Non-CEA Error Closed
3071 Timeout Error Closed
3073 Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns
3074 Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open
3075 R-Peer-Disc R-Disc Wait-Conn-Ack
3076 R-Conn-CER R-Reject Wait-Conn-Ack/
3077 Elect
3078 Timeout Error Closed
3080 Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open
3081 I-Peer-Disc I-Disc, R-Open
3082 R-Snd-CEA
3083 I-Rcv-CEA R-Disc I-Open
3084 R-Peer-Disc R-Disc Wait-I-CEA
3085 R-Conn-CER R-Reject Wait-Returns
3086 Timeout Error Closed
3088 R-Open Send-Message R-Snd-Message R-Open
3089 R-Rcv-Message Process R-Open
3090 R-Rcv-DWR Process-DWR, R-Open
3091 R-Snd-DWA
3092 R-Rcv-DWA Process-DWA R-Open
3093 R-Conn-CER R-Reject R-Open
3094 Stop R-Snd-DPR Closing
3095 R-Rcv-DPR R-Snd-DPA, Closed
3096 R-Disc
3098 R-Peer-Disc R-Disc Closed
3099 R-Rcv-CER R-Snd-CEA R-Open
3100 R-Rcv-CEA Process-CEA R-Open
3102 I-Open Send-Message I-Snd-Message I-Open
3103 I-Rcv-Message Process I-Open
3104 I-Rcv-DWR Process-DWR, I-Open
3105 I-Snd-DWA
3106 I-Rcv-DWA Process-DWA I-Open
3107 R-Conn-CER R-Reject I-Open
3108 Stop I-Snd-DPR Closing
3109 I-Rcv-DPR I-Snd-DPA, Closed
3110 I-Disc
3111 I-Peer-Disc I-Disc Closed
3112 I-Rcv-CER I-Snd-CEA I-Open
3113 I-Rcv-CEA Process-CEA I-Open
3115 Closing I-Rcv-DPA I-Disc Closed
3116 R-Rcv-DPA R-Disc Closed
3117 Timeout Error Closed
3118 I-Peer-Disc I-Disc Closed
3119 R-Peer-Disc R-Disc Closed
3121 5.6.1. Incoming connections
3123 When a connection request is received from a Diameter peer, it is
3124 not, in the general case, possible to know the identity of that peer
3125 until a CER is received from it. This is because host and port
3126 determine the identity of a Diameter peer; and the source port of an
3127 incoming connection is arbitrary. Upon receipt of CER, the identity
3128 of the connecting peer can be uniquely determined from Origin-Host.
3130 For this reason, a Diameter peer must employ logic separate from the
3131 state machine to receive connection requests, accept them, and await
3132 CER. Once CER arrives on a new connection, the Origin-Host that
3133 identifies the peer is used to locate the state machine associated
3134 with that peer, and the new connection and CER are passed to the
3135 state machine as an R-Conn-CER event.
3137 The logic that handles incoming connections SHOULD close and discard
3138 the connection if any message other than CER arrives, or if an
3139 implementation-defined timeout occurs prior to receipt of CER.
3141 Because handling of incoming connections up to and including receipt
3142 of CER requires logic, separate from that of any individual state
3143 machine associated with a particular peer, it is described separately
3144 in this section rather than in the state machine above.
3146 5.6.2. Events
3148 Transitions and actions in the automaton are caused by events. In
3149 this section, we will ignore the -I and -R prefix, since the actual
3150 event would be identical, but would occur on one of two possible
3151 connections.
3153 Start The Diameter application has signaled that a
3154 connection should be initiated with the peer.
3156 R-Conn-CER An acknowledgement is received stating that the
3157 transport connection has been established, and the
3158 associated CER has arrived.
3160 Rcv-Conn-Ack A positive acknowledgement is received confirming that
3161 the transport connection is established.
3163 Rcv-Conn-Nack A negative acknowledgement was received stating that
3164 the transport connection was not established.
3166 Timeout An application-defined timer has expired while waiting
3167 for some event.
3169 Rcv-CER A CER message from the peer was received.
3171 Rcv-CEA A CEA message from the peer was received.
3173 Rcv-Non-CEA A message other than CEA from the peer was received.
3175 Peer-Disc A disconnection indication from the peer was received.
3177 Rcv-DPR A DPR message from the peer was received.
3179 Rcv-DPA A DPA message from the peer was received.
3181 Win-Election An election was held, and the local node was the
3182 winner.
3184 Send-Message A message is to be sent.
3186 Rcv-Message A message other than CER, CEA, DPR, DPA, DWR or DWA
3187 was received.
3189 Stop The Diameter application has signaled that a
3190 connection should be terminated (e.g., on system
3191 shutdown).
3193 5.6.3. Actions
3195 Actions in the automaton are caused by events and typically indicate
3196 the transmission of packets and/or an action to be taken on the
3197 connection. In this section we will ignore the I- and R-prefix,
3198 since the actual action would be identical, but would occur on one of
3199 two possible connections.
3201 Snd-Conn-Req A transport connection is initiated with the peer.
3203 Accept The incoming connection associated with the R-Conn-CER
3204 is accepted as the responder connection.
3206 Reject The incoming connection associated with the R-Conn-CER
3207 is disconnected.
3209 Process-CER The CER associated with the R-Conn-CER is processed.
3210 Snd-CER A CER message is sent to the peer.
3212 Snd-CEA A CEA message is sent to the peer.
3214 Cleanup If necessary, the connection is shutdown, and any
3215 local resources are freed.
3217 Error The transport layer connection is disconnected, either
3218 politely or abortively, in response to an error
3219 condition. Local resources are freed.
3221 Process-CEA A received CEA is processed.
3223 Snd-DPR A DPR message is sent to the peer.
3225 Snd-DPA A DPA message is sent to the peer.
3227 Disc The transport layer connection is disconnected, and
3228 local resources are freed.
3230 Elect An election occurs (see Section 5.6.4 for more
3231 information).
3233 Snd-Message A message is sent.
3235 Snd-DWR A DWR message is sent.
3237 Snd-DWA A DWA message is sent.
3239 Process-DWR The DWR message is serviced.
3241 Process-DWA The DWA message is serviced.
3243 Process A message is serviced.
3245 5.6.4. The Election Process
3247 The election is performed on the responder. The responder compares
3248 the Origin-Host received in the CER with its own Origin-Host as two
3249 streams of octets. If the local Origin-Host lexicographically
3250 succeeds the received Origin-Host a Win-Election event is issued
3251 locally. Diameter identities are in ASCII form therefore the lexical
3252 comparison is consistent with DNS case insensitivity where octets
3253 that fall in the ASCII range 'a' through 'z' MUST compare equally to
3254 their upper-case counterparts between 'A' and 'Z'. See Appendix D
3255 for interactions between the Diameter protocol and Internationalized
3256 Domain Name (IDNs).
3258 The winner of the election MUST close the connection it initiated.
3259 Historically, maintaining the responder side of a connection was more
3260 efficient than maintaining the initiator side. However, current
3261 practices makes this distinction irrelevant.
3263 5.6.5. Capabilities Update
3265 A Diameter node MUST initiate peer capabilities update by sending a
3266 Capabilities-Exchange-Req (CER) to all its peers which supports peer
3267 capabilities update and is in OPEN state. The receiver of CER in
3268 open state MUST process and reply to the CER as a described in
3269 Section 5.3. The CEA which the receiver sends MUST contain its
3270 latest capabilities. Note that peers which successfully process the
3271 peer capabilities update SHOULD also update their routing tables to
3272 reflect the change. The receiver of the CEA, with a Result-Code AVP
3273 other than DIAMETER_SUCCESS, initiates the transport disconnect. The
3274 peer may periodically attempt to reconnect, as stated in Section 2.1.
3276 Peer capabilities update in the open state SHOULD be limited to the
3277 advertisement of the new list of supported applications and MUST
3278 preclude re-negotiation of security mechanism or other capabilities.
3279 If any capabilities change happens in the node (e.g. change in
3280 security mechanisms), other than a change in the supported
3281 applications, the node SHOULD gracefully terminate (setting the
3282 Disconnect-Cause AVP value to REBOOTING) and re-establish the
3283 diameter connections to all the peers.
3285 6. Diameter message processing
3287 This section describes how Diameter requests and answers are created
3288 and processed.
3290 6.1. Diameter Request Routing Overview
3292 A request is sent towards its final destination using a combination
3293 of the Destination-Realm and Destination-Host AVPs, in one of these
3294 three combinations:
3296 o a request that is not able to be proxied (such as CER) MUST NOT
3297 contain either Destination-Realm or Destination-Host AVPs.
3299 o a request that needs to be sent to a home server serving a
3300 specific realm, but not to a specific server (such as the first
3301 request of a series of round-trips), MUST contain a Destination-
3302 Realm AVP, but MUST NOT contain a Destination-Host AVP.
3304 o otherwise, a request that needs to be sent to a specific home
3305 server among those serving a given realm, MUST contain both the
3306 Destination-Realm and Destination-Host AVPs.
3308 The Destination-Host AVP is used as described above when the
3309 destination of the request is fixed, which includes:
3311 o Authentication requests that span multiple round trips
3313 o A Diameter message that uses a security mechanism that makes use
3314 of a pre-established session key shared between the source and the
3315 final destination of the message.
3317 o Server initiated messages that MUST be received by a specific
3318 Diameter client (e.g., access device), such as the Abort-Session-
3319 Request message, which is used to request that a particular user's
3320 session be terminated.
3322 Note that an agent can forward a request to a host described in the
3323 Destination-Host AVP only if the host in question is included in its
3324 peer table (see Section 2.7). Otherwise, the request is routed based
3325 on the Destination-Realm only (see Sections 6.1.6).
3327 The Destination-Realm AVP MUST be present if the message is
3328 proxiable. A message that MUST NOT be forwarded by Diameter agents
3329 (proxies, redirects or relays) MUST NOT include the Destination-Realm
3330 in its ABNF. The value of the Destination-Realm AVP MAY be extracted
3331 from the User-Name AVP, or other application- specific methods.
3333 When a message is received, the message is processed in the following
3334 order:
3336 o If the message is destined for the local host, the procedures
3337 listed in Section 6.1.4 are followed.
3339 o If the message is intended for a Diameter peer with whom the local
3340 host is able to directly communicate, the procedures listed in
3341 Section 6.1.5 are followed. This is known as Request Forwarding.
3343 o The procedures listed in Section 6.1.6 are followed, which is
3344 known as Request Routing.
3346 o If none of the above is successful, an answer is returned with the
3347 Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the E-bit set.
3349 For routing of Diameter messages to work within an administrative
3350 domain, all Diameter nodes within the realm MUST be peers.
3352 Note the processing rules contained in this section are intended to
3353 be used as general guidelines to Diameter developers. Certain
3354 implementations MAY use different methods than the ones described
3355 here, and still comply with the protocol specification. See Section
3356 7 for more detail on error handling.
3358 6.1.1. Originating a Request
3360 When creating a request, in addition to any other procedures
3361 described in the application definition for that specific request,
3362 the following procedures MUST be followed:
3364 o the Command-Code is set to the appropriate value
3366 o the 'R' bit is set
3368 o the End-to-End Identifier is set to a locally unique value
3370 o the Origin-Host and Origin-Realm AVPs MUST be set to the
3371 appropriate values, used to identify the source of the message
3373 o the Destination-Host and Destination-Realm AVPs MUST be set to the
3374 appropriate values as described in Section 6.1.
3376 6.1.2. Sending a Request
3378 When sending a request, originated either locally, or as the result
3379 of a forwarding or routing operation, the following procedures MUST
3380 be followed:
3382 o the Hop-by-Hop Identifier should be set to a locally unique value.
3384 o The message should be saved in the list of pending requests.
3386 Other actions to perform on the message based on the particular role
3387 the agent is playing are described in the following sections.
3389 6.1.3. Receiving Requests
3391 A relay or proxy agent MUST check for forwarding loops when receiving
3392 requests. A loop is detected if the server finds its own identity in
3393 a Route-Record AVP. When such an event occurs, the agent MUST answer
3394 with the Result-Code AVP set to DIAMETER_LOOP_DETECTED.
3396 6.1.4. Processing Local Requests
3398 A request is known to be for local consumption when one of the
3399 following conditions occur:
3401 o The Destination-Host AVP contains the local host's identity,
3403 o The Destination-Host AVP is not present, the Destination-Realm AVP
3404 contains a realm the server is configured to process locally, and
3405 the Diameter application is locally supported, or
3407 o Both the Destination-Host and the Destination-Realm are not
3408 present.
3410 When a request is locally processed, the rules in Section 6.2 should
3411 be used to generate the corresponding answer.
3413 6.1.5. Request Forwarding
3415 Request forwarding is done using the Diameter Peer Table. The
3416 Diameter peer table contains all of the peers that the local node is
3417 able to directly communicate with.
3419 When a request is received, and the host encoded in the Destination-
3420 Host AVP is one that is present in the peer table, the message SHOULD
3421 be forwarded to the peer.
3423 6.1.6. Request Routing
3425 Diameter request message routing is done via realms and applications.
3426 A Diameter message that may be forwarded by Diameter agents (proxies,
3427 redirects or relays) MUST include the target realm in the
3428 Destination-Realm AVP. Request routing SHOULD rely on the
3429 Destination-Realm AVP and the application id present in the request
3430 message header to aid in the routing decision. The realm MAY be
3431 retrieved from the User-Name AVP, which is in the form of a Network
3432 Access Identifier (NAI). The realm portion of the NAI is inserted in
3433 the Destination-Realm AVP.
3435 Diameter agents MAY have a list of locally supported realms and
3436 applications, and MAY have a list of externally supported realms and
3437 applications. When a request is received that includes a realm
3438 and/or application that is not locally supported, the message is
3439 routed to the peer configured in the Routing Table (see Section 2.7).
3441 Realm names and application identifiers are the minimum supported
3442 routing criteria, additional routing information maybe needed to
3443 support redirect semantics.
3445 6.1.7. Predictive Loop Avoidance
3447 Before forwarding or routing a request, Diameter agents, in addition
3448 to processing done in Section 6.1.3, SHOULD check for the presence of
3449 candidate route's peer identity in any of the Route-Record AVPs. In
3450 an event of the agent detecting the presence of a candidate route's
3451 peer identity in a Route-Record AVP, the agent MUST ignore such route
3452 for the Diameter request message and attempt alternate routes if any.
3453 In case all the candidate routes are eliminated by the above
3454 criteria, the agent SHOULD return DIAMETER_UNABLE_TO_DELIVER message.
3456 6.1.8. Redirecting requests
3458 When a redirect agent receives a request whose routing entry is set
3459 to REDIRECT, it MUST reply with an answer message with the 'E' bit
3460 set, while maintaining the Hop-by-Hop Identifier in the header, and
3461 include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of
3462 the servers associated with the routing entry are added in separate
3463 Redirect-Host AVP.
3465 +------------------+
3466 | Diameter |
3467 | Redirect Agent |
3468 +------------------+
3469 ^ | 2. command + 'E' bit
3470 1. Request | | Result-Code =
3471 joe@example.com | | DIAMETER_REDIRECT_INDICATION +
3472 | | Redirect-Host AVP(s)
3473 | v
3474 +-------------+ 3. Request +-------------+
3475 | example.com |------------->| example.net |
3476 | Relay | | Diameter |
3477 | Agent |<-------------| Server |
3478 +-------------+ 4. Answer +-------------+
3480 Figure 5: Diameter Redirect Agent
3482 The receiver of the answer message with the 'E' bit set, and the
3483 Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-by-
3484 hop field in the Diameter header to identify the request in the
3485 pending message queue (see Section 5.3) that is to be redirected. If
3486 no transport connection exists with the new agent, one is created,
3487 and the request is sent directly to it.
3489 Multiple Redirect-Host AVPs are allowed. The receiver of the answer
3490 message with the 'E' bit set selects exactly one of these hosts as
3491 the destination of the redirected message.
3493 When the Redirect-Host-Usage AVP included in the answer message has a
3494 non-zero value, a route entry for the redirect indications is created
3495 and cached by the receiver. The redirect usage for such route entry
3496 is set by the value of Redirect-Host-Usage AVP and the lifetime of
3497 the cached route entry is set by Redirect-Max-Cache-Time AVP value.
3499 It is possible that multiple redirect indications can create multiple
3500 cached route entries differing only in their redirect usage and the
3501 peer to forward messages to. As an example, two(2) route entries
3502 that are created by two(2) redirect indications results in two(2)
3503 cached routes for the same realm and application Id. However, one
3504 has a redirect usage of ALL_SESSION where matching request will be
3505 forwarded to one peer and the other has a redirect usage of ALL_REALM
3506 where request are forwarded to another peer. Therefore, an incoming
3507 request that matches the realm and application Id of both routes will
3508 need additional resolution. In such a case, a routing precedence
3509 rule MUST be used againts the redirect usage value to resolve the
3510 contention. The precedence rule can be found in Section 6.13.
3512 6.1.9. Relaying and Proxying Requests
3514 A relay or proxy agent MUST append a Route-Record AVP to all requests
3515 forwarded. The AVP contains the identity of the peer the request was
3516 received from.
3518 The Hop-by-Hop identifier in the request is saved, and replaced with
3519 a locally unique value. The source of the request is also saved,
3520 which includes the IP address, port and protocol.
3522 A relay or proxy agent MAY include the Proxy-Info AVP in requests if
3523 it requires access to any local state information when the
3524 corresponding response is received. Proxy-Info AVP has certain
3525 security implications and SHOULD contain an embedded HMAC with a
3526 node-local key. Alternatively, it MAY simply use local storage to
3527 store state information.
3529 The message is then forwarded to the next hop, as identified in the
3530 Routing Table.
3532 Figure 6 provides an example of message routing using the procedures
3533 listed in these sections.
3535 (Origin-Host=nas.mno.net) (Origin-Host=nas.mno.net)
3536 (Origin-Realm=mno.net) (Origin-Realm=mno.net)
3537 (Destination-Realm=example.com) (Destination-
3538 Realm=example.com)
3539 (Route-Record=nas.example.net)
3540 +------+ ------> +------+ ------> +------+
3541 | | (Request) | | (Request) | |
3542 | NAS +-------------------+ DRL +-------------------+ HMS |
3543 | | | | | |
3544 +------+ <------ +------+ <------ +------+
3545 example.net (Answer) example.net (Answer) example.com
3546 (Origin-Host=hms.example.com) (Origin-Host=hms.example.com)
3547 (Origin-Realm=example.com) (Origin-Realm=example.com)
3549 Figure 6: Routing of Diameter messages
3551 Relay agents do not require full validation of incoming messages. At
3552 a minimum, validation of the message header and relevant routing AVPs
3553 has to be done when relaying messages.
3555 6.2. Diameter Answer Processing
3557 When a request is locally processed, the following procedures MUST be
3558 applied to create the associated answer, in addition to any
3559 additional procedures that MAY be discussed in the Diameter
3560 application defining the command:
3562 o The same Hop-by-Hop identifier in the request is used in the
3563 answer.
3565 o The local host's identity is encoded in the Origin-Host AVP.
3567 o The Destination-Host and Destination-Realm AVPs MUST NOT be
3568 present in the answer message.
3570 o The Result-Code AVP is added with its value indicating success or
3571 failure.
3573 o If the Session-Id is present in the request, it MUST be included
3574 in the answer.
3576 o Any Proxy-Info AVPs in the request MUST be added to the answer
3577 message, in the same order they were present in the request.
3579 o The 'P' bit is set to the same value as the one in the request.
3581 o The same End-to-End identifier in the request is used in the
3582 answer.
3584 Note that the error messages (see Section 7.3) are also subjected to
3585 the above processing rules.
3587 6.2.1. Processing received Answers
3589 A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an
3590 answer received against the list of pending requests. The
3591 corresponding message should be removed from the list of pending
3592 requests. It SHOULD ignore answers received that do not match a
3593 known Hop-by-Hop Identifier.
3595 6.2.2. Relaying and Proxying Answers
3597 If the answer is for a request which was proxied or relayed, the
3598 agent MUST restore the original value of the Diameter header's Hop-
3599 by-Hop Identifier field.
3601 If the last Proxy-Info AVP in the message is targeted to the local
3602 Diameter server, the AVP MUST be removed before the answer is
3603 forwarded.
3605 If a relay or proxy agent receives an answer with a Result-Code AVP
3606 indicating a failure, it MUST NOT modify the contents of the AVP.
3607 Any additional local errors detected SHOULD be logged, but not
3608 reflected in the Result-Code AVP. If the agent receives an answer
3609 message with a Result-Code AVP indicating success, and it wishes to
3610 modify the AVP to indicate an error, it MUST modify the Result-Code
3611 AVP to contain the appropriate error in the message destined towards
3612 the access device as well as include the Error-Reporting-Host AVP and
3613 it MUST issue an STR on behalf of the access device.
3615 The agent MUST then send the answer to the host that it received the
3616 original request from.
3618 6.3. Origin-Host AVP
3620 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and
3621 MUST be present in all Diameter messages. This AVP identifies the
3622 endpoint that originated the Diameter message. Relay agents MUST NOT
3623 modify this AVP.
3625 The value of the Origin-Host AVP is guaranteed to be unique within a
3626 single host.
3628 Note that the Origin-Host AVP may resolve to more than one address as
3629 the Diameter peer may support more than one address.
3631 This AVP SHOULD be placed as close to the Diameter header as
3632 possible. 6.10
3634 6.4. Origin-Realm AVP
3636 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity.
3637 This AVP contains the Realm of the originator of any Diameter message
3638 and MUST be present in all messages.
3640 This AVP SHOULD be placed as close to the Diameter header as
3641 possible.
3643 6.5. Destination-Host AVP
3645 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity.
3646 This AVP MUST be present in all unsolicited agent initiated messages,
3647 MAY be present in request messages, and MUST NOT be present in Answer
3648 messages.
3650 The absence of the Destination-Host AVP will cause a message to be
3651 sent to any Diameter server supporting the application within the
3652 realm specified in Destination-Realm AVP.
3654 This AVP SHOULD be placed as close to the Diameter header as
3655 possible.
3657 6.6. Destination-Realm AVP
3659 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity,
3660 and contains the realm the message is to be routed to. The
3661 Destination-Realm AVP MUST NOT be present in Answer messages.
3662 Diameter Clients insert the realm portion of the User-Name AVP.
3663 Diameter servers initiating a request message use the value of the
3664 Origin-Realm AVP from a previous message received from the intended
3665 target host (unless it is known a priori). When present, the
3666 Destination-Realm AVP is used to perform message routing decisions.
3668 Request messages whose ABNF does not list the Destination-Realm AVP
3669 as a mandatory AVP are inherently non-routable messages.
3671 This AVP SHOULD be placed as close to the Diameter header as
3672 possible.
3674 6.7. Routing AVPs
3676 The AVPs defined in this section are Diameter AVPs used for routing
3677 purposes. These AVPs change as Diameter messages are processed by
3678 agents.
3680 6.7.1. Route-Record AVP
3682 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The
3683 identity added in this AVP MUST be the same as the one received in
3684 the Origin-Host of the Capabilities Exchange message.
3686 6.7.2. Proxy-Info AVP
3688 The Proxy-Info AVP (AVP Code 284) is of type Grouped. The Grouped
3689 Data field has the following ABNF grammar:
3691 Proxy-Info ::= < AVP Header: 284 >
3692 { Proxy-Host }
3693 { Proxy-State }
3694 * [ AVP ]
3696 6.7.3. Proxy-Host AVP
3698 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This
3699 AVP contains the identity of the host that added the Proxy-Info AVP.
3701 6.7.4. Proxy-State AVP
3703 The Proxy-State AVP (AVP Code 33) is of type OctetString, and
3704 contains state local information, and MUST be treated as opaque data.
3706 6.8. Auth-Application-Id AVP
3708 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and
3709 is used in order to advertise support of the Authentication and
3710 Authorization portion of an application (see Section 2.4). If
3711 present in a message other than CER and CEA, the value of the Auth-
3712 Application-Id AVP MUST match the application id present in the
3713 diameter message header except when used in a CER or CEA messages.
3715 6.9. Acct-Application-Id AVP
3717 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and
3718 is used in order to advertise support of the Accounting portion of an
3719 application (see Section 2.4). If present in a message other than
3720 CER and CEA, the value of the Acct-Application-Id AVP MUST match the
3721 application id present in the diameter message header except when
3722 used in a CER or CEA messages.
3724 6.10. Inband-Security-Id AVP
3726 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and
3727 is used in order to advertise support of the Security portion of the
3728 application.
3730 Currently, the following values are supported, but there is ample
3731 room to add new security Ids.
3733 NO_INBAND_SECURITY 0
3735 This peer does not support TLS. This is the default value, if the
3736 AVP is omitted.
3738 TLS 1
3740 This node supports TLS security, as defined by [RFC4346].
3742 6.11. Vendor-Specific-Application-Id AVP
3744 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type
3745 Grouped and is used to advertise support of a vendor-specific
3746 Diameter Application. Exactly one instance of either Auth-
3747 Application-Id or Acct-Application-Id AVP MAY be present. The
3748 application identifier carried by either Auth-Application-Id or Acct-
3749 Application-Id AVP MUST comply with vendor specific application
3750 identifier assignment described in Sec 11.3. It MUST also match the
3751 application id present in the diameter header except when used in a
3752 CER or CEA messages.
3754 The Vendor-Id AVP is an informational AVP pertaining to the vendor
3755 who may have authorship of the vendor-specific Diameter application.
3756 It MUST NOT be used as a means of defining a completely separate
3757 vendor-specific application identifier space.
3759 This AVP MUST also be present as the first AVP in all experimental
3760 commands defined in the vendor-specific application.
3762 This AVP SHOULD be placed as close to the Diameter header as
3763 possible.
3765 AVP Format
3767 ::= < AVP Header: 260 >
3768 { Vendor-Id }
3769 ({ Auth-Application-Id } /
3770 { Acct-Application-Id })
3772 6.12. Redirect-Host AVP
3774 One or more of instances of this AVP MUST be present if the answer
3775 message's 'E' bit is set and the Result-Code AVP is set to
3776 DIAMETER_REDIRECT_INDICATION.
3778 Upon receiving the above, the receiving Diameter node SHOULD forward
3779 the request directly to one of the hosts identified in these AVPs.
3780 The server contained in the selected Redirect-Host AVP SHOULD be used
3781 for all messages pertaining to this session.
3783 6.13. Redirect-Host-Usage AVP
3785 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated.
3786 This AVP MAY be present in answer messages whose 'E' bit is set and
3787 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION.
3789 When present, this AVP dictates how the routing entry resulting from
3790 the Redirect-Host is to be used. The following values are supported:
3792 DONT_CACHE 0
3794 The host specified in the Redirect-Host AVP should not be cached.
3795 This is the default value.
3797 ALL_SESSION 1
3799 All messages within the same session, as defined by the same value
3800 of the Session-ID AVP MAY be sent to the host specified in the
3801 Redirect-Host AVP.
3803 ALL_REALM 2
3805 All messages destined for the realm requested MAY be sent to the
3806 host specified in the Redirect-Host AVP.
3808 REALM_AND_APPLICATION 3
3810 All messages for the application requested to the realm specified
3811 MAY be sent to the host specified in the Redirect-Host AVP.
3813 ALL_APPLICATION 4
3815 All messages for the application requested MAY be sent to the host
3816 specified in the Redirect-Host AVP.
3818 ALL_HOST 5
3820 All messages that would be sent to the host that generated the
3821 Redirect-Host MAY be sent to the host specified in the Redirect-
3822 Host AVP.
3824 ALL_USER 6
3826 All messages for the user requested MAY be sent to the host
3827 specified in the Redirect-Host AVP.
3829 When multiple cached routes are created by redirect indications and
3830 they differs only in redirect usage and peers to forward requests to
3831 (see Section 6.1.8), a precedence rule MUST be applied to the
3832 redirect usage values of the cached routes during normal routing to
3833 resolve contentions that may occur. The precedence rule is the order
3834 that dictate which redirect usage should be considered before any
3835 other as they appear. The order is as follows:
3837 1. ALL_SESSION
3839 2. ALL_USER
3841 3. REALM_AND_APPLICATION
3843 4. ALL_REALM
3845 5. ALL_APPLICATION
3847 6. ALL_HOST
3849 6.14. Redirect-Max-Cache-Time AVP
3851 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32.
3852 This AVP MUST be present in answer messages whose 'E' bit is set, the
3853 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the
3854 Redirect-Host-Usage AVP set to a non-zero value.
3856 This AVP contains the maximum number of seconds the peer and route
3857 table entries, created as a result of the Redirect-Host, will be
3858 cached. Note that once a host created due to a redirect indication
3859 is no longer reachable, any associated peer and routing table entries
3860 MUST be deleted.
3862 7. Error Handling
3864 There are two different types of errors in Diameter; protocol and
3865 application errors. A protocol error is one that occurs at the base
3866 protocol level, and MAY require per hop attention (e.g., message
3867 routing error). Application errors, on the other hand, generally
3868 occur due to a problem with a function specified in a Diameter
3869 application (e.g., user authentication, Missing AVP).
3871 Result-Code AVP values that are used to report protocol errors MUST
3872 only be present in answer messages whose 'E' bit is set. When a
3873 request message is received that causes a protocol error, an answer
3874 message is returned with the 'E' bit set, and the Result-Code AVP is
3875 set to the appropriate protocol error value. As the answer is sent
3876 back towards the originator of the request, each proxy or relay agent
3877 MAY take action on the message.
3879 1. Request +---------+ Link Broken
3880 +-------------------------->|Diameter |----///----+
3881 | +---------------------| | v
3882 +------+--+ | 2. answer + 'E' set | Relay 2 | +--------+
3883 |Diameter |<-+ (Unable to Forward) +---------+ |Diameter|
3884 | | | Home |
3885 | Relay 1 |--+ +---------+ | Server |
3886 +---------+ | 3. Request |Diameter | +--------+
3887 +-------------------->| | ^
3888 | Relay 3 |-----------+
3889 +---------+
3891 Figure 7: Example of Protocol Error causing answer message
3893 Figure 7 provides an example of a message forwarded upstream by a
3894 Diameter relay. When the message is received by Relay 2, and it
3895 detects that it cannot forward the request to the home server, an
3896 answer message is returned with the 'E' bit set and the Result-Code
3897 AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls
3898 within the protocol error category, Relay 1 would take special
3899 action, and given the error, attempt to route the message through its
3900 alternate Relay 3.
3902 +---------+ 1. Request +---------+ 2. Request +---------+
3903 | Access |------------>|Diameter |------------>|Diameter |
3904 | | | | | Home |
3905 | Device |<------------| Relay |<------------| Server |
3906 +---------+ 4. Answer +---------+ 3. Answer +---------+
3907 (Missing AVP) (Missing AVP)
3909 Figure 8: Example of Application Error Answer message
3911 Figure 8 provides an example of a Diameter message that caused an
3912 application error. When application errors occur, the Diameter
3913 entity reporting the error clears the 'R' bit in the Command Flags,
3914 and adds the Result-Code AVP with the proper value. Application
3915 errors do not require any proxy or relay agent involvement, and
3916 therefore the message would be forwarded back to the originator of
3917 the request.
3919 There are certain Result-Code AVP application errors that require
3920 additional AVPs to be present in the answer. In these cases, the
3921 Diameter node that sets the Result-Code AVP to indicate the error
3922 MUST add the AVPs. Examples are:
3924 o An unrecognized AVP is received with the 'M' bit (Mandatory bit)
3925 set, causes an answer to be sent with the Result-Code AVP set to
3926 DIAMETER_AVP_UNSUPPORTED, and the Failed-AVP AVP containing the
3927 offending AVP.
3929 o An AVP that is received with an unrecognized value causes an
3930 answer to be returned with the Result-Code AVP set to
3931 DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the
3932 AVP causing the error.
3934 o A command is received with an AVP that is omitted, yet is
3935 mandatory according to the command's ABNF. The receiver issues an
3936 answer with the Result-Code set to DIAMETER_MISSING_AVP, and
3937 creates an AVP with the AVP Code and other fields set as expected
3938 in the missing AVP. The created AVP is then added to the Failed-
3939 AVP AVP.
3941 The Result-Code AVP describes the error that the Diameter node
3942 encountered in its processing. In case there are multiple errors,
3943 the Diameter node MUST report only the first error it encountered
3944 (detected possibly in some implementation dependent order). The
3945 specific errors that can be described by this AVP are described in
3946 the following section.
3948 7.1. Result-Code AVP
3950 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and
3951 indicates whether a particular request was completed successfully or
3952 whether an error occurred. All Diameter answer messages defined in
3953 IETF applications MUST include one Result-Code AVP. A non-successful
3954 Result-Code AVP (one containing a non 2xxx value other than
3955 DIAMETER_REDIRECT_INDICATION) MUST include the Error-Reporting-Host
3956 AVP if the host setting the Result-Code AVP is different from the
3957 identity encoded in the Origin-Host AVP.
3959 The Result-Code data field contains an IANA-managed 32-bit address
3960 space representing errors (see Section 11.4). Diameter provides the
3961 following classes of errors, all identified by the thousands digit in
3962 the decimal notation:
3964 o 1xxx (Informational)
3966 o 2xxx (Success)
3968 o 3xxx (Protocol Errors)
3970 o 4xxx (Transient Failures)
3972 o 5xxx (Permanent Failure)
3974 A non-recognized class (one whose first digit is not defined in this
3975 section) MUST be handled as a permanent failure.
3977 7.1.1. Informational
3979 Errors that fall within this category are used to inform the
3980 requester that a request could not be satisfied, and additional
3981 action is required on its part before access is granted.
3983 DIAMETER_MULTI_ROUND_AUTH 1001
3985 This informational error is returned by a Diameter server to
3986 inform the access device that the authentication mechanism being
3987 used requires multiple round trips, and a subsequent request needs
3988 to be issued in order for access to be granted.
3990 7.1.2. Success
3992 Errors that fall within the Success category are used to inform a
3993 peer that a request has been successfully completed.
3995 DIAMETER_SUCCESS 2001
3997 The Request was successfully completed.
3999 DIAMETER_LIMITED_SUCCESS 2002
4001 When returned, the request was successfully completed, but
4002 additional processing is required by the application in order to
4003 provide service to the user.
4005 7.1.3. Protocol Errors
4007 Errors that fall within the Protocol Error category SHOULD be treated
4008 on a per-hop basis, and Diameter proxies MAY attempt to correct the
4009 error, if it is possible. Note that these and only these errors MUST
4010 only be used in answer messages whose 'E' bit is set. To provide
4011 backward compatibility with existing implementations that follow
4012 [RFC3588], some of the error values that have previously been used in
4013 this category by [RFC3588] will not be re-used. Therefore the error
4014 values enumerated here maybe non-sequential.
4016 DIAMETER_UNABLE_TO_DELIVER 3002
4018 This error is given when Diameter can not deliver the message to
4019 the destination, either because no host within the realm
4020 supporting the required application was available to process the
4021 request, or because Destination-Host AVP was given without the
4022 associated Destination-Realm AVP.
4024 DIAMETER_REALM_NOT_SERVED 3003
4026 The intended realm of the request is not recognized.
4028 DIAMETER_TOO_BUSY 3004
4030 When returned, a Diameter node SHOULD attempt to send the message
4031 to an alternate peer. This error MUST only be used when a
4032 specific server is requested, and it cannot provide the requested
4033 service.
4035 DIAMETER_LOOP_DETECTED 3005
4037 An agent detected a loop while trying to get the message to the
4038 intended recipient. The message MAY be sent to an alternate peer,
4039 if one is available, but the peer reporting the error has
4040 identified a configuration problem.
4042 DIAMETER_REDIRECT_INDICATION 3006
4044 A redirect agent has determined that the request could not be
4045 satisfied locally and the initiator of the request should direct
4046 the request directly to the server, whose contact information has
4047 been added to the response. When set, the Redirect-Host AVP MUST
4048 be present.
4050 DIAMETER_APPLICATION_UNSUPPORTED 3007
4052 A request was sent for an application that is not supported.
4054 DIAMETER_INVALID_BIT_IN_HEADER 3011
4056 This error is returned when a reserved bit in the Diameter header
4057 is set to one (1) or the bits in the Diameter header defined in
4058 Sec 3 are set incorrectly.
4060 DIAMETER_INVALID_MESSAGE_LENGTH 3012
4062 This error is returned when a request is received with an invalid
4063 message length.
4065 7.1.4. Transient Failures
4067 Errors that fall within the transient failures category are used to
4068 inform a peer that the request could not be satisfied at the time it
4069 was received, but MAY be able to satisfy the request in the future.
4070 Note that these errors MUST be used in answer messages whose 'E' bit
4071 is not set.
4073 DIAMETER_AUTHENTICATION_REJECTED 4001
4075 The authentication process for the user failed, most likely due to
4076 an invalid password used by the user. Further attempts MUST only
4077 be tried after prompting the user for a new password.
4079 DIAMETER_OUT_OF_SPACE 4002
4081 A Diameter node received the accounting request but was unable to
4082 commit it to stable storage due to a temporary lack of space.
4084 ELECTION_LOST 4003
4086 The peer has determined that it has lost the election process and
4087 has therefore disconnected the transport connection.
4089 7.1.5. Permanent Failures
4091 Errors that fall within the permanent failures category are used to
4092 inform the peer that the request failed, and should not be attempted
4093 again. Note that these errors SHOULD be used in answer messages
4094 whose 'E' bit is not set. In error conditions where it is not
4095 possible or efficient to compose application specific answer grammar
4096 then answer messages with E-bit set and complying to the grammar
4097 described in 7.2 MAY also be used for permanent errors.
4099 To provide backward compatibility with existing implementations that
4100 follow [RFC3588], some of the error values that have previously been
4101 used in this category by [RFC3588] will not be re-used. Therefore
4102 the error values enumerated here maybe non-sequential.
4104 DIAMETER_AVP_UNSUPPORTED 5001
4106 The peer received a message that contained an AVP that is not
4107 recognized or supported and was marked with the Mandatory bit. A
4108 Diameter message with this error MUST contain one or more Failed-
4109 AVP AVP containing the AVPs that caused the failure.
4111 DIAMETER_UNKNOWN_SESSION_ID 5002
4113 The request contained an unknown Session-Id.
4115 DIAMETER_AUTHORIZATION_REJECTED 5003
4117 A request was received for which the user could not be authorized.
4118 This error could occur if the service requested is not permitted
4119 to the user.
4121 DIAMETER_INVALID_AVP_VALUE 5004
4123 The request contained an AVP with an invalid value in its data
4124 portion. A Diameter message indicating this error MUST include
4125 the offending AVPs within a Failed-AVP AVP.
4127 DIAMETER_MISSING_AVP 5005
4129 The request did not contain an AVP that is required by the Command
4130 Code definition. If this value is sent in the Result-Code AVP, a
4131 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP
4132 AVP MUST contain an example of the missing AVP complete with the
4133 Vendor-Id if applicable. The value field of the missing AVP
4134 should be of correct minimum length and contain zeroes.
4136 DIAMETER_RESOURCES_EXCEEDED 5006
4138 A request was received that cannot be authorized because the user
4139 has already expended allowed resources. An example of this error
4140 condition is a user that is restricted to one dial-up PPP port,
4141 attempts to establish a second PPP connection.
4143 DIAMETER_CONTRADICTING_AVPS 5007
4145 The Home Diameter server has detected AVPs in the request that
4146 contradicted each other, and is not willing to provide service to
4147 the user. The Failed-AVP AVPs MUST be present which contains the
4148 AVPs that contradicted each other.
4150 DIAMETER_AVP_NOT_ALLOWED 5008
4152 A message was received with an AVP that MUST NOT be present. The
4153 Failed-AVP AVP MUST be included and contain a copy of the
4154 offending AVP.
4156 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009
4158 A message was received that included an AVP that appeared more
4159 often than permitted in the message definition. The Failed-AVP
4160 AVP MUST be included and contain a copy of the first instance of
4161 the offending AVP that exceeded the maximum number of occurrences
4163 DIAMETER_NO_COMMON_APPLICATION 5010
4165 This error is returned by a Diameter node that is not acting as a
4166 relay when it receives a CER which advertises a set of
4167 applications that it does not support.
4169 DIAMETER_UNSUPPORTED_VERSION 5011
4171 This error is returned when a request was received, whose version
4172 number is unsupported.
4174 DIAMETER_UNABLE_TO_COMPLY 5012
4176 This error is returned when a request is rejected for unspecified
4177 reasons.
4179 DIAMETER_INVALID_AVP_LENGTH 5014
4181 The request contained an AVP with an invalid length. A Diameter
4182 message indicating this error MUST include the offending AVPs
4183 within a Failed-AVP AVP. In cases where the erroneous avp length
4184 value exceeds the message length or is less than the minimum AVP
4185 header length, it is sufficient to include the offending AVP
4186 header and a zero filled payload of the minimum required length
4187 for the payloads data type. If the AVP is a grouped AVP, the
4188 grouped AVP header with an empty payload would be sufficient to
4189 indicate the offending AVP. In the case where the offending AVP
4190 header cannot be fully decoded when avp length is less than the
4191 minimum AVP header length, it is sufficient to include an
4192 offending AVP header that is formulated by padding the incomplete
4193 AVP header with zero up to the minimum AVP header length.
4195 DIAMETER_NO_COMMON_SECURITY 5017
4197 This error is returned when a CER message is received, and there
4198 are no common security mechanisms supported between the peers. A
4199 Capabilities-Exchange-Answer (CEA) MUST be returned with the
4200 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY.
4202 DIAMETER_UNKNOWN_PEER 5018
4204 A CER was received from an unknown peer.
4206 DIAMETER_COMMAND_UNSUPPORTED 5019
4208 The Request contained a Command-Code that the receiver did not
4209 recognize or support. This MUST be used when a Diameter node
4210 receives an experimental command that it does not understand.
4212 DIAMETER_INVALID_HDR_BITS 5020
4214 A request was received whose bits in the Diameter header were
4215 either set to an invalid combination, or to a value that is
4216 inconsistent with the command code's definition.
4218 DIAMETER_INVALID_AVP_BITS 5021
4220 A request was received that included an AVP whose flag bits are
4221 set to an unrecognized value, or that is inconsistent with the
4222 AVP's definition.
4224 7.2. Error Bit
4226 The 'E' (Error Bit) in the Diameter header is set when the request
4227 caused a protocol-related error (see Section 7.1.3). A message with
4228 the 'E' bit MUST NOT be sent as a response to an answer message.
4229 Note that a message with the 'E' bit set is still subjected to the
4230 processing rules defined in Section 6.2. When set, the answer
4231 message will not conform to the ABNF specification for the command,
4232 and will instead conform to the following ABNF:
4234 Message Format
4236 ::= < Diameter Header: code, ERR [PXY] >
4237 0*1< Session-Id >
4238 { Origin-Host }
4239 { Origin-Realm }
4240 { Result-Code }
4241 [ Origin-State-Id ]
4242 [ Error-Message ]
4243 [ Error-Reporting-Host ]
4244 [ Failed-AVP ]
4245 * [ Proxy-Info ]
4246 * [ AVP ]
4248 Note that the code used in the header is the same than the one found
4249 in the request message, but with the 'R' bit cleared and the 'E' bit
4250 set. The 'P' bit in the header is set to the same value as the one
4251 found in the request message.
4253 7.3. Error-Message AVP
4255 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY
4256 accompany a Result-Code AVP as a human readable error message. The
4257 Error-Message AVP is not intended to be useful in real-time, and
4258 SHOULD NOT be expected to be parsed by network entities.
4260 7.4. Error-Reporting-Host AVP
4262 The Error-Reporting-Host AVP (AVP Code 294) is of type
4263 DiameterIdentity. This AVP contains the identity of the Diameter
4264 host that sent the Result-Code AVP to a value other than 2001
4265 (Success), only if the host setting the Result-Code is different from
4266 the one encoded in the Origin-Host AVP. This AVP is intended to be
4267 used for troubleshooting purposes, and MUST be set when the Result-
4268 Code AVP indicates a failure.
4270 7.5. Failed-AVP AVP
4272 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides
4273 debugging information in cases where a request is rejected or not
4274 fully processed due to erroneous information in a specific AVP. The
4275 value of the Result-Code AVP will provide information on the reason
4276 for the Failed-AVP AVP. A Diameter message SHOULD contain only one
4277 Failed-AVP that corresponds to the error indicated by the Result-Code
4278 AVP. For practical purposes, this Failed-AVP would typically refer
4279 to the first AVP processing error that a Diameter node encounters.
4281 The possible reasons for this AVP are the presence of an improperly
4282 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP
4283 value, the omission of a required AVP, the presence of an explicitly
4284 excluded AVP (see tables in Section 10), or the presence of two or
4285 more occurrences of an AVP which is restricted to 0, 1, or 0-1
4286 occurrences.
4288 A Diameter message SHOULD contain one Failed-AVP AVP, containing the
4289 entire AVP that could not be processed successfully. If the failure
4290 reason is omission of a required AVP, an AVP with the missing AVP
4291 code, the missing vendor id, and a zero filled payload of the minimum
4292 required length for the omitted AVP will be added. If the failure
4293 reason is an invalid AVP length where the reported length is less
4294 than the minimum AVP header length or greater than the reported
4295 message length, a copy of the offending AVP header and a zero filled
4296 payload of the minimum required length SHOULD be added.
4298 In the case where the offending AVP is embedded within a grouped AVP,
4299 the Failed-AVP MAY contain the grouped AVP which in turn contains the
4300 single offending AVP. The same method MAY be employed if the grouped
4301 AVP itself is embedded in yet another grouped AVP and so on. In this
4302 case, the Failed-AVP MAY contain the grouped AVP heirarchy up to the
4303 single offending AVP. This enables the recipient to detect the
4304 location of the offending AVP when embedded in a group.
4306 AVP Format
4308 ::= < AVP Header: 279 >
4309 1* {AVP}
4311 7.6. Experimental-Result AVP
4313 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and
4314 indicates whether a particular vendor-specific request was completed
4315 successfully or whether an error occurred. Its Data field has the
4316 following ABNF grammar:
4318 AVP Format
4320 Experimental-Result ::= < AVP Header: 297 >
4321 { Vendor-Id }
4322 { Experimental-Result-Code }
4324 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies
4325 the vendor responsible for the assignment of the result code which
4326 follows. All Diameter answer messages defined in vendor-specific
4327 applications MUST include either one Result-Code AVP or one
4328 Experimental-Result AVP.
4330 7.7. Experimental-Result-Code AVP
4332 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32
4333 and contains a vendor-assigned value representing the result of
4334 processing the request.
4336 It is recommended that vendor-specific result codes follow the same
4337 conventions given for the Result-Code AVP regarding the different
4338 types of result codes and the handling of errors (for non 2xxx
4339 values).
4341 8. Diameter User Sessions
4343 In general, Diameter can provide two different types of services to
4344 applications. The first involves authentication and authorization,
4345 and can optionally make use of accounting. The second only makes use
4346 of accounting.
4348 When a service makes use of the authentication and/or authorization
4349 portion of an application, and a user requests access to the network,
4350 the Diameter client issues an auth request to its local server. The
4351 auth request is defined in a service specific Diameter application
4352 (e.g., NASREQ). The request contains a Session-Id AVP, which is used
4353 in subsequent messages (e.g., subsequent authorization, accounting,
4354 etc) relating to the user's session. The Session-Id AVP is a means
4355 for the client and servers to correlate a Diameter message with a
4356 user session.
4358 When a Diameter server authorizes a user to use network resources for
4359 a finite amount of time, and it is willing to extend the
4360 authorization via a future request, it MUST add the Authorization-
4361 Lifetime AVP to the answer message. The Authorization-Lifetime AVP
4362 defines the maximum number of seconds a user MAY make use of the
4363 resources before another authorization request is expected by the
4364 server. The Auth-Grace-Period AVP contains the number of seconds
4365 following the expiration of the Authorization-Lifetime, after which
4366 the server will release all state information related to the user's
4367 session. Note that if payment for services is expected by the
4368 serving realm from the user's home realm, the Authorization-Lifetime
4369 AVP, combined with the Auth-Grace-Period AVP, implies the maximum
4370 length of the session the home realm is willing to be fiscally
4371 responsible for. Services provided past the expiration of the
4372 Authorization-Lifetime and Auth-Grace-Period AVPs are the
4373 responsibility of the access device. Of course, the actual cost of
4374 services rendered is clearly outside the scope of the protocol.
4376 An access device that does not expect to send a re-authorization or a
4377 session termination request to the server MAY include the Auth-
4378 Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint
4379 to the server. If the server accepts the hint, it agrees that since
4380 no session termination message will be received once service to the
4381 user is terminated, it cannot maintain state for the session. If the
4382 answer message from the server contains a different value in the
4383 Auth-Session-State AVP (or the default value if the AVP is absent),
4384 the access device MUST follow the server's directives. Note that the
4385 value NO_STATE_MAINTAINED MUST NOT be set in subsequent re-
4386 authorization requests and answers.
4388 The base protocol does not include any authorization request
4389 messages, since these are largely application-specific and are
4390 defined in a Diameter application document. However, the base
4391 protocol does define a set of messages that is used to terminate user
4392 sessions. These are used to allow servers that maintain state
4393 information to free resources.
4395 When a service only makes use of the Accounting portion of the
4396 Diameter protocol, even in combination with an application, the
4397 Session-Id is still used to identify user sessions. However, the
4398 session termination messages are not used, since a session is
4399 signaled as being terminated by issuing an accounting stop message.
4401 Diameter may also be used for services that cannot be easily
4402 categorized as authentication, authorization or accounting (e.g.,
4403 certain 3GPP IMS interfaces). In such cases, the finite state
4404 machine defined in subsequent sections may not be applicable.
4405 Therefore, the applications itself MAY need to define its own finite
4406 state machine. However, such application specific statemachines MUST
4407 comply with general Diameter user session requirements such co-
4408 relating all message exchanges via Session-Id AVP.
4410 8.1. Authorization Session State Machine
4412 This section contains a set of finite state machines, representing
4413 the life cycle of Diameter sessions, and which MUST be observed by
4414 all Diameter implementations that make use of the authentication
4415 and/or authorization portion of a Diameter application. The term
4416 Service-Specific below refers to a message defined in a Diameter
4417 application (e.g., Mobile IPv4, NASREQ).
4419 There are four different authorization session state machines
4420 supported in the Diameter base protocol. The first two describe a
4421 session in which the server is maintaining session state, indicated
4422 by the value of the Auth-Session-State AVP (or its absence). One
4423 describes the session from a client perspective, the other from a
4424 server perspective. The second two state machines are used when the
4425 server does not maintain session state. Here again, one describes
4426 the session from a client perspective, the other from a server
4427 perspective.
4429 When a session is moved to the Idle state, any resources that were
4430 allocated for the particular session must be released. Any event not
4431 listed in the state machines MUST be considered as an error
4432 condition, and an answer, if applicable, MUST be returned to the
4433 originator of the message.
4435 In the case that an application does not support re-auth, the state
4436 transitions related to server-initiated re-auth when both client and
4437 server sessions maintains state (e.g., Send RAR, Pending, Receive
4438 RAA) MAY be ignored.
4440 In the state table, the event 'Failure to send X' means that the
4441 Diameter agent is unable to send command X to the desired
4442 destination. This could be due to the peer being down, or due to the
4443 peer sending back a transient failure or temporary protocol error
4444 notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the
4445 Result-Code AVP of the corresponding Answer command. The event 'X
4446 successfully sent' is the complement of 'Failure to send X'.
4448 The following state machine is observed by a client when state is
4449 maintained on the server:
4451 CLIENT, STATEFUL
4452 State Event Action New State
4453 -------------------------------------------------------------
4454 Idle Client or Device Requests Send Pending
4455 access service
4456 specific
4457 auth req
4459 Idle ASR Received Send ASA Idle
4460 for unknown session with
4461 Result-Code
4462 = UNKNOWN_
4463 SESSION_ID
4465 Idle RAR Received Send RAA Idle
4466 for unknown session with
4467 Result-Code
4468 = UNKNOWN_
4469 SESSION_ID
4471 Pending Successful Service-specific Grant Open
4472 authorization answer Access
4473 received with default
4474 Auth-Session-State value
4476 Pending Successful Service-specific Sent STR Discon
4477 authorization answer received
4478 but service not provided
4480 Pending Error processing successful Sent STR Discon
4481 Service-specific authorization
4482 answer
4484 Pending Failed Service-specific Cleanup Idle
4485 authorization answer received
4487 Open User or client device Send Open
4488 requests access to service service
4489 specific
4490 auth req
4492 Open Successful Service-specific Provide Open
4493 authorization answer received Service
4495 Open Failed Service-specific Discon. Idle
4496 authorization answer user/device
4497 received.
4499 Open RAR received and client will Send RAA Open
4500 perform subsequent re-auth with
4501 Result-Code
4502 = SUCCESS
4504 Open RAR received and client will Send RAA Idle
4505 not perform subsequent with
4506 re-auth Result-Code
4507 != SUCCESS,
4508 Discon.
4509 user/device
4511 Open Session-Timeout Expires on Send STR Discon
4512 Access Device
4514 Open ASR Received, Send ASA Discon
4515 client will comply with with
4516 request to end the session Result-Code
4517 = SUCCESS,
4518 Send STR.
4520 Open ASR Received, Send ASA Open
4521 client will not comply with with
4522 request to end the session Result-Code
4523 != SUCCESS
4525 Open Authorization-Lifetime + Send STR Discon
4526 Auth-Grace-Period expires on
4527 access device
4529 Discon ASR Received Send ASA Discon
4531 Discon STA Received Discon. Idle
4532 user/device
4534 The following state machine is observed by a server when it is
4535 maintaining state for the session:
4537 SERVER, STATEFUL
4538 State Event Action New State
4539 -------------------------------------------------------------
4540 Idle Service-specific authorization Send Open
4541 request received, and successful
4542 user is authorized serv.
4543 specific
4544 answer
4546 Idle Service-specific authorization Send Idle
4547 request received, and failed serv.
4548 user is not authorized specific
4549 answer
4551 Open Service-specific authorization Send Open
4552 request received, and user successful
4553 is authorized serv. specific
4554 answer
4556 Open Service-specific authorization Send Idle
4557 request received, and user failed serv.
4558 is not authorized specific
4559 answer,
4560 Cleanup
4562 Open Home server wants to confirm Send RAR Pending
4563 authentication and/or
4564 authorization of the user
4566 Pending Received RAA with a failed Cleanup Idle
4567 Result-Code
4569 Pending Received RAA with Result-Code Update Open
4570 = SUCCESS session
4572 Open Home server wants to Send ASR Discon
4573 terminate the service
4575 Open Authorization-Lifetime (and Cleanup Idle
4576 Auth-Grace-Period) expires
4577 on home server.
4579 Open Session-Timeout expires on Cleanup Idle
4580 home server
4582 Discon Failure to send ASR Wait, Discon
4583 resend ASR
4585 Discon ASR successfully sent and Cleanup Idle
4586 ASA Received with Result-Code
4588 Not ASA Received None No Change.
4589 Discon
4591 Any STR Received Send STA, Idle
4592 Cleanup.
4594 The following state machine is observed by a client when state is not
4595 maintained on the server:
4597 CLIENT, STATELESS
4598 State Event Action New State
4599 -------------------------------------------------------------
4600 Idle Client or Device Requests Send Pending
4601 access service
4602 specific
4603 auth req
4605 Pending Successful Service-specific Grant Open
4606 authorization answer Access
4607 received with Auth-Session-
4608 State set to
4609 NO_STATE_MAINTAINED
4611 Pending Failed Service-specific Cleanup Idle
4612 authorization answer
4613 received
4615 Open Session-Timeout Expires on Discon. Idle
4616 Access Device user/device
4618 Open Service to user is terminated Discon. Idle
4619 user/device
4621 The following state machine is observed by a server when it is not
4622 maintaining state for the session:
4624 SERVER, STATELESS
4625 State Event Action New State
4626 -------------------------------------------------------------
4627 Idle Service-specific authorization Send serv. Idle
4628 request received, and specific
4629 successfully processed answer
4631 8.2. Accounting Session State Machine
4633 The following state machines MUST be supported for applications that
4634 have an accounting portion or that require only accounting services.
4635 The first state machine is to be observed by clients.
4637 See Section 9.7 for Accounting Command Codes and Section 9.8 for
4638 Accounting AVPs.
4640 The server side in the accounting state machine depends in some cases
4641 on the particular application. The Diameter base protocol defines a
4642 default state machine that MUST be followed by all applications that
4643 have not specified other state machines. This is the second state
4644 machine in this section described below.
4646 The default server side state machine requires the reception of
4647 accounting records in any order and at any time, and does not place
4648 any standards requirement on the processing of these records.
4649 Implementations of Diameter MAY perform checking, ordering,
4650 correlation, fraud detection, and other tasks based on these records.
4651 Both base Diameter AVPs as well as application specific AVPs MAY be
4652 inspected as a part of these tasks. The tasks can happen either
4653 immediately after record reception or in a post-processing phase.
4654 However, as these tasks are typically application or even policy
4655 dependent, they are not standardized by the Diameter specifications.
4656 Applications MAY define requirements on when to accept accounting
4657 records based on the used value of Accounting-Realtime-Required AVP,
4658 credit limits checks, and so on.
4660 However, the Diameter base protocol defines one optional server side
4661 state machine that MAY be followed by applications that require
4662 keeping track of the session state at the accounting server. Note
4663 that such tracking is incompatible with the ability to sustain long
4664 duration connectivity problems. Therefore, the use of this state
4665 machine is recommended only in applications where the value of the
4666 Accounting-Realtime-Required AVP is DELIVER_AND_GRANT, and hence
4667 accounting connectivity problems are required to cause the serviced
4668 user to be disconnected. Otherwise, records produced by the client
4669 may be lost by the server which no longer accepts them after the
4670 connectivity is re-established. This state machine is the third
4671 state machine in this section. The state machine is supervised by a
4672 supervision session timer Ts, which the value should be reasonably
4673 higher than the Acct_Interim_Interval value. Ts MAY be set to two
4674 times the value of the Acct_Interim_Interval so as to avoid the
4675 accounting session in the Diameter server to change to Idle state in
4676 case of short transient network failure.
4678 Any event not listed in the state machines MUST be considered as an
4679 error condition, and a corresponding answer, if applicable, MUST be
4680 returned to the originator of the message.
4682 In the state table, the event 'Failure to send' means that the
4683 Diameter client is unable to communicate with the desired
4684 destination. This could be due to the peer being down, or due to the
4685 peer sending back a transient failure or temporary protocol error
4686 notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or
4687 DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting
4688 Answer command.
4690 The event 'Failed answer' means that the Diameter client received a
4691 non-transient failure notification in the Accounting Answer command.
4693 Note that the action 'Disconnect user/dev' MUST have an effect also
4694 to the authorization session state table, e.g., cause the STR message
4695 to be sent, if the given application has both authentication/
4696 authorization and accounting portions.
4698 The states PendingS, PendingI, PendingL, PendingE and PendingB stand
4699 for pending states to wait for an answer to an accounting request
4700 related to a Start, Interim, Stop, Event or buffered record,
4701 respectively.
4703 CLIENT, ACCOUNTING
4704 State Event Action New State
4705 -------------------------------------------------------------
4706 Idle Client or device requests Send PendingS
4707 access accounting
4708 start req.
4710 Idle Client or device requests Send PendingE
4711 a one-time service accounting
4712 event req
4714 Idle Records in storage Send PendingB
4715 record
4717 PendingS Successful accounting Open
4718 start answer received
4720 PendingS Failure to send and buffer Store Open
4721 space available and realtime Start
4722 not equal to DELIVER_AND_GRANT Record
4724 PendingS Failure to send and no buffer Open
4725 space available and realtime
4726 equal to GRANT_AND_LOSE
4728 PendingS Failure to send and no buffer Disconnect Idle
4729 space available and realtime user/dev
4730 not equal to
4731 GRANT_AND_LOSE
4733 PendingS Failed accounting start answer Open
4734 received and realtime equal
4735 to GRANT_AND_LOSE
4737 PendingS Failed accounting start answer Disconnect Idle
4738 received and realtime not user/dev
4739 equal to GRANT_AND_LOSE
4741 PendingS User service terminated Store PendingS
4742 stop
4743 record
4745 Open Interim interval elapses Send PendingI
4746 accounting
4747 interim
4748 record
4749 Open User service terminated Send PendingL
4750 accounting
4751 stop req.
4753 PendingI Successful accounting interim Open
4754 answer received
4756 PendingI Failure to send and (buffer Store Open
4757 space available or old record interim
4758 can be overwritten) and record
4759 realtime not equal to
4760 DELIVER_AND_GRANT
4762 PendingI Failure to send and no buffer Open
4763 space available and realtime
4764 equal to GRANT_AND_LOSE
4766 PendingI Failure to send and no buffer Disconnect Idle
4767 space available and realtime user/dev
4768 not equal to GRANT_AND_LOSE
4770 PendingI Failed accounting interim Open
4771 answer received and realtime
4772 equal to GRANT_AND_LOSE
4774 PendingI Failed accounting interim Disconnect Idle
4775 answer received and realtime user/dev
4776 not equal to GRANT_AND_LOSE
4778 PendingI User service terminated Store PendingI
4779 stop
4780 record
4781 PendingE Successful accounting Idle
4782 event answer received
4784 PendingE Failure to send and buffer Store Idle
4785 space available event
4786 record
4788 PendingE Failure to send and no buffer Idle
4789 space available
4791 PendingE Failed accounting event answer Idle
4792 received
4794 PendingB Successful accounting answer Delete Idle
4795 received record
4797 PendingB Failure to send Idle
4799 PendingB Failed accounting answer Delete Idle
4800 received record
4802 PendingL Successful accounting Idle
4803 stop answer received
4805 PendingL Failure to send and buffer Store Idle
4806 space available stop
4807 record
4809 PendingL Failure to send and no buffer Idle
4810 space available
4812 PendingL Failed accounting stop answer Idle
4813 received
4815 SERVER, STATELESS ACCOUNTING
4816 State Event Action New State
4817 -------------------------------------------------------------
4819 Idle Accounting start request Send Idle
4820 received, and successfully accounting
4821 processed. start
4822 answer
4824 Idle Accounting event request Send Idle
4825 received, and successfully accounting
4826 processed. event
4827 answer
4829 Idle Interim record received, Send Idle
4830 and successfully processed. accounting
4831 interim
4832 answer
4834 Idle Accounting stop request Send Idle
4835 received, and successfully accounting
4836 processed stop answer
4838 Idle Accounting request received, Send Idle
4839 no space left to store accounting
4840 records answer,
4841 Result-Code
4842 = OUT_OF_
4843 SPACE
4845 SERVER, STATEFUL ACCOUNTING
4846 State Event Action New State
4847 -------------------------------------------------------------
4849 Idle Accounting start request Send Open
4850 received, and successfully accounting
4851 processed. start
4852 answer,
4853 Start Ts
4855 Idle Accounting event request Send Idle
4856 received, and successfully accounting
4857 processed. event
4858 answer
4860 Idle Accounting request received, Send Idle
4861 no space left to store accounting
4862 records answer,
4863 Result-Code
4864 = OUT_OF_
4865 SPACE
4867 Open Interim record received, Send Open
4868 and successfully processed. accounting
4869 interim
4870 answer,
4871 Restart Ts
4873 Open Accounting stop request Send Idle
4874 received, and successfully accounting
4875 processed stop answer,
4876 Stop Ts
4878 Open Accounting request received, Send Idle
4879 no space left to store accounting
4880 records answer,
4881 Result-Code
4882 = OUT_OF_
4883 SPACE,
4884 Stop Ts
4886 Open Session supervision timer Ts Stop Ts Idle
4887 expired
4889 8.3. Server-Initiated Re-Auth
4891 A Diameter server may initiate a re-authentication and/or re-
4892 authorization service for a particular session by issuing a Re-Auth-
4893 Request (RAR).
4895 For example, for pre-paid services, the Diameter server that
4896 originally authorized a session may need some confirmation that the
4897 user is still using the services.
4899 An access device that receives a RAR message with Session-Id equal to
4900 a currently active session MUST initiate a re-auth towards the user,
4901 if the service supports this particular feature. Each Diameter
4902 application MUST state whether service-initiated re-auth is
4903 supported, since some applications do not allow access devices to
4904 prompt the user for re-auth.
4906 8.3.1. Re-Auth-Request
4908 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258
4909 and the message flags' 'R' bit set, may be sent by any server to the
4910 access device that is providing session service, to request that the
4911 user be re-authenticated and/or re-authorized.
4913 Message Format
4915 ::= < Diameter Header: 258, REQ, PXY >
4916 < Session-Id >
4917 { Origin-Host }
4918 { Origin-Realm }
4919 { Destination-Realm }
4920 { Destination-Host }
4921 { Auth-Application-Id }
4922 { Re-Auth-Request-Type }
4923 [ User-Name ]
4924 [ Origin-State-Id ]
4925 * [ Proxy-Info ]
4926 * [ Route-Record ]
4927 * [ AVP ]
4929 8.3.2. Re-Auth-Answer
4931 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258
4932 and the message flags' 'R' bit clear, is sent in response to the RAR.
4933 The Result-Code AVP MUST be present, and indicates the disposition of
4934 the request.
4936 A successful RAA message MUST be followed by an application-specific
4937 authentication and/or authorization message.
4939 Message Format
4941 ::= < Diameter Header: 258, PXY >
4942 < Session-Id >
4943 { Result-Code }
4944 { Origin-Host }
4945 { Origin-Realm }
4946 [ User-Name ]
4947 [ Origin-State-Id ]
4948 [ Error-Message ]
4949 [ Error-Reporting-Host ]
4950 [ Failed-AVP ]
4951 * [ Redirect-Host ]
4952 [ Redirect-Host-Usage ]
4953 [ Redirect-Max-Cache-Time ]
4954 * [ Proxy-Info ]
4955 * [ AVP ]
4957 8.4. Session Termination
4959 It is necessary for a Diameter server that authorized a session, for
4960 which it is maintaining state, to be notified when that session is no
4961 longer active, both for tracking purposes as well as to allow
4962 stateful agents to release any resources that they may have provided
4963 for the user's session. For sessions whose state is not being
4964 maintained, this section is not used.
4966 When a user session that required Diameter authorization terminates,
4967 the access device that provided the service MUST issue a Session-
4968 Termination-Request (STR) message to the Diameter server that
4969 authorized the service, to notify it that the session is no longer
4970 active. An STR MUST be issued when a user session terminates for any
4971 reason, including user logoff, expiration of Session-Timeout,
4972 administrative action, termination upon receipt of an Abort-Session-
4973 Request (see below), orderly shutdown of the access device, etc.
4975 The access device also MUST issue an STR for a session that was
4976 authorized but never actually started. This could occur, for
4977 example, due to a sudden resource shortage in the access device, or
4978 because the access device is unwilling to provide the type of service
4979 requested in the authorization, or because the access device does not
4980 support a mandatory AVP returned in the authorization, etc.
4982 It is also possible that a session that was authorized is never
4983 actually started due to action of a proxy. For example, a proxy may
4984 modify an authorization answer, converting the result from success to
4985 failure, prior to forwarding the message to the access device. If
4986 the answer did not contain an Auth-Session-State AVP with the value
4987 NO_STATE_MAINTAINED, a proxy that causes an authorized session not to
4988 be started MUST issue an STR to the Diameter server that authorized
4989 the session, since the access device has no way of knowing that the
4990 session had been authorized.
4992 A Diameter server that receives an STR message MUST clean up
4993 resources (e.g., session state) associated with the Session-Id
4994 specified in the STR, and return a Session-Termination-Answer.
4996 A Diameter server also MUST clean up resources when the Session-
4997 Timeout expires, or when the Authorization-Lifetime and the Auth-
4998 Grace-Period AVPs expires without receipt of a re-authorization
4999 request, regardless of whether an STR for that session is received.
5000 The access device is not expected to provide service beyond the
5001 expiration of these timers; thus, expiration of either of these
5002 timers implies that the access device may have unexpectedly shut
5003 down.
5005 8.4.1. Session-Termination-Request
5007 The Session-Termination-Request (STR), indicated by the Command-Code
5008 set to 275 and the Command Flags' 'R' bit set, is sent by the access
5009 device to inform the Diameter Server that an authenticated and/or
5010 authorized session is being terminated.
5012 Message Format
5014 ::= < Diameter Header: 275, REQ, PXY >
5015 < Session-Id >
5016 { Origin-Host }
5017 { Origin-Realm }
5018 { Destination-Realm }
5019 { Auth-Application-Id }
5020 { Termination-Cause }
5021 [ User-Name ]
5022 [ Destination-Host ]
5023 * [ Class ]
5024 [ Origin-State-Id ]
5025 * [ Proxy-Info ]
5026 * [ Route-Record ]
5027 * [ AVP ]
5029 8.4.2. Session-Termination-Answer
5031 The Session-Termination-Answer (STA), indicated by the Command-Code
5032 set to 275 and the message flags' 'R' bit clear, is sent by the
5033 Diameter Server to acknowledge the notification that the session has
5034 been terminated. The Result-Code AVP MUST be present, and MAY
5035 contain an indication that an error occurred while servicing the STR.
5037 Upon sending or receipt of the STA, the Diameter Server MUST release
5038 all resources for the session indicated by the Session-Id AVP. Any
5039 intermediate server in the Proxy-Chain MAY also release any
5040 resources, if necessary.
5042 Message Format
5044 ::= < Diameter Header: 275, PXY >
5045 < Session-Id >
5046 { Result-Code }
5047 { Origin-Host }
5048 { Origin-Realm }
5049 [ User-Name ]
5050 * [ Class ]
5051 [ Error-Message ]
5052 [ Error-Reporting-Host ]
5053 [ Failed-AVP ]
5054 [ Origin-State-Id ]
5055 * [ Redirect-Host ]
5056 [ Redirect-Host-Usage ]
5057 ^
5058 [ Redirect-Max-Cache-Time ]
5059 * [ Proxy-Info ]
5060 * [ AVP ]
5062 8.5. Aborting a Session
5064 A Diameter server may request that the access device stop providing
5065 service for a particular session by issuing an Abort-Session-Request
5066 (ASR).
5068 For example, the Diameter server that originally authorized the
5069 session may be required to cause that session to be stopped for
5070 credit or other reasons that were not anticipated when the session
5071 was first authorized. On the other hand, an operator may maintain a
5072 management server for the purpose of issuing ASRs to administratively
5073 remove users from the network.
5075 An access device that receives an ASR with Session-ID equal to a
5076 currently active session MAY stop the session. Whether the access
5077 device stops the session or not is implementation- and/or
5078 configuration-dependent. For example, an access device may honor
5079 ASRs from certain agents only. In any case, the access device MUST
5080 respond with an Abort-Session-Answer, including a Result-Code AVP to
5081 indicate what action it took.
5083 Note that if the access device does stop the session upon receipt of
5084 an ASR, it issues an STR to the authorizing server (which may or may
5085 not be the agent issuing the ASR) just as it would if the session
5086 were terminated for any other reason.
5088 8.5.1. Abort-Session-Request
5090 The Abort-Session-Request (ASR), indicated by the Command-Code set to
5091 274 and the message flags' 'R' bit set, may be sent by any server to
5092 the access device that is providing session service, to request that
5093 the session identified by the Session-Id be stopped.
5095 Message Format
5097 ::= < Diameter Header: 274, REQ, PXY >
5098 < Session-Id >
5099 { Origin-Host }
5100 { Origin-Realm }
5101 { Destination-Realm }
5102 { Destination-Host }
5103 { Auth-Application-Id }
5104 [ User-Name ]
5105 [ Origin-State-Id ]
5106 * [ Proxy-Info ]
5107 * [ Route-Record ]
5108 * [ AVP ]
5110 8.5.2. Abort-Session-Answer
5112 The Abort-Session-Answer (ASA), indicated by the Command-Code set to
5113 274 and the message flags' 'R' bit clear, is sent in response to the
5114 ASR. The Result-Code AVP MUST be present, and indicates the
5115 disposition of the request.
5117 If the session identified by Session-Id in the ASR was successfully
5118 terminated, Result-Code is set to DIAMETER_SUCCESS. If the session
5119 is not currently active, Result-Code is set to
5120 DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the
5121 session for any other reason, Result-Code is set to
5122 DIAMETER_UNABLE_TO_COMPLY.
5124 Message Format
5126 ::= < Diameter Header: 274, PXY >
5127 < Session-Id >
5128 { Result-Code }
5129 { Origin-Host }
5130 { Origin-Realm }
5131 [ User-Name ]
5132 [ Origin-State-Id ]
5133 [ Error-Message ]
5134 [ Error-Reporting-Host ]
5135 [ Failed-AVP ]
5136 * [ Redirect-Host ]
5137 [ Redirect-Host-Usage ]
5138 [ Redirect-Max-Cache-Time ]
5139 * [ Proxy-Info ]
5140 * [ AVP ]
5142 8.6. Inferring Session Termination from Origin-State-Id
5144 Origin-State-Id is used to allow rapid detection of terminated
5145 sessions for which no STR would have been issued, due to
5146 unanticipated shutdown of an access device.
5148 By including Origin-State-Id in CER/CEA messages, an access device
5149 allows a next-hop server to determine immediately upon connection
5150 whether the device has lost its sessions since the last connection.
5152 By including Origin-State-Id in request messages, an access device
5153 also allows a server with which it communicates via proxy to make
5154 such a determination. However, a server that is not directly
5155 connected with the access device will not discover that the access
5156 device has been restarted unless and until it receives a new request
5157 from the access device. Thus, use of this mechanism across proxies
5158 is opportunistic rather than reliable, but useful nonetheless.
5160 When a Diameter server receives an Origin-State-Id that is greater
5161 than the Origin-State-Id previously received from the same issuer, it
5162 may assume that the issuer has lost state since the previous message
5163 and that all sessions that were active under the lower Origin-State-
5164 Id have been terminated. The Diameter server MAY clean up all
5165 session state associated with such lost sessions, and MAY also issues
5166 STRs for all such lost sessions that were authorized on upstream
5167 servers, to allow session state to be cleaned up globally.
5169 8.7. Auth-Request-Type AVP
5171 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is
5172 included in application-specific auth requests to inform the peers
5173 whether a user is to be authenticated only, authorized only or both.
5174 Note any value other than both MAY cause RADIUS interoperability
5175 issues. The following values are defined:
5177 AUTHENTICATE_ONLY 1
5179 The request being sent is for authentication only, and MUST
5180 contain the relevant application specific authentication AVPs that
5181 are needed by the Diameter server to authenticate the user.
5183 AUTHORIZE_ONLY 2
5185 The request being sent is for authorization only, and MUST contain
5186 the application specific authorization AVPs that are necessary to
5187 identify the service being requested/offered.
5189 AUTHORIZE_AUTHENTICATE 3
5191 The request contains a request for both authentication and
5192 authorization. The request MUST include both the relevant
5193 application specific authentication information, and authorization
5194 information necessary to identify the service being requested/
5195 offered.
5197 8.8. Session-Id AVP
5199 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used
5200 to identify a specific session (see Section 8). All messages
5201 pertaining to a specific session MUST include only one Session-Id AVP
5202 and the same value MUST be used throughout the life of a session.
5203 When present, the Session-Id SHOULD appear immediately following the
5204 Diameter Header (see Section 3).
5206 The Session-Id MUST be globally and eternally unique, as it is meant
5207 to uniquely identify a user session without reference to any other
5208 information, and may be needed to correlate historical authentication
5209 information with accounting information. The Session-Id includes a
5210 mandatory portion and an implementation-defined portion; a
5211 recommended format for the implementation-defined portion is outlined
5212 below.
5214 The Session-Id MUST begin with the sender's identity encoded in the
5215 DiameterIdentity type (see Section 4.4). The remainder of the
5216 Session-Id is delimited by a ";" character, and MAY be any sequence
5217 that the client can guarantee to be eternally unique; however, the
5218 following format is recommended, (square brackets [] indicate an
5219 optional element):
5221 ;;[;]
5223 and are decimal representations of the
5224 high and low 32 bits of a monotonically increasing 64-bit value. The
5225 64-bit value is rendered in two part to simplify formatting by 32-bit
5226 processors. At startup, the high 32 bits of the 64-bit value MAY be
5227 initialized to the time, and the low 32 bits MAY be initialized to
5228 zero. This will for practical purposes eliminate the possibility of
5229 overlapping Session-Ids after a reboot, assuming the reboot process
5230 takes longer than a second. Alternatively, an implementation MAY
5231 keep track of the increasing value in non-volatile memory.
5233 is implementation specific but may include a modem's
5234 device Id, a layer 2 address, timestamp, etc.
5236 Example, in which there is no optional value:
5238 accesspoint7.acme.com;1876543210;523
5240 Example, in which there is an optional value:
5242 accesspoint7.acme.com;1876543210;523;mobile@200.1.1.88
5244 The Session-Id is created by the Diameter application initiating the
5245 session, which in most cases is done by the client. Note that a
5246 Session-Id MAY be used for both the authorization and accounting
5247 commands of a given application.
5249 8.9. Authorization-Lifetime AVP
5251 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32
5252 and contains the maximum number of seconds of service to be provided
5253 to the user before the user is to be re-authenticated and/or re-
5254 authorized. Great care should be taken when the Authorization-
5255 Lifetime value is determined, since a low, non-zero, value could
5256 create significant Diameter traffic, which could congest both the
5257 network and the agents.
5259 A value of zero (0) means that immediate re-auth is necessary by the
5260 access device. This is typically used in cases where multiple
5261 authentication methods are used, and a successful auth response with
5262 this AVP set to zero is used to signal that the next authentication
5263 method is to be immediately initiated. The absence of this AVP, or a
5264 value of all ones (meaning all bits in the 32 bit field are set to
5265 one) means no re-auth is expected.
5267 If both this AVP and the Session-Timeout AVP are present in a
5268 message, the value of the latter MUST NOT be smaller than the
5269 Authorization-Lifetime AVP.
5271 An Authorization-Lifetime AVP MAY be present in re-authorization
5272 messages, and contains the number of seconds the user is authorized
5273 to receive service from the time the re-auth answer message is
5274 received by the access device.
5276 This AVP MAY be provided by the client as a hint of the maximum
5277 lifetime that it is willing to accept. However, the server MAY
5278 return a value that is equal to, or smaller, than the one provided by
5279 the client.
5281 8.10. Auth-Grace-Period AVP
5283 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and
5284 contains the number of seconds the Diameter server will wait
5285 following the expiration of the Authorization-Lifetime AVP before
5286 cleaning up resources for the session.
5288 8.11. Auth-Session-State AVP
5290 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and
5291 specifies whether state is maintained for a particular session. The
5292 client MAY include this AVP in requests as a hint to the server, but
5293 the value in the server's answer message is binding. The following
5294 values are supported:
5296 STATE_MAINTAINED 0
5298 This value is used to specify that session state is being
5299 maintained, and the access device MUST issue a session termination
5300 message when service to the user is terminated. This is the
5301 default value.
5303 NO_STATE_MAINTAINED 1
5305 This value is used to specify that no session termination messages
5306 will be sent by the access device upon expiration of the
5307 Authorization-Lifetime.
5309 8.12. Re-Auth-Request-Type AVP
5311 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and
5312 is included in application-specific auth answers to inform the client
5313 of the action expected upon expiration of the Authorization-Lifetime.
5314 If the answer message contains an Authorization-Lifetime AVP with a
5315 positive value, the Re-Auth-Request-Type AVP MUST be present in an
5316 answer message. The following values are defined:
5318 AUTHORIZE_ONLY 0
5320 An authorization only re-auth is expected upon expiration of the
5321 Authorization-Lifetime. This is the default value if the AVP is
5322 not present in answer messages that include the Authorization-
5323 Lifetime.
5325 AUTHORIZE_AUTHENTICATE 1
5327 An authentication and authorization re-auth is expected upon
5328 expiration of the Authorization-Lifetime.
5330 8.13. Session-Timeout AVP
5332 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32
5333 and contains the maximum number of seconds of service to be provided
5334 to the user before termination of the session. When both the
5335 Session-Timeout and the Authorization-Lifetime AVPs are present in an
5336 answer message, the former MUST be equal to or greater than the value
5337 of the latter.
5339 A session that terminates on an access device due to the expiration
5340 of the Session-Timeout MUST cause an STR to be issued, unless both
5341 the access device and the home server had previously agreed that no
5342 session termination messages would be sent (see Section 8.9).
5344 A Session-Timeout AVP MAY be present in a re-authorization answer
5345 message, and contains the remaining number of seconds from the
5346 beginning of the re-auth.
5348 A value of zero, or the absence of this AVP, means that this session
5349 has an unlimited number of seconds before termination.
5351 This AVP MAY be provided by the client as a hint of the maximum
5352 timeout that it is willing to accept. However, the server MAY return
5353 a value that is equal to, or smaller, than the one provided by the
5354 client.
5356 8.14. User-Name AVP
5358 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which
5359 contains the User-Name, in a format consistent with the NAI
5360 specification [RFC4282].
5362 8.15. Termination-Cause AVP
5364 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and
5365 is used to indicate the reason why a session was terminated on the
5366 access device. The following values are defined:
5368 DIAMETER_LOGOUT 1
5370 The user initiated a disconnect
5372 DIAMETER_SERVICE_NOT_PROVIDED 2
5374 This value is used when the user disconnected prior to the receipt
5375 of the authorization answer message.
5377 DIAMETER_BAD_ANSWER 3
5379 This value indicates that the authorization answer received by the
5380 access device was not processed successfully.
5382 DIAMETER_ADMINISTRATIVE 4
5384 The user was not granted access, or was disconnected, due to
5385 administrative reasons, such as the receipt of a Abort-Session-
5386 Request message.
5388 DIAMETER_LINK_BROKEN 5
5390 The communication to the user was abruptly disconnected.
5392 DIAMETER_AUTH_EXPIRED 6
5394 The user's access was terminated since its authorized session time
5395 has expired.
5397 DIAMETER_USER_MOVED 7
5399 The user is receiving services from another access device.
5401 DIAMETER_SESSION_TIMEOUT 8
5403 The user's session has timed out, and service has been terminated.
5405 8.16. Origin-State-Id AVP
5407 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a
5408 monotonically increasing value that is advanced whenever a Diameter
5409 entity restarts with loss of previous state, for example upon reboot.
5410 Origin-State-Id MAY be included in any Diameter message, including
5411 CER.
5413 A Diameter entity issuing this AVP MUST create a higher value for
5414 this AVP each time its state is reset. A Diameter entity MAY set
5415 Origin-State-Id to the time of startup, or it MAY use an incrementing
5416 counter retained in non-volatile memory across restarts.
5418 The Origin-State-Id, if present, MUST reflect the state of the entity
5419 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST
5420 either remove Origin-State-Id or modify it appropriately as well.
5421 Typically, Origin-State-Id is used by an access device that always
5422 starts up with no active sessions; that is, any session active prior
5423 to restart will have been lost. By including Origin-State-Id in a
5424 message, it allows other Diameter entities to infer that sessions
5425 associated with a lower Origin-State-Id are no longer active. If an
5426 access device does not intend for such inferences to be made, it MUST
5427 either not include Origin-State-Id in any message, or set its value
5428 to 0.
5430 8.17. Session-Binding AVP
5432 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY
5433 be present in application-specific authorization answer messages. If
5434 present, this AVP MAY inform the Diameter client that all future
5435 application-specific re-auth messages for this session MUST be sent
5436 to the same authorization server. This AVP MAY also specify that a
5437 Session-Termination-Request message for this session MUST be sent to
5438 the same authorizing server.
5440 This field is a bit mask, and the following bits have been defined:
5442 RE_AUTH 1
5444 When set, future re-auth messages for this session MUST NOT
5445 include the Destination-Host AVP. When cleared, the default
5446 value, the Destination-Host AVP MUST be present in all re-auth
5447 messages for this session.
5449 STR 2
5451 When set, the STR message for this session MUST NOT include the
5452 Destination-Host AVP. When cleared, the default value, the
5453 Destination-Host AVP MUST be present in the STR message for this
5454 session.
5456 ACCOUNTING 4
5458 When set, all accounting messages for this session MUST NOT
5459 include the Destination-Host AVP. When cleared, the default
5460 value, the Destination-Host AVP, if known, MUST be present in all
5461 accounting messages for this session.
5463 8.18. Session-Server-Failover AVP
5465 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated,
5466 and MAY be present in application-specific authorization answer
5467 messages that either do not include the Session-Binding AVP or
5468 include the Session-Binding AVP with any of the bits set to a zero
5469 value. If present, this AVP MAY inform the Diameter client that if a
5470 re-auth or STR message fails due to a delivery problem, the Diameter
5471 client SHOULD issue a subsequent message without the Destination-Host
5472 AVP. When absent, the default value is REFUSE_SERVICE.
5474 The following values are supported:
5476 REFUSE_SERVICE 0
5478 If either the re-auth or the STR message delivery fails, terminate
5479 service with the user, and do not attempt any subsequent attempts.
5481 TRY_AGAIN 1
5483 If either the re-auth or the STR message delivery fails, resend
5484 the failed message without the Destination-Host AVP present.
5486 ALLOW_SERVICE 2
5488 If re-auth message delivery fails, assume that re-authorization
5489 succeeded. If STR message delivery fails, terminate the session.
5491 TRY_AGAIN_ALLOW_SERVICE 3
5493 If either the re-auth or the STR message delivery fails, resend
5494 the failed message without the Destination-Host AVP present. If
5495 the second delivery fails for re-auth, assume re-authorization
5496 succeeded. If the second delivery fails for STR, terminate the
5497 session.
5499 8.19. Multi-Round-Time-Out AVP
5501 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32,
5502 and SHOULD be present in application-specific authorization answer
5503 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH.
5504 This AVP contains the maximum number of seconds that the access
5505 device MUST provide the user in responding to an authentication
5506 request.
5508 8.20. Class AVP
5510 The Class AVP (AVP Code 25) is of type OctetString and is used to by
5511 Diameter servers to return state information to the access device.
5512 When one or more Class AVPs are present in application-specific
5513 authorization answer messages, they MUST be present in subsequent re-
5514 authorization, session termination and accounting messages. Class
5515 AVPs found in a re-authorization answer message override the ones
5516 found in any previous authorization answer message. Diameter server
5517 implementations SHOULD NOT return Class AVPs that require more than
5518 4096 bytes of storage on the Diameter client. A Diameter client that
5519 receives Class AVPs whose size exceeds local available storage MUST
5520 terminate the session.
5522 8.21. Event-Timestamp AVP
5524 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be
5525 included in an Accounting-Request and Accounting-Answer messages to
5526 record the time that the reported event occurred, in seconds since
5527 January 1, 1900 00:00 UTC.
5529 9. Accounting
5531 This accounting protocol is based on a server directed model with
5532 capabilities for real-time delivery of accounting information.
5533 Several fault resilience methods [RFC2975] have been built in to the
5534 protocol in order minimize loss of accounting data in various fault
5535 situations and under different assumptions about the capabilities of
5536 the used devices.
5538 9.1. Server Directed Model
5540 The server directed model means that the device generating the
5541 accounting data gets information from either the authorization server
5542 (if contacted) or the accounting server regarding the way accounting
5543 data shall be forwarded. This information includes accounting record
5544 timeliness requirements.
5546 As discussed in [RFC2975], real-time transfer of accounting records
5547 is a requirement, such as the need to perform credit limit checks and
5548 fraud detection. Note that batch accounting is not a requirement,
5549 and is therefore not supported by Diameter. Should batched
5550 accounting be required in the future, a new Diameter application will
5551 need to be created, or it could be handled using another protocol.
5552 Note, however, that even if at the Diameter layer accounting requests
5553 are processed one by one, transport protocols used under Diameter
5554 typically batch several requests in the same packet under heavy
5555 traffic conditions. This may be sufficient for many applications.
5557 The authorization server (chain) directs the selection of proper
5558 transfer strategy, based on its knowledge of the user and
5559 relationships of roaming partnerships. The server (or agents) uses
5560 the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to
5561 control the operation of the Diameter peer operating as a client.
5562 The Acct-Interim-Interval AVP, when present, instructs the Diameter
5563 node acting as a client to produce accounting records continuously
5564 even during a session. Accounting-Realtime-Required AVP is used to
5565 control the behavior of the client when the transfer of accounting
5566 records from the Diameter client is delayed or unsuccessful.
5568 The Diameter accounting server MAY override the interim interval or
5569 the realtime requirements by including the Acct-Interim-Interval or
5570 Accounting-Realtime-Required AVP in the Accounting-Answer message.
5571 When one of these AVPs is present, the latest value received SHOULD
5572 be used in further accounting activities for the same session.
5574 9.2. Protocol Messages
5576 A Diameter node that receives a successful authentication and/or
5577 authorization messages from the Home AAA server MUST collect
5578 accounting information for the session. The Accounting-Request
5579 message is used to transmit the accounting information to the Home
5580 AAA server, which MUST reply with the Accounting-Answer message to
5581 confirm reception. The Accounting-Answer message includes the
5582 Result-Code AVP, which MAY indicate that an error was present in the
5583 accounting message. A rejected Accounting-Request message MAY cause
5584 the user's session to be terminated, depending on the value of the
5585 Accounting-Realtime-Required AVP received earlier for the session in
5586 question.
5588 Each Diameter Accounting protocol message MAY be compressed, in order
5589 to reduce network bandwidth usage. If TLS is used to secure the
5590 Diameter session, then TLS compression [RFC4346] MAY be used.
5592 9.3. Accounting Application Extension and Requirements
5594 Each Diameter application (e.g., NASREQ, MobileIP), MUST define their
5595 Service-Specific AVPs that MUST be present in the Accounting-Request
5596 message in a section entitled "Accounting AVPs". The application
5597 MUST assume that the AVPs described in this document will be present
5598 in all Accounting messages, so only their respective service-specific
5599 AVPs need to be defined in this section.
5601 Applications have the option of using one or both of the following
5602 accounting application extension models:
5604 Split Accounting Service
5606 The accounting message will carry the application identifier of
5607 the Diameter base accounting application (see Section 2.4).
5608 Accounting messages maybe routed to Diameter nodes other than the
5609 corresponding Diameter application. These nodes might be
5610 centralized accounting servers that provide accounting service for
5611 multiple different Diameter applications. These nodes MUST
5612 advertise the Diameter base accounting application identifier
5613 during capabilities exchange.
5615 Accounting messages which uses the Diameter base accounting
5616 application identifier in its header as well as in the Acct-
5617 Application-Id AVP.
5619 Coupled Accounting Service
5621 The accounting messages will carry the application identifier of
5622 the application that is using it. The application itself will
5623 process the received accounting records or forward them to an
5624 accounting server. There is no accounting application
5625 advertisement required during capabilities exchange and the
5626 accounting messages will be routed the same as any of the other
5627 application messages.
5629 In cases where an application does not define its own accounting
5630 service, it is preferred that the split accounting model be used.
5632 9.4. Fault Resilience
5634 Diameter Base protocol mechanisms are used to overcome small message
5635 loss and network faults of temporary nature.
5637 Diameter peers acting as clients MUST implement the use of failover
5638 to guard against server failures and certain network failures.
5639 Diameter peers acting as agents or related off-line processing
5640 systems MUST detect duplicate accounting records caused by the
5641 sending of same record to several servers and duplication of messages
5642 in transit. This detection MUST be based on the inspection of the
5643 Session-Id and Accounting-Record-Number AVP pairs. Appendix C
5644 discusses duplicate detection needs and implementation issues.
5646 Diameter clients MAY have non-volatile memory for the safe storage of
5647 accounting records over reboots or extended network failures, network
5648 partitions, and server failures. If such memory is available, the
5649 client SHOULD store new accounting records there as soon as the
5650 records are created and until a positive acknowledgement of their
5651 reception from the Diameter Server has been received. Upon a reboot,
5652 the client MUST starting sending the records in the non-volatile
5653 memory to the accounting server with appropriate modifications in
5654 termination cause, session length, and other relevant information in
5655 the records.
5657 A further application of this protocol may include AVPs to control
5658 how many accounting records may at most be stored in the Diameter
5659 client without committing them to the non-volatile memory or
5660 transferring them to the Diameter server.
5662 The client SHOULD NOT remove the accounting data from any of its
5663 memory areas before the correct Accounting-Answer has been received.
5664 The client MAY remove oldest, undelivered or yet unacknowledged
5665 accounting data if it runs out of resources such as memory. It is an
5666 implementation dependent matter for the client to accept new sessions
5667 under this condition.
5669 9.5. Accounting Records
5671 In all accounting records, the Session-Id AVP MUST be present; the
5672 User-Name AVP MUST be present if it is available to the Diameter
5673 client.
5675 Different types of accounting records are sent depending on the
5676 actual type of accounted service and the authorization server's
5677 directions for interim accounting. If the accounted service is a
5678 one-time event, meaning that the start and stop of the event are
5679 simultaneous, then the Accounting-Record-Type AVP MUST be present and
5680 set to the value EVENT_RECORD.
5682 If the accounted service is of a measurable length, then the AVP MUST
5683 use the values START_RECORD, STOP_RECORD, and possibly,
5684 INTERIM_RECORD. If the authorization server has not directed interim
5685 accounting to be enabled for the session, two accounting records MUST
5686 be generated for each service of type session. When the initial
5687 Accounting-Request for a given session is sent, the Accounting-
5688 Record-Type AVP MUST be set to the value START_RECORD. When the last
5689 Accounting-Request is sent, the value MUST be STOP_RECORD.
5691 If the authorization server has directed interim accounting to be
5692 enabled, the Diameter client MUST produce additional records between
5693 the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The
5694 production of these records is directed by Acct-Interim-Interval as
5695 well as any re-authentication or re-authorization of the session.
5696 The Diameter client MUST overwrite any previous interim accounting
5697 records that are locally stored for delivery, if a new record is
5698 being generated for the same session. This ensures that only one
5699 pending interim record can exist on an access device for any given
5700 session.
5702 A particular value of Accounting-Sub-Session-Id MUST appear only in
5703 one sequence of accounting records from a DIAMETER client, except for
5704 the purposes of retransmission. The one sequence that is sent MUST
5705 be either one record with Accounting-Record-Type AVP set to the value
5706 EVENT_RECORD, or several records starting with one having the value
5707 START_RECORD, followed by zero or more INTERIM_RECORD and a single
5708 STOP_RECORD. A particular Diameter application specification MUST
5709 define the type of sequences that MUST be used.
5711 9.6. Correlation of Accounting Records
5713 The Diameter protocol's Session-Id AVP, which is globally unique (see
5714 Section 8.8), is used during the authorization phase to identify a
5715 particular session. Services that do not require any authorization
5716 still use the Session-Id AVP to identify sessions. Accounting
5717 messages MAY use a different Session-Id from that sent in
5718 authorization messages. Specific applications MAY require different
5719 a Session-ID for accounting messages.
5721 However, there are certain applications that require multiple
5722 accounting sub-sessions. Such applications would send messages with
5723 a constant Session-Id AVP, but a different Accounting-Sub-Session-Id
5724 AVP. In these cases, correlation is performed using the Session-Id.
5725 It is important to note that receiving a STOP_RECORD with no
5726 Accounting-Sub-Session-Id AVP when sub-sessions were originally used
5727 in the START_RECORD messages implies that all sub-sessions are
5728 terminated.
5730 Furthermore, there are certain applications where a user receives
5731 service from different access devices (e.g., Mobile IPv4), each with
5732 their own unique Session-Id. In such cases, the Acct-Multi-Session-
5733 Id AVP is used for correlation. During authorization, a server that
5734 determines that a request is for an existing session SHOULD include
5735 the Acct-Multi-Session-Id AVP, which the access device MUST include
5736 in all subsequent accounting messages.
5738 The Acct-Multi-Session-Id AVP MAY include the value of the original
5739 Session-Id. It's contents are implementation specific, but MUST be
5740 globally unique across other Acct-Multi-Session-Id, and MUST NOT
5741 change during the life of a session.
5743 A Diameter application document MUST define the exact concept of a
5744 session that is being accounted, and MAY define the concept of a
5745 multi-session. For instance, the NASREQ DIAMETER application treats
5746 a single PPP connection to a Network Access Server as one session,
5747 and a set of Multilink PPP sessions as one multi-session.
5749 9.7. Accounting Command-Codes
5751 This section defines Command-Code values that MUST be supported by
5752 all Diameter implementations that provide Accounting services.
5754 9.7.1. Accounting-Request
5756 The Accounting-Request (ACR) command, indicated by the Command-Code
5757 field set to 271 and the Command Flags' 'R' bit set, is sent by a
5758 Diameter node, acting as a client, in order to exchange accounting
5759 information with a peer.
5761 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs
5762 MUST be present. If the Vendor-Specific-Application-Id grouped AVP
5763 is present, it must have an Acct-Application-Id inside.
5765 The AVP listed below SHOULD include service specific accounting AVPs,
5766 as described in Section 9.3.
5768 Message Format
5770 ::= < Diameter Header: 271, REQ, PXY >
5771 < Session-Id >
5772 { Origin-Host }
5773 { Origin-Realm }
5774 { Destination-Realm }
5775 { Accounting-Record-Type }
5776 { Accounting-Record-Number }
5777 [ Acct-Application-Id ]
5778 [ Vendor-Specific-Application-Id ]
5779 [ User-Name ]
5780 [ Destination-Host ]
5781 [ Accounting-Sub-Session-Id ]
5782 [ Acct-Session-Id ]
5783 [ Acct-Multi-Session-Id ]
5784 [ Acct-Interim-Interval ]
5785 [ Accounting-Realtime-Required ]
5786 [ Origin-State-Id ]
5787 [ Event-Timestamp ]
5788 * [ Proxy-Info ]
5789 * [ Route-Record ]
5790 * [ AVP ]
5792 9.7.2. Accounting-Answer
5794 The Accounting-Answer (ACA) command, indicated by the Command-Code
5795 field set to 271 and the Command Flags' 'R' bit cleared, is used to
5796 acknowledge an Accounting-Request command. The Accounting-Answer
5797 command contains the same Session-Id as the corresponding request.
5799 Only the target Diameter Server, known as the home Diameter Server,
5800 SHOULD respond with the Accounting-Answer command.
5802 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs
5803 MUST be present. If the Vendor-Specific-Application-Id grouped AVP
5804 is present, it must have an Acct-Application-Id inside.
5806 The AVP listed below SHOULD include service specific accounting AVPs,
5807 as described in Section 9.3.
5809 Message Format
5811 ::= < Diameter Header: 271, PXY >
5812 < Session-Id >
5813 { Result-Code }
5814 { Origin-Host }
5815 { Origin-Realm }
5816 { Accounting-Record-Type }
5817 { Accounting-Record-Number }
5818 [ Acct-Application-Id ]
5819 [ Vendor-Specific-Application-Id ]
5820 [ User-Name ]
5821 [ Accounting-Sub-Session-Id ]
5822 [ Acct-Session-Id ]
5823 [ Acct-Multi-Session-Id ]
5824 [ Error-Message ]
5825 [ Error-Reporting-Host ]
5826 [ Failed-AVP ]
5827 [ Acct-Interim-Interval ]
5828 [ Accounting-Realtime-Required ]
5829 [ Origin-State-Id ]
5830 [ Event-Timestamp ]
5831 * [ Proxy-Info ]
5832 * [ AVP ]
5834 9.8. Accounting AVPs
5836 This section contains AVPs that describe accounting usage information
5837 related to a specific session.
5839 9.8.1. Accounting-Record-Type AVP
5841 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated
5842 and contains the type of accounting record being sent. The following
5843 values are currently defined for the Accounting-Record-Type AVP:
5845 EVENT_RECORD 1
5847 An Accounting Event Record is used to indicate that a one-time
5848 event has occurred (meaning that the start and end of the event
5849 are simultaneous). This record contains all information relevant
5850 to the service, and is the only record of the service.
5852 START_RECORD 2
5854 An Accounting Start, Interim, and Stop Records are used to
5855 indicate that a service of a measurable length has been given. An
5856 Accounting Start Record is used to initiate an accounting session,
5857 and contains accounting information that is relevant to the
5858 initiation of the session.
5860 INTERIM_RECORD 3
5862 An Interim Accounting Record contains cumulative accounting
5863 information for an existing accounting session. Interim
5864 Accounting Records SHOULD be sent every time a re-authentication
5865 or re-authorization occurs. Further, additional interim record
5866 triggers MAY be defined by application-specific Diameter
5867 applications. The selection of whether to use INTERIM_RECORD
5868 records is done by the Acct-Interim-Interval AVP.
5870 STOP_RECORD 4
5872 An Accounting Stop Record is sent to terminate an accounting
5873 session and contains cumulative accounting information relevant to
5874 the existing session.
5876 9.8.2. Acct-Interim-Interval
5878 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and
5879 is sent from the Diameter home authorization server to the Diameter
5880 client. The client uses information in this AVP to decide how and
5881 when to produce accounting records. With different values in this
5882 AVP, service sessions can result in one, two, or two+N accounting
5883 records, based on the needs of the home-organization. The following
5884 accounting record production behavior is directed by the inclusion of
5885 this AVP:
5887 1. The omission of the Acct-Interim-Interval AVP or its inclusion
5888 with Value field set to 0 means that EVENT_RECORD, START_RECORD,
5889 and STOP_RECORD are produced, as appropriate for the service.
5891 2. The inclusion of the AVP with Value field set to a non-zero value
5892 means that INTERIM_RECORD records MUST be produced between the
5893 START_RECORD and STOP_RECORD records. The Value field of this
5894 AVP is the nominal interval between these records in seconds.
5896 The Diameter node that originates the accounting information,
5897 known as the client, MUST produce the first INTERIM_RECORD record
5898 roughly at the time when this nominal interval has elapsed from
5899 the START_RECORD, the next one again as the interval has elapsed
5900 once more, and so on until the session ends and a STOP_RECORD
5901 record is produced.
5903 The client MUST ensure that the interim record production times
5904 are randomized so that large accounting message storms are not
5905 created either among records or around a common service start
5906 time.
5908 9.8.3. Accounting-Record-Number AVP
5910 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32
5911 and identifies this record within one session. As Session-Id AVPs
5912 are globally unique, the combination of Session-Id and Accounting-
5913 Record-Number AVPs is also globally unique, and can be used in
5914 matching accounting records with confirmations. An easy way to
5915 produce unique numbers is to set the value to 0 for records of type
5916 EVENT_RECORD and START_RECORD, and set the value to 1 for the first
5917 INTERIM_RECORD, 2 for the second, and so on until the value for
5918 STOP_RECORD is one more than for the last INTERIM_RECORD.
5920 9.8.4. Acct-Session-Id AVP
5922 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only
5923 used when RADIUS/Diameter translation occurs. This AVP contains the
5924 contents of the RADIUS Acct-Session-Id attribute.
5926 9.8.5. Acct-Multi-Session-Id AVP
5928 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String,
5929 following the format specified in Section 8.8. The Acct-Multi-
5930 Session-Id AVP is used to link together multiple related accounting
5931 sessions, where each session would have a unique Session-Id, but the
5932 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the
5933 Diameter server in an authorization answer, and MUST be used in all
5934 accounting messages for the given session.
5936 9.8.6. Accounting-Sub-Session-Id AVP
5938 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type
5939 Unsigned64 and contains the accounting sub-session identifier. The
5940 combination of the Session-Id and this AVP MUST be unique per sub-
5941 session, and the value of this AVP MUST be monotonically increased by
5942 one for all new sub-sessions. The absence of this AVP implies no
5943 sub-sessions are in use, with the exception of an Accounting-Request
5944 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD
5945 message with no Accounting-Sub-Session-Id AVP present will signal the
5946 termination of all sub-sessions for a given Session-Id.
5948 9.8.7. Accounting-Realtime-Required AVP
5950 The Accounting-Realtime-Required AVP (AVP Code 483) is of type
5951 Enumerated and is sent from the Diameter home authorization server to
5952 the Diameter client or in the Accounting-Answer from the accounting
5953 server. The client uses information in this AVP to decide what to do
5954 if the sending of accounting records to the accounting server has
5955 been temporarily prevented due to, for instance, a network problem.
5957 DELIVER_AND_GRANT 1
5959 The AVP with Value field set to DELIVER_AND_GRANT means that the
5960 service MUST only be granted as long as there is a connection to
5961 an accounting server. Note that the set of alternative accounting
5962 servers are treated as one server in this sense. Having to move
5963 the accounting record stream to a backup server is not a reason to
5964 discontinue the service to the user.
5966 GRANT_AND_STORE 2
5968 The AVP with Value field set to GRANT_AND_STORE means that service
5969 SHOULD be granted if there is a connection, or as long as records
5970 can still be stored as described in Section 9.4.
5972 This is the default behavior if the AVP isn't included in the
5973 reply from the authorization server.
5975 GRANT_AND_LOSE 3
5977 The AVP with Value field set to GRANT_AND_LOSE means that service
5978 SHOULD be granted even if the records can not be delivered or
5979 stored.
5981 10. AVP Occurrence Table
5983 The following tables presents the AVPs defined in this document, and
5984 specifies in which Diameter messages they MAY be present or not.
5985 AVPs that occur only inside a Grouped AVP are not shown in this
5986 table.
5988 The table uses the following symbols:
5990 0 The AVP MUST NOT be present in the message.
5992 0+ Zero or more instances of the AVP MAY be present in the
5993 message.
5995 0-1 Zero or one instance of the AVP MAY be present in the message.
5996 It is considered an error if there are more than one instance of
5997 the AVP.
5999 1 One instance of the AVP MUST be present in the message.
6001 1+ At least one instance of the AVP MUST be present in the
6002 message.
6004 10.1. Base Protocol Command AVP Table
6006 The table in this section is limited to the non-accounting Command
6007 Codes defined in this specification.
6009 +-----------------------------------------------+
6010 | Command-Code |
6011 +---+---+---+---+---+---+---+---+---+---+---+---+
6012 Attribute Name |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA|
6013 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+
6014 Acct-Interim- |0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 |
6015 Interval | | | | | | | | | | | | |
6016 Accounting-Realtime-|0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 |
6017 Required | | | | | | | | | | | | |
6018 Acct-Application-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6019 Auth-Application-Id |0+ |0+ |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 |
6020 Auth-Grace-Period |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6021 Auth-Request-Type |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6022 Auth-Session-State |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6023 Authorization- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6024 Lifetime | | | | | | | | | | | | |
6025 Class |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0+ |0+ |
6026 Destination-Host |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0-1|0 |
6027 Destination-Realm |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 |
6028 Disconnect-Cause |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6029 Error-Message |0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|
6030 Error-Reporting-Host|0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1|
6031 Failed-AVP |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |
6032 Firmware-Revision |0-1|0-1|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6033 Host-IP-Address |1+ |1+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6034 Inband-Security-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6035 Multi-Round-Time-Out|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6036 Origin-Host |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |
6037 Origin-Realm |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |
6038 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|
6039 Product-Name |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6040 Proxy-Info |0 |0 |0 |0 |0 |0 |0+ |0+ |0+ |0+ |0+ |0+ |
6041 Redirect-Host |0 |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |
6042 Redirect-Host-Usage |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1|
6043 Redirect-Max-Cache- |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1|
6044 Time | | | | | | | | | | | | |
6045 Result-Code |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |
6046 Re-Auth-Request-Type|0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 |
6047 Route-Record |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |0 |
6048 Session-Binding |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6049 Session-Id |0 |0 |0 |0 |0 |0 |1 |1 |1 |1 |1 |1 |
6050 Session-Server- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6051 Failover | | | | | | | | | | | | |
6052 Session-Timeout |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6053 Supported-Vendor-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6054 Termination-Cause |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |1 |0 |
6055 User-Name |0 |0 |0 |0 |0 |0 |0-1|0-1|0-1|0-1|0-1|0-1|
6056 Vendor-Id |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6057 Vendor-Specific- |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |
6058 Application-Id | | | | | | | | | | | | |
6059 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+
6061 10.2. Accounting AVP Table
6063 The table in this section is used to represent which AVPs defined in
6064 this document are to be present in the Accounting messages. These
6065 AVP occurrence requirements are guidelines, which may be expanded,
6066 and/or overridden by application-specific requirements in the
6067 Diameter applications documents.
6069 +-----------+
6070 | Command |
6071 | Code |
6072 +-----+-----+
6073 Attribute Name | ACR | ACA |
6074 ------------------------------+-----+-----+
6075 Acct-Interim-Interval | 0-1 | 0-1 |
6076 Acct-Multi-Session-Id | 0-1 | 0-1 |
6077 Accounting-Record-Number | 1 | 1 |
6078 Accounting-Record-Type | 1 | 1 |
6079 Acct-Session-Id | 0-1 | 0-1 |
6080 Accounting-Sub-Session-Id | 0-1 | 0-1 |
6081 Accounting-Realtime-Required | 0-1 | 0-1 |
6082 Acct-Application-Id | 0-1 | 0-1 |
6083 Auth-Application-Id | 0 | 0 |
6084 Class | 0+ | 0+ |
6085 Destination-Host | 0-1 | 0 |
6086 Destination-Realm | 1 | 0 |
6087 Error-Reporting-Host | 0 | 0+ |
6088 Event-Timestamp | 0-1 | 0-1 |
6089 Origin-Host | 1 | 1 |
6090 Origin-Realm | 1 | 1 |
6091 Proxy-Info | 0+ | 0+ |
6092 Route-Record | 0+ | 0 |
6093 Result-Code | 0 | 1 |
6094 Session-Id | 1 | 1 |
6095 Termination-Cause | 0 | 0 |
6096 User-Name | 0-1 | 0-1 |
6097 Vendor-Specific-Application-Id| 0-1 | 0-1 |
6098 ------------------------------+-----+-----+
6100 11. IANA Considerations
6102 This section provides guidance to the Internet Assigned Numbers
6103 Authority (IANA) regarding registration of values related to the
6104 Diameter protocol, in accordance with BCP 26 [RFC2434]. The
6105 following policies are used here with the meanings defined in BCP 26:
6106 "Private Use", "First Come First Served", "Expert Review",
6107 "Specification Required", "IETF Consensus", "Standards Action".
6109 This section explains the criteria to be used by the IANA for
6110 assignment of numbers within namespaces defined within this document.
6112 Diameter is not intended as a general purpose protocol, and
6113 allocations SHOULD NOT be made for purposes unrelated to
6114 authentication, authorization or accounting.
6116 For registration requests where a Designated Expert should be
6117 consulted, the responsible IESG area director should appoint the
6118 Designated Expert. For Designated Expert with Specification
6119 Required, the request is posted to the DIME WG mailing list (or, if
6120 it has been disbanded, a successor designated by the Area Director)
6121 for comment and review, and MUST include a pointer to a public
6122 specification. Before a period of 30 days has passed, the Designated
6123 Expert will either approve or deny the registration request and
6124 publish a notice of the decision to the DIME WG mailing list or its
6125 successor. A denial notice must be justified by an explanation and,
6126 in the cases where it is possible, concrete suggestions on how the
6127 request can be modified so as to become acceptable.
6129 11.1. AVP Header
6131 As defined in Section 4, the AVP header contains three fields that
6132 requires IANA namespace management; the AVP Code, Vendor-ID and Flags
6133 field.
6135 11.1.1. AVP Codes
6137 The AVP Code namespace is used to identify attributes. There are
6138 multiple namespaces. Vendors can have their own AVP Codes namespace
6139 which will be identified by their Vendor-ID (also known as
6140 Enterprise-Number) and they control the assignments of their vendor-
6141 specific AVP codes within their own namespace. The absence of a
6142 Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA
6143 controlled AVP Codes namespace. The AVP Codes and sometimes also
6144 possible values in an AVP are controlled and maintained by IANA.
6146 AVP Code 0 is not used. AVP Codes 1-255 are managed separately as
6147 RADIUS Attribute Types [RADTYPE]. This document defines the AVP
6148 Codes 257-274, 276-285, 287, 291-300, 480, 483 and 485-486. See
6149 Section 4.5 for the assignment of the namespace in this
6150 specification.
6152 AVPs may be allocated following Designated Expert with Specification
6153 Required [RFC2434]. Release of blocks of AVPs (more than 3 at a time
6154 for a given purpose) should require IETF Consensus.
6156 Note that Diameter defines a mechanism for Vendor-Specific AVPs,
6157 where the Vendor-Id field in the AVP header is set to a non-zero
6158 value. Vendor-Specific AVPs codes are for Private Use and should be
6159 encouraged instead of allocation of global attribute types, for
6160 functions specific only to one vendor's implementation of Diameter,
6161 where no interoperability is deemed useful. Where a Vendor-Specific
6162 AVP is implemented by more than one vendor, allocation of global AVPs
6163 should be encouraged instead.
6165 11.1.2. AVP Flags
6167 There are 8 bits in the AVP Flags field of the AVP header, defined in
6168 Section 4. This document assigns bit 0 ('V'endor Specific), bit 1
6169 ('M'andatory) and bit 2 ('P'rotected). The remaining bits should
6170 only be assigned via a Standards Action [RFC2434].
6172 11.2. Diameter Header
6174 As defined in Section 3, the Diameter header contains two fields that
6175 require IANA namespace management; Command Code and Command Flags.
6177 11.2.1. Command Codes
6179 The Command Code namespace is used to identify Diameter commands.
6180 The values 0-255 (0x00-0xff) are reserved for RADIUS backward
6181 compatibility, and are defined as "RADIUS Packet Type Codes" in
6182 [RADTYPE]. Values 256 - 8,388,607 (0x100 to 0x7fffff) are for
6183 permanent, standard commands, allocated by IETF Consensus [RFC2434].
6184 This document defines the Command Codes 257, 258, 271, 274-275, 280
6185 and 282. See Section 3.1 for the assignment of the namespace in this
6186 specification.
6188 The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved
6189 for vendor-specific command codes, to be allocated on a First Come,
6190 First Served basis by IANA [RFC2434]. The request to IANA for a
6191 Vendor-Specific Command Code SHOULD include a reference to a publicly
6192 available specification which documents the command in sufficient
6193 detail to aid in interoperability between independent
6194 implementations. If the specification cannot be made publicly
6195 available, the request for a vendor-specific command code MUST
6196 include the contact information of persons and/or entities
6197 responsible for authoring and maintaining the command.
6199 The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe -
6200 0xffffff) are reserved for experimental commands. As these codes are
6201 only for experimental and testing purposes, no guarantee is made for
6202 interoperability between Diameter peers using experimental commands,
6203 as outlined in [IANA-EXP].
6205 11.2.2. Command Flags
6207 There are eight bits in the Command Flags field of the Diameter
6208 header. This document assigns bit 0 ('R'equest), bit 1 ('P'roxy),
6209 bit 2 ('E'rror) and bit 3 ('T'). Bits 4 through 7 MUST only be
6210 assigned via a Standards Action [RFC2434].
6212 11.3. Application Identifiers
6214 As defined in Section 2.4, the Application Identifier is used to
6215 identify a specific Diameter Application. There are standards-track
6216 application ids and vendor specific application ids.
6218 IANA [RFC2434] has assigned the range 0x00000001 to 0x00ffffff for
6219 standards-track applications; and 0x01000000 - 0xfffffffe for vendor
6220 specific applications, on a first-come, first-served basis. The
6221 following values are allocated.
6223 Diameter Common Messages 0
6224 NASREQ 1 [RFC4005]
6225 Mobile-IP 2 [RFC4004]
6226 Diameter Base Accounting 3
6227 Relay 0xffffffff
6229 Assignment of standards-track application IDs are by Designated
6230 Expert with Specification Required [RFC2434].
6232 Both Auth-Application-Id and Acct-Application-Id AVPs use the same
6233 Application Identifier space. A diameter node advertising itself as
6234 a relay agent MUST set either Application-Id or Acct-Application-Id
6235 to 0xffffffff.
6237 Vendor-Specific Application Identifiers, are for Private Use. Vendor-
6238 Specific Application Identifiers are assigned on a First Come, First
6239 Served basis by IANA.
6241 11.4. AVP Values
6243 Certain AVPs in Diameter define a list of values with various
6244 meanings. For attributes other than those specified in this section,
6245 adding additional values to the list can be done on a First Come,
6246 First Served basis by IANA.
6248 11.4.1. Result-Code AVP Values
6250 As defined in Section 7.1, the Result-Code AVP (AVP Code 268) defines
6251 the values 1001, 2001-2002, 3001-3012, 4001-4003 and 5001-5021.
6253 All remaining values are available for assignment via IETF Consensus
6254 [RFC2434].
6256 11.4.2. Accounting-Record-Type AVP Values
6258 As defined in Section 9.8.1, the Accounting-Record-Type AVP (AVP Code
6259 480) defines the values 1-4. All remaining values are available for
6260 assignment via IETF Consensus [RFC2434].
6262 11.4.3. Termination-Cause AVP Values
6264 As defined in Section 8.15, the Termination-Cause AVP (AVP Code 295)
6265 defines the values 1-8. All remaining values are available for
6266 assignment via IETF Consensus [RFC2434].
6268 11.4.4. Redirect-Host-Usage AVP Values
6270 As defined in Section 6.13, the Redirect-Host-Usage AVP (AVP Code
6271 261) defines the values 0-5. All remaining values are available for
6272 assignment via IETF Consensus [RFC2434].
6274 11.4.5. Session-Server-Failover AVP Values
6276 As defined in Section 8.18, the Session-Server-Failover AVP (AVP Code
6277 271) defines the values 0-3. All remaining values are available for
6278 assignment via IETF Consensus [RFC2434].
6280 11.4.6. Session-Binding AVP Values
6282 As defined in Section 8.17, the Session-Binding AVP (AVP Code 270)
6283 defines the bits 1-4. All remaining bits are available for
6284 assignment via IETF Consensus [RFC2434].
6286 11.4.7. Disconnect-Cause AVP Values
6288 As defined in Section 5.4.3, the Disconnect-Cause AVP (AVP Code 273)
6289 defines the values 0-2. All remaining values are available for
6290 assignment via IETF Consensus [RFC2434].
6292 11.4.8. Auth-Request-Type AVP Values
6294 As defined in Section 8.7, the Auth-Request-Type AVP (AVP Code 274)
6295 defines the values 1-3. All remaining values are available for
6296 assignment via IETF Consensus [RFC2434].
6298 11.4.9. Auth-Session-State AVP Values
6300 As defined in Section 8.11, the Auth-Session-State AVP (AVP Code 277)
6301 defines the values 0-1. All remaining values are available for
6302 assignment via IETF Consensus [RFC2434].
6304 11.4.10. Re-Auth-Request-Type AVP Values
6306 As defined in Section 8.12, the Re-Auth-Request-Type AVP (AVP Code
6307 285) defines the values 0-1. All remaining values are available for
6308 assignment via IETF Consensus [RFC2434].
6310 11.4.11. Accounting-Realtime-Required AVP Values
6312 As defined in Section 9.8.7, the Accounting-Realtime-Required AVP
6313 (AVP Code 483) defines the values 1-3. All remaining values are
6314 available for assignment via IETF Consensus [RFC2434].
6316 11.4.12. Inband-Security-Id AVP (code 299)
6318 As defined in Section 6.10, the Inband-Security-Id AVP (AVP Code 299)
6319 defines the values 0-1. All remaining values are available for
6320 assignment via IETF Consensus [RFC2434].
6322 11.5. Diameter TCP/SCTP Port Numbers
6324 The IANA has assigned TCP and SCTP port number 3868 to Diameter.
6326 11.6. NAPTR Service Fields
6328 The registration in the RFC MUST include the following information:
6330 Service Field: The service field being registered. An example for a
6331 new fictitious transport protocol called NCTP might be "AAA+D2N".
6333 Protocol: The specific transport protocol associated with that
6334 service field. This MUST include the name and acronym for the
6335 protocol, along with reference to a document that describes the
6336 transport protocol. For example - "New Connectionless Transport
6337 Protocol (NCTP), RFC 5766".
6339 Name and Contact Information: The name, address, email address and
6340 telephone number for the person performing the registration.
6342 The following values have been placed into the registry:
6344 Services Field Protocol
6346 AAA+D2T TCP
6347 AAA+D2S SCTP
6349 12. Diameter protocol related configurable parameters
6351 This section contains the configurable parameters that are found
6352 throughout this document:
6354 Diameter Peer
6356 A Diameter entity MAY communicate with peers that are statically
6357 configured. A statically configured Diameter peer would require
6358 that either the IP address or the fully qualified domain name
6359 (FQDN) be supplied, which would then be used to resolve through
6360 DNS.
6362 Routing Table
6364 A Diameter proxy server routes messages based on the realm portion
6365 of a Network Access Identifier (NAI). The server MUST have a
6366 table of Realm Names, and the address of the peer to which the
6367 message must be forwarded to. The routing table MAY also include
6368 a "default route", which is typically used for all messages that
6369 cannot be locally processed.
6371 Tc timer
6373 The Tc timer controls the frequency that transport connection
6374 attempts are done to a peer with whom no active transport
6375 connection exists. The recommended value is 30 seconds.
6377 13. Security Considerations
6379 The Diameter base protocol messages SHOULD be secured by using TLS
6380 [RFC4346]. Additional security measures that are transparent to and
6381 independent of Diameter, such as IPSec [RFC4301], can also be
6382 deployed to secure connections between peers.
6384 During deployment, connections between Diameter nodes SHOULD be
6385 protected by TLS. All Diameter base protocol implementations MUST
6386 support the use of TLS. The Diameter protocol SHOULD NOT be used
6387 without any security mechanism.
6389 If a Diameter connection is to be protected via TLS, then the CER/CEA
6390 exchange MUST include an Inband-Security-ID AVP with a value of TLS.
6391 For TLS usage, a TLS handshake will begin when both ends are in the
6392 open state, after completion of the CER/CEA exchange. If the TLS
6393 handshake is successful, all further messages will be sent via TLS.
6394 If the handshake fails, both ends move to the closed state. See
6395 Sections 13.1 for more details.
6397 13.1. TLS Usage
6399 A Diameter node that initiates a connection to another Diameter node
6400 acts as a TLS client according to [RFC4346], and a Diameter node that
6401 accepts a connection acts as a TLS server. Diameter nodes
6402 implementing TLS for security MUST mutually authenticate as part of
6403 TLS session establishment. In order to ensure mutual authentication,
6404 the Diameter node acting as TLS server must request a certificate
6405 from the Diameter node acting as TLS client, and the Diameter node
6406 acting as TLS client MUST be prepared to supply a certificate on
6407 request.
6409 Diameter nodes MUST be able to negotiate the following TLS cipher
6410 suites:
6412 TLS_RSA_WITH_RC4_128_MD5
6413 TLS_RSA_WITH_RC4_128_SHA
6414 TLS_RSA_WITH_3DES_EDE_CBC_SHA
6416 Diameter nodes SHOULD be able to negotiate the following TLS cipher
6417 suite:
6419 TLS_RSA_WITH_AES_128_CBC_SHA
6421 Diameter nodes MAY negotiate other TLS cipher suites.
6423 Upon receiving the peers certificate, Diameter nodes SHOULD further
6424 validate the identity of the peer by matching the received Origin-
6425 Host and/or Origin-Realm in the CER and CEA exchange against the
6426 content of the peers certificate. Diameter peer hostname and/or
6427 realm validation can be performed in the following order:
6429 o If one ore more 'Subject Alternate Name (subjectAltName)'
6430 extension of type dNSName is present in the certificate (See
6431 [RFC3280]), then the Origin-Host value can be used to find a
6432 matching extension.
6434 o If there are no matches found, then the Origin-Realm value can be
6435 used to find a matching subjectAltName extension.
6437 o Otherwise, the Origin-Host value should be found within the
6438 'Common Name (CN)' field in the Subject field of the certificate
6439 (See [RFC3280]).
6441 Identity validation MAY be omitted by a Diameter node if the
6442 information contained in the certificate cannot be co-related or
6443 mapped to the Origin-Host and Origin-Realm presented by a peer.
6444 However, the Diameter node SHOULD have external information or other
6445 means to validate the identity of a peer.
6447 13.2. Peer-to-Peer Considerations
6449 As with any peer-to-peer protocol, proper configuration of the trust
6450 model within a Diameter peer is essential to security. When
6451 certificates are used, it is necessary to configure the root
6452 certificate authorities trusted by the Diameter peer. These root CAs
6453 are likely to be unique to Diameter usage and distinct from the root
6454 CAs that might be trusted for other purposes such as Web browsing.
6455 In general, it is expected that those root CAs will be configured so
6456 as to reflect the business relationships between the organization
6457 hosting the Diameter peer and other organizations. As a result, a
6458 Diameter peer will typically not be configured to allow connectivity
6459 with any arbitrary peer. With certificate authentication, Diameter
6460 peers may not be known beforehand and therefore peer discovery may be
6461 required.
6463 14. References
6465 14.1. Normative References
6467 [FLOATPOINT]
6468 Institute of Electrical and Electronics Engineers, "IEEE
6469 Standard for Binary Floating-Point Arithmetic, ANSI/IEEE
6470 Standard 754-1985", August 1985.
6472 [IANAADFAM]
6473 IANA,, "Address Family Numbers",
6474 http://www.iana.org/assignments/address-family-numbers.
6476 [RADTYPE] IANA,, "RADIUS Types",
6477 http://www.iana.org/assignments/radius-types.
6479 [IPV4] Postel, J., "Internet Protocol", RFC 791, September 1981.
6481 [TCP] Postel, J., "Transmission Control Protocol", RFC 793,
6482 January 1981.
6484 [RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and
6485 Accounting (AAA) Transport Profile", RFC 3539, June 2003.
6487 [RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and
6488 P. McCann, "Diameter Mobile IPv4 Application", RFC 4004,
6489 August 2005.
6491 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton,
6492 "Diameter Network Access Server Application", RFC 4005,
6493 August 2005.
6495 [RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J.
6496 Loughney, "Diameter Credit-Control Application", RFC 4006,
6497 August 2005.
6499 [RFC4072] Eronen, P., Hiller, T., and G. Zorn, "Diameter Extensible
6500 Authentication Protocol (EAP) Application", RFC 4072,
6501 August 2005.
6503 [RFC4740] Garcia-Martin, M., Belinchon, M., Pallares-Lopez, M.,
6504 Canales-Valenzuela, C., and K. Tammi, "Diameter Session
6505 Initiation Protocol (SIP) Application", RFC 4740,
6506 November 2006.
6508 [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
6509 Specifications: ABNF", RFC 4234, October 2005.
6511 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J.
6512 Arkko, "Diameter Base Protocol", RFC 3588, September 2003.
6514 [RFC3748] Aboba, B., Blunk, L., Vollbrecht, J., Carlson, J., and H.
6515 Levkowetz, "Extensible Authentication Protocol (EAP)",
6516 RFC 3748, June 2004.
6518 [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an
6519 IANA Considerations Section in RFCs", BCP 26, RFC 2434,
6520 October 1998.
6522 [RFC4306] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol",
6523 RFC 4306, December 2005.
6525 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing
6526 Architecture", RFC 4291, February 2006.
6528 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
6529 Requirement Levels", BCP 14, RFC 2119, March 1997.
6531 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The
6532 Network Access Identifier", RFC 4282, December 2005.
6534 [RFC3403] Mealling, M., "Dynamic Delegation Discovery System (DDDS)
6535 Part Three: The Domain Name System (DNS) Database",
6536 RFC 3403, October 2002.
6538 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston,
6539 A., Peterson, J., Sparks, R., Handley, M., and E.
6540 Schooler, "SIP: Session Initiation Protocol", RFC 3261,
6541 June 2002.
6543 [RFC2960] Stewart, R., Xie, Q., Morneault, K., Sharp, C.,
6544 Schwarzbauer, H., Taylor, T., Rytina, I., Kalla, M.,
6545 Zhang, L., and V. Paxson, "Stream Control Transmission
6546 Protocol", RFC 2960, October 2000.
6548 [RFC4346] Dierks, T. and E. Rescorla, "The Transport Layer Security
6549 (TLS) Protocol Version 1.1", RFC 4346, April 2006.
6551 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
6552 Resource Identifier (URI): Generic Syntax", STD 66,
6553 RFC 3986, January 2005.
6555 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
6556 10646", STD 63, RFC 3629, November 2003.
6558 [RFC3280] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet
6559 X.509 Public Key Infrastructure Certificate and
6560 Certificate Revocation List (CRL) Profile", RFC 3280,
6561 April 2002.
6563 [RFC3490] Faltstrom, P., Hoffman, P., and A. Costello,
6564 "Internationalizing Domain Names in Applications (IDNA)",
6565 RFC 3490, March 2003.
6567 [RFC3491] Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep
6568 Profile for Internationalized Domain Names (IDN)",
6569 RFC 3491, March 2003.
6571 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode
6572 for Internationalized Domain Names in Applications
6573 (IDNA)", RFC 3492, March 2003.
6575 14.2. Informational References
6577 [RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P.,
6578 Shiino, H., Zorn, G., Dommety, G., C.Perkins, B.Patil,
6579 D.Mitton, S.Manning, M.Beadles, P.Walsh, X.Chen,
6580 S.Sivalingham, A.Hameed, M.Munson, S.Jacobs, B.Lim,
6581 B.Hirschman, R.Hsu, Y.Xu, E.Campell, S.Baba, and E.Jaques,
6582 "Criteria for Evaluating AAA Protocols for Network
6583 Access", RFC 2989, November 2000.
6585 [RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to
6586 Accounting Management", RFC 2975, October 2000.
6588 [RFC3232] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by
6589 an On-line Database", RFC 3232, January 2002.
6591 [RFC3576] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B.
6592 Aboba, "Dynamic Authorization Extensions to Remote
6593 Authentication Dial In User Service (RADIUS)", RFC 3576,
6594 July 2003.
6596 [RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51,
6597 RFC 1661, July 1994.
6599 [RFC2607] Aboba, B. and J. Vollbrecht, "Proxy Chaining and Policy
6600 Implementation in Roaming", RFC 2607, June 1999.
6602 [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000.
6604 [RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS
6605 Extensions", RFC 2869, June 2000.
6607 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson,
6608 "Remote Authentication Dial In User Service (RADIUS)",
6609 RFC 2865, June 2000.
6611 [RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6",
6612 RFC 3162, August 2001.
6614 [RFC2194] Aboba, B., Lu, J., Alsop, J., Ding, J., and W. Wang,
6615 "Review of Roaming Implementations", RFC 2194,
6616 September 1997.
6618 [RFC2477] Aboba, B. and G. Zorn, "Criteria for Evaluating Roaming
6619 Protocols", RFC 2477, January 1999.
6621 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the
6622 Internet Protocol", RFC 4301, December 2005.
6624 [RFC4330] Mills, D., "Simple Network Time Protocol (SNTP) Version 4
6625 for IPv4, IPv6 and OSI", RFC 4330, January 2006.
6627 [RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called
6628 TACACS", RFC 1492, July 1993.
6630 [RFC4690] Klensin, J., Faltstrom, P., Karp, C., and IAB, "Review and
6631 Recommendations for Internationalized Domain Names
6632 (IDNs)", RFC 4690, September 2006.
6634 [IANA-EXP]
6635 Narten, T., "Assigning Experimental and Testing Numbers
6636 Considered Useful, Work in Progress.".
6638 Appendix A. Acknowledgements
6640 The authors would like to thank the following people that have
6641 provided proposals and contributions to this document:
6643 To Vishnu Ram and Satendra Gera for their contributions on
6644 Capabilities Updates, Predictive Loop Avoidance as well as many other
6645 technical proposals. To Tolga Asveren for his insights and
6646 contributions on almost all of the proposed solutions incorporated
6647 into this document. To Timothy Smith for helping on the Capabilities
6648 Updates and other topics. To Tony Zhang for providing fixes to loop
6649 holes on composing Failed-AVPs as well as many other issues and
6650 topics. To Jan Nordqvist for clearly stating the usage of
6651 application ids. To Anders Kristensen for providing needed technical
6652 opinions. To David Frascone for providing invaluable review of the
6653 document. To Mark Jones for providing clarifying text on vendor
6654 command codes and other vendor specific indicators.
6656 Special thanks also to people who have provided invaluable comments
6657 and inputs especially in resolving controversial issues:
6659 Glen Zorn, Yoshihiro Ohba, Marco Stura, and Pasi Eronen.
6661 Finally, we would like to thank the original authors of this
6662 document:
6664 Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman and Glen Zorn.
6666 Their invaluable knowledge and experience has given us a robust and
6667 flexible AAA protocol that many people have seen great value in
6668 adopting. We greatly appreciate their support and stewardship for
6669 the continued improvements of Diameter as a protocol. We would also
6670 like to extend our gratitude to folks aside from the authors who have
6671 assisted and contributed to the original version of this document.
6672 Their efforts significantly contributed to the success of Diameter.
6674 Appendix B. NAPTR Example
6676 As an example, consider a client that wishes to resolve aaa:ex.com.
6677 The client performs a NAPTR query for that domain, and the following
6678 NAPTR records are returned:
6680 ;; order pref flags service regexp replacement
6681 IN NAPTR 50 50 "s" "AAA+D2S" ""
6682 _diameter._sctp.example.com IN NAPTR 100 50 "s" "AAA+D2T"
6683 "" _aaa._tcp.example.com
6685 This indicates that the server supports SCTP, and TCP, in that order.
6686 If the client supports over SCTP, SCTP will be used, targeted to a
6687 host determined by an SRV lookup of _diameter._sctp.ex.com. That
6688 lookup would return:
6690 ;; Priority Weight Port Target
6691 IN SRV 0 1 5060 server1.example.com IN SRV 0
6692 2 5060 server2.example.com
6694 Appendix C. Duplicate Detection
6696 As described in Section 9.4, accounting record duplicate detection is
6697 based on session identifiers. Duplicates can appear for various
6698 reasons:
6700 o Failover to an alternate server. Where close to real-time
6701 performance is required, failover thresholds need to be kept low
6702 and this may lead to an increased likelihood of duplicates.
6703 Failover can occur at the client or within Diameter agents.
6705 o Failure of a client or agent after sending of a record from non-
6706 volatile memory, but prior to receipt of an application layer ACK
6707 and deletion of the record. record to be sent. This will result
6708 in retransmission of the record soon after the client or agent has
6709 rebooted.
6711 o Duplicates received from RADIUS gateways. Since the
6712 retransmission behavior of RADIUS is not defined within [RFC2865],
6713 the likelihood of duplication will vary according to the
6714 implementation.
6716 o Implementation problems and misconfiguration.
6718 The T flag is used as an indication of an application layer
6719 retransmission event, e.g., due to failover to an alternate server.
6720 It is defined only for request messages sent by Diameter clients or
6721 agents. For instance, after a reboot, a client may not know whether
6722 it has already tried to send the accounting records in its non-
6723 volatile memory before the reboot occurred. Diameter servers MAY use
6724 the T flag as an aid when processing requests and detecting duplicate
6725 messages. However, servers that do this MUST ensure that duplicates
6726 are found even when the first transmitted request arrives at the
6727 server after the retransmitted request. It can be used only in cases
6728 where no answer has been received from the Server for a request and
6729 the request is sent again, (e.g., due to a failover to an alternate
6730 peer, due to a recovered primary peer or due to a client re-sending a
6731 stored record from non-volatile memory such as after reboot of a
6732 client or agent).
6734 In some cases the Diameter accounting server can delay the duplicate
6735 detection and accounting record processing until a post-processing
6736 phase takes place. At that time records are likely to be sorted
6737 according to the included User-Name and duplicate elimination is easy
6738 in this case. In other situations it may be necessary to perform
6739 real-time duplicate detection, such as when credit limits are imposed
6740 or real-time fraud detection is desired.
6742 In general, only generation of duplicates due to failover or re-
6743 sending of records in non-volatile storage can be reliably detected
6744 by Diameter clients or agents. In such cases the Diameter client or
6745 agents can mark the message as possible duplicate by setting the T
6746 flag. Since the Diameter server is responsible for duplicate
6747 detection, it can choose to make use of the T flag or not, in order
6748 to optimize duplicate detection. Since the T flag does not affect
6749 interoperability, and may not be needed by some servers, generation
6750 of the T flag is REQUIRED for Diameter clients and agents, but MAY be
6751 implemented by Diameter servers.
6753 As an example, it can be usually be assumed that duplicates appear
6754 within a time window of longest recorded network partition or device
6755 fault, perhaps a day. So only records within this time window need
6756 to be looked at in the backward direction. Secondly, hashing
6757 techniques or other schemes, such as the use of the T flag in the
6758 received messages, may be used to eliminate the need to do a full
6759 search even in this set except for rare cases.
6761 The following is an example of how the T flag may be used by the
6762 server to detect duplicate requests.
6764 A Diameter server MAY check the T flag of the received message to
6765 determine if the record is a possible duplicate. If the T flag is
6766 set in the request message, the server searches for a duplicate
6767 within a configurable duplication time window backward and
6768 forward. This limits database searching to those records where
6769 the T flag is set. In a well run network, network partitions and
6770 device faults will presumably be rare events, so this approach
6771 represents a substantial optimization of the duplicate detection
6772 process. During failover, it is possible for the original record
6773 to be received after the T flag marked record, due to differences
6774 in network delays experienced along the path by the original and
6775 duplicate transmissions. The likelihood of this occurring
6776 increases as the failover interval is decreased. In order to be
6777 able to detect out of order duplicates, the Diameter server should
6778 use backward and forward time windows when performing duplicate
6779 checking for the T flag marked request. For example, in order to
6780 allow time for the original record to exit the network and be
6781 recorded by the accounting server, the Diameter server can delay
6782 processing records with the T flag set until a time period
6783 TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing
6784 of the original transport connection. After this time period has
6785 expired, then it may check the T flag marked records against the
6786 database with relative assurance that the original records, if
6787 sent, have been received and recorded.
6789 Appendix D. Internationalized Domain Names
6791 To be compatible with the existing DNS infrastructure and simplify
6792 host and domain name comparison, Diameter identities (FQDNs) are
6793 represented in ASCII form. This allows the Diameter protocol to fall
6794 in-line with the DNS strategy of being transparent from the effects
6795 of Internationalized Domain Names (IDNs) by following the
6796 recommnedations in [RFC4690] and [RFC3490]. Applications that
6797 provide support for IDNs outside of the Diameter protocol but
6798 interacting with it SHOULD use the representation and conversion
6799 framework described in [RFC3490], [RFC3491] and [RFC3492].
6801 Authors' Addresses
6803 Victor Fajardo (editor)
6804 Toshiba America Research
6805 One Telcordia Drive, 1S-222
6806 Piscataway, NJ 08854
6807 USA
6809 Phone: 1 908-421-1845
6810 Email: vfajardo@tari.toshiba.com
6812 Jari Arkko
6813 Ericsson Research
6814 02420 Jorvas
6815 Finland
6817 Phone: +358 40 5079256
6818 Email: jari.arkko@ericsson.com
6820 John Loughney
6821 Nokia Research Center
6822 955 Page Mill Road
6823 Palo Alto, CA 94304
6824 US
6826 Phone: 1-650-283-8068
6827 Email: john.loughney@nokia.com
6829 Full Copyright Statement
6831 Copyright (C) The IETF Trust (2007).
6833 This document is subject to the rights, licenses and restrictions
6834 contained in BCP 78, and except as set forth therein, the authors
6835 retain all their rights.
6837 This document and the information contained herein are provided on an
6838 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
6839 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
6840 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
6841 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
6842 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
6843 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
6845 Intellectual Property
6847 The IETF takes no position regarding the validity or scope of any
6848 Intellectual Property Rights or other rights that might be claimed to
6849 pertain to the implementation or use of the technology described in
6850 this document or the extent to which any license under such rights
6851 might or might not be available; nor does it represent that it has
6852 made any independent effort to identify any such rights. Information
6853 on the procedures with respect to rights in RFC documents can be
6854 found in BCP 78 and BCP 79.
6856 Copies of IPR disclosures made to the IETF Secretariat and any
6857 assurances of licenses to be made available, or the result of an
6858 attempt made to obtain a general license or permission for the use of
6859 such proprietary rights by implementers or users of this
6860 specification can be obtained from the IETF on-line IPR repository at
6861 http://www.ietf.org/ipr.
6863 The IETF invites any interested party to bring to its attention any
6864 copyrights, patents or patent applications, or other proprietary
6865 rights that may cover technology that may be required to implement
6866 this standard. Please address the information to the IETF at
6867 ietf-ipr@ietf.org.
6869 Acknowledgment
6871 Funding for the RFC Editor function is provided by the IETF
6872 Administrative Support Activity (IASA).