idnits 2.17.1 draft-ietf-dime-rfc3588bis-24.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. 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 1 instance of lines with non-RFC2606-compliant FQDNs in the document. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? -- The draft header indicates that this document obsoletes RFC3588, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 6629 has weird spacing: '...service rege...' == Line 6650 has weird spacing: '...service rege...' -- 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 (August 26, 2010) is 4984 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: 'TBD' is mentioned on line 6298, but not defined == Missing Reference: 'PXY' is mentioned on line 4226, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'FLOATPOINT' -- Possible downref: Non-RFC (?) normative reference: ref. 'IANAADFAM' -- Possible downref: Non-RFC (?) normative reference: ref. 'RADTYPE' ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 4005 (Obsoleted by RFC 7155) ** Obsolete normative reference: RFC 4006 (Obsoleted by RFC 8506) ** Obsolete normative reference: RFC 3588 (Obsoleted by RFC 6733) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 4282 (Obsoleted by RFC 7542) ** Obsolete normative reference: RFC 4960 (Obsoleted by RFC 9260) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) Summary: 8 errors (**), 0 flaws (~~), 6 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 DIME V. Fajardo, Ed. 3 Internet-Draft Telcordia Technologies 4 Obsoletes: 3588 (if approved) J. Arkko 5 Intended status: Standards Track Ericsson Research 6 Expires: February 27, 2011 J. Loughney 7 Nokia Research Center 8 G. Zorn 9 Network Zen 10 August 26, 2010 12 Diameter Base Protocol 13 draft-ietf-dime-rfc3588bis-24.txt 15 Abstract 17 The Diameter base protocol is intended to provide an Authentication, 18 Authorization and Accounting (AAA) framework for applications such as 19 network access or IP mobility in both local and roaming situations. 20 This document specifies the message format, transport, error 21 reporting, accounting and security services used by all Diameter 22 applications. The Diameter base protocol as defined in this document 23 must be supported by all Diameter implementations. 25 Status of this Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on February 27, 2011. 42 Copyright Notice 44 Copyright (c) 2010 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 60 1.1. Diameter Protocol . . . . . . . . . . . . . . . . . . . . 9 61 1.1.1. Description of the Document Set . . . . . . . . . . 10 62 1.1.2. Conventions Used in This Document . . . . . . . . . 11 63 1.1.3. Changes from RFC3588 . . . . . . . . . . . . . . . . 11 64 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 12 65 1.3. Approach to Extensibility . . . . . . . . . . . . . . . . 18 66 1.3.1. Defining New AVP Values . . . . . . . . . . . . . . 19 67 1.3.2. Creating New AVPs . . . . . . . . . . . . . . . . . 19 68 1.3.3. Creating New Commands . . . . . . . . . . . . . . . 19 69 1.3.4. Creating New Diameter Applications . . . . . . . . . 20 70 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 22 71 2.1. Transport . . . . . . . . . . . . . . . . . . . . . . . . 23 72 2.1.1. SCTP Guidelines . . . . . . . . . . . . . . . . . . 24 73 2.2. Securing Diameter Messages . . . . . . . . . . . . . . . 24 74 2.3. Diameter Application Compliance . . . . . . . . . . . . . 24 75 2.4. Application Identifiers . . . . . . . . . . . . . . . . . 25 76 2.5. Connections vs. Sessions . . . . . . . . . . . . . . . . 25 77 2.6. Peer Table . . . . . . . . . . . . . . . . . . . . . . . 26 78 2.7. Routing Table . . . . . . . . . . . . . . . . . . . . . . 27 79 2.8. Role of Diameter Agents . . . . . . . . . . . . . . . . . 29 80 2.8.1. Relay Agents . . . . . . . . . . . . . . . . . . . . 30 81 2.8.2. Proxy Agents . . . . . . . . . . . . . . . . . . . . 31 82 2.8.3. Redirect Agents . . . . . . . . . . . . . . . . . . 31 83 2.8.4. Translation Agents . . . . . . . . . . . . . . . . . 32 84 2.9. Diameter Path Authorization . . . . . . . . . . . . . . . 33 85 3. Diameter Header . . . . . . . . . . . . . . . . . . . . . . . 35 86 3.1. Command Codes . . . . . . . . . . . . . . . . . . . . . . 38 87 3.2. Command Code ABNF specification . . . . . . . . . . . . . 38 88 3.3. Diameter Command Naming Conventions . . . . . . . . . . . 41 89 4. Diameter AVPs . . . . . . . . . . . . . . . . . . . . . . . . 42 90 4.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 42 91 4.1.1. Optional Header Elements . . . . . . . . . . . . . . 43 92 4.2. Basic AVP Data Formats . . . . . . . . . . . . . . . . . 44 93 4.3. Derived AVP Data Formats . . . . . . . . . . . . . . . . 45 94 4.3.1. Common Derived AVPs . . . . . . . . . . . . . . . . 45 95 4.4. Grouped AVP Values . . . . . . . . . . . . . . . . . . . 52 96 4.4.1. Example AVP with a Grouped Data type . . . . . . . . 53 97 4.5. Diameter Base Protocol AVPs . . . . . . . . . . . . . . . 56 98 5. Diameter Peers . . . . . . . . . . . . . . . . . . . . . . . 59 99 5.1. Peer Connections . . . . . . . . . . . . . . . . . . . . 59 100 5.2. Diameter Peer Discovery . . . . . . . . . . . . . . . . . 60 101 5.3. Capabilities Exchange . . . . . . . . . . . . . . . . . . 61 102 5.3.1. Capabilities-Exchange-Request . . . . . . . . . . . 63 103 5.3.2. Capabilities-Exchange-Answer . . . . . . . . . . . . 63 104 5.3.3. Vendor-Id AVP . . . . . . . . . . . . . . . . . . . 64 105 5.3.4. Firmware-Revision AVP . . . . . . . . . . . . . . . 64 106 5.3.5. Host-IP-Address AVP . . . . . . . . . . . . . . . . 64 107 5.3.6. Supported-Vendor-Id AVP . . . . . . . . . . . . . . 65 108 5.3.7. Product-Name AVP . . . . . . . . . . . . . . . . . . 65 109 5.4. Disconnecting Peer connections . . . . . . . . . . . . . 65 110 5.4.1. Disconnect-Peer-Request . . . . . . . . . . . . . . 66 111 5.4.2. Disconnect-Peer-Answer . . . . . . . . . . . . . . . 66 112 5.4.3. Disconnect-Cause AVP . . . . . . . . . . . . . . . . 66 113 5.5. Transport Failure Detection . . . . . . . . . . . . . . . 67 114 5.5.1. Device-Watchdog-Request . . . . . . . . . . . . . . 67 115 5.5.2. Device-Watchdog-Answer . . . . . . . . . . . . . . . 67 116 5.5.3. Transport Failure Algorithm . . . . . . . . . . . . 68 117 5.5.4. Failover and Failback Procedures . . . . . . . . . . 68 118 5.6. Peer State Machine . . . . . . . . . . . . . . . . . . . 69 119 5.6.1. Incoming connections . . . . . . . . . . . . . . . . 71 120 5.6.2. Events . . . . . . . . . . . . . . . . . . . . . . . 72 121 5.6.3. Actions . . . . . . . . . . . . . . . . . . . . . . 73 122 5.6.4. The Election Process . . . . . . . . . . . . . . . . 75 123 6. Diameter message processing . . . . . . . . . . . . . . . . . 76 124 6.1. Diameter Request Routing Overview . . . . . . . . . . . . 76 125 6.1.1. Originating a Request . . . . . . . . . . . . . . . 77 126 6.1.2. Sending a Request . . . . . . . . . . . . . . . . . 77 127 6.1.3. Receiving Requests . . . . . . . . . . . . . . . . . 78 128 6.1.4. Processing Local Requests . . . . . . . . . . . . . 78 129 6.1.5. Request Forwarding . . . . . . . . . . . . . . . . . 78 130 6.1.6. Request Routing . . . . . . . . . . . . . . . . . . 78 131 6.1.7. Predictive Loop Avoidance . . . . . . . . . . . . . 79 132 6.1.8. Redirecting Requests . . . . . . . . . . . . . . . . 79 133 6.1.9. Relaying and Proxying Requests . . . . . . . . . . . 80 134 6.2. Diameter Answer Processing . . . . . . . . . . . . . . . 82 135 6.2.1. Processing received Answers . . . . . . . . . . . . 82 136 6.2.2. Relaying and Proxying Answers . . . . . . . . . . . 82 137 6.3. Origin-Host AVP . . . . . . . . . . . . . . . . . . . . . 83 138 6.4. Origin-Realm AVP . . . . . . . . . . . . . . . . . . . . 83 139 6.5. Destination-Host AVP . . . . . . . . . . . . . . . . . . 83 140 6.6. Destination-Realm AVP . . . . . . . . . . . . . . . . . . 84 141 6.7. Routing AVPs . . . . . . . . . . . . . . . . . . . . . . 84 142 6.7.1. Route-Record AVP . . . . . . . . . . . . . . . . . . 84 143 6.7.2. Proxy-Info AVP . . . . . . . . . . . . . . . . . . . 84 144 6.7.3. Proxy-Host AVP . . . . . . . . . . . . . . . . . . . 85 145 6.7.4. Proxy-State AVP . . . . . . . . . . . . . . . . . . 85 146 6.8. Auth-Application-Id AVP . . . . . . . . . . . . . . . . . 85 147 6.9. Acct-Application-Id AVP . . . . . . . . . . . . . . . . . 85 148 6.10. Inband-Security-Id AVP . . . . . . . . . . . . . . . . . 85 149 6.11. Vendor-Specific-Application-Id AVP . . . . . . . . . . . 86 150 6.12. Redirect-Host AVP . . . . . . . . . . . . . . . . . . . . 87 151 6.13. Redirect-Host-Usage AVP . . . . . . . . . . . . . . . . . 87 152 6.14. Redirect-Max-Cache-Time AVP . . . . . . . . . . . . . . . 88 153 7. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 90 154 7.1. Result-Code AVP . . . . . . . . . . . . . . . . . . . . . 92 155 7.1.1. Informational . . . . . . . . . . . . . . . . . . . 92 156 7.1.2. Success . . . . . . . . . . . . . . . . . . . . . . 93 157 7.1.3. Protocol Errors . . . . . . . . . . . . . . . . . . 93 158 7.1.4. Transient Failures . . . . . . . . . . . . . . . . . 94 159 7.1.5. Permanent Failures . . . . . . . . . . . . . . . . . 95 160 7.2. Error Bit . . . . . . . . . . . . . . . . . . . . . . . . 98 161 7.3. Error-Message AVP . . . . . . . . . . . . . . . . . . . . 99 162 7.4. Error-Reporting-Host AVP . . . . . . . . . . . . . . . . 99 163 7.5. Failed-AVP AVP . . . . . . . . . . . . . . . . . . . . . 99 164 7.6. Experimental-Result AVP . . . . . . . . . . . . . . . . . 100 165 7.7. Experimental-Result-Code AVP . . . . . . . . . . . . . . 100 166 8. Diameter User Sessions . . . . . . . . . . . . . . . . . . . 101 167 8.1. Authorization Session State Machine . . . . . . . . . . . 102 168 8.2. Accounting Session State Machine . . . . . . . . . . . . 107 169 8.3. Server-Initiated Re-Auth . . . . . . . . . . . . . . . . 112 170 8.3.1. Re-Auth-Request . . . . . . . . . . . . . . . . . . 112 171 8.3.2. Re-Auth-Answer . . . . . . . . . . . . . . . . . . . 113 172 8.4. Session Termination . . . . . . . . . . . . . . . . . . . 114 173 8.4.1. Session-Termination-Request . . . . . . . . . . . . 115 174 8.4.2. Session-Termination-Answer . . . . . . . . . . . . . 115 175 8.5. Aborting a Session . . . . . . . . . . . . . . . . . . . 116 176 8.5.1. Abort-Session-Request . . . . . . . . . . . . . . . 116 177 8.5.2. Abort-Session-Answer . . . . . . . . . . . . . . . . 117 178 8.6. Inferring Session Termination from Origin-State-Id . . . 118 179 8.7. Auth-Request-Type AVP . . . . . . . . . . . . . . . . . . 118 180 8.8. Session-Id AVP . . . . . . . . . . . . . . . . . . . . . 119 181 8.9. Authorization-Lifetime AVP . . . . . . . . . . . . . . . 120 182 8.10. Auth-Grace-Period AVP . . . . . . . . . . . . . . . . . . 121 183 8.11. Auth-Session-State AVP . . . . . . . . . . . . . . . . . 121 184 8.12. Re-Auth-Request-Type AVP . . . . . . . . . . . . . . . . 121 185 8.13. Session-Timeout AVP . . . . . . . . . . . . . . . . . . . 122 186 8.14. User-Name AVP . . . . . . . . . . . . . . . . . . . . . . 122 187 8.15. Termination-Cause AVP . . . . . . . . . . . . . . . . . . 122 188 8.16. Origin-State-Id AVP . . . . . . . . . . . . . . . . . . . 124 189 8.17. Session-Binding AVP . . . . . . . . . . . . . . . . . . . 124 190 8.18. Session-Server-Failover AVP . . . . . . . . . . . . . . . 125 191 8.19. Multi-Round-Time-Out AVP . . . . . . . . . . . . . . . . 126 192 8.20. Class AVP . . . . . . . . . . . . . . . . . . . . . . . . 126 193 8.21. Event-Timestamp AVP . . . . . . . . . . . . . . . . . . . 126 194 9. Accounting . . . . . . . . . . . . . . . . . . . . . . . . . 127 195 9.1. Server Directed Model . . . . . . . . . . . . . . . . . . 127 196 9.2. Protocol Messages . . . . . . . . . . . . . . . . . . . . 128 197 9.3. Accounting Application Extension and Requirements . . . . 128 198 9.4. Fault Resilience . . . . . . . . . . . . . . . . . . . . 129 199 9.5. Accounting Records . . . . . . . . . . . . . . . . . . . 129 200 9.6. Correlation of Accounting Records . . . . . . . . . . . . 130 201 9.7. Accounting Command-Codes . . . . . . . . . . . . . . . . 131 202 9.7.1. Accounting-Request . . . . . . . . . . . . . . . . . 131 203 9.7.2. Accounting-Answer . . . . . . . . . . . . . . . . . 132 204 9.8. Accounting AVPs . . . . . . . . . . . . . . . . . . . . . 133 205 9.8.1. Accounting-Record-Type AVP . . . . . . . . . . . . . 133 206 9.8.2. Acct-Interim-Interval AVP . . . . . . . . . . . . . 134 207 9.8.3. Accounting-Record-Number AVP . . . . . . . . . . . . 135 208 9.8.4. Acct-Session-Id AVP . . . . . . . . . . . . . . . . 135 209 9.8.5. Acct-Multi-Session-Id AVP . . . . . . . . . . . . . 135 210 9.8.6. Accounting-Sub-Session-Id AVP . . . . . . . . . . . 135 211 9.8.7. Accounting-Realtime-Required AVP . . . . . . . . . . 136 212 10. AVP Occurrence Table . . . . . . . . . . . . . . . . . . . . 137 213 10.1. Base Protocol Command AVP Table . . . . . . . . . . . . . 137 214 10.2. Accounting AVP Table . . . . . . . . . . . . . . . . . . 138 215 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 140 216 11.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 140 217 11.1.1. AVP Codes . . . . . . . . . . . . . . . . . . . . . 140 218 11.1.2. AVP Flags . . . . . . . . . . . . . . . . . . . . . 141 219 11.2. Diameter Header . . . . . . . . . . . . . . . . . . . . . 141 220 11.2.1. Command Codes . . . . . . . . . . . . . . . . . . . 141 221 11.2.2. Command Flags . . . . . . . . . . . . . . . . . . . 142 222 11.3. Application Identifiers . . . . . . . . . . . . . . . . . 142 223 11.4. AVP Values . . . . . . . . . . . . . . . . . . . . . . . 142 224 11.4.1. Result-Code AVP Values . . . . . . . . . . . . . . . 143 225 11.4.2. Experimental-Result-Code AVP . . . . . . . . . . . . 143 226 11.4.3. Accounting-Record-Type AVP Values . . . . . . . . . 143 227 11.4.4. Termination-Cause AVP Values . . . . . . . . . . . . 143 228 11.4.5. Redirect-Host-Usage AVP Values . . . . . . . . . . . 143 229 11.4.6. Session-Server-Failover AVP Values . . . . . . . . . 143 230 11.4.7. Session-Binding AVP Values . . . . . . . . . . . . . 143 231 11.4.8. Disconnect-Cause AVP Values . . . . . . . . . . . . 144 232 11.4.9. Auth-Request-Type AVP Values . . . . . . . . . . . . 144 233 11.4.10. Auth-Session-State AVP Values . . . . . . . . . . . 144 234 11.4.11. Re-Auth-Request-Type AVP Values . . . . . . . . . . 144 235 11.4.12. Accounting-Realtime-Required AVP Values . . . . . . 144 236 11.4.13. Inband-Security-Id AVP (code 299) . . . . . . . . . 144 237 11.5. Diameter TCP, SCTP and TLS/TCP Port Numbers . . . . . . . 144 238 11.6. S-NAPTR Parameters . . . . . . . . . . . . . . . . . . . 144 239 12. Diameter protocol related configurable parameters . . . . . . 146 240 13. Security Considerations . . . . . . . . . . . . . . . . . . . 147 241 13.1. TLS Usage . . . . . . . . . . . . . . . . . . . . . . . . 147 242 13.2. Peer-to-Peer Considerations . . . . . . . . . . . . . . . 148 243 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 149 244 14.1. Normative References . . . . . . . . . . . . . . . . . . 149 245 14.2. Informational References . . . . . . . . . . . . . . . . 150 246 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 152 247 A.1. RFC3588bis . . . . . . . . . . . . . . . . . . . . . . . 152 248 A.2. RFC3588 . . . . . . . . . . . . . . . . . . . . . . . . . 153 249 Appendix B. S-NAPTR Example . . . . . . . . . . . . . . . . . . 154 250 Appendix C. Duplicate Detection . . . . . . . . . . . . . . . . 155 251 Appendix D. Internationalized Domain Names . . . . . . . . . . . 157 252 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 158 254 1. Introduction 256 Authentication, Authorization and Accounting (AAA) protocols such as 257 TACACS [RFC1492] and RADIUS [RFC2865] were initially deployed to 258 provide dial-up PPP [RFC1661] and terminal server access. Over time, 259 AAA support was needed on many new access technologies, the scale and 260 complexity of AAA networks grew, and AAA was also used on new 261 applications (such as voice over IP). This lead to new demands on 262 AAA protocols. 264 Network access requirements for AAA protocols are summarized in 265 [RFC2989]. These include: 267 Failover 269 [RFC2865] does not define failover mechanisms, and as a result, 270 failover behavior differs between implementations. In order to 271 provide well-defined failover behavior, Diameter supports 272 application-layer acknowledgements, and defines failover 273 algorithms and the associated state machine. This is described in 274 Section 5.5 and [RFC3539]. 276 Transmission-level security 278 [RFC2865] defines an application-layer authentication and 279 integrity scheme that is required only for use with Response 280 packets. While [RFC2869] defines an additional authentication and 281 integrity mechanism, use is only required during Extensible 282 Authentication Protocol (EAP) sessions. While attribute-hiding is 283 supported, [RFC2865] does not provide support for per-packet 284 confidentiality. In accounting, [RFC2866] assumes that replay 285 protection is provided by the backend billing server, rather than 286 within the protocol itself. 288 While [RFC3162] defines the use of IPsec with RADIUS, support for 289 IPsec is not required. In order to provide universal support for 290 transmission-level security, and enable both intra- and inter- 291 domain AAA deployments, Diameter provides support for TLS. 292 Security is discussed in Section 13. 294 Reliable transport 296 RADIUS runs over UDP, and does not define retransmission behavior; 297 as a result, reliability varies between implementations. As 298 described in [RFC2975], this is a major issue in accounting, where 299 packet loss may translate directly into revenue loss. In order to 300 provide well defined transport behavior, Diameter runs over 301 reliable transport mechanisms (TCP, SCTP) as defined in [RFC3539]. 303 Agent support 305 [RFC2865] does not provide for explicit support for agents, 306 including Proxies, Redirects and Relays. Since the expected 307 behavior is not defined, it varies between implementations. 308 Diameter defines agent behavior explicitly; this is described in 309 Section 2.8. 311 Server-initiated messages 313 While RADIUS server-initiated messages are defined in [RFC5176], 314 support is optional. This makes it difficult to implement 315 features such as unsolicited disconnect or reauthentication/ 316 reauthorization on demand across a heterogeneous deployment. To 317 tackle this issue, support for server-initiated messages is 318 mandatory in Diameter. 320 Transition support 322 While Diameter does not share a common protocol data unit (PDU) 323 with RADIUS, considerable effort has been expended in enabling 324 backward compatibility with RADIUS, so that the two protocols may 325 be deployed in the same network. Initially, it is expected that 326 Diameter will be deployed within new network devices, as well as 327 within gateways enabling communication between legacy RADIUS 328 devices and Diameter agents. This capability enables Diameter 329 support to be added to legacy networks, by addition of a gateway 330 or server speaking both RADIUS and Diameter. 332 In addition to addressing the above requirements, Diameter also 333 provides support for the following: 335 Capability negotiation 337 RADIUS does not support error messages, capability negotiation, or 338 a mandatory/non-mandatory flag for attributes. Since RADIUS 339 clients and servers are not aware of each other's capabilities, 340 they may not be able to successfully negotiate a mutually 341 acceptable service, or in some cases, even be aware of what 342 service has been implemented. Diameter includes support for error 343 handling (Section 7), capability negotiation (Section 5.3), and 344 mandatory/non-mandatory Attribute-Value Pairs (AVPs) (Section 345 4.1). 347 Peer discovery and configuration 349 RADIUS implementations typically require that the name or address 350 of servers or clients be manually configured, along with the 351 corresponding shared secrets. This results in a large 352 administrative burden, and creates the temptation to reuse the 353 RADIUS shared secret, which can result in major security 354 vulnerabilities if the Request Authenticator is not globally and 355 temporally unique as required in [RFC2865]. Through DNS, Diameter 356 enables dynamic discovery of peers (see Section 5.2). Derivation 357 of dynamic session keys is enabled via transmission-level 358 security. 360 Over time, the capabilities of Network Access Server (NAS) devices 361 have increased substantially. As a result, while Diameter is a 362 considerably more sophisticated protocol than RADIUS, it remains 363 feasible to implement it within embedded devices. 365 1.1. Diameter Protocol 367 The Diameter base protocol provides the following facilities: 369 o Ability to exchange messages and deliver AVPs 371 o Capabilities negotiation 373 o Error notification 375 o Extensibility, through addition of new applications, commands and 376 AVPs (required in [RFC2989]). 378 o Basic services necessary for applications, such as handling of 379 user sessions or accounting 381 All data delivered by the protocol is in the form of AVPs. Some of 382 these AVP values are used by the Diameter protocol itself, while 383 others deliver data associated with particular applications that 384 employ Diameter. AVPs may be arbitrarily added to Diameter messages, 385 the only restriction being that the Augmented Backus-Naur Form (ABNF, 386 [RFC5234]) Command Code syntax specification (Section 3.2) is 387 satisfied. AVPs are used by the base Diameter protocol to support 388 the following required features: 390 o Transporting of user authentication information, for the purposes 391 of enabling the Diameter server to authenticate the user. 393 o Transporting of service-specific authorization information, 394 between client and servers, allowing the peers to decide whether a 395 user's access request should be granted. 397 o Exchanging resource usage information, which may be used for 398 accounting purposes, capacity planning, etc. 400 o Routing, relaying, proxying and redirecting of Diameter messages 401 through a server hierarchy. 403 The Diameter base protocol satisfies the minimum requirements for an 404 AAA protocol, as specified by [RFC2989]. The base protocol may be 405 used by itself for accounting purposes only, or it may be used with a 406 Diameter application, such as Mobile IPv4 [RFC4004], or network 407 access [RFC4005]. It is also possible for the base protocol to be 408 extended for use in new applications, via the addition of new 409 commands or AVPs. The initial focus of Diameter was network access 410 and accounting applications. A truly generic AAA protocol used by 411 many applications might provide functionality not provided by 412 Diameter. Therefore, it is imperative that the designers of new 413 applications understand their requirements before using Diameter. 414 See Section 2.4 for more information on Diameter applications. 416 Any node can initiate a request. In that sense, Diameter is a peer- 417 to-peer protocol. In this document, a Diameter Client is a device at 418 the edge of the network that performs access control, such as a 419 Network Access Server (NAS) or a Foreign Agent (FA). A Diameter 420 client generates Diameter messages to request authentication, 421 authorization, and accounting services for the user. A Diameter 422 agent is a node that does not provide local user authentication or 423 authorization services; agents include proxies, redirects and relay 424 agents. A Diameter server performs authentication and/or 425 authorization of the user. A Diameter node may act as an agent for 426 certain requests while acting as a server for others. 428 The Diameter protocol also supports server-initiated messages, such 429 as a request to abort service to a particular user. 431 1.1.1. Description of the Document Set 433 The Diameter specification consists of an updated version of the base 434 protocol specification (this document) and the Transport Profile 435 [RFC3539]. This document obsoletes RFC 3588. A summary of the base 436 protocol updates included in this document can be found in 437 Section 1.1.3. 439 This document defines the base protocol specification for AAA, which 440 includes support for accounting. There are also a myriad of 441 applications documents describing applications that use this base 442 specification for Authentication, Authorization and Accounting. 443 These application documents specify how to use the Diameter protocol 444 within the context of their application. 446 The Transport Profile document [RFC3539] discusses transport layer 447 issues that arise with AAA protocols and recommendations on how to 448 overcome these issues. This document also defines the Diameter 449 failover algorithm and state machine. 451 1.1.2. Conventions Used in This Document 453 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 454 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 455 document are to be interpreted as described in [RFC2119]. 457 1.1.3. Changes from RFC3588 459 This document obsoletes RFC 3588 but is fully backward compatible 460 with that document. The changes introduced in this document focus on 461 fixing issues that have surfaced during implementation of [RFC3588]. 462 An overview of some the major changes are given below. 464 o Deprecated the use of Inband-Security AVP for negotiating 465 transport layer security. It has been generally considered that 466 bootstrapping of TLS via Inband-Security AVP creates certain 467 security risk because it does not completely protect the 468 information carried in the CER/CEA. This version of Diameter 469 adopted a common approach of defining a well-known secured port 470 that peers should use when communicating via TLS. This new 471 approach augments the existing Inband-Security negotiation but 472 does not completely replace it. The old method is kept for 473 backwards compatibility reasons. 475 o Deprecated the exchange of CER/CEA messages in the open state. 476 This feature was implied in the peer state machine table of 477 [RFC3588] but it was not clearly defined anywhere else in that 478 document. As work on this document progressed, it became clear 479 that the multiplicity of meaning and use of Application Id AVPs in 480 the CER/CEA messages (and the messages themselves) is seen as an 481 abuse of the Diameter extensibility rules and thus required 482 simplification. It is assumed that the capabilities exchange in 483 the open state will be re-introduced in a separate specification 484 which clearly defines new commands for this feature. 486 o Simplified Security Requirements. The use of a secured transport 487 for exchanging Diameter messages remains mandatory. However, TLS 488 has become the primary method of securing Diameter and IPsec is a 489 secondary alternative. See Section 13 for details. The support 490 for the End-to-End security framework (E2ESequence AVP and 'P'-bit 491 in the AVP header) has also been deprecated. 493 o Diameter Extensibility Changes. This includes fixes to the 494 Diameter extensibility description (Section 1.3 and others) to 495 better aid Diameter application designers; in addition, the new 496 specification relaxes the policy with respect to the allocation of 497 command codes for vendor-specific uses (see Section 11.2.1 for 498 details). 500 o Application Id Usage. Clarify the proper use of Application Id 501 information which can be found in multiple places within a 502 Diameter message. This includes correlating Application Ids found 503 in the message headers and AVPs. These changes also clearly 504 specify the proper Application Id value to use for specific base 505 protocol messages (ASR/ASA, STR/STA) as well as clarifying the 506 content and use of Vendor-Specific-Application-Id. 508 o Routing Fixes. This document more clearly specifies what 509 information (AVPs and Application Id) can be used for making 510 general routing decisions. A rule for the prioritization of 511 redirect routing criteria when multiple route entries are found 512 via redirects has also been added (See Section 6.13 for details). 514 o Simplification of Diameter Peer Discovery. The Diameter discovery 515 process now supports only widely used discovery schemes; the rest 516 have been deprecated (see Section 5.2 for details). 518 There are many other many miscellaneous fixes that have been 519 introduced in this document that may not be considered significant 520 but they are important nonetheless. Examples are removal of obsolete 521 types, fixes to command ABNFs, fixes to the state machine, 522 clarification of the election process, message validation, fixes to 523 Failed-AVP and Result-Code AVP values, etc. A comprehensive list of 524 changes is not shown here for practical reasons. 526 1.2. Terminology 528 AAA 530 Authentication, Authorization and Accounting. 532 ABNF 534 Augmented Backus-Naur Form [RFC5234]. A metalanguage with its own 535 formal syntax and rules. It is based on the Backus-Naur Form and 536 is used to define message exchanges in a bi-directional 537 communications protocol. 539 Accounting 541 The act of collecting information on resource usage for the 542 purpose of capacity planning, auditing, billing or cost 543 allocation. 545 Accounting Record 547 An accounting record represents a summary of the resource 548 consumption of a user over the entire session. Accounting servers 549 creating the accounting record may do so by processing interim 550 accounting events or accounting events from several devices 551 serving the same user. 553 Authentication 555 The act of verifying the identity of an entity (subject). 557 Authorization 559 The act of determining whether a requesting entity (subject) will 560 be allowed access to a resource (object). 562 AVP 564 The Diameter protocol consists of a header followed by one or more 565 Attribute-Value-Pairs (AVPs). An AVP includes a header and is 566 used to encapsulate protocol-specific data (e.g., routing 567 information) as well as authentication, authorization or 568 accounting information. 570 Diameter Agent 572 A Diameter Agent is a Diameter Node that provides either relay, 573 proxy, redirect or translation services. 575 Diameter Client 577 A Diameter Client is a Diameter Node that supports Diameter client 578 applications as well as the base protocol. Diameter Clients are 579 often implemented in devices situated at the edge of a network and 580 provide access control services for that network. Typical 581 examples of Diameter Clients include the Network Access Server 582 (NAS) and the Mobile IP Foreign Agent (FA). 584 Diameter Node 586 A Diameter Node is a host process that implements the Diameter 587 protocol, and acts either as a Client, Agent or Server. 589 Diameter Peer 591 If a Diameter Node shares a direct transport connection with 592 another Diameter Node, it is a Diameter Peer to that Diameter 593 Node. 595 Diameter Server 597 A Diameter Server is a Diameter Node that handles authentication, 598 authorization and accounting requests for a particular realm. By 599 its very nature, a Diameter Server must support Diameter server 600 applications in addition to the base protocol. 602 Downstream 604 Downstream is used to identify the direction of a particular 605 Diameter message from the Home Server towards the Diameter Client. 607 Home Realm 609 A Home Realm is the administrative domain with which the user 610 maintains an account relationship. 612 Home Server 614 A Diameter Server which serves the Home Realm. 616 Interim accounting 618 An interim accounting message provides a snapshot of usage during 619 a user's session. It is typically implemented in order to provide 620 for partial accounting of a user's session in the case a device 621 reboot or other network problem prevents the delivery of a session 622 summary message or session record. 624 Local Realm 626 A local realm is the administrative domain providing services to a 627 user. An administrative domain may act as a local realm for 628 certain users, while being a home realm for others. 630 Multi-session 632 A multi-session represents a logical linking of several sessions. 633 Multi-sessions are tracked by using the Acct-Multi-Session-Id. An 634 example of a multi-session would be a Multi-link PPP bundle. Each 635 leg of the bundle would be a session while the entire bundle would 636 be a multi-session. 638 Network Access Identifier 640 The Network Access Identifier, or NAI [RFC4282], is used in the 641 Diameter protocol to extract a user's identity and realm. The 642 identity is used to identify the user during authentication and/or 643 authorization, while the realm is used for message routing 644 purposes. 646 Proxy Agent or Proxy 648 In addition to forwarding requests and responses, proxies make 649 policy decisions relating to resource usage and provisioning. 650 This is typically accomplished by tracking the state of NAS 651 devices. While proxies typically do not respond to client 652 Requests prior to receiving a Response from the server, they may 653 originate Reject messages in cases where policies are violated. 654 As a result, proxies need to understand the semantics of the 655 messages passing through them, and may not support all Diameter 656 applications. 658 Realm 660 The string in the NAI that immediately follows the '@' character. 661 NAI realm names are required to be unique, and are piggybacked on 662 the administration of the DNS namespace. Diameter makes use of 663 the realm, also loosely referred to as domain, to determine 664 whether messages can be satisfied locally, or whether they must be 665 routed or redirected. In RADIUS, realm names are not necessarily 666 piggybacked on the DNS namespace but may be independent of it. 668 Real-time Accounting 670 Real-time accounting involves the processing of information on 671 resource usage within a defined time window. Time constraints are 672 typically imposed in order to limit financial risk. The Diameter 673 Credit Control Application [RFC4006] is an example of an 674 application that defines real-time accounting functionality. 676 Relay Agent or Relay 678 Relays forward requests and responses based on routing-related 679 AVPs and routing table entries. Since relays do not make policy 680 decisions, they do not examine or alter non-routing AVPs. As a 681 result, relays never originate messages, do not need to understand 682 the semantics of messages or non-routing AVPs, and are capable of 683 handling any Diameter application or message type. Since relays 684 make decisions based on information in routing AVPs and realm 685 forwarding tables they do not keep state on NAS resource usage or 686 sessions in progress. 688 Redirect Agent 690 Rather than forwarding requests and responses between clients and 691 servers, redirect agents refer clients to servers and allow them 692 to communicate directly. Since redirect agents do not sit in the 693 forwarding path, they do not alter any AVPs transiting between 694 client and server. Redirect agents do not originate messages and 695 are capable of handling any message type, although they may be 696 configured only to redirect messages of certain types, while 697 acting as relay or proxy agents for other types. As with proxy 698 agents, redirect agents do not keep state with respect to sessions 699 or NAS resources. 701 Session 703 A session is a related progression of events devoted to a 704 particular activity. Diameter application documents provide 705 guidelines as to when a session begins and ends. All Diameter 706 packets with the same Session-Id are considered to be part of the 707 same session. 709 Stateful Agent 711 A stateful agent is one that maintains session state information, 712 by keeping track of all authorized active sessions. Each 713 authorized session is bound to a particular service, and its state 714 is considered active either until it is notified otherwise, or by 715 expiration. 717 Sub-session 719 A sub-session represents a distinct service (e.g., QoS or data 720 characteristics) provided to a given session. These services may 721 happen concurrently (e.g., simultaneous voice and data transfer 722 during the same session) or serially. These changes in sessions 723 are tracked with the Accounting-Sub-Session-Id. 725 Transaction state 727 The Diameter protocol requires that agents maintain transaction 728 state, which is used for failover purposes. Transaction state 729 implies that upon forwarding a request, the Hop-by-Hop identifier 730 is saved; the field is replaced with a locally unique identifier, 731 which is restored to its original value when the corresponding 732 answer is received. The request's state is released upon receipt 733 of the answer. A stateless agent is one that only maintains 734 transaction state. 736 Translation Agent 738 A translation agent is a stateful Diameter node that performs 739 protocol translation between Diameter and another AAA protocol, 740 such as RADIUS. 742 Transport Connection 744 A transport connection is a TCP or SCTP connection existing 745 directly between two Diameter peers, otherwise known as a Peer-to- 746 Peer Connection. 748 Upstream 750 Upstream is used to identify the direction of a particular 751 Diameter message from the Diameter Client towards the Home Server. 753 User 755 The entity or device requesting or using some resource, in support 756 of which a Diameter client has generated a request. 758 1.3. Approach to Extensibility 760 The Diameter protocol is designed to be extensible, using several 761 mechanisms, including: 763 o Defining new AVP values 765 o Creating new AVPs 767 o Creating new commands 769 o Creating new applications 771 From the point of view of extensibility Diameter authentication, 772 authorization and accounting applications are treated in the same 773 way. 775 Note: Protocol designers should try to re-use existing functionality, 776 namely AVP values, AVPs, commands, and Diameter applications. Reuse 777 simplifies standardization and implementation. To avoid potential 778 interoperability issues it is important to ensure that the semantics 779 of the re-used features are well understood. Given that Diameter can 780 also carry RADIUS attributes as Diameter AVPs, such re-use 781 considerations apply also to existing RADIUS attributes that may be 782 useful in a Diameter application. 784 1.3.1. Defining New AVP Values 786 In order to allocate a new AVP value for AVPs defined in the Diameter 787 Base protocol, the IETF needs to approve a new RFC that describes the 788 AVP value. IANA considerations for these AVP values are discussed in 789 Section 11.4. 791 The allocation of AVP values for other AVPs is guided by the IANA 792 considerations of the document that defines those AVPs. Typically, 793 allocation of new values for an AVP defined in an IETF RFC should 794 require IETF Review [RFC5226], whereas values for vendor-specific 795 AVPs can be allocated by the vendor. 797 1.3.2. Creating New AVPs 799 A new AVP being defined MUST use one of the data types listed in 800 Section 4.2 or Section 4.3. If an appropriate derived data type is 801 already defined, it SHOULD be used instead of a base data type to 802 encourage reusability and good design practice. 804 In the event that a logical grouping of AVPs is necessary, and 805 multiple "groups" are possible in a given command, it is recommended 806 that a Grouped AVP be used (see Section 4.4). 808 The creation of new AVPs can happen in various ways. The recommended 809 approach is to define a new general-purpose AVP in a standards track 810 RFC approved by the IETF. However, as described in Section 11.1.1 811 there are also other mechanisms. 813 1.3.3. Creating New Commands 815 A new Command Code MUST be allocated when required AVPs (those 816 indicated as {AVP} in the ABNF definition) are added to, deleted from 817 or redefined in (for example, by changing a required AVP into an 818 optional one) an existing command. 820 Furthermore, if the transport characteristics of a command are 821 changed (for example, with respect to the number of round trips 822 required) a new Command Code MUST be registered. 824 A change to the ABNF of a command, such as described above, MUST 825 result in the definition of a new Command Code. This subsequently 826 leads to the need to define a new Diameter Application for any 827 application that will use that new Command. 829 The IANA considerations for commands are discussed in Section 11.2.1. 831 1.3.4. Creating New Diameter Applications 833 Every Diameter application specification MUST have an IANA assigned 834 Application Id (see Section 2.4 and Section 11.3). The managed 835 Application Id space is flat and there is no relationship between 836 different Diameter applications with respect to their Application 837 Ids. As such, there is no versioning support provided by these 838 application Ids itself; every Diameter application is a standalone 839 application. If the application has a relationship with other 840 Diameter applications, such a relationship is not known to Diameter. 842 Before describing the rules for creating new Diameter applications it 843 is important to discuss the semantics of the AVPs occurrences as 844 stated in the ABNF and the M-bit flag (Section 4.1) for an AVP. 845 There is no relationship imposed between the two; they are set 846 independently. 848 o The ABNF indicates what AVPs are placed into a Diameter Command by 849 the sender of that Command. Often, since there are multiple modes 850 of protocol interactions many of the AVPs are indicated as 851 optional. 853 o The M-bit allows the sender to indicate to the receiver whether or 854 not understanding the semantics of an AVP and its content is 855 mandatory. If the M-bit is set by the sender and the receiver 856 does not understand the AVP or the values carried within that AVP 857 then a failure is generated (see Section 7). 859 It is the decision of the protocol designer when to develop a new 860 Diameter application rather than extending Diameter in other ways. 861 However, a new Diameter application MUST be created when one or more 862 of the following criteria are met: 864 M-bit Setting 866 An AVP with the M-bit in the MUST column of the AVP flag table is 867 added to an existing Command/Application. 869 An AVP with the M-bit in the MAY column of the AVP flag table is 870 added to an existing Command/Application. 872 Note: The M-bit setting for a given AVP is relevant to an 873 Application and each command within that application which 874 includes the AVP. That is, if an AVP appears in two commands for 875 application Foo and the M-bit settings are different in each 876 command, then there should be two AVP flag tables describing when 877 to set the M-bit. 879 Commands 881 A new command is used within the existing application either 882 because an additional command is added, an existing command has 883 been modified so that a new Command Code had to be registered, or 884 a command has been deleted. 886 If the ABNF definition of a command allows it, an implementation may 887 add arbitrary optional AVPs with the M-bit cleared (including vendor- 888 specific AVPs) to that command without needing to define a new 889 application. Please refer to Section 11.1.1 for details. 891 2. Protocol Overview 893 The base Diameter protocol concerns itself with establishing 894 connections to peers, capabilities negotiation, how messages are sent 895 and routed through peers, and how the connections are eventually torn 896 down. The base protocol also defines certain rules that apply to all 897 message exchanges between Diameter nodes. 899 Communication between Diameter peers begins with one peer sending a 900 message to another Diameter peer. The set of AVPs included in the 901 message is determined by a particular Diameter application. One AVP 902 that is included to reference a user's session is the Session-Id. 904 The initial request for authentication and/or authorization of a user 905 would include the Session-Id AVP. The Session-Id is then used in all 906 subsequent messages to identify the user's session (see Section 8 for 907 more information). The communicating party may accept the request, 908 or reject it by returning an answer message with the Result-Code AVP 909 set to indicate an error occurred. The specific behavior of the 910 Diameter server or client receiving a request depends on the Diameter 911 application employed. 913 Session state (associated with a Session-Id) MUST be freed upon 914 receipt of the Session-Termination-Request, Session-Termination- 915 Answer, expiration of authorized service time in the Session-Timeout 916 AVP, and according to rules established in a particular Diameter 917 application. 919 The base Diameter protocol may be used by itself for accounting 920 applications. For authentication and authorization, it is always 921 extended for a particular application. 923 Diameter Clients MUST support the base protocol, which includes 924 accounting. In addition, they MUST fully support each Diameter 925 application that is needed to implement the client's service, e.g., 926 NASREQ and/or Mobile IPv4. A Diameter Client MUST be referred to as 927 "Diameter X Client" where X is the application which it supports, and 928 not a "Diameter Client". 930 Diameter Servers MUST support the base protocol, which includes 931 accounting. In addition, they MUST fully support each Diameter 932 application that is needed to implement the intended service, e.g., 933 NASREQ and/or Mobile IPv4. A Diameter Server MUST be referred to as 934 "Diameter X Server" where X is the application which it supports, and 935 not a "Diameter Server". 937 Diameter Relays and redirect agents are transparent to the Diameter 938 applications but they MUST support the Diameter base protocol, which 939 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 MUST be referred to as 945 "Diameter X Proxy" where X is the application which it supports, and 946 not a "Diameter Proxy". 948 2.1. Transport 950 The Diameter Transport profile is defined in [RFC3539]. 952 The base Diameter protocol is run on port 3868 for both TCP [RFC793] 953 and SCTP [RFC4960]. For TLS [RFC5246], a Diameter node that initiate 954 a TLS connection prior to any message exchanges MUST run on port 955 [TBD]. It is assumed that TLS is run on top of TCP when it is used. 956 The remainder of this document uses the term TLS to abbreviate the 957 use of TLS over TCP. 959 If the Diameter peer does not support receiving TLS connections on 960 port [TBD], i.e. the peer complies only with [RFC3588], then the 961 initiator MAY revert to using TCP or SCTP and on port 3868. Note 962 that this scheme is kept for the purpose of backwards compatibility 963 only and that there are inherent security vulnerabilities when the 964 initial CER/CEA messages are sent un-protected (see Section 5.6). 966 Diameter clients MUST support either TCP or SCTP, while agents and 967 servers SHOULD support both. 969 A Diameter node MAY initiate connections from a source port other 970 than the one that it declares it accepts incoming connections on, and 971 MUST be prepared to receive connections on port 3868 for TCP or SCTP 972 and port [TBD] for TLS connections. A given Diameter instance of the 973 peer state machine MUST NOT use more than one transport connection to 974 communicate with a given peer, unless multiple instances exist on the 975 peer in which case a separate connection per process is allowed. 977 When no transport connection exists with a peer, an attempt to 978 connect SHOULD be periodically made. This behavior is handled via 979 the Tc timer (see Section 12 for details), whose recommended value is 980 30 seconds. There are certain exceptions to this rule, such as when 981 a peer has terminated the transport connection stating that it does 982 not wish to communicate. 984 When connecting to a peer and either zero or more transports are 985 specified, TLS SHOULD be tried first, followed by TCP, then by SCTP. 986 See Section 5.2 for more information on peer discovery. 988 Diameter implementations SHOULD be able to interpret ICMP protocol 989 port unreachable messages as explicit indications that the server is 990 not reachable, subject to security policy on trusting such messages. 991 Further guidance regarding the treatment of ICMP errors can be found 992 in [RFC5927] and [RFC5461]. Diameter implementations SHOULD also be 993 able to interpret a reset from the transport and timed-out connection 994 attempts. If Diameter receives data from the lower layer that cannot 995 be parsed or identified as a Diameter error made by the peer, the 996 stream is compromised and cannot be recovered. The transport 997 connection MUST be closed using a RESET call (send a TCP RST bit) or 998 an SCTP ABORT message (graceful closure is compromised). 1000 2.1.1. SCTP Guidelines 1002 The following are guidelines for Diameter implementations that 1003 support SCTP: 1005 1. For interoperability: All Diameter nodes MUST be prepared to 1006 receive Diameter messages on any SCTP stream in the association. 1007 These messages can be out-of-order and belong to different 1008 Diameter sessions. 1010 2. To prevent blocking: All Diameter nodes SHOULD utilize all SCTP 1011 streams available to the association to prevent head-of-the-line 1012 blocking. 1014 2.2. Securing Diameter Messages 1016 Connections between Diameter peers SHOULD be protected by TLS. All 1017 Diameter base protocol implementations MUST support the use of TLS. 1018 If desired, alternative security mechanisms that are independent of 1019 Diameter, such as IPsec [RFC4301], can be deployed to secure 1020 connections between peers. The Diameter protocol MUST NOT be used 1021 without any security mechanism. 1023 2.3. Diameter Application Compliance 1025 Application Ids are advertised during the capabilities exchange phase 1026 (see Section 5.3). Advertising support of an application implies 1027 that the sender supports the functionality specified in the 1028 respective Diameter application specification. 1030 Implementations MAY add arbitrary optional AVPs with the M-bit 1031 cleared (including vendor-specific AVPs) to a command defined in an 1032 application, but only if the command's ABNF syntax specification 1033 allows for it. Please refer to Section 11.1.1 for details. 1035 2.4. Application Identifiers 1037 Each Diameter application MUST have an IANA assigned Application Id 1038 (see Section 11.3). The base protocol does not require an 1039 Application Id since its support is mandatory. During the 1040 capabilities exchange, Diameter nodes inform their peers of locally 1041 supported applications. Furthermore, all Diameter messages contain 1042 an Application Id, which is used in the message forwarding process. 1044 The following Application Id values are defined: 1046 Diameter Common Messages 0 1047 Diameter Base Accounting 3 1048 Relay 0xffffffff 1050 Relay and redirect agents MUST advertise the Relay Application 1051 Identifier, while all other Diameter nodes MUST advertise locally 1052 supported applications. The receiver of a Capabilities Exchange 1053 message advertising Relay service MUST assume that the sender 1054 supports all current and future applications. 1056 Diameter relay and proxy agents are responsible for finding an 1057 upstream server that supports the application of a particular 1058 message. If none can be found, an error message is returned with the 1059 Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1061 2.5. Connections vs. Sessions 1063 This section attempts to provide the reader with an understanding of 1064 the difference between connection and session, which are terms used 1065 extensively throughout this document. 1067 A connection refers to a transport level connection between two peers 1068 that is used to send and receive Diameter messages. A session is a 1069 logical concept at the application layer existing between the 1070 Diameter client and the Diameter server; it is identified via the 1071 Session-Id AVP. 1073 +--------+ +-------+ +--------+ 1074 | Client | | Relay | | Server | 1075 +--------+ +-------+ +--------+ 1076 <----------> <----------> 1077 peer connection A peer connection B 1079 <-----------------------------> 1080 User session x 1082 Figure 1: Diameter connections and sessions 1084 In the example provided in Figure 1, peer connection A is established 1085 between the Client and the Relay. Peer connection B is established 1086 between the Relay and the Server. User session X spans from the 1087 Client via the Relay to the Server. Each "user" of a service causes 1088 an auth request to be sent, with a unique session identifier. Once 1089 accepted by the server, both the client and the server are aware of 1090 the session. 1092 It is important to note that there is no relationship between a 1093 connection and a session, and that Diameter messages for multiple 1094 sessions are all multiplexed through a single connection. Also note 1095 that Diameter messages pertaining to the session, both application 1096 specific and those that are defined in this document such as ASR/ASA, 1097 RAR/RAA and STR/STA MUST carry the Application Id of the application. 1098 Diameter messages pertaining to peer connection establishment and 1099 maintenance such as CER/CEA, DWR/DWA and DPR/DPA MUST carry an 1100 Application Id of zero (0). 1102 2.6. Peer Table 1104 The Diameter Peer Table is used in message forwarding, and referenced 1105 by the Routing Table. A Peer Table entry contains the following 1106 fields: 1108 Host identity 1110 Following the conventions described for the DiameterIdentity 1111 derived AVP data format in Section 4.3. This field contains the 1112 contents of the Origin-Host (Section 6.3) AVP found in the CER or 1113 CEA message. 1115 StatusT 1117 This is the state of the peer entry, and MUST match one of the 1118 values listed in Section 5.6. 1120 Static or Dynamic 1122 Specifies whether a peer entry was statically configured or 1123 dynamically discovered. 1125 Expiration time 1127 Specifies the time at which dynamically discovered peer table 1128 entries are to be either refreshed, or expired. 1130 TLS Enabled 1132 Specifies whether TLS is to be used when communicating with the 1133 peer. 1135 Additional security information, when needed (e.g., keys, 1136 certificates) 1138 2.7. Routing Table 1140 All Realm-Based routing lookups are performed against what is 1141 commonly known as the Routing Table (see Section 12). A Routing 1142 Table Entry contains the following fields: 1144 Realm Name 1146 This is the field that is MUST be used as a primary key in the 1147 routing table lookups. Note that some implementations perform 1148 their lookups based on longest-match-from-the-right on the realm 1149 rather than requiring an exact match. 1151 Application Identifier 1153 An application is identified by an Application Id. A route entry 1154 can have a different destination based on the Application Id in 1155 the message header. This field MUST be used as a secondary key 1156 field in routing table lookups. 1158 Local Action 1160 The Local Action field is used to identify how a message should be 1161 treated. The following actions are supported: 1163 1. LOCAL - Diameter messages that can be satisfied locally, and 1164 do not need to be routed to another Diameter entity. 1166 2. RELAY - All Diameter messages that fall within this category 1167 MUST be routed to a next hop Diameter entity that is indicated 1168 by the identifier described below. Routing is done without 1169 modifying any non-routing AVPs. See Section 6.1.9 for 1170 relaying guidelines 1172 3. PROXY - All Diameter messages that fall within this category 1173 MUST be routed to a next Diameter entity that is indicated by 1174 the identifier described below. The local server MAY apply 1175 its local policies to the message by including new AVPs to the 1176 message prior to routing. See Section 6.1.9 for proxying 1177 guidelines. 1179 4. REDIRECT - Diameter messages that fall within this category 1180 MUST have the identity of the home Diameter server(s) 1181 appended, and returned to the sender of the message. See 1182 Section 6.1.8 for redirect guidelines. 1184 Server Identifier 1186 One or more servers to which the message is to be routed. These 1187 servers MUST also be present in the Peer table. When the Local 1188 Action is set to RELAY or PROXY, this field contains the identity 1189 of the server(s) the message MUST be routed to. When the Local 1190 Action field is set to REDIRECT, this field contains the identity 1191 of one or more servers the message MUST be redirected to. 1193 Static or Dynamic 1195 Specifies whether a route entry was statically configured or 1196 dynamically discovered. 1198 Expiration time 1200 Specifies the time at which a dynamically discovered route table 1201 entry expires. 1203 It is important to note that Diameter agents MUST support at least 1204 one of the LOCAL, RELAY, PROXY or REDIRECT modes of operation. 1205 Agents do not need to support all modes of operation in order to 1206 conform with the protocol specification, but MUST follow the protocol 1207 compliance guidelines in Section 2. Relay agents and proxies MUST 1208 NOT reorder AVPs. 1210 The routing table MAY include a default entry that MUST be used for 1211 any requests not matching any of the other entries. The routing 1212 table MAY consist of only such an entry. 1214 When a request is routed, the target server MUST have advertised the 1215 Application Id (see Section 2.4) for the given message, or have 1216 advertised itself as a relay or proxy agent. Otherwise, an error is 1217 returned with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1219 2.8. Role of Diameter Agents 1221 In addition to clients and servers, the Diameter protocol introduces 1222 relay, proxy, redirect, and translation agents, each of which is 1223 defined in Section 1.3. These Diameter agents are useful for several 1224 reasons: 1226 o They can distribute administration of systems to a configurable 1227 grouping, including the maintenance of security associations. 1229 o They can be used for concentration of requests from an number of 1230 co-located or distributed NAS equipment sets to a set of like user 1231 groups. 1233 o They can do value-added processing to the requests or responses. 1235 o They can be used for load balancing. 1237 o A complex network will have multiple authentication sources, they 1238 can sort requests and forward towards the correct target. 1240 The Diameter protocol requires that agents maintain transaction 1241 state, which is used for failover purposes. Transaction state 1242 implies that upon forwarding a request, its Hop-by-Hop identifier is 1243 saved; the field is replaced with a locally unique identifier, which 1244 is restored to its original value when the corresponding answer is 1245 received. The request's state is released upon receipt of the 1246 answer. A stateless agent is one that only maintains transaction 1247 state. 1249 The Proxy-Info AVP allows stateless agents to add local state to a 1250 Diameter request, with the guarantee that the same state will be 1251 present in the answer. However, the protocol's failover procedures 1252 require that agents maintain a copy of pending requests. 1254 A stateful agent is one that maintains session state information by 1255 keeping track of all authorized active sessions. Each authorized 1256 session is bound to a particular service, and its state is considered 1257 active either until the agent is notified otherwise, or the session 1258 expires. Each authorized session has an expiration, which is 1259 communicated by Diameter servers via the Session-Timeout AVP. 1261 Maintaining session state may be useful in certain applications, such 1262 as: 1264 o Protocol translation (e.g., RADIUS <-> Diameter) 1266 o Limiting resources authorized to a particular user 1268 o Per user or transaction auditing 1270 A Diameter agent MAY act in a stateful manner for some requests and 1271 be stateless for others. A Diameter implementation MAY act as one 1272 type of agent for some requests, and as another type of agent for 1273 others. 1275 2.8.1. Relay Agents 1277 Relay Agents are Diameter agents that accept requests and route 1278 messages to other Diameter nodes based on information found in the 1279 messages (e.g., Destination-Realm). This routing decision is 1280 performed using a list of supported realms, and known peers. This is 1281 known as the Routing Table, as is defined further in Section 2.7. 1283 Relays may, for example, be used to aggregate requests from multiple 1284 Network Access Servers (NASes) within a common geographical area 1285 (POP). The use of Relays is advantageous since it eliminates the 1286 need for NASes to be configured with the necessary security 1287 information they would otherwise require to communicate with Diameter 1288 servers in other realms. Likewise, this reduces the configuration 1289 load on Diameter servers that would otherwise be necessary when NASes 1290 are added, changed or deleted. 1292 Relays modify Diameter messages by inserting and removing routing 1293 information, but do not modify any other portion of a message. 1294 Relays SHOULD NOT maintain session state but MUST maintain 1295 transaction state. 1297 +------+ ---------> +------+ ---------> +------+ 1298 | | 1. Request | | 2. Request | | 1299 | NAS | | DRL | | HMS | 1300 | | 4. Answer | | 3. Answer | | 1301 +------+ <--------- +------+ <--------- +------+ 1302 example.net example.net example.com 1304 Figure 2: Relaying of Diameter messages 1306 The example provided in Figure 2 depicts a request issued from NAS, 1307 which is an access device, for the user bob@example.com. Prior to 1308 issuing the request, NAS performs a Diameter route lookup, using 1309 "example.com" as the key, and determines that the message is to be 1310 relayed to DRL, which is a Diameter Relay. DRL performs the same 1311 route lookup as NAS, and relays the message to HMS, which is 1312 example.com's Home Diameter Server. HMS identifies that the request 1313 can be locally supported (via the realm), processes the 1314 authentication and/or authorization request, and replies with an 1315 answer, which is routed back to NAS using saved transaction state. 1317 Since Relays do not perform any application level processing, they 1318 provide relaying services for all Diameter applications, and 1319 therefore MUST advertise the Relay Application Id. 1321 2.8.2. Proxy Agents 1323 Similarly to relays, proxy agents route Diameter messages using the 1324 Diameter Routing Table. However, they differ since they modify 1325 messages to implement policy enforcement. This requires that proxies 1326 maintain the state of their downstream peers (e.g., access devices) 1327 to enforce resource usage, provide admission control, and 1328 provisioning. 1330 Proxies may, for example, be used in call control centers or access 1331 ISPs that provide outsourced connections, they can monitor the number 1332 and types of ports in use, and make allocation and admission 1333 decisions according to their configuration. 1335 Since enforcing policies requires an understanding of the service 1336 being provided, Proxies MUST only advertise the Diameter applications 1337 they support. 1339 2.8.3. Redirect Agents 1341 Redirect agents are useful in scenarios where the Diameter routing 1342 configuration needs to be centralized. An example is a redirect 1343 agent that provides services to all members of a consortium, but does 1344 not wish to be burdened with relaying all messages between realms. 1345 This scenario is advantageous since it does not require that the 1346 consortium provide routing updates to its members when changes are 1347 made to a member's infrastructure. 1349 Since redirect agents do not relay messages, and only return an 1350 answer with the information necessary for Diameter agents to 1351 communicate directly, they do not modify messages. Since redirect 1352 agents do not receive answer messages, they cannot maintain session 1353 state. 1355 The example provided in Figure 3 depicts a request issued from the 1356 access device, NAS, for the user bob@example.com. The message is 1357 forwarded by the NAS to its relay, DRL, which does not have a routing 1358 entry in its Diameter Routing Table for example.com. DRL has a 1359 default route configured to DRD, which is a redirect agent that 1360 returns a redirect notification to DRL, as well as HMS' contact 1361 information. Upon receipt of the redirect notification, DRL 1362 establishes a transport connection with HMS, if one doesn't already 1363 exist, and forwards the request to it. 1365 +------+ 1366 | | 1367 | DRD | 1368 | | 1369 +------+ 1370 ^ | 1371 2. Request | | 3. Redirection 1372 | | Notification 1373 | v 1374 +------+ ---------> +------+ ---------> +------+ 1375 | | 1. Request | | 4. Request | | 1376 | NAS | | DRL | | HMS | 1377 | | 6. Answer | | 5. Answer | | 1378 +------+ <--------- +------+ <--------- +------+ 1379 example.net example.net example.com 1381 Figure 3: Redirecting a Diameter Message 1383 Since redirect agents do not perform any application level 1384 processing, they provide relaying services for all Diameter 1385 applications, and therefore MUST advertise the Relay Application 1386 Identifier. 1388 2.8.4. Translation Agents 1390 A translation agent is a device that provides translation between two 1391 protocols (e.g., RADIUS<->Diameter, TACACS+<->Diameter). Translation 1392 agents are likely to be used as aggregation servers to communicate 1393 with a Diameter infrastructure, while allowing for the embedded 1394 systems to be migrated at a slower pace. 1396 Given that the Diameter protocol introduces the concept of long-lived 1397 authorized sessions, translation agents MUST be session stateful and 1398 MUST maintain transaction state. 1400 Translation of messages can only occur if the agent recognizes the 1401 application of a particular request, and therefore translation agents 1402 MUST only advertise their locally supported applications. 1404 +------+ ---------> +------+ ---------> +------+ 1405 | | RADIUS Request | | Diameter Request | | 1406 | NAS | | TLA | | HMS | 1407 | | RADIUS Answer | | Diameter Answer | | 1408 +------+ <--------- +------+ <--------- +------+ 1409 example.net example.net example.com 1411 Figure 4: Translation of RADIUS to Diameter 1413 2.9. Diameter Path Authorization 1415 As noted in Section 2.2, Diameter provides transmission level 1416 security for each connection using TLS. Therefore, each connection 1417 can be authenticated, replay and integrity protected. 1419 In addition to authenticating each connection, each connection as 1420 well as the entire session MUST also be authorized. Before 1421 initiating a connection, a Diameter Peer MUST check that its peers 1422 are authorized to act in their roles. For example, a Diameter peer 1423 may be authentic, but that does not mean that it is authorized to act 1424 as a Diameter Server advertising a set of Diameter applications. 1426 Prior to bringing up a connection, authorization checks are performed 1427 at each connection along the path. Diameter capabilities negotiation 1428 (CER/CEA) also MUST be carried out, in order to determine what 1429 Diameter applications are supported by each peer. Diameter sessions 1430 MUST be routed only through authorized nodes that have advertised 1431 support for the Diameter application required by the session. 1433 As noted in Section 6.1.9, a relay or proxy agent MUST append a 1434 Route-Record AVP to all requests forwarded. The AVP contains the 1435 identity of the peer the request was received from. 1437 The home Diameter server, prior to authorizing a session, MUST check 1438 the Route-Record AVPs to make sure that the route traversed by the 1439 request is acceptable. For example, administrators within the home 1440 realm may not wish to honor requests that have been routed through an 1441 untrusted realm. By authorizing a request, the home Diameter server 1442 is implicitly indicating its willingness to engage in the business 1443 transaction as specified by the contractual relationship between the 1444 server and the previous hop. A DIAMETER_AUTHORIZATION_REJECTED error 1445 message (see Section 7.1.5) is sent if the route traversed by the 1446 request is unacceptable. 1448 A home realm may also wish to check that each accounting request 1449 message corresponds to a Diameter response authorizing the session. 1450 Accounting requests without corresponding authorization responses 1451 SHOULD be subjected to further scrutiny, as should accounting 1452 requests indicating a difference between the requested and provided 1453 service. 1455 Forwarding of an authorization response is considered evidence of a 1456 willingness to take on financial risk relative to the session. A 1457 local realm may wish to limit this exposure, for example, by 1458 establishing credit limits for intermediate realms and refusing to 1459 accept responses which would violate those limits. By issuing an 1460 accounting request corresponding to the authorization response, the 1461 local realm implicitly indicates its agreement to provide the service 1462 indicated in the authorization response. If the service cannot be 1463 provided by the local realm, then a DIAMETER_UNABLE_TO_COMPLY error 1464 message MUST be sent within the accounting request; a Diameter client 1465 receiving an authorization response for a service that it cannot 1466 perform MUST NOT substitute an alternate service, and then send 1467 accounting requests for the alternate service instead. 1469 3. Diameter Header 1471 A summary of the Diameter header format is shown below. The fields 1472 are transmitted in network byte order. 1474 0 1 2 3 1475 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 1476 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1477 | Version | Message Length | 1478 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1479 | command flags | Command-Code | 1480 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1481 | Application-ID | 1482 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1483 | Hop-by-Hop Identifier | 1484 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1485 | End-to-End Identifier | 1486 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1487 | AVPs ... 1488 +-+-+-+-+-+-+-+-+-+-+-+-+- 1490 Version 1492 This Version field MUST be set to 1 to indicate Diameter Version 1493 1. 1495 Message Length 1497 The Message Length field is three octets and indicates the length 1498 of the Diameter message including the header fields and the padded 1499 AVPs. Thus the message length field is always a multiple of 4. 1501 Command Flags 1503 The Command Flags field is eight bits. The following bits are 1504 assigned: 1506 0 1 2 3 4 5 6 7 1507 +-+-+-+-+-+-+-+-+ 1508 |R P E T r r r r| 1509 +-+-+-+-+-+-+-+-+ 1511 R(equest) 1513 If set, the message is a request. If cleared, the message is 1514 an answer. 1516 P(roxiable) 1518 If set, the message MAY be proxied, relayed or redirected. If 1519 cleared, the message MUST be locally processed. 1521 E(rror) 1523 If set, the message contains a protocol error, and the message 1524 will not conform to the ABNF described for this command. 1525 Messages with the 'E' bit set are commonly referred to as error 1526 messages. This bit MUST NOT be set in request messages. See 1527 Section 7.2. 1529 T(Potentially re-transmitted message) 1531 This flag is set after a link failover procedure, to aid the 1532 removal of duplicate requests. It is set when resending 1533 requests not yet acknowledged, as an indication of a possible 1534 duplicate due to a link failure. This bit MUST be cleared when 1535 sending a request for the first time, otherwise the sender MUST 1536 set this flag. Diameter agents only need to be concerned about 1537 the number of requests they send based on a single received 1538 request; retransmissions by other entities need not be tracked. 1539 Diameter agents that receive a request with the T flag set, 1540 MUST keep the T flag set in the forwarded request. This flag 1541 MUST NOT be set if an error answer message (e.g., a protocol 1542 error) has been received for the earlier message. It can be 1543 set only in cases where no answer has been received from the 1544 server for a request and the request is sent again. This flag 1545 MUST NOT be set in answer messages. 1547 r(eserved) 1549 These flag bits are reserved for future use, and MUST be set to 1550 zero, and ignored by the receiver. 1552 Command-Code 1554 The Command-Code field is three octets, and is used in order to 1555 communicate the command associated with the message. The 24-bit 1556 address space is managed by IANA (see Section 11.2.1). 1558 Command-Code values 16,777,214 and 16,777,215 (hexadecimal values 1559 FFFFFE -FFFFFF) are reserved for experimental use (See Section 1560 11.3). 1562 Application-ID 1564 Application-ID is four octets and is used to identify to which 1565 application the message is applicable for. The application can be 1566 an authentication application, an accounting application or a 1567 vendor specific application. See Section 11.3 for the possible 1568 values that the application-id may use. 1570 The value of the application-id field in the header MUST be the 1571 same as any relevant application-id AVPs contained in the message. 1573 Hop-by-Hop Identifier 1575 The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in 1576 network byte order) and aids in matching requests and replies. 1577 The sender MUST ensure that the Hop-by-Hop identifier in a request 1578 is unique on a given connection at any given time, and MAY attempt 1579 to ensure that the number is unique across reboots. The sender of 1580 an Answer message MUST ensure that the Hop-by-Hop Identifier field 1581 contains the same value that was found in the corresponding 1582 request. The Hop-by-Hop identifier is normally a monotonically 1583 increasing number, whose start value was randomly generated. An 1584 answer message that is received with an unknown Hop-by-Hop 1585 Identifier MUST be discarded. 1587 End-to-End Identifier 1589 The End-to-End Identifier is an unsigned 32-bit integer field (in 1590 network byte order) and is used to detect duplicate messages. 1591 Upon reboot implementations MAY set the high order 12 bits to 1592 contain the low order 12 bits of current time, and the low order 1593 20 bits to a random value. Senders of request messages MUST 1594 insert a unique identifier on each message. The identifier MUST 1595 remain locally unique for a period of at least 4 minutes, even 1596 across reboots. The originator of an Answer message MUST ensure 1597 that the End-to-End Identifier field contains the same value that 1598 was found in the corresponding request. The End-to-End Identifier 1599 MUST NOT be modified by Diameter agents of any kind. The 1600 combination of the Origin-Host (see Section 6.3) and this field is 1601 used to detect duplicates. Duplicate requests SHOULD cause the 1602 same answer to be transmitted (modulo the hop-by-hop Identifier 1603 field and any routing AVPs that may be present), and MUST NOT 1604 affect any state that was set when the original request was 1605 processed. Duplicate answer messages that are to be locally 1606 consumed (see Section 6.2) SHOULD be silently discarded. 1608 AVPs 1610 AVPs are a method of encapsulating information relevant to the 1611 Diameter message. See Section 4 for more information on AVPs. 1613 3.1. Command Codes 1615 Each command Request/Answer pair is assigned a command code, and the 1616 sub-type (i.e., request or answer) is identified via the 'R' bit in 1617 the Command Flags field of the Diameter header. 1619 Every Diameter message MUST contain a command code in its header's 1620 Command-Code field, which is used to determine the action that is to 1621 be taken for a particular message. The following Command Codes are 1622 defined in the Diameter base protocol: 1624 Command-Name Abbrev. Code Reference 1625 -------------------------------------------------------- 1626 Abort-Session-Request ASR 274 8.5.1 1627 Abort-Session-Answer ASA 274 8.5.2 1628 Accounting-Request ACR 271 9.7.1 1629 Accounting-Answer ACA 271 9.7.2 1630 Capabilities-Exchange- CER 257 5.3.1 1631 Request 1632 Capabilities-Exchange- CEA 257 5.3.2 1633 Answer 1634 Device-Watchdog-Request DWR 280 5.5.1 1635 Device-Watchdog-Answer DWA 280 5.5.2 1636 Disconnect-Peer-Request DPR 282 5.4.1 1637 Disconnect-Peer-Answer DPA 282 5.4.2 1638 Re-Auth-Request RAR 258 8.3.1 1639 Re-Auth-Answer RAA 258 8.3.2 1640 Session-Termination- STR 275 8.4.1 1641 Request 1642 Session-Termination- STA 275 8.4.2 1643 Answer 1645 3.2. Command Code ABNF specification 1647 Every Command Code defined MUST include a corresponding ABNF 1648 specification, which is used to define the AVPs that MUST or MAY be 1649 present when sending the message. The following format is used in 1650 the definition: 1652 command-def = "::=" diameter-message 1654 command-name = diameter-name 1655 diameter-name = ALPHA *(ALPHA / DIGIT / "-") 1657 diameter-message = header [ *fixed] [ *required] [ *optional] 1659 header = "<" "Diameter Header:" command-id 1660 [r-bit] [p-bit] [e-bit] [application-id] ">" 1662 application-id = 1*DIGIT 1664 command-id = 1*DIGIT 1665 ; The Command Code assigned to the command 1667 r-bit = ", REQ" 1668 ; If present, the 'R' bit in the Command 1669 ; Flags is set, indicating that the message 1670 ; is a request, as opposed to an answer. 1672 p-bit = ", PXY" 1673 ; If present, the 'P' bit in the Command 1674 ; Flags is set, indicating that the message 1675 ; is proxiable. 1677 e-bit = ", ERR" 1678 ; If present, the 'E' bit in the Command 1679 ; Flags is set, indicating that the answer 1680 ; message contains a Result-Code AVP in 1681 ; the "protocol error" class. 1683 fixed = [qual] "<" avp-spec ">" 1684 ; Defines the fixed position of an AVP 1686 required = [qual] "{" avp-spec "}" 1687 ; The AVP MUST be present and can appear 1688 ; anywhere in the message. 1690 optional = [qual] "[" avp-name "]" 1691 ; The avp-name in the 'optional' rule cannot 1692 ; evaluate to any AVP Name which is included 1693 ; in a fixed or required rule. The AVP can 1694 ; appear anywhere in the message. 1695 ; 1696 ; NOTE: "[" and "]" have a slightly different 1697 ; meaning than in ABNF (RFC 5234]). These braces 1698 ; cannot be used to express optional fixed rules 1699 ; (such as an optional ICV at the end). To do this, 1700 ; the convention is '0*1fixed'. 1702 qual = [min] "*" [max] 1703 ; See ABNF conventions, RFC 5234 Section 4. 1704 ; The absence of any qualifiers depends on 1705 ; whether it precedes a fixed, required, or 1706 ; optional rule. If a fixed or required rule has 1707 ; no qualifier, then exactly one such AVP MUST 1708 ; be present. If an optional rule has no 1709 ; qualifier, then 0 or 1 such AVP may be 1710 ; present. If an optional rule has a qualifier, 1711 ; then the value of min MUST be 0 if present. 1713 min = 1*DIGIT 1714 ; The minimum number of times the element may 1715 ; be present. If absent, the default value is zero 1716 ; for fixed and optional rules and one for required 1717 ; rules. The value MUST be at least one for for 1718 ; required rules. 1720 max = 1*DIGIT 1721 ; The maximum number of times the element may 1722 ; be present. If absent, the default value is 1723 ; infinity. A value of zero implies the AVP MUST 1724 ; NOT be present. 1726 avp-spec = diameter-name 1727 ; The avp-spec has to be an AVP Name, defined 1728 ; in the base or extended Diameter 1729 ; specifications. 1731 avp-name = avp-spec / "AVP" 1732 ; The string "AVP" stands for *any* arbitrary AVP 1733 ; Name, not otherwise listed in that command code 1734 ; definition. Addition this AVP is recommended for 1735 ; all command ABNFs to allow for extensibility. 1737 The following is a definition of a fictitious command code: 1739 Example-Request ::= < Diameter Header: 9999999, REQ, PXY > 1740 { User-Name } 1741 * { Origin-Host } 1742 * [ AVP ] 1744 3.3. Diameter Command Naming Conventions 1746 Diameter command names typically includes one or more English words 1747 followed by the verb Request or Answer. Each English word is 1748 delimited by a hyphen. A three-letter acronym for both the request 1749 and answer is also normally provided. 1751 An example is a message set used to terminate a session. The command 1752 name is Session-Terminate-Request and Session-Terminate-Answer, while 1753 the acronyms are STR and STA, respectively. 1755 Both the request and the answer for a given command share the same 1756 command code. The request is identified by the R(equest) bit in the 1757 Diameter header set to one (1), to ask that a particular action be 1758 performed, such as authorizing a user or terminating a session. Once 1759 the receiver has completed the request it issues the corresponding 1760 answer, which includes a result code that communicates one of the 1761 following: 1763 o The request was successful 1765 o The request failed 1767 o An additional request has to be sent to provide information the 1768 peer requires prior to returning a successful or failed answer. 1770 o The receiver could not process the request, but provides 1771 information about a Diameter peer that is able to satisfy the 1772 request, known as redirect. 1774 Additional information, encoded within AVPs, may also be included in 1775 answer messages. 1777 4. Diameter AVPs 1779 Diameter AVPs carry specific authentication, accounting, 1780 authorization and routing information as well as configuration 1781 details for the request and reply. 1783 Each AVP of type OctetString MUST be padded to align on a 32-bit 1784 boundary, while other AVP types align naturally. A number of zero- 1785 valued bytes are added to the end of the AVP Data field till a word 1786 boundary is reached. The length of the padding is not reflected in 1787 the AVP Length field. 1789 4.1. AVP Header 1791 The fields in the AVP header MUST be sent in network byte order. The 1792 format of the header is: 1794 0 1 2 3 1795 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 1796 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1797 | AVP Code | 1798 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1799 |V M P r r r r r| AVP Length | 1800 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1801 | Vendor-ID (opt) | 1802 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1803 | Data ... 1804 +-+-+-+-+-+-+-+-+ 1806 AVP Code 1808 The AVP Code, combined with the Vendor-Id field, identifies the 1809 attribute uniquely. AVP numbers 1 through 255 are reserved for 1810 re-use of RADIUS attributes, without setting the Vendor-Id field. 1811 AVP numbers 256 and above are used for Diameter, which are 1812 allocated by IANA (see Section 11.1). 1814 AVP Flags 1816 The AVP Flags field informs the receiver how each attribute must 1817 be handled. The 'r' (reserved) bits are unused and SHOULD be set 1818 to 0. Note that subsequent Diameter applications MAY define 1819 additional bits within the AVP Header, and an unrecognized bit 1820 SHOULD be considered an error. The 'P' bit has been reserved for 1821 future usage of end-to-end security. At the time of writing there 1822 are no end-to-end security mechanisms specified therefore the 'P' 1823 bit SHOULD be set to 0. 1825 The 'M' Bit, known as the Mandatory bit, indicates whether the 1826 receiver of the AVP MUST parse and understand the semantic of the 1827 AVP including its content. The receiving entity MUST return an 1828 appropriate error message if it receives an AVP that has the M-bit 1829 set but does not understand it. An exception applies when the AVP 1830 is embedded within a Grouped AVP. See Section 4.4 for details. 1831 Diameter Relay and redirect agents MUST NOT reject messages with 1832 unrecognized AVPs. 1834 The 'M' bit MUST be set according to the rules defined in the 1835 application specification which introduces or re-uses this AVP. 1836 Within a given application, the M-bit setting for an AVP is either 1837 defined for all command types or for each command type. 1839 AVPs with the 'M' bit cleared are informational only and a 1840 receiver that receives a message with such an AVP that is not 1841 supported, or whose value is not supported, MAY simply ignore the 1842 AVP. 1844 The 'V' bit, known as the Vendor-Specific bit, indicates whether 1845 the optional Vendor-ID field is present in the AVP header. When 1846 set the AVP Code belongs to the specific vendor code address 1847 space. 1849 AVP Length 1851 The AVP Length field is three octets, and indicates the number of 1852 octets in this AVP including the AVP Code, AVP Length, AVP Flags, 1853 Vendor-ID field (if present) and the AVP data. If a message is 1854 received with an invalid attribute length, the message MUST be 1855 rejected. 1857 4.1.1. Optional Header Elements 1859 The AVP Header contains one optional field. This field is only 1860 present if the respective bit-flag is enabled. 1862 Vendor-ID 1864 The Vendor-ID field is present if the 'V' bit is set in the AVP 1865 Flags field. The optional four-octet Vendor-ID field contains the 1866 IANA assigned "SMI Network Management Private Enterprise Codes" 1867 [RFC3232] value, encoded in network byte order. Any vendor or 1868 standardization organization that are also treated like vendors in 1869 the IANA managed "SMI Network Management Private Enterprise Codes" 1870 space wishing to implement a vendor-specific Diameter AVP MUST use 1871 their own Vendor-ID along with their privately managed AVP address 1872 space, guaranteeing that they will not collide with any other 1873 vendor's vendor-specific AVP(s), nor with future IETF AVPs. 1875 A vendor ID value of zero (0) corresponds to the IETF adopted AVP 1876 values, as managed by the IANA. Since the absence of the vendor 1877 ID field implies that the AVP in question is not vendor specific, 1878 implementations MUST NOT use the zero (0) vendor ID. 1880 4.2. Basic AVP Data Formats 1882 The Data field is zero or more octets and contains information 1883 specific to the Attribute. The format and length of the Data field 1884 is determined by the AVP Code and AVP Length fields. The format of 1885 the Data field MUST be one of the following base data types or a data 1886 type derived from the base data types. In the event that a new Basic 1887 AVP Data Format is needed, a new version of this RFC MUST be created. 1889 OctetString 1891 The data contains arbitrary data of variable length. Unless 1892 otherwise noted, the AVP Length field MUST be set to at least 8 1893 (12 if the 'V' bit is enabled). AVP Values of this type that are 1894 not a multiple of four-octets in length is followed by the 1895 necessary padding so that the next AVP (if any) will start on a 1896 32-bit boundary. 1898 Integer32 1900 32 bit signed value, in network byte order. The AVP Length field 1901 MUST be set to 12 (16 if the 'V' bit is enabled). 1903 Integer64 1905 64 bit signed value, in network byte order. The AVP Length field 1906 MUST be set to 16 (20 if the 'V' bit is enabled). 1908 Unsigned32 1910 32 bit unsigned value, in network byte order. The AVP Length 1911 field MUST be set to 12 (16 if the 'V' bit is enabled). 1913 Unsigned64 1915 64 bit unsigned value, in network byte order. The AVP Length 1916 field MUST be set to 16 (20 if the 'V' bit is enabled). 1918 Float32 1920 This represents floating point values of single precision as 1921 described by [FLOATPOINT]. The 32-bit value is transmitted in 1922 network byte order. The AVP Length field MUST be set to 12 (16 if 1923 the 'V' bit is enabled). 1925 Float64 1927 This represents floating point values of double precision as 1928 described by [FLOATPOINT]. The 64-bit value is transmitted in 1929 network byte order. The AVP Length field MUST be set to 16 (20 if 1930 the 'V' bit is enabled). 1932 Grouped 1934 The Data field is specified as a sequence of AVPs. Each of these 1935 AVPs follows - in the order in which they are specified - 1936 including their headers and padding. The AVP Length field is set 1937 to 8 (12 if the 'V' bit is enabled) plus the total length of all 1938 included AVPs, including their headers and padding. Thus the AVP 1939 length field of an AVP of type Grouped is always a multiple of 4. 1941 4.3. Derived AVP Data Formats 1943 In addition to using the Basic AVP Data Formats, applications may 1944 define data formats derived from the Basic AVP Data Formats. An 1945 application that defines new Derived AVP Data Formats MUST include 1946 them in a section entitled "Derived AVP Data Formats", using the same 1947 format as the definitions below. Each new definition MUST be either 1948 defined or listed with a reference to the RFC that defines the 1949 format. 1951 4.3.1. Common Derived AVPs 1953 The following are commonly used Derived AVP Data Formats. 1955 Address 1957 The Address format is derived from the OctetString AVP Base 1958 Format. It is a discriminated union, representing, for example a 1959 32-bit (IPv4) [RFC791] or 128-bit (IPv6) [RFC4291] address, most 1960 significant octet first. The first two octets of the Address AVP 1961 represents the AddressType, which contains an Address Family 1962 defined in [IANAADFAM]. The AddressType is used to discriminate 1963 the content and format of the remaining octets. 1965 Time 1967 The Time format is derived from the OctetString AVP Base Format. 1968 The string MUST contain four octets, in the same format as the 1969 first four bytes are in the NTP timestamp format. The NTP 1970 Timestamp format is defined in Chapter 3 of [RFC5905]. 1972 This represents the number of seconds since 0h on 1 January 1900 1973 with respect to the Coordinated Universal Time (UTC). 1975 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow. 1976 SNTP [RFC5905] describes a procedure to extend the time to 2104. 1977 This procedure MUST be supported by all Diameter nodes. 1979 UTF8String 1981 The UTF8String format is derived from the OctetString AVP Base 1982 Format. This is a human readable string represented using the 1983 ISO/IEC IS 10646-1 character set, encoded as an OctetString using 1984 the UTF-8 [RFC3629] transformation format described in RFC 3629. 1986 Since additional code points are added by amendments to the 10646 1987 standard from time to time, implementations MUST be prepared to 1988 encounter any code point from 0x00000001 to 0x7fffffff. Byte 1989 sequences that do not correspond to the valid encoding of a code 1990 point into UTF-8 charset or are outside this range are prohibited. 1992 The use of control codes SHOULD be avoided. When it is necessary 1993 to represent a new line, the control code sequence CR LF SHOULD be 1994 used. 1996 The use of leading or trailing white space SHOULD be avoided. 1998 For code points not directly supported by user interface hardware 1999 or software, an alternative means of entry and display, such as 2000 hexadecimal, MAY be provided. 2002 For information encoded in 7-bit US-ASCII, the UTF-8 charset is 2003 identical to the US-ASCII charset. 2005 UTF-8 may require multiple bytes to represent a single character / 2006 code point; thus the length of an UTF8String in octets may be 2007 different from the number of characters encoded. 2009 Note that the AVP Length field of an UTF8String is measured in 2010 octets, not characters. 2012 DiameterIdentity 2014 The DiameterIdentity format is derived from the OctetString AVP 2015 Base Format. 2017 DiameterIdentity = FQDN/Realm 2019 DiameterIdentity value is used to uniquely identify either: 2021 * A Diameter node for purposes of duplicate connection and 2022 routing loop detection. 2024 * A Realm to determine whether messages can be satisfied locally, 2025 or whether they must be routed or redirected. 2027 When a DiameterIdentity is used to identify a Diameter node the 2028 contents of the string MUST be the FQDN of the Diameter node. If 2029 multiple Diameter nodes run on the same host, each Diameter node 2030 MUST be assigned a unique DiameterIdentity. If a Diameter node 2031 can be identified by several FQDNs, a single FQDN should be picked 2032 at startup, and used as the only DiameterIdentity for that node, 2033 whatever the connection it is sent on. Note that in this 2034 document, DiameterIdentity is in ASCII form in order to be 2035 compatible with existing DNS infrastructure. See Appendix D for 2036 interactions between the Diameter protocol and Internationalized 2037 Domain Name (IDNs). 2039 DiameterURI 2041 The DiameterURI MUST follow the Uniform Resource Identifiers (URI) 2042 syntax [RFC3986] rules specified below: 2044 "aaa://" FQDN [ port ] [ transport ] [ protocol ] 2046 ; No transport security 2048 "aaas://" FQDN [ port ] [ transport ] [ protocol ] 2050 ; Transport security used 2052 FQDN = Fully Qualified Host Name 2054 port = ":" 1*DIGIT 2056 ; One of the ports used to listen for 2057 ; incoming connections. 2058 ; If absent, the default Diameter port 2059 ; (3868) is assumed if no transport 2060 ; security is used and port (TBD) when 2061 ; transport security (TLS) is used. 2063 transport = ";transport=" transport-protocol 2065 ; One of the transports used to listen 2066 ; for incoming connections. If absent, 2067 ; the default protocol is assumed to be TCP. 2068 ; UDP MUST NOT be used when the aaa-protocol 2069 ; field is set to diameter. 2071 transport-protocol = ( "tcp" / "sctp" / "udp" ) 2073 protocol = ";protocol=" aaa-protocol 2075 ; If absent, the default AAA protocol 2076 ; is Diameter. 2078 aaa-protocol = ( "diameter" / "radius" / "tacacs+" ) 2080 The following are examples of valid Diameter host identities: 2082 aaa://host.example.com;transport=tcp 2083 aaa://host.example.com:6666;transport=tcp 2084 aaa://host.example.com;protocol=diameter 2085 aaa://host.example.com:6666;protocol=diameter 2086 aaa://host.example.com:6666;transport=tcp;protocol=diameter 2087 aaa://host.example.com:1813;transport=udp;protocol=radius 2089 Enumerated 2091 Enumerated is derived from the Integer32 AVP Base Format. The 2092 definition contains a list of valid values and their 2093 interpretation and is described in the Diameter application 2094 introducing the AVP. 2096 IPFilterRule 2098 The IPFilterRule format is derived from the OctetString AVP Base 2099 Format and uses the ASCII charset. The rule syntax is a modified 2100 subset of ipfw(8) from FreeBSD. Packets may be filtered based on 2101 the following information that is associated with it: 2103 Direction (in or out) 2104 Source and destination IP address (possibly masked) 2105 Protocol 2106 Source and destination port (lists or ranges) 2107 TCP flags 2108 IP fragment flag 2109 IP options 2110 ICMP types 2112 Rules for the appropriate direction are evaluated in order, with 2113 the first matched rule terminating the evaluation. Each packet is 2114 evaluated once. If no rule matches, the packet is dropped if the 2115 last rule evaluated was a permit, and passed if the last rule was 2116 a deny. 2118 IPFilterRule filters MUST follow the format: 2120 action dir proto from src to dst [options] 2122 action permit - Allow packets that match the rule. 2123 deny - Drop packets that match the rule. 2125 dir "in" is from the terminal, "out" is to the 2126 terminal. 2128 proto An IP protocol specified by number. The "ip" 2129 keyword means any protocol will match. 2131 src and dst
[ports] 2133 The
may be specified as: 2134 ipno An IPv4 or IPv6 number in dotted- 2135 quad or canonical IPv6 form. Only 2136 this exact IP number will match the 2137 rule. 2138 ipno/bits An IP number as above with a mask 2139 width of the form 192.0.2.10/24. In 2140 this case, all IP numbers from 2141 192.0.2.0 to 192.0.2.255 will match. 2142 The bit width MUST be valid for the 2143 IP version and the IP number MUST 2144 NOT have bits set beyond the mask. 2145 For a match to occur, the same IP 2146 version must be present in the 2147 packet that was used in describing 2148 the IP address. To test for a 2149 particular IP version, the bits part 2150 can be set to zero. The keyword 2151 "any" is 0.0.0.0/0 or the IPv6 2152 equivalent. The keyword "assigned" 2153 is the address or set of addresses 2154 assigned to the terminal. For IPv4, 2155 a typical first rule is often "deny 2156 in ip! assigned" 2158 The sense of the match can be inverted by 2159 preceding an address with the not modifier (!), 2160 causing all other addresses to be matched 2161 instead. This does not affect the selection of 2162 port numbers. 2164 With the TCP, UDP and SCTP protocols, optional 2165 ports may be specified as: 2167 {port/port-port}[,ports[,...]] 2169 The '-' notation specifies a range of ports 2170 (including boundaries). 2172 Fragmented packets that have a non-zero offset 2173 (i.e., not the first fragment) will never match 2174 a rule that has one or more port 2175 specifications. See the frag option for 2176 details on matching fragmented packets. 2178 options: 2179 frag Match if the packet is a fragment and this is not 2180 the first fragment of the datagram. frag may not 2181 be used in conjunction with either tcpflags or 2182 TCP/UDP port specifications. 2184 ipoptions spec 2185 Match if the IP header contains the comma 2186 separated list of options specified in spec. The 2187 supported IP options are: 2189 ssrr (strict source route), lsrr (loose source 2190 route), rr (record packet route) and ts 2191 (timestamp). The absence of a particular option 2192 may be denoted with a '!'. 2194 tcpoptions spec 2195 Match if the TCP header contains the comma 2196 separated list of options specified in spec. The 2197 supported TCP options are: 2199 mss (maximum segment size), window (tcp window 2200 advertisement), sack (selective ack), ts (rfc1323 2201 timestamp) and cc (rfc1644 t/tcp connection 2202 count). The absence of a particular option may 2203 be denoted with a '!'. 2205 established 2206 TCP packets only. Match packets that have the RST 2207 or ACK bits set. 2209 setup TCP packets only. Match packets that have the SYN 2210 bit set but no ACK bit. 2212 tcpflags spec 2213 TCP packets only. Match if the TCP header 2214 contains the comma separated list of flags 2215 specified in spec. The supported TCP flags are: 2217 fin, syn, rst, psh, ack and urg. The absence of a 2218 particular flag may be denoted with a '!'. A rule 2219 that contains a tcpflags specification can never 2220 match a fragmented packet that has a non-zero 2221 offset. See the frag option for details on 2222 matching fragmented packets. 2224 icmptypes types 2225 ICMP packets only. Match if the ICMP type is in 2226 the list types. The list may be specified as any 2227 combination of ranges or individual types 2228 separated by commas. Both the numeric values and 2229 the symbolic values listed below can be used. The 2230 supported ICMP types are: 2232 echo reply (0), destination unreachable (3), 2233 source quench (4), redirect (5), echo request 2234 (8), router advertisement (9), router 2235 solicitation (10), time-to-live exceeded (11), IP 2236 header bad (12), timestamp request (13), 2237 timestamp reply (14), information request (15), 2238 information reply (16), address mask request (17) 2239 and address mask reply (18). 2241 There is one kind of packet that the access device MUST always 2242 discard, that is an IP fragment with a fragment offset of one. 2243 This is a valid packet, but it only has one use, to try to 2244 circumvent firewalls. 2246 An access device that is unable to interpret or apply a deny rule 2247 MUST terminate the session. An access device that is unable to 2248 interpret or apply a permit rule MAY apply a more restrictive 2249 rule. An access device MAY apply deny rules of its own before the 2250 supplied rules, for example to protect the access device owner's 2251 infrastructure. 2253 4.4. Grouped AVP Values 2255 The Diameter protocol allows AVP values of type 'Grouped'. This 2256 implies that the Data field is actually a sequence of AVPs. It is 2257 possible to include an AVP with a Grouped type within a Grouped type, 2258 that is, to nest them. AVPs within an AVP of type Grouped have the 2259 same padding requirements as non-Grouped AVPs, as defined in Section 2260 4. 2262 The AVP Code numbering space of all AVPs included in a Grouped AVP is 2263 the same as for non-grouped AVPs. Receivers of a Grouped AVP that 2264 does not have the 'M' (mandatory) bit set and one or more of the 2265 encapsulated AVPs within the group has the 'M' (mandatory) bit set 2266 MAY simply be ignored if the Grouped AVP itself is unrecognized. The 2267 rule applies even if the encapsulated AVP with its 'M' (mandatory) 2268 bit set is further encapsulated within other sub-groups; i.e. other 2269 Grouped AVPs embedded within the Grouped AVP. 2271 Every Grouped AVP defined MUST include a corresponding grammar, using 2272 ABNF [RFC5234] (with modifications), as defined below. 2274 grouped-avp-def = "::=" avp 2276 name-fmt = ALPHA *(ALPHA / DIGIT / "-") 2278 name = name-fmt 2279 ; The name has to be the name of an AVP, 2280 ; defined in the base or extended Diameter 2281 ; specifications. 2283 avp = header [ *fixed] [ *required] [ *optional] 2285 header = "<" "AVP-Header:" avpcode [vendor] ">" 2287 avpcode = 1*DIGIT 2288 ; The AVP Code assigned to the Grouped AVP 2290 vendor = 1*DIGIT 2291 ; The Vendor-ID assigned to the Grouped AVP. 2292 ; If absent, the default value of zero is 2293 ; used. 2295 4.4.1. Example AVP with a Grouped Data type 2297 The Example-AVP (AVP Code 999999) is of type Grouped and is used to 2298 clarify how Grouped AVP values work. The Grouped Data field has the 2299 following ABNF grammar: 2301 Example-AVP ::= < AVP Header: 999999 > 2302 { Origin-Host } 2303 1*{ Session-Id } 2304 *[ AVP ] 2306 An Example-AVP with Grouped Data follows. 2308 The Origin-Host AVP is required (Section 6.3). In this case: 2310 Origin-Host = "example.com". 2312 One or more Session-Ids must follow. Here there are two: 2314 Session-Id = 2315 "grump.example.com:33041;23432;893;0AF3B81" 2317 Session-Id = 2318 "grump.example.com:33054;23561;2358;0AF3B82" 2320 optional AVPs included are 2322 Recovery-Policy = 2323 2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35 2324 2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5 2325 c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd 2326 f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a 2327 cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119 2328 26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c 2329 1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92 2331 Futuristic-Acct-Record = 2332 fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0 2333 57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8 2334 17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c 2335 41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067 2336 d3427475e49968f841 2338 The data for the optional AVPs is represented in hex since the format 2339 of these AVPs is neither known at the time of definition of the 2340 Example-AVP group, nor (likely) at the time when the example instance 2341 of this AVP is interpreted - except by Diameter implementations which 2342 support the same set of AVPs. The encoding example illustrates how 2343 padding is used and how length fields are calculated. Also note that 2344 AVPs may be present in the Grouped AVP value which the receiver 2345 cannot interpret (here, the Recover-Policy and Futuristic-Acct-Record 2346 AVPs). The length of the Example-AVP is the sum of all the length of 2347 the member AVPs including their padding plus the Example-AVP header 2348 size. 2350 This AVP would be encoded as follows: 2352 0 1 2 3 4 5 6 7 2353 +-------+-------+-------+-------+-------+-------+-------+-------+ 2354 0 | Example AVP Header (AVP Code = 999999), Length = 496 | 2355 +-------+-------+-------+-------+-------+-------+-------+-------+ 2356 8 | Origin-Host AVP Header (AVP Code = 264), Length = 19 | 2357 +-------+-------+-------+-------+-------+-------+-------+-------+ 2358 16 | 'e' | 'x' | 'a' | 'm' | 'p' | 'l' | 'e' | '.' | 2359 +-------+-------+-------+-------+-------+-------+-------+-------+ 2360 24 | 'c' | 'o' | 'm' |Padding| Session-Id AVP Header | 2361 +-------+-------+-------+-------+-------+-------+-------+-------+ 2362 32 | (AVP Code = 263), Length = 49 | 'g' | 'r' | 'u' | 'm' | 2363 +-------+-------+-------+-------+-------+-------+-------+-------+ 2364 . . . 2365 +-------+-------+-------+-------+-------+-------+-------+-------+ 2366 72 | 'F' | '3' | 'B' | '8' | '1' |Padding|Padding|Padding| 2367 +-------+-------+-------+-------+-------+-------+-------+-------+ 2368 80 | Session-Id AVP Header (AVP Code = 263), Length = 50 | 2369 +-------+-------+-------+-------+-------+-------+-------+-------+ 2370 88 | 'g' | 'r' | 'u' | 'm' | 'p' | '.' | 'e' | 'x' | 2371 +-------+-------+-------+-------+-------+-------+-------+-------+ 2372 . . . 2373 +-------+-------+-------+-------+-------+-------+-------+-------+ 2374 120| '5' | '8' | ';' | '0' | 'A' | 'F' | '3' | 'B' | 2375 +-------+-------+-------+-------+-------+-------+-------+-------+ 2376 128| '8' | '2' |Padding|Padding| Recovery-Policy Header (AVP | 2377 +-------+-------+-------+-------+-------+-------+-------+-------+ 2378 136| Code = 8341), Length = 223 | 0x21 | 0x63 | 0xbc | 0x1d | 2379 +-------+-------+-------+-------+-------+-------+-------+-------+ 2380 144| 0x0a | 0xd8 | 0x23 | 0x71 | 0xf6 | 0xbc | 0x09 | 0x48 | 2381 +-------+-------+-------+-------+-------+-------+-------+-------+ 2382 . . . 2383 +-------+-------+-------+-------+-------+-------+-------+-------+ 2384 352| 0x8c | 0x7f | 0x92 |Padding| Futuristic-Acct-Record Header | 2385 +-------+-------+-------+-------+-------+-------+-------+-------+ 2386 328|(AVP Code = 15930),Length = 137| 0xfe | 0x19 | 0xda | 0x58 | 2387 +-------+-------+-------+-------+-------+-------+-------+-------+ 2388 336| 0x02 | 0xac | 0xd9 | 0x8b | 0x07 | 0xa5 | 0xb8 | 0xc6 | 2389 +-------+-------+-------+-------+-------+-------+-------+-------+ 2390 . . . 2391 +-------+-------+-------+-------+-------+-------+-------+-------+ 2392 488| 0xe4 | 0x99 | 0x68 | 0xf8 | 0x41 |Padding|Padding|Padding| 2393 +-------+-------+-------+-------+-------+-------+-------+-------+ 2395 4.5. Diameter Base Protocol AVPs 2397 The following table describes the Diameter AVPs defined in the base 2398 protocol, their AVP Code values, types, possible flag values. 2400 Due to space constraints, the short form DiamIdent is used to 2401 represent DiameterIdentity. 2403 +----------+ 2404 | AVP Flag | 2405 | rules | 2406 |----+-----| 2407 AVP Section | |MUST | 2408 Attribute Name Code Defined Data Type |MUST| NOT | 2409 -----------------------------------------|----+-----| 2410 Acct- 85 9.8.2 Unsigned32 | M | V | 2411 Interim-Interval | | | 2412 Accounting- 483 9.8.7 Enumerated | M | V | 2413 Realtime-Required | | | 2414 Acct- 50 9.8.5 UTF8String | M | V | 2415 Multi-Session-Id | | | 2416 Accounting- 485 9.8.3 Unsigned32 | M | V | 2417 Record-Number | | | 2418 Accounting- 480 9.8.1 Enumerated | M | V | 2419 Record-Type | | | 2420 Accounting- 44 9.8.4 OctetString| M | V | 2421 Session-Id | | | 2422 Accounting- 287 9.8.6 Unsigned64 | M | V | 2423 Sub-Session-Id | | | 2424 Acct- 259 6.9 Unsigned32 | M | V | 2425 Application-Id | | | 2426 Auth- 258 6.8 Unsigned32 | M | V | 2427 Application-Id | | | 2428 Auth-Request- 274 8.7 Enumerated | M | V | 2429 Type | | | 2430 Authorization- 291 8.9 Unsigned32 | M | V | 2431 Lifetime | | | 2432 Auth-Grace- 276 8.10 Unsigned32 | M | V | 2433 Period | | | 2434 Auth-Session- 277 8.11 Enumerated | M | V | 2435 State | | | 2436 Re-Auth-Request- 285 8.12 Enumerated | M | V | 2437 Type | | | 2438 Class 25 8.20 OctetString| M | V | 2439 Destination-Host 293 6.5 DiamIdent | M | V | 2440 Destination- 283 6.6 DiamIdent | M | V | 2441 Realm | | | 2442 Disconnect-Cause 273 5.4.3 Enumerated | M | V | 2443 Error-Message 281 7.3 UTF8String | | V,M | 2444 Error-Reporting- 294 7.4 DiamIdent | | V,M | 2445 Host | | | 2446 Event-Timestamp 55 8.21 Time | M | V | 2447 Experimental- 297 7.6 Grouped | M | V | 2448 Result | | | 2449 -----------------------------------------|----+-----| 2450 +----------+ 2451 | AVP Flag | 2452 | rules | 2453 |----+-----| 2454 AVP Section | |MUST | 2455 Attribute Name Code Defined Data Type |MUST| NOT | 2456 -----------------------------------------|----+-----| 2457 Experimental- 298 7.7 Unsigned32 | M | V | 2458 Result-Code | | | 2459 Failed-AVP 279 7.5 Grouped | M | V | 2460 Firmware- 267 5.3.4 Unsigned32 | | V,M | 2461 Revision | | | 2462 Host-IP-Address 257 5.3.5 Address | M | V | 2463 Inband-Security | M | V | 2464 -Id 299 6.10 Unsigned32 | | | 2465 Multi-Round- 272 8.19 Unsigned32 | M | V | 2466 Time-Out | | | 2467 Origin-Host 264 6.3 DiamIdent | M | V | 2468 Origin-Realm 296 6.4 DiamIdent | M | V | 2469 Origin-State-Id 278 8.16 Unsigned32 | M | V | 2470 Product-Name 269 5.3.7 UTF8String | | V,M | 2471 Proxy-Host 280 6.7.3 DiamIdent | M | V | 2472 Proxy-Info 284 6.7.2 Grouped | M | V | 2473 Proxy-State 33 6.7.4 OctetString| M | V | 2474 Redirect-Host 292 6.12 DiamURI | M | V | 2475 Redirect-Host- 261 6.13 Enumerated | M | V | 2476 Usage | | | 2477 Redirect-Max- 262 6.14 Unsigned32 | M | V | 2478 Cache-Time | | | 2479 Result-Code 268 7.1 Unsigned32 | M | V | 2480 Route-Record 282 6.7.1 DiamIdent | M | V | 2481 Session-Id 263 8.8 UTF8String | M | V | 2482 Session-Timeout 27 8.13 Unsigned32 | M | V | 2483 Session-Binding 270 8.17 Unsigned32 | M | V | 2484 Session-Server- 271 8.18 Enumerated | M | V | 2485 Failover | | | 2486 Supported- 265 5.3.6 Unsigned32 | M | V | 2487 Vendor-Id | | | 2488 Termination- 295 8.15 Enumerated | M | V | 2489 Cause | | | 2490 User-Name 1 8.14 UTF8String | M | V | 2491 Vendor-Id 266 5.3.3 Unsigned32 | M | V | 2492 Vendor-Specific- 260 6.11 Grouped | M | V | 2493 Application-Id | | | 2494 -----------------------------------------|----+-----| 2496 5. Diameter Peers 2498 This section describes how Diameter nodes establish connections and 2499 communicate with peers. 2501 5.1. Peer Connections 2503 Connections between diameter peers are established using their valid 2504 DiameterIdentity. A Diameter node initiating a connection to a peer 2505 MUST know the peers DiameterIdentity. Methods for discovering a 2506 Diameter peer can be found in Section 5.2. 2508 Although a Diameter node may have many possible peers that it is able 2509 to communicate with, it may not be economical to have an established 2510 connection to all of them. At a minimum, a Diameter node SHOULD have 2511 an established connection with two peers per realm, known as the 2512 primary and secondary peers. Of course, a node MAY have additional 2513 connections, if it is deemed necessary. Typically, all messages for 2514 a realm are sent to the primary peer, but in the event that failover 2515 procedures are invoked, any pending requests are sent to the 2516 secondary peer. However, implementations are free to load balance 2517 requests between a set of peers. 2519 Note that a given peer MAY act as a primary for a given realm, while 2520 acting as a secondary for another realm. 2522 When a peer is deemed suspect, which could occur for various reasons, 2523 including not receiving a DWA within an allotted timeframe, no new 2524 requests should be forwarded to the peer, but failover procedures are 2525 invoked. When an active peer is moved to this mode, additional 2526 connections SHOULD be established to ensure that the necessary number 2527 of active connections exists. 2529 There are two ways that a peer is removed from the suspect peer list: 2531 1. The peer is no longer reachable, causing the transport connection 2532 to be shutdown. The peer is moved to the closed state. 2534 2. Three watchdog messages are exchanged with accepted round trip 2535 times, and the connection to the peer is considered stabilized. 2537 In the event the peer being removed is either the primary or 2538 secondary, an alternate peer SHOULD replace the deleted peer, and 2539 assume the role of either primary or secondary. 2541 5.2. Diameter Peer Discovery 2543 Allowing for dynamic Diameter agent discovery will make it possible 2544 for simpler and more robust deployment of Diameter services. In 2545 order to promote interoperable implementations of Diameter peer 2546 discovery, the following mechanisms are described. These are based 2547 on existing IETF standards. The first option (manual configuration) 2548 MUST be supported by all Diameter nodes, while the latter option 2549 (DNS) MAY be supported. 2551 There are two cases where Diameter peer discovery may be performed. 2552 The first is when a Diameter client needs to discover a first-hop 2553 Diameter agent. The second case is when a Diameter agent needs to 2554 discover another agent - for further handling of a Diameter 2555 operation. In both cases, the following 'search order' is 2556 recommended: 2558 1. The Diameter implementation consults its list of static 2559 (manually) configured Diameter agent locations. These will be 2560 used if they exist and respond. 2562 2. The Diameter implementation performs a NAPTR query for a server 2563 in a particular realm. The Diameter implementation has to know 2564 in advance which realm to look for a Diameter agent. This could 2565 be deduced, for example, from the 'realm' in a NAI that a 2566 Diameter implementation needed to perform a Diameter operation 2567 on. 2569 The NAPTR usage in Diameter follows the S-NAPTR DDDS application 2570 [RFC3958] in which the SERVICE field includes tags for the 2571 desired application and supported application protocol. The 2572 application service tag for a Diameter application is 'aaa' and 2573 the supported application protocol tags are 'diameter.tcp', 2574 'diameter.sctp' or 'diameter.tls'. 2576 The client can follow the resolution process defined by the 2577 S-NAPTR DDDS [RFC3958] application to find a matching SRV, A or 2578 AAAA record of a suitable peer. The domain suffixes in the NAPTR 2579 replacement field SHOULD match the domain of the original query. 2580 An example can be found in Appendix B. 2582 3. If no NAPTR records are found, the requester directly queries for 2583 SRV records '_diameter._sctp'.realm, '_diameter._tcp'.realm and 2584 '_diameter._tls'.realm depending on the requesters network 2585 protocol capabilities. If SRV records are found then the 2586 requester can perform address record query (A RR's and/or AAAA 2587 RR's) for the target hostname specified in the SRV records. If 2588 no SRV records are found, the requester gives up. 2590 If the server is using a site certificate, the domain name in the 2591 NAPTR query and the domain name in the replacement field MUST both be 2592 valid based on the site certificate handed out by the server in the 2593 TLS or IKE exchange. Similarly, the domain name in the SRV query and 2594 the domain name in the target in the SRV record MUST both be valid 2595 based on the same site certificate. Otherwise, an attacker could 2596 modify the DNS records to contain replacement values in a different 2597 domain, and the client could not validate that this was the desired 2598 behavior, or the result of an attack. 2600 Also, the Diameter Peer MUST check to make sure that the discovered 2601 peers are authorized to act in its role. Authentication via IKE or 2602 TLS, or validation of DNS RRs via DNSSEC is not sufficient to 2603 conclude this. For example, a web server may have obtained a valid 2604 TLS certificate, and secured RRs may be included in the DNS, but this 2605 does not imply that it is authorized to act as a Diameter Server. 2607 Authorization can be achieved for example, by configuration of a 2608 Diameter Server CA. Alternatively this can be achieved by definition 2609 of OIDs within TLS or IKE certificates so as to signify Diameter 2610 Server authorization. 2612 A dynamically discovered peer causes an entry in the Peer Table (see 2613 Section 2.6) to be created. Note that entries created via DNS MUST 2614 expire (or be refreshed) within the DNS TTL. If a peer is discovered 2615 outside of the local realm, a routing table entry (see Section 2.7) 2616 for the peer's realm is created. The routing table entry's 2617 expiration MUST match the peer's expiration value. 2619 5.3. Capabilities Exchange 2621 When two Diameter peers establish a transport connection, they MUST 2622 exchange the Capabilities Exchange messages, as specified in the peer 2623 state machine (see Section 5.6). This message allows the discovery 2624 of a peer's identity and its capabilities (protocol version number, 2625 supported Diameter applications, security mechanisms, etc.) 2627 The receiver only issues commands to its peers that have advertised 2628 support for the Diameter application that defines the command. A 2629 Diameter node MUST cache the supported applications in order to 2630 ensure that unrecognized commands and/or AVPs are not unnecessarily 2631 sent to a peer. 2633 A receiver of a Capabilities-Exchange-Req (CER) message that does not 2634 have any applications in common with the sender MUST return a 2635 Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to 2636 DIAMETER_NO_COMMON_APPLICATION, and SHOULD disconnect the transport 2637 layer connection. Note that receiving a CER or CEA from a peer 2638 advertising itself as a Relay (see Section 2.4) MUST be interpreted 2639 as having common applications with the peer. 2641 The receiver of the Capabilities-Exchange-Request (CER) MUST 2642 determine common applications by computing the intersection of its 2643 own set of supported Application Id against all of the application 2644 identifier AVPs (Auth-Application-Id, Acct-Application-Id and Vendor- 2645 Specific-Application-Id) present in the CER. The value of the 2646 Vendor-Id AVP in the Vendor-Specific-Application-Id MUST NOT be used 2647 during computation. The sender of the Capabilities-Exchange-Answer 2648 (CEA) SHOULD include all of its supported applications as a hint to 2649 the receiver regarding all of its application capabilities. 2651 Diameter implementations SHOULD first attempt to establish a TLS 2652 connection prior to the CER/CEA exchange. This protects the 2653 capabilities information of both peers. To support older Diameter 2654 implementations that do not fully conform to this document, the 2655 transport security MAY still be negotiated via Inband-Security AVP. 2656 In this case, the receiver of a Capabilities-Exchange-Req (CER) 2657 message that does not have any security mechanisms in common with the 2658 sender MUST return a Capabilities-Exchange-Answer (CEA) with the 2659 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY, and SHOULD 2660 disconnect the transport layer connection. 2662 CERs received from unknown peers MAY be silently discarded, or a CEA 2663 MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER. 2664 In both cases, the transport connection is closed. If the local 2665 policy permits receiving CERs from unknown hosts, a successful CEA 2666 MAY be returned. If a CER from an unknown peer is answered with a 2667 successful CEA, the lifetime of the peer entry is equal to the 2668 lifetime of the transport connection. In case of a transport 2669 failure, all the pending transactions destined to the unknown peer 2670 can be discarded. 2672 The CER and CEA messages MUST NOT be proxied, redirected or relayed. 2674 Since the CER/CEA messages cannot be proxied, it is still possible 2675 that an upstream agent receives a message for which it has no 2676 available peers to handle the application that corresponds to the 2677 Command-Code. In such instances, the 'E' bit is set in the answer 2678 message (see Section 7.) with the Result-Code AVP set to 2679 DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action 2680 (e.g., re-routing request to an alternate peer). 2682 With the exception of the Capabilities-Exchange-Request message, a 2683 message of type Request that includes the Auth-Application-Id or 2684 Acct-Application-Id AVPs, or a message with an application-specific 2685 command code, MAY only be forwarded to a host that has explicitly 2686 advertised support for the application (or has advertised the Relay 2687 Application Id). 2689 5.3.1. Capabilities-Exchange-Request 2691 The Capabilities-Exchange-Request (CER), indicated by the Command- 2692 Code set to 257 and the Command Flags' 'R' bit set, is sent to 2693 exchange local capabilities. Upon detection of a transport failure, 2694 this message MUST NOT be sent to an alternate peer. 2696 When Diameter is run over SCTP [RFC4960], which allows for 2697 connections to span multiple interfaces and multiple IP addresses, 2698 the Capabilities-Exchange-Request message MUST contain one Host-IP- 2699 Address AVP for each potential IP address that MAY be locally used 2700 when transmitting Diameter messages. 2702 Message Format 2704 ::= < Diameter Header: 257, REQ > 2705 { Origin-Host } 2706 { Origin-Realm } 2707 1* { Host-IP-Address } 2708 { Vendor-Id } 2709 { Product-Name } 2710 [ Origin-State-Id ] 2711 * [ Supported-Vendor-Id ] 2712 * [ Auth-Application-Id ] 2713 * [ Inband-Security-Id ] 2714 * [ Acct-Application-Id ] 2715 * [ Vendor-Specific-Application-Id ] 2716 [ Firmware-Revision ] 2717 * [ AVP ] 2719 5.3.2. Capabilities-Exchange-Answer 2721 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code 2722 set to 257 and the Command Flags' 'R' bit cleared, is sent in 2723 response to a CER message. 2725 When Diameter is run over SCTP [RFC4960], which allows connections to 2726 span multiple interfaces, hence, multiple IP addresses, the 2727 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address 2728 AVP for each potential IP address that MAY be locally used when 2729 transmitting Diameter messages. 2731 Message Format 2733 ::= < Diameter Header: 257 > 2734 { Result-Code } 2735 { Origin-Host } 2736 { Origin-Realm } 2737 1* { Host-IP-Address } 2738 { Vendor-Id } 2739 { Product-Name } 2740 [ Origin-State-Id ] 2741 [ Error-Message ] 2742 [ Failed-AVP ] 2743 * [ Supported-Vendor-Id ] 2744 * [ Auth-Application-Id ] 2745 * [ Inband-Security-Id ] 2746 * [ Acct-Application-Id ] 2747 * [ Vendor-Specific-Application-Id ] 2748 [ Firmware-Revision ] 2749 * [ AVP ] 2751 5.3.3. Vendor-Id AVP 2753 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains 2754 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232] 2755 value assigned to the vendor of the Diameter device. It is 2756 envisioned that the combination of the Vendor-Id, Product-Name 2757 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may 2758 provide useful debugging information. 2760 A Vendor-Id value of zero in the CER or CEA messages is reserved and 2761 indicates that this field is ignored. 2763 5.3.4. Firmware-Revision AVP 2765 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is 2766 used to inform a Diameter peer of the firmware revision of the 2767 issuing device. 2769 For devices that do not have a firmware revision (general purpose 2770 computers running Diameter software modules, for instance), the 2771 revision of the Diameter software module may be reported instead. 2773 5.3.5. Host-IP-Address AVP 2775 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used 2776 to inform a Diameter peer of the sender's IP address. All source 2777 addresses that a Diameter node expects to use with SCTP [RFC4960] 2778 MUST be advertised in the CER and CEA messages by including a Host- 2779 IP-Address AVP for each address. 2781 5.3.6. Supported-Vendor-Id AVP 2783 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and 2784 contains the IANA "SMI Network Management Private Enterprise Codes" 2785 [RFC3232] value assigned to a vendor other than the device vendor but 2786 including the application vendor. This is used in the CER and CEA 2787 messages in order to inform the peer that the sender supports (a 2788 subset of) the vendor-specific AVPs defined by the vendor identified 2789 in this AVP. The value of this AVP MUST NOT be set to zero. 2790 Multiple instances of this AVP containing the same value SHOULD NOT 2791 be sent. 2793 5.3.7. Product-Name AVP 2795 The Product-Name AVP (AVP Code 269) is of type UTF8String, and 2796 contains the vendor assigned name for the product. The Product-Name 2797 AVP SHOULD remain constant across firmware revisions for the same 2798 product. 2800 5.4. Disconnecting Peer connections 2802 When a Diameter node disconnects one of its transport connections, 2803 its peer cannot know the reason for the disconnect, and will most 2804 likely assume that a connectivity problem occurred, or that the peer 2805 has rebooted. In these cases, the peer may periodically attempt to 2806 reconnect, as stated in Section 2.1. In the event that the 2807 disconnect was a result of either a shortage of internal resources, 2808 or simply that the node in question has no intentions of forwarding 2809 any Diameter messages to the peer in the foreseeable future, a 2810 periodic connection request would not be welcomed. The 2811 Disconnection-Reason AVP contains the reason the Diameter node issued 2812 the Disconnect-Peer-Request message. 2814 The Disconnect-Peer-Request message is used by a Diameter node to 2815 inform its peer of its intent to disconnect the transport layer, and 2816 that the peer shouldn't reconnect unless it has a valid reason to do 2817 so (e.g., message to be forwarded). Upon receipt of the message, the 2818 Disconnect-Peer-Answer is returned, which SHOULD contain an error if 2819 messages have recently been forwarded, and are likely in flight, 2820 which would otherwise cause a race condition. 2822 The receiver of the Disconnect-Peer-Answer initiates the transport 2823 disconnect. The sender of the Disconnect-Peer-Answer should be able 2824 to detect the transport closure and cleanup the connection. 2826 5.4.1. Disconnect-Peer-Request 2828 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set 2829 to 282 and the Command Flags' 'R' bit set, is sent to a peer to 2830 inform its intentions to shutdown the transport connection. Upon 2831 detection of a transport failure, this message MUST NOT be sent to an 2832 alternate peer. 2834 Message Format 2836 ::= < Diameter Header: 282, REQ > 2837 { Origin-Host } 2838 { Origin-Realm } 2839 { Disconnect-Cause } 2840 * [ AVP ] 2842 5.4.2. Disconnect-Peer-Answer 2844 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set 2845 to 282 and the Command Flags' 'R' bit cleared, is sent as a response 2846 to the Disconnect-Peer-Request message. Upon receipt of this 2847 message, the transport connection is shutdown. 2849 Message Format 2851 ::= < Diameter Header: 282 > 2852 { Result-Code } 2853 { Origin-Host } 2854 { Origin-Realm } 2855 [ Error-Message ] 2856 [ Failed-AVP ] 2857 * [ AVP ] 2859 5.4.3. Disconnect-Cause AVP 2861 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A 2862 Diameter node MUST include this AVP in the Disconnect-Peer-Request 2863 message to inform the peer of the reason for its intention to 2864 shutdown the transport connection. The following values are 2865 supported: 2867 REBOOTING 0 2868 A scheduled reboot is imminent. Receiver of DPR with above result 2869 code MAY attempt reconnection. 2871 BUSY 1 2872 The peer's internal resources are constrained, and it has 2873 determined that the transport connection needs to be closed. 2874 Receiver of DPR with above result code SHOULD NOT attempt 2875 reconnection. 2877 DO_NOT_WANT_TO_TALK_TO_YOU 2 2878 The peer has determined that it does not see a need for the 2879 transport connection to exist, since it does not expect any 2880 messages to be exchanged in the near future. Receiver of DPR 2881 with above result code SHOULD NOT attempt reconnection. 2883 5.5. Transport Failure Detection 2885 Given the nature of the Diameter protocol, it is recommended that 2886 transport failures be detected as soon as possible. Detecting such 2887 failures will minimize the occurrence of messages sent to unavailable 2888 agents, resulting in unnecessary delays, and will provide better 2889 failover performance. The Device-Watchdog-Request and Device- 2890 Watchdog-Answer messages, defined in this section, are used to pro- 2891 actively detect transport failures. 2893 5.5.1. Device-Watchdog-Request 2895 The Device-Watchdog-Request (DWR), indicated by the Command-Code set 2896 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no 2897 traffic has been exchanged between two peers (see Section 5.5.3). 2898 Upon detection of a transport failure, this message MUST NOT be sent 2899 to an alternate peer. 2901 Message Format 2903 ::= < Diameter Header: 280, REQ > 2904 { Origin-Host } 2905 { Origin-Realm } 2906 [ Origin-State-Id ] 2907 * [ AVP ] 2909 5.5.2. Device-Watchdog-Answer 2911 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set 2912 to 280 and the Command Flags' 'R' bit cleared, is sent as a response 2913 to the Device-Watchdog-Request message. 2915 Message Format 2917 ::= < Diameter Header: 280 > 2918 { Result-Code } 2919 { Origin-Host } 2920 { Origin-Realm } 2921 [ Error-Message ] 2922 [ Failed-AVP ] 2923 [ Origin-State-Id ] 2924 * [ AVP ] 2926 5.5.3. Transport Failure Algorithm 2928 The transport failure algorithm is defined in [RFC3539]. All 2929 Diameter implementations MUST support the algorithm defined in the 2930 specification in order to be compliant to the Diameter base protocol. 2932 5.5.4. Failover and Failback Procedures 2934 In the event that a transport failure is detected with a peer, it is 2935 necessary for all pending request messages to be forwarded to an 2936 alternate agent, if possible. This is commonly referred to as 2937 failover. 2939 In order for a Diameter node to perform failover procedures, it is 2940 necessary for the node to maintain a pending message queue for a 2941 given peer. When an answer message is received, the corresponding 2942 request is removed from the queue. The Hop-by-Hop Identifier field 2943 is used to match the answer with the queued request. 2945 When a transport failure is detected, if possible all messages in the 2946 queue are sent to an alternate agent with the T flag set. On booting 2947 a Diameter client or agent, the T flag is also set on any records 2948 still remaining to be transmitted in non-volatile storage. An 2949 example of a case where it is not possible to forward the message to 2950 an alternate server is when the message has a fixed destination, and 2951 the unavailable peer is the message's final destination (see 2952 Destination-Host AVP). Such an error requires that the agent return 2953 an answer message with the 'E' bit set and the Result-Code AVP set to 2954 DIAMETER_UNABLE_TO_DELIVER. 2956 It is important to note that multiple identical requests or answers 2957 MAY be received as a result of a failover. The End-to-End Identifier 2958 field in the Diameter header along with the Origin-Host AVP MUST be 2959 used to identify duplicate messages. 2961 As described in Section 2.1, a connection request should be 2962 periodically attempted with the failed peer in order to re-establish 2963 the transport connection. Once a connection has been successfully 2964 established, messages can once again be forwarded to the peer. This 2965 is commonly referred to as failback. 2967 5.6. Peer State Machine 2969 This section contains a finite state machine that MUST be observed by 2970 all Diameter implementations. Each Diameter node MUST follow the 2971 state machine described below when communicating with each peer. 2972 Multiple actions are separated by commas, and may continue on 2973 succeeding lines, as space requires. Similarly, state and next state 2974 may also span multiple lines, as space requires. 2976 This state machine is closely coupled with the state machine 2977 described in [RFC3539], which is used to open, close, failover, 2978 probe, and reopen transport connections. Note in particular that 2979 [RFC3539] requires the use of watchdog messages to probe connections. 2980 For Diameter, DWR and DWA messages are to be used. 2982 I- is used to represent the initiator (connecting) connection, while 2983 the R- is used to represent the responder (listening) connection. 2984 The lack of a prefix indicates that the event or action is the same 2985 regardless of the connection on which the event occurred. 2987 The stable states that a state machine may be in are Closed, I-Open 2988 and R-Open; all other states are intermediate. Note that I-Open and 2989 R-Open are equivalent except for whether the initiator or responder 2990 transport connection is used for communication. 2992 A CER message is always sent on the initiating connection immediately 2993 after the connection request is successfully completed. In the case 2994 of an election, one of the two connections will shut down. The 2995 responder connection will survive if the Origin-Host of the local 2996 Diameter entity is higher than that of the peer; the initiator 2997 connection will survive if the peer's Origin-Host is higher. All 2998 subsequent messages are sent on the surviving connection. Note that 2999 the results of an election on one peer are guaranteed to be the 3000 inverse of the results on the other. 3002 For TLS usage, TLS handshake SHOULD begin when both ends are in the 3003 closed state prior to any Diameter message exchanges. The TLS 3004 connection SHOULD be established before sending any CER or CEA 3005 message to secure and protect the capabilities information of both 3006 peers. The TLS connection SHOULD be disconnected when the state 3007 machine moves to the closed state. When connecting to responders 3008 that do not conform to this document (i.e. older Diameter 3009 implementations that are not prepared to received TLS connections in 3010 the closed state), the initial TLS connection attempt will fail. The 3011 initiator MAY then attempt to connect via TCP or SCTP and initiate 3012 the TLS handshake when both ends are in the open state. If the 3013 handshake is successful, all further messages will be sent via TLS. 3014 If the handshake fails, both ends moves to the closed state. 3016 The state machine constrains only the behavior of a Diameter 3017 implementation as seen by Diameter peers through events on the wire. 3019 Any implementation that produces equivalent results is considered 3020 compliant. 3022 state event action next state 3023 ----------------------------------------------------------------- 3024 Closed Start I-Snd-Conn-Req Wait-Conn-Ack 3025 R-Conn-CER R-Accept, R-Open 3026 Process-CER, 3027 R-Snd-CEA 3029 Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA 3030 I-Rcv-Conn-Nack Cleanup Closed 3031 R-Conn-CER R-Accept, Wait-Conn-Ack/ 3032 Process-CER Elect 3033 Timeout Error Closed 3035 Wait-I-CEA I-Rcv-CEA Process-CEA I-Open 3036 R-Conn-CER R-Accept, Wait-Returns 3037 Process-CER, 3038 Elect 3039 I-Peer-Disc I-Disc Closed 3040 I-Rcv-Non-CEA Error Closed 3041 Timeout Error Closed 3043 Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns 3044 Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open 3045 R-Peer-Disc R-Disc Wait-Conn-Ack 3046 R-Conn-CER R-Reject Wait-Conn-Ack/ 3047 Elect 3048 Timeout Error Closed 3050 Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open 3051 I-Peer-Disc I-Disc, R-Open 3052 R-Snd-CEA 3053 I-Rcv-CEA R-Disc I-Open 3054 R-Peer-Disc R-Disc Wait-I-CEA 3055 R-Conn-CER R-Reject Wait-Returns 3056 Timeout Error Closed 3058 R-Open Send-Message R-Snd-Message R-Open 3059 R-Rcv-Message Process R-Open 3060 R-Rcv-DWR Process-DWR, R-Open 3061 R-Snd-DWA 3062 R-Rcv-DWA Process-DWA R-Open 3063 R-Conn-CER R-Reject R-Open 3064 Stop R-Snd-DPR Closing 3065 R-Rcv-DPR R-Snd-DPA, Closed 3066 R-Disc 3067 R-Peer-Disc R-Disc Closed 3069 I-Open Send-Message I-Snd-Message I-Open 3070 I-Rcv-Message Process I-Open 3071 I-Rcv-DWR Process-DWR, I-Open 3072 I-Snd-DWA 3073 I-Rcv-DWA Process-DWA I-Open 3074 R-Conn-CER R-Reject I-Open 3075 Stop I-Snd-DPR Closing 3076 I-Rcv-DPR I-Snd-DPA, Closed 3077 I-Disc 3078 I-Peer-Disc I-Disc Closed 3080 Closing I-Rcv-DPA I-Disc Closed 3081 R-Rcv-DPA R-Disc Closed 3082 Timeout Error Closed 3083 I-Peer-Disc I-Disc Closed 3084 R-Peer-Disc R-Disc Closed 3086 5.6.1. Incoming connections 3088 When a connection request is received from a Diameter peer, it is 3089 not, in the general case, possible to know the identity of that peer 3090 until a CER is received from it. This is because host and port 3091 determine the identity of a Diameter peer; and the source port of an 3092 incoming connection is arbitrary. Upon receipt of CER, the identity 3093 of the connecting peer can be uniquely determined from Origin-Host. 3095 For this reason, a Diameter peer must employ logic separate from the 3096 state machine to receive connection requests, accept them, and await 3097 CER. Once CER arrives on a new connection, the Origin-Host that 3098 identifies the peer is used to locate the state machine associated 3099 with that peer, and the new connection and CER are passed to the 3100 state machine as an R-Conn-CER event. 3102 The logic that handles incoming connections SHOULD close and discard 3103 the connection if any message other than CER arrives, or if an 3104 implementation-defined timeout occurs prior to receipt of CER. 3106 Because handling of incoming connections up to and including receipt 3107 of CER requires logic, separate from that of any individual state 3108 machine associated with a particular peer, it is described separately 3109 in this section rather than in the state machine above. 3111 5.6.2. Events 3113 Transitions and actions in the automaton are caused by events. In 3114 this section, we will ignore the -I and -R prefix, since the actual 3115 event would be identical, but would occur on one of two possible 3116 connections. 3118 Start The Diameter application has signaled that a 3119 connection should be initiated with the peer. 3121 R-Conn-CER An acknowledgement is received stating that the 3122 transport connection has been established, and the 3123 associated CER has arrived. 3125 Rcv-Conn-Ack A positive acknowledgement is received confirming that 3126 the transport connection is established. 3128 Rcv-Conn-Nack A negative acknowledgement was received stating that 3129 the transport connection was not established. 3131 Timeout An application-defined timer has expired while waiting 3132 for some event. 3134 Rcv-CER A CER message from the peer was received. 3136 Rcv-CEA A CEA message from the peer was received. 3138 Rcv-Non-CEA A message other than CEA from the peer was received. 3140 Peer-Disc A disconnection indication from the peer was received. 3142 Rcv-DPR A DPR message from the peer was received. 3144 Rcv-DPA A DPA message from the peer was received. 3146 Win-Election An election was held, and the local node was the 3147 winner. 3149 Send-Message A message is to be sent. 3151 Rcv-Message A message other than CER, CEA, DPR, DPA, DWR or DWA 3152 was received. 3154 Stop The Diameter application has signaled that a 3155 connection should be terminated (e.g., on system 3156 shutdown). 3158 5.6.3. Actions 3160 Actions in the automaton are caused by events and typically indicate 3161 the transmission of packets and/or an action to be taken on the 3162 connection. In this section we will ignore the I- and R-prefix, 3163 since the actual action would be identical, but would occur on one of 3164 two possible connections. 3166 Snd-Conn-Req A transport connection is initiated with the peer. 3168 Accept The incoming connection associated with the R-Conn-CER 3169 is accepted as the responder connection. 3171 Reject The incoming connection associated with the R-Conn-CER 3172 is disconnected. 3174 Process-CER The CER associated with the R-Conn-CER is processed. 3175 Snd-CER A CER message is sent to the peer. 3177 Snd-CEA A CEA message is sent to the peer. 3179 Cleanup If necessary, the connection is shutdown, and any 3180 local resources are freed. 3182 Error The transport layer connection is disconnected, 3183 either politely or abortively, in response to 3184 an error condition. Local resources are freed. 3186 Process-CEA A received CEA is processed. 3188 Snd-DPR A DPR message is sent to the peer. 3190 Snd-DPA A DPA message is sent to the peer. 3192 Disc The transport layer connection is disconnected, 3193 and local resources are freed. 3195 Elect An election occurs (see Section 5.6.4 for more 3196 information). 3198 Snd-Message A message is sent. 3200 Snd-DWR A DWR message is sent. 3202 Snd-DWA A DWA message is sent. 3204 Process-DWR The DWR message is serviced. 3206 Process-DWA The DWA message is serviced. 3208 Process A message is serviced. 3210 5.6.4. The Election Process 3212 The election is performed on the responder. The responder compares 3213 the Origin-Host received in the CER with its own Origin-Host as two 3214 streams of octets. If the local Origin-Host lexicographically 3215 succeeds the received Origin-Host a Win-Election event is issued 3216 locally. Diameter identities are in ASCII form therefore the lexical 3217 comparison is consistent with DNS case insensitivity where octets 3218 that fall in the ASCII range 'a' through 'z' MUST compare equally to 3219 their upper-case counterparts between 'A' and 'Z'. See Appendix D 3220 for interactions between the Diameter protocol and Internationalized 3221 Domain Name (IDNs). 3223 The winner of the election MUST close the connection it initiated. 3224 Historically, maintaining the responder side of a connection was more 3225 efficient than maintaining the initiator side. However, current 3226 practices makes this distinction irrelevant. 3228 6. Diameter message processing 3230 This section describes how Diameter requests and answers are created 3231 and processed. 3233 6.1. Diameter Request Routing Overview 3235 A request is sent towards its final destination using a combination 3236 of the Destination-Realm and Destination-Host AVPs, in one of these 3237 three combinations: 3239 o a request that is not able to be proxied (such as CER) MUST NOT 3240 contain either Destination-Realm or Destination-Host AVPs. 3242 o a request that needs to be sent to a home server serving a 3243 specific realm, but not to a specific server (such as the first 3244 request of a series of round-trips), MUST contain a Destination- 3245 Realm AVP, but MUST NOT contain a Destination-Host AVP. For 3246 Diameter clients, the value of the Destination-Realm AVP MAY be 3247 extracted from the User-Name AVP, or other methods. 3249 o otherwise, a request that needs to be sent to a specific home 3250 server among those serving a given realm, MUST contain both the 3251 Destination-Realm and Destination-Host AVPs. 3253 The Destination-Host AVP is used as described above when the 3254 destination of the request is fixed, which includes: 3256 o Authentication requests that span multiple round trips 3258 o A Diameter message that uses a security mechanism that makes use 3259 of a pre-established session key shared between the source and the 3260 final destination of the message. 3262 o Server initiated messages that MUST be received by a specific 3263 Diameter client (e.g., access device), such as the Abort-Session- 3264 Request message, which is used to request that a particular user's 3265 session be terminated. 3267 Note that an agent can forward a request to a host described in the 3268 Destination-Host AVP only if the host in question is included in its 3269 peer table (see Section 2.7). Otherwise, the request is routed based 3270 on the Destination-Realm only (see Sections 6.1.6). 3272 When a message is received, the message is processed in the following 3273 order: 3275 o If the message is destined for the local host, the procedures 3276 listed in Section 6.1.4 are followed. 3278 o If the message is intended for a Diameter peer with whom the local 3279 host is able to directly communicate, the procedures listed in 3280 Section 6.1.5 are followed. This is known as Request Forwarding. 3282 o The procedures listed in Section 6.1.6 are followed, which is 3283 known as Request Routing. 3285 o If none of the above is successful, an answer is returned with the 3286 Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the E-bit set. 3288 For routing of Diameter messages to work within an administrative 3289 domain, all Diameter nodes within the realm MUST be peers. 3291 Note the processing rules contained in this section are intended to 3292 be used as general guidelines to Diameter developers. Certain 3293 implementations MAY use different methods than the ones described 3294 here, and still comply with the protocol specification. See Section 3295 7 for more detail on error handling. 3297 6.1.1. Originating a Request 3299 When creating a request, in addition to any other procedures 3300 described in the application definition for that specific request, 3301 the following procedures MUST be followed: 3303 o the Command-Code is set to the appropriate value 3305 o the 'R' bit is set 3307 o the End-to-End Identifier is set to a locally unique value 3309 o the Origin-Host and Origin-Realm AVPs MUST be set to the 3310 appropriate values, used to identify the source of the message 3312 o the Destination-Host and Destination-Realm AVPs MUST be set to the 3313 appropriate values as described in Section 6.1. 3315 6.1.2. Sending a Request 3317 When sending a request, originated either locally, or as the result 3318 of a forwarding or routing operation, the following procedures SHOULD 3319 be followed: 3321 o The Hop-by-Hop Identifier SHOULD be set to a locally unique value. 3323 o The message SHOULD be saved in the list of pending requests. 3325 Other actions to perform on the message based on the particular role 3326 the agent is playing are described in the following sections. 3328 6.1.3. Receiving Requests 3330 A relay or proxy agent MUST check for forwarding loops when receiving 3331 requests. A loop is detected if the server finds its own identity in 3332 a Route-Record AVP. When such an event occurs, the agent MUST answer 3333 with the Result-Code AVP set to DIAMETER_LOOP_DETECTED. 3335 6.1.4. Processing Local Requests 3337 A request is known to be for local consumption when one of the 3338 following conditions occur: 3340 o The Destination-Host AVP contains the local host's identity, 3342 o The Destination-Host AVP is not present, the Destination-Realm AVP 3343 contains a realm the server is configured to process locally, and 3344 the Diameter application is locally supported, or 3346 o Both the Destination-Host and the Destination-Realm are not 3347 present. 3349 When a request is locally processed, the rules in Section 6.2 should 3350 be used to generate the corresponding answer. 3352 6.1.5. Request Forwarding 3354 Request forwarding is done using the Diameter Peer Table. The 3355 Diameter peer table contains all of the peers that the local node is 3356 able to directly communicate with. 3358 When a request is received, and the host encoded in the Destination- 3359 Host AVP is one that is present in the peer table, the message SHOULD 3360 be forwarded to the peer. 3362 6.1.6. Request Routing 3364 Diameter request message routing is done via realms and application 3365 identifiers. A Diameter message that may be forwarded by Diameter 3366 agents (proxies, redirect or relay agents) MUST include the target 3367 realm in the Destination-Realm AVP. Request routing SHOULD rely on 3368 the Destination-Realm AVP and the Application Id present in the 3369 request message header to aid in the routing decision. The realm MAY 3370 be retrieved from the User-Name AVP, which is in the form of a 3371 Network Access Identifier (NAI). The realm portion of the NAI is 3372 inserted in the Destination-Realm AVP. 3374 Diameter agents MAY have a list of locally supported realms and 3375 applications, and MAY have a list of externally supported realms and 3376 applications. When a request is received that includes a realm 3377 and/or application that is not locally supported, the message is 3378 routed to the peer configured in the Routing Table (see Section 2.7). 3380 Realm names and Application Ids are the minimum supported routing 3381 criteria, additional information may be needed to support redirect 3382 semantics. 3384 6.1.7. Predictive Loop Avoidance 3386 Before forwarding or routing a request, Diameter agents, in addition 3387 to processing done in Section 6.1.3, SHOULD check for the presence of 3388 candidate route's peer identity in any of the Route-Record AVPs. In 3389 an event of the agent detecting the presence of a candidate route's 3390 peer identity in a Route-Record AVP, the agent MUST ignore such route 3391 for the Diameter request message and attempt alternate routes if any. 3392 In case all the candidate routes are eliminated by the above 3393 criteria, the agent SHOULD return DIAMETER_UNABLE_TO_DELIVER message. 3395 6.1.8. Redirecting Requests 3397 When a redirect agent receives a request whose routing entry is set 3398 to REDIRECT, it MUST reply with an answer message with the 'E' bit 3399 set, while maintaining the Hop-by-Hop Identifier in the header, and 3400 include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of 3401 the servers associated with the routing entry are added in separate 3402 Redirect-Host AVP. 3404 +------------------+ 3405 | Diameter | 3406 | Redirect Agent | 3407 +------------------+ 3408 ^ | 2. command + 'E' bit 3409 1. Request | | Result-Code = 3410 joe@example.com | | DIAMETER_REDIRECT_INDICATION + 3411 | | Redirect-Host AVP(s) 3412 | v 3413 +-------------+ 3. Request +-------------+ 3414 | example.com |------------->| example.net | 3415 | Relay | | Diameter | 3416 | Agent |<-------------| Server | 3417 +-------------+ 4. Answer +-------------+ 3418 Figure 5: Diameter Redirect Agent 3420 The receiver of the answer message with the 'E' bit set, and the 3421 Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-by- 3422 hop field in the Diameter header to identify the request in the 3423 pending message queue (see Section 5.3) that is to be redirected. If 3424 no transport connection exists with the new agent, one is created, 3425 and the request is sent directly to it. 3427 Multiple Redirect-Host AVPs are allowed. The receiver of the answer 3428 message with the 'E' bit set selects exactly one of these hosts as 3429 the destination of the redirected message. 3431 When the Redirect-Host-Usage AVP included in the answer message has a 3432 non-zero value, a route entry for the redirect indications is created 3433 and cached by the receiver. The redirect usage for such route entry 3434 is set by the value of Redirect-Host-Usage AVP and the lifetime of 3435 the cached route entry is set by Redirect-Max-Cache-Time AVP value. 3437 It is possible that multiple redirect indications can create multiple 3438 cached route entries differing only in their redirect usage and the 3439 peer to forward messages to. As an example, two(2) route entries 3440 that are created by two(2) redirect indications results in two(2) 3441 cached routes for the same realm and Application Id. However, one 3442 has a redirect usage of ALL_SESSION where matching request will be 3443 forwarded to one peer and the other has a redirect usage of ALL_REALM 3444 where request are forwarded to another peer. Therefore, an incoming 3445 request that matches the realm and Application Id of both routes will 3446 need additional resolution. In such a case, a routing precedence 3447 rule MUST be used against the redirect usage value to resolve the 3448 contention. The precedence rule can be found in Section 6.13. 3450 6.1.9. Relaying and Proxying Requests 3452 A relay or proxy agent MUST append a Route-Record AVP to all requests 3453 forwarded. The AVP contains the identity of the peer the request was 3454 received from. 3456 The Hop-by-Hop identifier in the request is saved, and replaced with 3457 a locally unique value. The source of the request is also saved, 3458 which includes the IP address, port and protocol. 3460 A relay or proxy agent MAY include the Proxy-Info AVP in requests if 3461 it requires access to any local state information when the 3462 corresponding response is received. The Proxy-Info AVP has security 3463 implications as state information is distribute to other entities. 3464 As such, it is RECOMMMENDED to protect the content of the Proxy-Info 3465 AVP with cryptographic mechanisms, for example by using a keyed 3466 message digest. Such a mechanism, however, requires the management 3467 of keys, although only locally at the Diameter server. Still, a full 3468 description of the management of the keys used to protect the Proxy- 3469 Info AVP is beyond the scope of this document. Below is a list of 3470 commonly recommended: 3472 o The keys should be generated securely following the randomness 3473 recommendations in [RFC4086]. 3475 o The keys and cryptographic protection algorithms should be at 3476 least 128 bits in strength. 3478 o The keys should not be used for any other purpose than generating 3479 and verifying tickets. 3481 o The keys should be changed regularly. 3483 o The keys should be changed if the ticket format or cryptographic 3484 protection algorithms change. 3486 The message is then forwarded to the next hop, as identified in the 3487 Routing Table. 3489 Figure 6 provides an example of message routing using the procedures 3490 listed in these sections. 3492 (Origin-Host=nas.example.net) (Origin-Host=nas.example.net) 3493 (Origin-Realm=example.net) (Origin-Realm=example.net) 3494 (Destination-Realm=example.com) (Destination- 3495 Realm=example.com) 3496 (Route-Record=nas.example.net) 3497 +------+ ------> +------+ ------> +------+ 3498 | | (Request) | | (Request) | | 3499 | NAS +-------------------+ DRL +-------------------+ HMS | 3500 | | | | | | 3501 +------+ <------ +------+ <------ +------+ 3502 example.net (Answer) example.net (Answer) example.com 3503 (Origin-Host=hms.example.com) (Origin-Host=hms.example.com) 3504 (Origin-Realm=example.com) (Origin-Realm=example.com) 3506 Figure 6: Routing of Diameter messages 3508 Relay and proxy agents are not required to perform full inspection of 3509 incoming messages. At a minimum, validation of the message header 3510 and relevant routing AVPs has to be done when relaying messages. 3511 Proxy agents may optionally perform more in-depth message validation 3512 for applications it is interested in. 3514 6.2. Diameter Answer Processing 3516 When a request is locally processed, the following procedures MUST be 3517 applied to create the associated answer, in addition to any 3518 additional procedures that MAY be discussed in the Diameter 3519 application defining the command: 3521 o The same Hop-by-Hop identifier in the request is used in the 3522 answer. 3524 o The local host's identity is encoded in the Origin-Host AVP. 3526 o The Destination-Host and Destination-Realm AVPs MUST NOT be 3527 present in the answer message. 3529 o The Result-Code AVP is added with its value indicating success or 3530 failure. 3532 o If the Session-Id is present in the request, it MUST be included 3533 in the answer. 3535 o Any Proxy-Info AVPs in the request MUST be added to the answer 3536 message, in the same order they were present in the request. 3538 o The 'P' bit is set to the same value as the one in the request. 3540 o The same End-to-End identifier in the request is used in the 3541 answer. 3543 Note that the error messages (see Section 7.3) are also subjected to 3544 the above processing rules. 3546 6.2.1. Processing received Answers 3548 A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an 3549 answer received against the list of pending requests. The 3550 corresponding message should be removed from the list of pending 3551 requests. It SHOULD ignore answers received that do not match a 3552 known Hop-by-Hop Identifier. 3554 6.2.2. Relaying and Proxying Answers 3556 If the answer is for a request which was proxied or relayed, the 3557 agent MUST restore the original value of the Diameter header's Hop- 3558 by-Hop Identifier field. 3560 If the last Proxy-Info AVP in the message is targeted to the local 3561 Diameter server, the AVP MUST be removed before the answer is 3562 forwarded. 3564 If a relay or proxy agent receives an answer with a Result-Code AVP 3565 indicating a failure, it MUST NOT modify the contents of the AVP. 3566 Any additional local errors detected SHOULD be logged, but not 3567 reflected in the Result-Code AVP. If the agent receives an answer 3568 message with a Result-Code AVP indicating success, and it wishes to 3569 modify the AVP to indicate an error, it MUST modify the Result-Code 3570 AVP to contain the appropriate error in the message destined towards 3571 the access device as well as include the Error-Reporting-Host AVP and 3572 it MUST issue an STR on behalf of the access device towards the 3573 Diameter server. 3575 The agent MUST then send the answer to the host that it received the 3576 original request from. 3578 6.3. Origin-Host AVP 3580 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and 3581 MUST be present in all Diameter messages. This AVP identifies the 3582 endpoint that originated the Diameter message. Relay agents MUST NOT 3583 modify this AVP. 3585 The value of the Origin-Host AVP is guaranteed to be unique within a 3586 single host. 3588 Note that the Origin-Host AVP may resolve to more than one address as 3589 the Diameter peer may support more than one address. 3591 This AVP SHOULD be placed as close to the Diameter header as 3592 possible. 3594 6.4. Origin-Realm AVP 3596 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity. 3597 This AVP contains the Realm of the originator of any Diameter message 3598 and MUST be present in all messages. 3600 This AVP SHOULD be placed as close to the Diameter header as 3601 possible. 3603 6.5. Destination-Host AVP 3605 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. 3606 This AVP MUST be present in all unsolicited agent initiated messages, 3607 MAY be present in request messages, and MUST NOT be present in Answer 3608 messages. 3610 The absence of the Destination-Host AVP will cause a message to be 3611 sent to any Diameter server supporting the application within the 3612 realm specified in Destination-Realm AVP. 3614 This AVP SHOULD be placed as close to the Diameter header as 3615 possible. 3617 6.6. Destination-Realm AVP 3619 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity, 3620 and contains the realm the message is to be routed to. The 3621 Destination-Realm AVP MUST NOT be present in Answer messages. 3622 Diameter Clients insert the realm portion of the User-Name AVP. 3623 Diameter servers initiating a request message use the value of the 3624 Origin-Realm AVP from a previous message received from the intended 3625 target host (unless it is known a priori). When present, the 3626 Destination-Realm AVP is used to perform message routing decisions. 3628 An ABNF for a request message that includes the Destination-Realm AVP 3629 SHOULD list the Destination-Realm AVP as a required AVP (an AVP 3630 indicated as {AVP}) otherwise the message is inherently a non- 3631 routable messages. 3633 This AVP SHOULD be placed as close to the Diameter header as 3634 possible. 3636 6.7. Routing AVPs 3638 The AVPs defined in this section are Diameter AVPs used for routing 3639 purposes. These AVPs change as Diameter messages are processed by 3640 agents. 3642 6.7.1. Route-Record AVP 3644 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The 3645 identity added in this AVP MUST be the same as the one received in 3646 the Origin-Host of the Capabilities Exchange message. 3648 6.7.2. Proxy-Info AVP 3650 The Proxy-Info AVP (AVP Code 284) is of type Grouped. This AVP 3651 contains the identity and local state information of Diameter node 3652 that creates and adds it to a message. The Grouped Data field has 3653 the following ABNF grammar: 3655 Proxy-Info ::= < AVP Header: 284 > 3656 { Proxy-Host } 3657 { Proxy-State } 3659 * [ AVP ] 3661 6.7.3. Proxy-Host AVP 3663 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This 3664 AVP contains the identity of the host that added the Proxy-Info AVP. 3666 6.7.4. Proxy-State AVP 3668 The Proxy-State AVP (AVP Code 33) is of type OctetString. It 3669 contains state information that would otherwise be stored at the 3670 Diameter entity that created it. As such, this AVP MUST be treated 3671 as opaque data by entities other Diameter entities. 3673 6.8. Auth-Application-Id AVP 3675 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and 3676 is used in order to advertise support of the Authentication and 3677 Authorization portion of an application (see Section 2.4). If 3678 present in a message other than CER and CEA, the value of the Auth- 3679 Application-Id AVP MUST match the Application Id present in the 3680 Diameter message header. 3682 6.9. Acct-Application-Id AVP 3684 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and 3685 is used in order to advertise support of the Accounting portion of an 3686 application (see Section 2.4). If present in a message other than 3687 CER and CEA, the value of the Acct-Application-Id AVP MUST match the 3688 Application Id present in the Diameter message header. 3690 6.10. Inband-Security-Id AVP 3692 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and 3693 is used in order to advertise support of the security portion of the 3694 application. The use of this AVP in CER and CEA messages is no 3695 longer recommended. Instead, discovery of a Diameter entities 3696 security capabilities can be done either through static configuration 3697 or via Diameter Peer Discovery described in Section 5.2. 3699 The following values are supported: 3701 NO_INBAND_SECURITY 0 3703 This peer does not support TLS. This is the default value, if the 3704 AVP is omitted. 3706 TLS 1 3708 This node supports TLS security, as defined by [RFC5246]. 3710 6.11. Vendor-Specific-Application-Id AVP 3712 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type 3713 Grouped and is used to advertise support of a vendor-specific 3714 Diameter Application. Exactly one instance of either Auth- 3715 Application-Id or Acct-Application-Id AVP MUST be present. The 3716 Application Id carried by either Auth-Application-Id or Acct- 3717 Application-Id AVP MUST comply with vendor specific Application Id 3718 assignment described in Sec 11.3. It MUST also match the Application 3719 Id present in the Diameter header except when used in a CER or CEA 3720 messages. 3722 The Vendor-Id AVP is an informational AVP pertaining to the vendor 3723 who may have authorship of the vendor-specific Diameter application. 3724 It MUST NOT be used as a means of defining a completely separate 3725 vendor-specific Application Id space. 3727 The Vendor-Specific-Application-Id AVP SHOULD be placed as close to 3728 the Diameter header as possible. 3730 AVP Format 3732 ::= < AVP Header: 260 > 3733 { Vendor-Id } 3734 [ Auth-Application-Id ] 3735 [ Acct-Application-Id ] 3737 A Vendor-Specific-Application-Id AVP MUST contain exactly one of 3738 either Auth-Application-Id or Acct-Application-Id. If a Vendor- 3739 Specific-Application-Id is received without any of these two AVPs, 3740 then the recipient SHOULD issue an answer with a Result-Code set to 3741 DIAMETER_MISSING_AVP. The answer SHOULD also include a Failed-AVP 3742 which MUST contain an example of an Auth-Application-Id AVP and an 3743 Acct-Application-Id AVP. 3745 If a Vendor-Specific-Application-Id is received that contains both 3746 Auth-Application-Id and Acct-Application-Id, then the recipient MUST 3747 issue an answer with Result-Code set to 3748 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. The answer MUST also include a 3749 Failed-AVP which MUST contain the received Auth-Application-Id AVP 3750 and Acct-Application-Id AVP. 3752 6.12. Redirect-Host AVP 3754 The Redirect-Host AVP (AVP Code 292) is of type DiameterURI. One or 3755 more of instances of this AVP MUST be present if the answer message's 3756 'E' bit is set and the Result-Code AVP is set to 3757 DIAMETER_REDIRECT_INDICATION. 3759 Upon receiving the above, the receiving Diameter node SHOULD forward 3760 the request directly to one of the hosts identified in these AVPs. 3761 The server contained in the selected Redirect-Host AVP SHOULD be used 3762 for all messages matching the criteria set by the Redirect-Host-Usage 3763 AVP. 3765 6.13. Redirect-Host-Usage AVP 3767 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated. 3768 This AVP MAY be present in answer messages whose 'E' bit is set and 3769 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION. 3771 When present, this AVP provides a hints about how the routing entry 3772 resulting from the Redirect-Host is to be used. The following values 3773 are supported: 3775 DONT_CACHE 0 3777 The host specified in the Redirect-Host AVP SHOULD NOT be cached. 3778 This is the default value. 3780 ALL_SESSION 1 3782 All messages within the same session, as defined by the same value 3783 of the Session-ID AVP SHOULD be sent to the host specified in the 3784 Redirect-Host AVP. 3786 ALL_REALM 2 3788 All messages destined for the realm requested SHOULD be sent to 3789 the host specified in the Redirect-Host AVP. 3791 REALM_AND_APPLICATION 3 3793 All messages for the application requested to the realm specified 3794 SHOULD be sent to the host specified in the Redirect-Host AVP. 3796 ALL_APPLICATION 4 3798 All messages for the application requested SHOULD be sent to the 3799 host specified in the Redirect-Host AVP. 3801 ALL_HOST 5 3803 All messages that would be sent to the host that generated the 3804 Redirect-Host SHOULD be sent to the host specified in the 3805 Redirect- Host AVP. 3807 ALL_USER 6 3809 All messages for the user requested SHOULD be sent to the host 3810 specified in the Redirect-Host AVP. 3812 When multiple cached routes are created by redirect indications and 3813 they differ only in redirect usage and peers to forward requests to 3814 (see Section 6.1.8), a precedence rule MUST be applied to the 3815 redirect usage values of the cached routes during normal routing to 3816 resolve contentions that may occur. The precedence rule is the order 3817 that dictate which redirect usage should be considered before any 3818 other as they appear. The order is as follows: 3820 1. ALL_SESSION 3822 2. ALL_USER 3824 3. REALM_AND_APPLICATION 3826 4. ALL_REALM 3828 5. ALL_APPLICATION 3830 6. ALL_HOST 3832 6.14. Redirect-Max-Cache-Time AVP 3834 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. 3835 This AVP MUST be present in answer messages whose 'E' bit is set, the 3836 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the 3837 Redirect-Host-Usage AVP set to a non-zero value. 3839 This AVP contains the maximum number of seconds the peer and route 3840 table entries, created as a result of the Redirect-Host, SHOULD be 3841 cached. Note that once a host is no longer reachable, any associated 3842 cache, peer and routing table entries MUST be deleted. 3844 7. Error Handling 3846 There are two different types of errors in Diameter; protocol and 3847 application errors. A protocol error is one that occurs at the base 3848 protocol level, and MAY require per hop attention (e.g., message 3849 routing error). Application errors, on the other hand, generally 3850 occur due to a problem with a function specified in a Diameter 3851 application (e.g., user authentication, missing AVP). 3853 Result-Code AVP values that are used to report protocol errors MUST 3854 only be present in answer messages whose 'E' bit is set. When a 3855 request message is received that causes a protocol error, an answer 3856 message is returned with the 'E' bit set, and the Result-Code AVP is 3857 set to the appropriate protocol error value. As the answer is sent 3858 back towards the originator of the request, each proxy or relay agent 3859 MAY take action on the message. 3861 1. Request +---------+ Link Broken 3862 +-------------------------->|Diameter |----///----+ 3863 | +---------------------| | v 3864 +------+--+ | 2. answer + 'E' set | Relay 2 | +--------+ 3865 |Diameter |<-+ (Unable to Forward) +---------+ |Diameter| 3866 | | | Home | 3867 | Relay 1 |--+ +---------+ | Server | 3868 +---------+ | 3. Request |Diameter | +--------+ 3869 +-------------------->| | ^ 3870 | Relay 3 |-----------+ 3871 +---------+ 3873 Figure 7: Example of Protocol Error causing answer message 3875 Figure 7 provides an example of a message forwarded upstream by a 3876 Diameter relay. When the message is received by Relay 2, and it 3877 detects that it cannot forward the request to the home server, an 3878 answer message is returned with the 'E' bit set and the Result-Code 3879 AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls 3880 within the protocol error category, Relay 1 would take special 3881 action, and given the error, attempt to route the message through its 3882 alternate Relay 3. 3884 +---------+ 1. Request +---------+ 2. Request +---------+ 3885 | Access |------------>|Diameter |------------>|Diameter | 3886 | | | | | Home | 3887 | Device |<------------| Relay |<------------| Server | 3888 +---------+ 4. Answer +---------+ 3. Answer +---------+ 3889 (Missing AVP) (Missing AVP) 3891 Figure 8: Example of Application Error Answer message 3893 Figure 8 provides an example of a Diameter message that caused an 3894 application error. When application errors occur, the Diameter 3895 entity reporting the error clears the 'R' bit in the Command Flags, 3896 and adds the Result-Code AVP with the proper value. Application 3897 errors do not require any proxy or relay agent involvement, and 3898 therefore the message would be forwarded back to the originator of 3899 the request. 3901 In the case where the answer message itself contains errors, any 3902 related session SHOULD be terminated by sending an STR or ASR 3903 message. The Termination-Cause AVP in the STR MAY be filled with the 3904 appropriate value to indicate the cause of the error. An application 3905 MAY also send an application-specific request instead of STR or ASR 3906 to signal the error in the case where no state is maintained or to 3907 allow for some form of error recovery with the corresponding Diameter 3908 entity. 3910 There are certain Result-Code AVP application errors that require 3911 additional AVPs to be present in the answer. In these cases, the 3912 Diameter node that sets the Result-Code AVP to indicate the error 3913 MUST add the AVPs. Examples are: 3915 o A request with an unrecognized AVP is received with the 'M' bit 3916 (Mandatory bit) set, causes an answer to be sent with the Result- 3917 Code AVP set to DIAMETER_AVP_UNSUPPORTED, and the Failed-AVP AVP 3918 containing the offending AVP. 3920 o A request with an AVP that is received with an unrecognized value 3921 causes an answer to be returned with the Result-Code AVP set to 3922 DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the 3923 AVP causing the error. 3925 o A command is received that is missing AVP(s) that are defined as 3926 required in the commands ABNF; examples are AVPs indicated as 3927 {AVP}. The receiver issues an answer with the Result-Code set to 3928 DIAMETER_MISSING_AVP, and creates an AVP with the AVP Code and 3929 other fields set as expected in the missing AVP. The created AVP 3930 is then added to the Failed- AVP AVP. 3932 The Result-Code AVP describes the error that the Diameter node 3933 encountered in its processing. In case there are multiple errors, 3934 the Diameter node MUST report only the first error it encountered 3935 (detected possibly in some implementation dependent order). The 3936 specific errors that can be described by this AVP are described in 3937 the following section. 3939 7.1. Result-Code AVP 3941 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and 3942 indicates whether a particular request was completed successfully or 3943 whether an error occurred. All Diameter answer messages in IETF 3944 defined Diameter application specification MUST include one Result- 3945 Code AVP. A non-successful Result-Code AVP (one containing a non 3946 2xxx value other than DIAMETER_REDIRECT_INDICATION) MUST include the 3947 Error-Reporting-Host AVP if the host setting the Result-Code AVP is 3948 different from the identity encoded in the Origin-Host AVP. 3950 The Result-Code data field contains an IANA-managed 32-bit address 3951 space representing errors (see Section 11.4). Diameter provides the 3952 following classes of errors, all identified by the thousands digit in 3953 the decimal notation: 3955 o 1xxx (Informational) 3957 o 2xxx (Success) 3959 o 3xxx (Protocol Errors) 3961 o 4xxx (Transient Failures) 3963 o 5xxx (Permanent Failure) 3965 A non-recognized class (one whose first digit is not defined in this 3966 section) MUST be handled as a permanent failure. 3968 7.1.1. Informational 3970 Errors that fall within this category are used to inform the 3971 requester that a request could not be satisfied, and additional 3972 action is required on its part before access is granted. 3974 DIAMETER_MULTI_ROUND_AUTH 1001 3976 This informational error is returned by a Diameter server to 3977 inform the access device that the authentication mechanism being 3978 used requires multiple round trips, and a subsequent request needs 3979 to be issued in order for access to be granted. 3981 7.1.2. Success 3983 Errors that fall within the Success category are used to inform a 3984 peer that a request has been successfully completed. 3986 DIAMETER_SUCCESS 2001 3988 The request was successfully completed. 3990 DIAMETER_LIMITED_SUCCESS 2002 3992 When returned, the request was successfully completed, but 3993 additional processing is required by the application in order to 3994 provide service to the user. 3996 7.1.3. Protocol Errors 3998 Errors that fall within the Protocol Error category SHOULD be treated 3999 on a per-hop basis, and Diameter proxies MAY attempt to correct the 4000 error, if it is possible. Note that these errors MUST only be used 4001 in answer messages whose 'E' bit is set. This document omits some 4002 error codes defined in [RFC3588]. To provide backward compatibility 4003 with [RFC3588] implementations these error code values are not re- 4004 used and hence the error codes values enumerated below are non- 4005 sequential. 4007 DIAMETER_UNABLE_TO_DELIVER 3002 4009 This error is given when Diameter can not deliver the message to 4010 the destination, either because no host within the realm 4011 supporting the required application was available to process the 4012 request, or because Destination-Host AVP was given without the 4013 associated Destination-Realm AVP. 4015 DIAMETER_REALM_NOT_SERVED 3003 4017 The intended realm of the request is not recognized. 4019 DIAMETER_TOO_BUSY 3004 4021 When returned, a Diameter node SHOULD attempt to send the message 4022 to an alternate peer. This error MUST only be used when a 4023 specific server is requested, and it cannot provide the requested 4024 service. 4026 DIAMETER_LOOP_DETECTED 3005 4028 An agent detected a loop while trying to get the message to the 4029 intended recipient. The message MAY be sent to an alternate peer, 4030 if one is available, but the peer reporting the error has 4031 identified a configuration problem. 4033 DIAMETER_REDIRECT_INDICATION 3006 4035 A redirect agent has determined that the request could not be 4036 satisfied locally and the initiator of the request SHOULD direct 4037 the request directly to the server, whose contact information has 4038 been added to the response. When set, the Redirect-Host AVP MUST 4039 be present. 4041 DIAMETER_APPLICATION_UNSUPPORTED 3007 4043 A request was sent for an application that is not supported. 4045 DIAMETER_INVALID_BIT_IN_HEADER 3011 4047 This error is returned when a reserved bit in the Diameter header 4048 is set to one (1) or the bits in the Diameter header defined in 4049 Section 3 are set incorrectly. 4051 DIAMETER_INVALID_MESSAGE_LENGTH 3012 4053 This error is returned when a request is received with an invalid 4054 message length. 4056 7.1.4. Transient Failures 4058 Errors that fall within the transient failures category are used to 4059 inform a peer that the request could not be satisfied at the time it 4060 was received, but MAY be able to satisfy the request in the future. 4061 Note that these errors MUST be used in answer messages whose 'E' bit 4062 is not set. 4064 DIAMETER_AUTHENTICATION_REJECTED 4001 4066 The authentication process for the user failed, most likely due to 4067 an invalid password used by the user. Further attempts MUST only 4068 be tried after prompting the user for a new password. 4070 DIAMETER_OUT_OF_SPACE 4002 4072 A Diameter node received the accounting request but was unable to 4073 commit it to stable storage due to a temporary lack of space. 4075 ELECTION_LOST 4003 4077 The peer has determined that it has lost the election process and 4078 has therefore disconnected the transport connection. 4080 7.1.5. Permanent Failures 4082 Errors that fall within the permanent failures category are used to 4083 inform the peer that the request failed, and should not be attempted 4084 again. Note that these errors SHOULD be used in answer messages 4085 whose 'E' bit is not set. In error conditions where it is not 4086 possible or efficient to compose application-specific answer grammar 4087 then answer messages with E-bit set and complying to the grammar 4088 described in 7.2 MAY also be used for permanent errors. 4090 To provide backward compatibility with existing implementations that 4091 follow [RFC3588], some of the error values that have previously been 4092 used in this category by [RFC3588] will not be re-used. Therefore 4093 the error values enumerated here maybe non-sequential. 4095 DIAMETER_AVP_UNSUPPORTED 5001 4097 The peer received a message that contained an AVP that is not 4098 recognized or supported and was marked with the Mandatory bit. A 4099 Diameter message with this error MUST contain one or more Failed- 4100 AVP AVP containing the AVPs that caused the failure. 4102 DIAMETER_UNKNOWN_SESSION_ID 5002 4104 The request contained an unknown Session-Id. 4106 DIAMETER_AUTHORIZATION_REJECTED 5003 4108 A request was received for which the user could not be authorized. 4109 This error could occur if the service requested is not permitted 4110 to the user. 4112 DIAMETER_INVALID_AVP_VALUE 5004 4114 The request contained an AVP with an invalid value in its data 4115 portion. A Diameter message indicating this error MUST include 4116 the offending AVPs within a Failed-AVP AVP. 4118 DIAMETER_MISSING_AVP 5005 4120 The request did not contain an AVP that is required by the Command 4121 Code definition. If this value is sent in the Result-Code AVP, a 4122 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP 4123 AVP MUST contain an example of the missing AVP complete with the 4124 Vendor-Id if applicable. The value field of the missing AVP 4125 should be of correct minimum length and contain zeroes. 4127 DIAMETER_RESOURCES_EXCEEDED 5006 4129 A request was received that cannot be authorized because the user 4130 has already expended allowed resources. An example of this error 4131 condition is a user that is restricted to one dial-up PPP port, 4132 attempts to establish a second PPP connection. 4134 DIAMETER_CONTRADICTING_AVPS 5007 4136 The Home Diameter server has detected AVPs in the request that 4137 contradicted each other, and is not willing to provide service to 4138 the user. The Failed-AVP AVPs MUST be present which contains the 4139 AVPs that contradicted each other. 4141 DIAMETER_AVP_NOT_ALLOWED 5008 4143 A message was received with an AVP that MUST NOT be present. The 4144 Failed-AVP AVP MUST be included and contain a copy of the 4145 offending AVP. 4147 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009 4149 A message was received that included an AVP that appeared more 4150 often than permitted in the message definition. The Failed-AVP 4151 AVP MUST be included and contain a copy of the first instance of 4152 the offending AVP that exceeded the maximum number of occurrences 4154 DIAMETER_NO_COMMON_APPLICATION 5010 4156 This error is returned by a Diameter node that receives a CER 4157 whereby no applications are common between the CER sending peer 4158 and the CER receiving peer. 4160 DIAMETER_UNSUPPORTED_VERSION 5011 4162 This error is returned when a request was received, whose version 4163 number is unsupported. 4165 DIAMETER_UNABLE_TO_COMPLY 5012 4167 This error is returned when a request is rejected for unspecified 4168 reasons. 4170 DIAMETER_INVALID_AVP_LENGTH 5014 4172 The request contained an AVP with an invalid length. A Diameter 4173 message indicating this error MUST include the offending AVPs 4174 within a Failed-AVP AVP. In cases where the erroneous avp length 4175 value exceeds the message length or is less than the minimum AVP 4176 header length, it is sufficient to include the offending AVP 4177 header and a zero filled payload of the minimum required length 4178 for the payloads data type. If the AVP is a grouped AVP, the 4179 grouped AVP header with an empty payload would be sufficient to 4180 indicate the offending AVP. In the case where the offending AVP 4181 header cannot be fully decoded when the AVP length is less than 4182 the minimum AVP header length, it is sufficient to include an 4183 offending AVP header that is formulated by padding the incomplete 4184 AVP header with zero up to the minimum AVP header length. 4186 DIAMETER_NO_COMMON_SECURITY 5017 4188 This error is returned when a CER message is received, and there 4189 are no common security mechanisms supported between the peers. A 4190 Capabilities-Exchange-Answer (CEA) MUST be returned with the 4191 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY. 4193 DIAMETER_UNKNOWN_PEER 5018 4195 A CER was received from an unknown peer. 4197 DIAMETER_COMMAND_UNSUPPORTED 5019 4199 This error code is used when a Diameter entity receives a message 4200 with a Command Code that it does not support. 4202 DIAMETER_INVALID_HDR_BITS 5020 4204 A request was received whose bits in the Diameter header were 4205 either set to an invalid combination, or to a value that is 4206 inconsistent with the command code's definition. 4208 DIAMETER_INVALID_AVP_BITS 5021 4210 A request was received that included an AVP whose flag bits are 4211 set to an unrecognized value, or that is inconsistent with the 4212 AVP's definition. 4214 7.2. Error Bit 4216 The 'E' (Error Bit) in the Diameter header is set when the request 4217 caused a protocol-related error (see Section 7.1.3). A message with 4218 the 'E' bit MUST NOT be sent as a response to an answer message. 4219 Note that a message with the 'E' bit set is still subjected to the 4220 processing rules defined in Section 6.2. When set, the answer 4221 message will not conform to the ABNF specification for the command, 4222 and will instead conform to the following ABNF: 4224 Message Format 4226 ::= < Diameter Header: code, ERR [PXY] > 4227 0*1< Session-Id > 4228 { Origin-Host } 4229 { Origin-Realm } 4230 { Result-Code } 4231 [ Origin-State-Id ] 4232 [ Error-Message ] 4233 [ Error-Reporting-Host ] 4234 [ Failed-AVP ] 4235 [ Experimental-Result ] 4236 * [ Proxy-Info ] 4237 * [ AVP ] 4239 Note that the code used in the header is the same than the one found 4240 in the request message, but with the 'R' bit cleared and the 'E' bit 4241 set. The 'P' bit in the header is set to the same value as the one 4242 found in the request message. 4244 7.3. Error-Message AVP 4246 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY 4247 accompany a Result-Code AVP as a human readable error message. The 4248 Error-Message AVP is not intended to be useful in an environment 4249 where error messages are processed automatically. It SHOULD NOT be 4250 expected that the content of this AVP is parsed by network entities. 4252 7.4. Error-Reporting-Host AVP 4254 The Error-Reporting-Host AVP (AVP Code 294) is of type 4255 DiameterIdentity. This AVP contains the identity of the Diameter 4256 host that sent the Result-Code AVP to a value other than 2001 4257 (Success), only if the host setting the Result-Code is different from 4258 the one encoded in the Origin-Host AVP. This AVP is intended to be 4259 used for troubleshooting purposes, and MUST be set when the Result- 4260 Code AVP indicates a failure. 4262 7.5. Failed-AVP AVP 4264 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides 4265 debugging information in cases where a request is rejected or not 4266 fully processed due to erroneous information in a specific AVP. The 4267 value of the Result-Code AVP will provide information on the reason 4268 for the Failed-AVP AVP. A Diameter message SHOULD contain only one 4269 Failed-AVP that corresponds to the error indicated by the Result-Code 4270 AVP. For practical purposes, this Failed-AVP would typically refer 4271 to the first AVP processing error that a Diameter node encounters. 4273 The possible reasons for this AVP are the presence of an improperly 4274 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP 4275 value, the omission of a required AVP, the presence of an explicitly 4276 excluded AVP (see tables in Section 10), or the presence of two or 4277 more occurrences of an AVP which is restricted to 0, 1, or 0-1 4278 occurrences. 4280 A Diameter message SHOULD contain one Failed-AVP AVP, containing the 4281 entire AVP that could not be processed successfully. If the failure 4282 reason is omission of a required AVP, an AVP with the missing AVP 4283 code, the missing vendor id, and a zero filled payload of the minimum 4284 required length for the omitted AVP will be added. If the failure 4285 reason is an invalid AVP length where the reported length is less 4286 than the minimum AVP header length or greater than the reported 4287 message length, a copy of the offending AVP header and a zero filled 4288 payload of the minimum required length SHOULD be added. 4290 In the case where the offending AVP is embedded within a grouped AVP, 4291 the Failed-AVP MAY contain the grouped AVP which in turn contains the 4292 single offending AVP. The same method MAY be employed if the grouped 4293 AVP itself is embedded in yet another grouped AVP and so on. In this 4294 case, the Failed-AVP MAY contain the grouped AVP hierarchy up to the 4295 single offending AVP. This enables the recipient to detect the 4296 location of the offending AVP when embedded in a group. 4298 AVP Format 4300 ::= < AVP Header: 279 > 4301 1* {AVP} 4303 7.6. Experimental-Result AVP 4305 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and 4306 indicates whether a particular vendor-specific request was completed 4307 successfully or whether an error occurred. This AVP has the 4308 following structure: 4310 AVP Format 4312 Experimental-Result ::= < AVP Header: 297 > 4313 { Vendor-Id } 4314 { Experimental-Result-Code } 4316 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies 4317 the vendor responsible for the assignment of the result code which 4318 follows. All Diameter answer messages defined in vendor-specific 4319 applications MUST include either one Result-Code AVP or one 4320 Experimental-Result AVP. 4322 7.7. Experimental-Result-Code AVP 4324 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 4325 and contains a vendor-assigned value representing the result of 4326 processing the request. 4328 It is recommended that vendor-specific result codes follow the same 4329 conventions given for the Result-Code AVP regarding the different 4330 types of result codes and the handling of errors (for non 2xxx 4331 values). 4333 8. Diameter User Sessions 4335 In general, Diameter can provide two different types of services to 4336 applications. The first involves authentication and authorization, 4337 and can optionally make use of accounting. The second only makes use 4338 of accounting. 4340 When a service makes use of the authentication and/or authorization 4341 portion of an application, and a user requests access to the network, 4342 the Diameter client issues an auth request to its local server. The 4343 auth request is defined in a service-specific Diameter application 4344 (e.g., NASREQ). The request contains a Session-Id AVP, which is used 4345 in subsequent messages (e.g., subsequent authorization, accounting, 4346 etc) relating to the user's session. The Session-Id AVP is a means 4347 for the client and servers to correlate a Diameter message with a 4348 user session. 4350 When a Diameter server authorizes a user to use network resources for 4351 a finite amount of time, and it is willing to extend the 4352 authorization via a future request, it MUST add the Authorization- 4353 Lifetime AVP to the answer message. The Authorization-Lifetime AVP 4354 defines the maximum number of seconds a user MAY make use of the 4355 resources before another authorization request is expected by the 4356 server. The Auth-Grace-Period AVP contains the number of seconds 4357 following the expiration of the Authorization-Lifetime, after which 4358 the server will release all state information related to the user's 4359 session. Note that if payment for services is expected by the 4360 serving realm from the user's home realm, the Authorization-Lifetime 4361 AVP, combined with the Auth-Grace-Period AVP, implies the maximum 4362 length of the session the home realm is willing to be fiscally 4363 responsible for. Services provided past the expiration of the 4364 Authorization-Lifetime and Auth-Grace-Period AVPs are the 4365 responsibility of the access device. Of course, the actual cost of 4366 services rendered is clearly outside the scope of the protocol. 4368 An access device that does not expect to send a re-authorization or a 4369 session termination request to the server MAY include the Auth- 4370 Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint 4371 to the server. If the server accepts the hint, it agrees that since 4372 no session termination message will be received once service to the 4373 user is terminated, it cannot maintain state for the session. If the 4374 answer message from the server contains a different value in the 4375 Auth-Session-State AVP (or the default value if the AVP is absent), 4376 the access device MUST follow the server's directives. Note that the 4377 value NO_STATE_MAINTAINED MUST NOT be set in subsequent re- 4378 authorization requests and answers. 4380 The base protocol does not include any authorization request 4381 messages, since these are largely application-specific and are 4382 defined in a Diameter application document. However, the base 4383 protocol does define a set of messages that are used to terminate 4384 user sessions. These are used to allow servers that maintain state 4385 information to free resources. 4387 When a service only makes use of the Accounting portion of the 4388 Diameter protocol, even in combination with an application, the 4389 Session-Id is still used to identify user sessions. However, the 4390 session termination messages are not used, since a session is 4391 signaled as being terminated by issuing an accounting stop message. 4393 Diameter may also be used for services that cannot be easily 4394 categorized as authentication, authorization or accounting (e.g., 4395 certain 3GPP IMS interfaces). In such cases, the finite state 4396 machine defined in subsequent sections may not be applicable. 4397 Therefore, the applications itself MAY need to define its own finite 4398 state machine. However, such application-specific state machines 4399 SHOULD follow the general state machine framework outlined in this 4400 document such as the use of Session-Id AVPs and the use of STR/STA, 4401 ASR/ASA messages for stateful sessions. 4403 8.1. Authorization Session State Machine 4405 This section contains a set of finite state machines, representing 4406 the life cycle of Diameter sessions, and which MUST be observed by 4407 all Diameter implementations that make use of the authentication 4408 and/or authorization portion of a Diameter application. The term 4409 Service-Specific below refers to a message defined in a Diameter 4410 application (e.g., Mobile IPv4, NASREQ). 4412 There are four different authorization session state machines 4413 supported in the Diameter base protocol. The first two describe a 4414 session in which the server is maintaining session state, indicated 4415 by the value of the Auth-Session-State AVP (or its absence). One 4416 describes the session from a client perspective, the other from a 4417 server perspective. The second two state machines are used when the 4418 server does not maintain session state. Here again, one describes 4419 the session from a client perspective, the other from a server 4420 perspective. 4422 When a session is moved to the Idle state, any resources that were 4423 allocated for the particular session must be released. Any event not 4424 listed in the state machines MUST be considered as an error 4425 condition, and an answer, if applicable, MUST be returned to the 4426 originator of the message. 4428 In the case that an application does not support re-auth, the state 4429 transitions related to server-initiated re-auth when both client and 4430 server sessions maintains state (e.g., Send RAR, Pending, Receive 4431 RAA) MAY be ignored. 4433 In the state table, the event 'Failure to send X' means that the 4434 Diameter agent is unable to send command X to the desired 4435 destination. This could be due to the peer being down, or due to the 4436 peer sending back a transient failure or temporary protocol error 4437 notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the 4438 Result-Code AVP of the corresponding Answer command. The event 'X 4439 successfully sent' is the complement of 'Failure to send X'. 4441 The following state machine is observed by a client when state is 4442 maintained on the server: 4444 CLIENT, STATEFUL 4445 State Event Action New State 4446 ------------------------------------------------------------- 4447 Idle Client or Device Requests Send Pending 4448 access service 4449 specific 4450 auth req 4452 Idle ASR Received Send ASA Idle 4453 for unknown session with 4454 Result-Code 4455 = UNKNOWN_ 4456 SESSION_ID 4458 Idle RAR Received Send RAA Idle 4459 for unknown session with 4460 Result-Code 4461 = UNKNOWN_ 4462 SESSION_ID 4464 Pending Successful Service-specific Grant Open 4465 authorization answer Access 4466 received with default 4467 Auth-Session-State value 4469 Pending Successful Service-specific Sent STR Discon 4470 authorization answer received 4471 but service not provided 4473 Pending Error processing successful Sent STR Discon 4474 Service-specific authorization 4475 answer 4477 Pending Failed Service-specific Cleanup Idle 4478 authorization answer received 4480 Open User or client device Send Open 4481 requests access to service service 4482 specific 4483 auth req 4485 Open Successful Service-specific Provide Open 4486 authorization answer received Service 4488 Open Failed Service-specific Discon. Idle 4489 authorization answer user/device 4490 received. 4492 Open RAR received and client will Send RAA Open 4493 perform subsequent re-auth with 4494 Result-Code 4495 = SUCCESS 4497 Open RAR received and client will Send RAA Idle 4498 not perform subsequent with 4499 re-auth Result-Code 4500 != SUCCESS, 4501 Discon. 4502 user/device 4504 Open Session-Timeout Expires on Send STR Discon 4505 Access Device 4507 Open ASR Received, Send ASA Discon 4508 client will comply with 4509 with request to end the Result-Code 4510 session = SUCCESS, 4511 Send STR. 4513 Open ASR Received, Send ASA Open 4514 client will not comply with 4515 with request to end the Result-Code 4516 session != SUCCESS 4518 Open Authorization-Lifetime + Send STR Discon 4519 Auth-Grace-Period expires on 4520 access device 4522 Discon ASR Received Send ASA Discon 4524 Discon STA Received Discon. Idle 4525 user/device 4527 The following state machine is observed by a server when it is 4528 maintaining state for the session: 4530 SERVER, STATEFUL 4531 State Event Action New State 4532 ------------------------------------------------------------- 4533 Idle Service-specific authorization Send Open 4534 request received, and successful 4535 user is authorized serv. 4536 specific 4537 answer 4539 Idle Service-specific authorization Send Idle 4540 request received, and failed serv. 4541 user is not authorized specific 4542 answer 4544 Open Service-specific authorization Send Open 4545 request received, and user successful 4546 is authorized serv. specific 4547 answer 4549 Open Service-specific authorization Send Idle 4550 request received, and user failed serv. 4551 is not authorized specific 4552 answer, 4553 Cleanup 4555 Open Home server wants to confirm Send RAR Pending 4556 authentication and/or 4557 authorization of the user 4559 Pending Received RAA with a failed Cleanup Idle 4560 Result-Code 4562 Pending Received RAA with Result-Code Update Open 4563 = SUCCESS session 4565 Open Home server wants to Send ASR Discon 4566 terminate the service 4568 Open Authorization-Lifetime (and Cleanup Idle 4569 Auth-Grace-Period) expires 4570 on home server. 4572 Open Session-Timeout expires on Cleanup Idle 4573 home server 4575 Discon Failure to send ASR Wait, Discon 4576 resend ASR 4578 Discon ASR successfully sent and Cleanup Idle 4579 ASA Received with Result-Code 4581 Not ASA Received None No Change. 4582 Discon 4584 Any STR Received Send STA, Idle 4585 Cleanup. 4587 The following state machine is observed by a client when state is not 4588 maintained on the server: 4590 CLIENT, STATELESS 4591 State Event Action New State 4592 ------------------------------------------------------------- 4593 Idle Client or Device Requests Send Pending 4594 access service 4595 specific 4596 auth req 4598 Pending Successful Service-specific Grant Open 4599 authorization answer Access 4600 received with Auth-Session- 4601 State set to 4602 NO_STATE_MAINTAINED 4604 Pending Failed Service-specific Cleanup Idle 4605 authorization answer 4606 received 4608 Open Session-Timeout Expires on Discon. Idle 4609 Access Device user/device 4611 Open Service to user is terminated Discon. Idle 4612 user/device 4614 The following state machine is observed by a server when it is not 4615 maintaining state for the session: 4617 SERVER, STATELESS 4618 State Event Action New State 4619 ------------------------------------------------------------- 4620 Idle Service-specific authorization Send serv. Idle 4621 request received, and specific 4622 successfully processed answer 4624 8.2. Accounting Session State Machine 4626 The following state machines MUST be supported for applications that 4627 have an accounting portion or that require only accounting services. 4628 The first state machine is to be observed by clients. 4630 See Section 9.7 for Accounting Command Codes and Section 9.8 for 4631 Accounting AVPs. 4633 The server side in the accounting state machine depends in some cases 4634 on the particular application. The Diameter base protocol defines a 4635 default state machine that MUST be followed by all applications that 4636 have not specified other state machines. This is the second state 4637 machine in this section described below. 4639 The default server side state machine requires the reception of 4640 accounting records in any order and at any time, and does not place 4641 any standards requirement on the processing of these records. 4642 Implementations of Diameter may perform checking, ordering, 4643 correlation, fraud detection, and other tasks based on these records. 4644 AVPs may need to be inspected as a part of these tasks. The tasks 4645 can happen either immediately after record reception or in a post- 4646 processing phase. However, as these tasks are typically application 4647 or even policy dependent, they are not standardized by the Diameter 4648 specifications. Applications MAY define requirements on when to 4649 accept accounting records based on the used value of Accounting- 4650 Realtime-Required AVP, credit limits checks, and so on. 4652 However, the Diameter base protocol defines one optional server side 4653 state machine that MAY be followed by applications that require 4654 keeping track of the session state at the accounting server. Note 4655 that such tracking is incompatible with the ability to sustain long 4656 duration connectivity problems. Therefore, the use of this state 4657 machine is recommended only in applications where the value of the 4658 Accounting-Realtime-Required AVP is DELIVER_AND_GRANT, and hence 4659 accounting connectivity problems are required to cause the serviced 4660 user to be disconnected. Otherwise, records produced by the client 4661 may be lost by the server which no longer accepts them after the 4662 connectivity is re-established. This state machine is the third 4663 state machine in this section. The state machine is supervised by a 4664 supervision session timer Ts, which the value should be reasonably 4665 higher than the Acct_Interim_Interval value. Ts MAY be set to two 4666 times the value of the Acct_Interim_Interval so as to avoid the 4667 accounting session in the Diameter server to change to Idle state in 4668 case of short transient network failure. 4670 Any event not listed in the state machines MUST be considered as an 4671 error condition, and a corresponding answer, if applicable, MUST be 4672 returned to the originator of the message. 4674 In the state table, the event 'Failure to send' means that the 4675 Diameter client is unable to communicate with the desired 4676 destination. This could be due to the peer being down, or due to the 4677 peer sending back a transient failure or temporary protocol error 4678 notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or 4679 DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting 4680 Answer command. 4682 The event 'Failed answer' means that the Diameter client received a 4683 non-transient failure notification in the Accounting Answer command. 4685 Note that the action 'Disconnect user/dev' MUST have an effect also 4686 to the authorization session state table, e.g., cause the STR message 4687 to be sent, if the given application has both authentication/ 4688 authorization and accounting portions. 4690 The states PendingS, PendingI, PendingL, PendingE and PendingB stand 4691 for pending states to wait for an answer to an accounting request 4692 related to a Start, Interim, Stop, Event or buffered record, 4693 respectively. 4695 CLIENT, ACCOUNTING 4696 State Event Action New State 4697 ------------------------------------------------------------- 4698 Idle Client or device requests Send PendingS 4699 access accounting 4700 start req. 4702 Idle Client or device requests Send PendingE 4703 a one-time service accounting 4704 event req 4706 Idle Records in storage Send PendingB 4707 record 4709 PendingS Successful accounting Open 4710 start answer received 4712 PendingS Failure to send and buffer Store Open 4713 space available and realtime Start 4714 not equal to DELIVER_AND_GRANT Record 4716 PendingS Failure to send and no buffer Open 4717 space available and realtime 4718 equal to GRANT_AND_LOSE 4720 PendingS Failure to send and no Disconnect Idle 4721 buffer space available and user/dev 4722 realtime not equal to 4723 GRANT_AND_LOSE 4725 PendingS Failed accounting start answer Open 4726 received and realtime equal 4727 to GRANT_AND_LOSE 4729 PendingS Failed accounting start answer Disconnect Idle 4730 received and realtime not user/dev 4731 equal to GRANT_AND_LOSE 4733 PendingS User service terminated Store PendingS 4734 stop 4735 record 4737 Open Interim interval elapses Send PendingI 4738 accounting 4739 interim 4740 record 4741 Open User service terminated Send PendingL 4742 accounting 4743 stop req. 4745 PendingI Successful accounting interim Open 4746 answer received 4748 PendingI Failure to send and (buffer Store Open 4749 space available or old interim 4750 record can be overwritten) record 4751 and realtime not equal to 4752 DELIVER_AND_GRANT 4754 PendingI Failure to send and no buffer Open 4755 space available and realtime 4756 equal to GRANT_AND_LOSE 4758 PendingI Failure to send and no Disconnect Idle 4759 buffer space available and user/dev 4760 realtime not equal to 4761 GRANT_AND_LOSE 4763 PendingI Failed accounting interim Open 4764 answer received and realtime 4765 equal to GRANT_AND_LOSE 4767 PendingI Failed accounting interim Disconnect Idle 4768 answer received and user/dev 4769 realtime not equal to 4770 GRANT_AND_LOSE 4772 PendingI User service terminated Store PendingI 4773 stop 4774 record 4775 PendingE Successful accounting Idle 4776 event answer received 4778 PendingE Failure to send and buffer Store Idle 4779 space available event 4780 record 4782 PendingE Failure to send and no buffer Idle 4783 space available 4785 PendingE Failed accounting event answer Idle 4786 received 4788 PendingB Successful accounting answer Delete Idle 4789 received record 4791 PendingB Failure to send Idle 4793 PendingB Failed accounting answer Delete Idle 4794 received record 4796 PendingL Successful accounting Idle 4797 stop answer received 4799 PendingL Failure to send and buffer Store Idle 4800 space available stop 4801 record 4803 PendingL Failure to send and no buffer Idle 4804 space available 4806 PendingL Failed accounting stop answer Idle 4807 received 4808 SERVER, STATELESS ACCOUNTING 4809 State Event Action New State 4810 ------------------------------------------------------------- 4812 Idle Accounting start request Send Idle 4813 received, and successfully accounting 4814 processed. start 4815 answer 4817 Idle Accounting event request Send Idle 4818 received, and successfully accounting 4819 processed. event 4820 answer 4822 Idle Interim record received, Send Idle 4823 and successfully processed. accounting 4824 interim 4825 answer 4827 Idle Accounting stop request Send Idle 4828 received, and successfully accounting 4829 processed stop answer 4831 Idle Accounting request received, Send Idle 4832 no space left to store accounting 4833 records answer, 4834 Result-Code 4835 = OUT_OF_ 4836 SPACE 4838 SERVER, STATEFUL ACCOUNTING 4839 State Event Action New State 4840 ------------------------------------------------------------- 4842 Idle Accounting start request Send Open 4843 received, and successfully accounting 4844 processed. start 4845 answer, 4846 Start Ts 4848 Idle Accounting event request Send Idle 4849 received, and successfully accounting 4850 processed. event 4851 answer 4853 Idle Accounting request received, Send Idle 4854 no space left to store accounting 4855 records answer, 4856 Result-Code 4857 = OUT_OF_ 4858 SPACE 4860 Open Interim record received, Send Open 4861 and successfully processed. accounting 4862 interim 4863 answer, 4864 Restart Ts 4866 Open Accounting stop request Send Idle 4867 received, and successfully accounting 4868 processed stop answer, 4869 Stop Ts 4871 Open Accounting request received, Send Idle 4872 no space left to store accounting 4873 records answer, 4874 Result-Code 4875 = OUT_OF_ 4876 SPACE, 4877 Stop Ts 4879 Open Session supervision timer Ts Stop Ts Idle 4880 expired 4882 8.3. Server-Initiated Re-Auth 4884 A Diameter server may initiate a re-authentication and/or re- 4885 authorization service for a particular session by issuing a Re-Auth- 4886 Request (RAR). 4888 For example, for pre-paid services, the Diameter server that 4889 originally authorized a session may need some confirmation that the 4890 user is still using the services. 4892 An access device that receives a RAR message with Session-Id equal to 4893 a currently active session MUST initiate a re-auth towards the user, 4894 if the service supports this particular feature. Each Diameter 4895 application MUST state whether server-initiated re-auth is supported, 4896 since some applications do not allow access devices to prompt the 4897 user for re-auth. 4899 8.3.1. Re-Auth-Request 4901 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258 4902 and the message flags' 'R' bit set, may be sent by any server to the 4903 access device that is providing session service, to request that the 4904 user be re-authenticated and/or re-authorized. 4906 Message Format 4908 ::= < Diameter Header: 258, REQ, PXY > 4909 < Session-Id > 4910 { Origin-Host } 4911 { Origin-Realm } 4912 { Destination-Realm } 4913 { Destination-Host } 4914 { Auth-Application-Id } 4915 { Re-Auth-Request-Type } 4916 [ User-Name ] 4917 [ Origin-State-Id ] 4918 * [ Proxy-Info ] 4919 * [ Route-Record ] 4920 * [ AVP ] 4922 8.3.2. Re-Auth-Answer 4924 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258 4925 and the message flags' 'R' bit clear, is sent in response to the RAR. 4926 The Result-Code AVP MUST be present, and indicates the disposition of 4927 the request. 4929 A successful RAA message MUST be followed by an application-specific 4930 authentication and/or authorization message. 4932 Message Format 4934 ::= < Diameter Header: 258, PXY > 4935 < Session-Id > 4936 { Result-Code } 4937 { Origin-Host } 4938 { Origin-Realm } 4939 [ User-Name ] 4940 [ Origin-State-Id ] 4941 [ Error-Message ] 4942 [ Error-Reporting-Host ] 4943 [ Failed-AVP ] 4944 * [ Redirect-Host ] 4945 [ Redirect-Host-Usage ] 4946 [ Redirect-Max-Cache-Time ] 4947 * [ Proxy-Info ] 4948 * [ AVP ] 4950 8.4. Session Termination 4952 It is necessary for a Diameter server that authorized a session, for 4953 which it is maintaining state, to be notified when that session is no 4954 longer active, both for tracking purposes as well as to allow 4955 stateful agents to release any resources that they may have provided 4956 for the user's session. For sessions whose state is not being 4957 maintained, this section is not used. 4959 When a user session that required Diameter authorization terminates, 4960 the access device that provided the service MUST issue a Session- 4961 Termination-Request (STR) message to the Diameter server that 4962 authorized the service, to notify it that the session is no longer 4963 active. An STR MUST be issued when a user session terminates for any 4964 reason, including user logoff, expiration of Session-Timeout, 4965 administrative action, termination upon receipt of an Abort-Session- 4966 Request (see below), orderly shutdown of the access device, etc. 4968 The access device also MUST issue an STR for a session that was 4969 authorized but never actually started. This could occur, for 4970 example, due to a sudden resource shortage in the access device, or 4971 because the access device is unwilling to provide the type of service 4972 requested in the authorization, or because the access device does not 4973 support a mandatory AVP returned in the authorization, etc. 4975 It is also possible that a session that was authorized is never 4976 actually started due to action of a proxy. For example, a proxy may 4977 modify an authorization answer, converting the result from success to 4978 failure, prior to forwarding the message to the access device. If 4979 the answer did not contain an Auth-Session-State AVP with the value 4980 NO_STATE_MAINTAINED, a proxy that causes an authorized session not to 4981 be started MUST issue an STR to the Diameter server that authorized 4982 the session, since the access device has no way of knowing that the 4983 session had been authorized. 4985 A Diameter server that receives an STR message MUST clean up 4986 resources (e.g., session state) associated with the Session-Id 4987 specified in the STR, and return a Session-Termination-Answer. 4989 A Diameter server also MUST clean up resources when the Session- 4990 Timeout expires, or when the Authorization-Lifetime and the Auth- 4991 Grace-Period AVPs expires without receipt of a re-authorization 4992 request, regardless of whether an STR for that session is received. 4993 The access device is not expected to provide service beyond the 4994 expiration of these timers; thus, expiration of either of these 4995 timers implies that the access device may have unexpectedly shut 4996 down. 4998 8.4.1. Session-Termination-Request 5000 The Session-Termination-Request (STR), indicated by the Command-Code 5001 set to 275 and the Command Flags' 'R' bit set, is sent by a Diameter 5002 client or by a Diameter proxy to inform the Diameter Server that an 5003 authenticated and/or authorized session is being terminated. 5005 Message Format 5007 ::= < Diameter Header: 275, REQ, PXY > 5008 < Session-Id > 5009 { Origin-Host } 5010 { Origin-Realm } 5011 { Destination-Realm } 5012 { Auth-Application-Id } 5013 { Termination-Cause } 5014 [ User-Name ] 5015 [ Destination-Host ] 5016 * [ Class ] 5017 [ Origin-State-Id ] 5018 * [ Proxy-Info ] 5019 * [ Route-Record ] 5020 * [ AVP ] 5022 8.4.2. Session-Termination-Answer 5024 The Session-Termination-Answer (STA), indicated by the Command-Code 5025 set to 275 and the message flags' 'R' bit clear, is sent by the 5026 Diameter Server to acknowledge the notification that the session has 5027 been terminated. The Result-Code AVP MUST be present, and MAY 5028 contain an indication that an error occurred while servicing the STR. 5030 Upon sending or receipt of the STA, the Diameter Server MUST release 5031 all resources for the session indicated by the Session-Id AVP. Any 5032 intermediate server in the Proxy-Chain MAY also release any 5033 resources, if necessary. 5035 Message Format 5037 ::= < Diameter Header: 275, PXY > 5038 < Session-Id > 5039 { Result-Code } 5040 { Origin-Host } 5041 { Origin-Realm } 5042 [ User-Name ] 5043 * [ Class ] 5044 [ Error-Message ] 5045 [ Error-Reporting-Host ] 5046 [ Failed-AVP ] 5047 [ Origin-State-Id ] 5048 * [ Redirect-Host ] 5049 [ Redirect-Host-Usage ] 5050 [ Redirect-Max-Cache-Time ] 5051 * [ Proxy-Info ] 5052 * [ AVP ] 5054 8.5. Aborting a Session 5056 A Diameter server may request that the access device stop providing 5057 service for a particular session by issuing an Abort-Session-Request 5058 (ASR). 5060 For example, the Diameter server that originally authorized the 5061 session may be required to cause that session to be stopped for lack 5062 of credit or other reasons that were not anticipated when the session 5063 was first authorized. 5065 An access device that receives an ASR with Session-ID equal to a 5066 currently active session MAY stop the session. Whether the access 5067 device stops the session or not is implementation- and/or 5068 configuration-dependent. For example, an access device may honor 5069 ASRs from certain agents only. In any case, the access device MUST 5070 respond with an Abort-Session-Answer, including a Result-Code AVP to 5071 indicate what action it took. 5073 8.5.1. Abort-Session-Request 5075 The Abort-Session-Request (ASR), indicated by the Command-Code set to 5076 274 and the message flags' 'R' bit set, may be sent by any Diameter 5077 server or any Diameter proxy to the access device that is providing 5078 session service, to request that the session identified by the 5079 Session-Id be stopped. 5081 Message Format 5083 ::= < Diameter Header: 274, REQ, PXY > 5084 < Session-Id > 5085 { Origin-Host } 5086 { Origin-Realm } 5087 { Destination-Realm } 5088 { Destination-Host } 5089 { Auth-Application-Id } 5090 [ User-Name ] 5091 [ Origin-State-Id ] 5092 * [ Proxy-Info ] 5093 * [ Route-Record ] 5094 * [ AVP ] 5096 8.5.2. Abort-Session-Answer 5098 The Abort-Session-Answer (ASA), indicated by the Command-Code set to 5099 274 and the message flags' 'R' bit clear, is sent in response to the 5100 ASR. The Result-Code AVP MUST be present, and indicates the 5101 disposition of the request. 5103 If the session identified by Session-Id in the ASR was successfully 5104 terminated, Result-Code is set to DIAMETER_SUCCESS. If the session 5105 is not currently active, Result-Code is set to 5106 DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the 5107 session for any other reason, Result-Code is set to 5108 DIAMETER_UNABLE_TO_COMPLY. 5110 Message Format 5112 ::= < Diameter Header: 274, PXY > 5113 < Session-Id > 5114 { Result-Code } 5115 { Origin-Host } 5116 { Origin-Realm } 5117 [ User-Name ] 5118 [ Origin-State-Id ] 5119 [ Error-Message ] 5120 [ Error-Reporting-Host ] 5121 [ Failed-AVP ] 5122 * [ Redirect-Host ] 5123 [ Redirect-Host-Usage ] 5124 [ Redirect-Max-Cache-Time ] 5125 * [ Proxy-Info ] 5126 * [ AVP ] 5128 8.6. Inferring Session Termination from Origin-State-Id 5130 The Origin-State-Id is used to allow detection of terminated sessions 5131 for which no STR would have been issued, due to unanticipated 5132 shutdown of an access device. 5134 A Diameter client or access device increments the value of the 5135 Origin-State-Id every time it is started or powered-up. The new 5136 Origin-State-Id is then sent in the CER/CEA message immediately upon 5137 connection to the server. The Diameter server receiving the new 5138 Origin-State-Id can determine whether the sending Diameter client had 5139 abruptly shutdown by comparing the old value of the Origin-State-Id 5140 it has kept for that specific client is less than the new value and 5141 whether it has un-terminated sessions originating from that client. 5143 An access device can also include the Origin-State-Id in request 5144 messages other than CER if there are relays or proxies in between the 5145 access device and the server. In this case, however, the server 5146 cannot discover that the access device has been restarted unless and 5147 until it receives a new request from it. Therefore this mechanism is 5148 more opportunistic across proxies and relays. 5150 The Diameter server may assume that all sessions that were active 5151 prior to detection of a client restart have been terminated. The 5152 Diameter server MAY clean up all session state associated with such 5153 lost sessions, and MAY also issues STRs for all such lost sessions 5154 that were authorized on upstream servers, to allow session state to 5155 be cleaned up globally. 5157 8.7. Auth-Request-Type AVP 5159 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is 5160 included in application-specific auth requests to inform the peers 5161 whether a user is to be authenticated only, authorized only or both. 5162 Note any value other than both MAY cause RADIUS interoperability 5163 issues. The following values are defined: 5165 AUTHENTICATE_ONLY 1 5167 The request being sent is for authentication only, and MUST 5168 contain the relevant application specific authentication AVPs that 5169 are needed by the Diameter server to authenticate the user. 5171 AUTHORIZE_ONLY 2 5173 The request being sent is for authorization only, and MUST contain 5174 the application-specific authorization AVPs that are necessary to 5175 identify the service being requested/offered. 5177 AUTHORIZE_AUTHENTICATE 3 5179 The request contains a request for both authentication and 5180 authorization. The request MUST include both the relevant 5181 application-specific authentication information, and authorization 5182 information necessary to identify the service being requested/ 5183 offered. 5185 8.8. Session-Id AVP 5187 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used 5188 to identify a specific session (see Section 8). All messages 5189 pertaining to a specific session MUST include only one Session-Id AVP 5190 and the same value MUST be used throughout the life of a session. 5191 When present, the Session-Id SHOULD appear immediately following the 5192 Diameter Header (see Section 3). 5194 The Session-Id MUST be globally and eternally unique, as it is meant 5195 to uniquely identify a user session without reference to any other 5196 information, and may be needed to correlate historical authentication 5197 information with accounting information. The Session-Id includes a 5198 mandatory portion and an implementation-defined portion; a 5199 recommended format for the implementation-defined portion is outlined 5200 below. 5202 The Session-Id MUST begin with the sender's identity encoded in the 5203 DiameterIdentity type (see Section 4.4). The remainder of the 5204 Session-Id is delimited by a ";" character, and MAY be any sequence 5205 that the client can guarantee to be eternally unique; however, the 5206 following format is recommended, (square brackets [] indicate an 5207 optional element): 5209 ;;[;] 5211 and are decimal representations of the 5212 high and low 32 bits of a monotonically increasing 64-bit value. The 5213 64-bit value is rendered in two part to simplify formatting by 32-bit 5214 processors. At startup, the high 32 bits of the 64-bit value MAY be 5215 initialized to the time in NTP format [RFC5905], and the low 32 bits 5216 MAY be initialized to zero. This will for practical purposes 5217 eliminate the possibility of overlapping Session-Ids after a reboot, 5218 assuming the reboot process takes longer than a second. 5219 Alternatively, an implementation MAY keep track of the increasing 5220 value in non-volatile memory. 5222 is implementation specific but may include a modem's 5223 device Id, a layer 2 address, timestamp, etc. 5225 Example, in which there is no optional value: 5227 accesspoint7.example.com;1876543210;523 5229 Example, in which there is an optional value: 5231 accesspoint7.example.com;1876543210;523;mobile@200.1.1.88 5233 The Session-Id is created by the Diameter application initiating the 5234 session, which in most cases is done by the client. Note that a 5235 Session-Id MAY be used for both the authentication, authorization and 5236 accounting commands of a given application. 5238 8.9. Authorization-Lifetime AVP 5240 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 5241 and contains the maximum number of seconds of service to be provided 5242 to the user before the user is to be re-authenticated and/or re- 5243 authorized. Care should be taken when the Authorization- Lifetime 5244 value is determined, since a low, non-zero, value could create 5245 significant Diameter traffic, which could congest both the network 5246 and the agents. 5248 A value of zero (0) means that immediate re-auth is necessary by the 5249 access device. The absence of this AVP, or a value of all ones 5250 (meaning all bits in the 32 bit field are set to one) means no re- 5251 auth is expected. 5253 If both this AVP and the Session-Timeout AVP are present in a 5254 message, the value of the latter MUST NOT be smaller than the 5255 Authorization-Lifetime AVP. 5257 An Authorization-Lifetime AVP MAY be present in re-authorization 5258 messages, and contains the number of seconds the user is authorized 5259 to receive service from the time the re-auth answer message is 5260 received by the access device. 5262 This AVP MAY be provided by the client as a hint of the maximum 5263 lifetime that it is willing to accept. The server MUST return a 5264 value that is equal to, or smaller, than the one provided by the 5265 client. 5267 8.10. Auth-Grace-Period AVP 5269 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and 5270 contains the number of seconds the Diameter server will wait 5271 following the expiration of the Authorization-Lifetime AVP before 5272 cleaning up resources for the session. 5274 8.11. Auth-Session-State AVP 5276 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and 5277 specifies whether state is maintained for a particular session. The 5278 client MAY include this AVP in requests as a hint to the server, but 5279 the value in the server's answer message is binding. The following 5280 values are supported: 5282 STATE_MAINTAINED 0 5284 This value is used to specify that session state is being 5285 maintained, and the access device MUST issue a session termination 5286 message when service to the user is terminated. This is the 5287 default value. 5289 NO_STATE_MAINTAINED 1 5291 This value is used to specify that no session termination messages 5292 will be sent by the access device upon expiration of the 5293 Authorization-Lifetime. 5295 8.12. Re-Auth-Request-Type AVP 5297 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and 5298 is included in application-specific auth answers to inform the client 5299 of the action expected upon expiration of the Authorization-Lifetime. 5300 If the answer message contains an Authorization-Lifetime AVP with a 5301 positive value, the Re-Auth-Request-Type AVP MUST be present in an 5302 answer message. The following values are defined: 5304 AUTHORIZE_ONLY 0 5306 An authorization only re-auth is expected upon expiration of the 5307 Authorization-Lifetime. This is the default value if the AVP is 5308 not present in answer messages that include the Authorization- 5309 Lifetime. 5311 AUTHORIZE_AUTHENTICATE 1 5313 An authentication and authorization re-auth is expected upon 5314 expiration of the Authorization-Lifetime. 5316 8.13. Session-Timeout AVP 5318 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32 5319 and contains the maximum number of seconds of service to be provided 5320 to the user before termination of the session. When both the 5321 Session-Timeout and the Authorization-Lifetime AVPs are present in an 5322 answer message, the former MUST be equal to or greater than the value 5323 of the latter. 5325 A session that terminates on an access device due to the expiration 5326 of the Session-Timeout MUST cause an STR to be issued, unless both 5327 the access device and the home server had previously agreed that no 5328 session termination messages would be sent (see Section 8.11). 5330 A Session-Timeout AVP MAY be present in a re-authorization answer 5331 message, and contains the remaining number of seconds from the 5332 beginning of the re-auth. 5334 A value of zero, or the absence of this AVP, means that this session 5335 has an unlimited number of seconds before termination. 5337 This AVP MAY be provided by the client as a hint of the maximum 5338 timeout that it is willing to accept. However, the server MAY return 5339 a value that is equal to, or smaller, than the one provided by the 5340 client. 5342 8.14. User-Name AVP 5344 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which 5345 contains the User-Name, in a format consistent with the NAI 5346 specification [RFC4282]. 5348 8.15. Termination-Cause AVP 5350 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and 5351 is used to indicate the reason why a session was terminated on the 5352 access device. The following values are defined: 5354 DIAMETER_LOGOUT 1 5356 The user initiated a disconnect 5358 DIAMETER_SERVICE_NOT_PROVIDED 2 5360 This value is used when the user disconnected prior to the receipt 5361 of the authorization answer message. 5363 DIAMETER_BAD_ANSWER 3 5365 This value indicates that the authorization answer received by the 5366 access device was not processed successfully. 5368 DIAMETER_ADMINISTRATIVE 4 5370 The user was not granted access, or was disconnected, due to 5371 administrative reasons, such as the receipt of a Abort-Session- 5372 Request message. 5374 DIAMETER_LINK_BROKEN 5 5376 The communication to the user was abruptly disconnected. 5378 DIAMETER_AUTH_EXPIRED 6 5380 The user's access was terminated since its authorized session time 5381 has expired. 5383 DIAMETER_USER_MOVED 7 5385 The user is receiving services from another access device. 5387 DIAMETER_SESSION_TIMEOUT 8 5389 The user's session has timed out, and service has been terminated. 5391 8.16. Origin-State-Id AVP 5393 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a 5394 monotonically increasing value that is advanced whenever a Diameter 5395 entity restarts with loss of previous state, for example upon reboot. 5396 Origin-State-Id MAY be included in any Diameter message, including 5397 CER. 5399 A Diameter entity issuing this AVP MUST create a higher value for 5400 this AVP each time its state is reset. A Diameter entity MAY set 5401 Origin-State-Id to the time of startup, or it MAY use an incrementing 5402 counter retained in non-volatile memory across restarts. 5404 The Origin-State-Id, if present, MUST reflect the state of the entity 5405 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST 5406 either remove Origin-State-Id or modify it appropriately as well. 5407 Typically, Origin-State-Id is used by an access device that always 5408 starts up with no active sessions; that is, any session active prior 5409 to restart will have been lost. By including Origin-State-Id in a 5410 message, it allows other Diameter entities to infer that sessions 5411 associated with a lower Origin-State-Id are no longer active. If an 5412 access device does not intend for such inferences to be made, it MUST 5413 either not include Origin-State-Id in any message, or set its value 5414 to 0. 5416 8.17. Session-Binding AVP 5418 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY 5419 be present in application-specific authorization answer messages. If 5420 present, this AVP MAY inform the Diameter client that all future 5421 application-specific re-auth and Session-Termination-Request messages 5422 for this session MUST be sent to the same authorization server. 5424 This field is a bit mask, and the following bits have been defined: 5426 RE_AUTH 1 5428 When set, future re-auth messages for this session MUST NOT 5429 include the Destination-Host AVP. When cleared, the default 5430 value, the Destination-Host AVP MUST be present in all re-auth 5431 messages for this session. 5433 STR 2 5435 When set, the STR message for this session MUST NOT include the 5436 Destination-Host AVP. When cleared, the default value, the 5437 Destination-Host AVP MUST be present in the STR message for this 5438 session. 5440 ACCOUNTING 4 5442 When set, all accounting messages for this session MUST NOT 5443 include the Destination-Host AVP. When cleared, the default 5444 value, the Destination-Host AVP, if known, MUST be present in all 5445 accounting messages for this session. 5447 8.18. Session-Server-Failover AVP 5449 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated, 5450 and MAY be present in application-specific authorization answer 5451 messages that either do not include the Session-Binding AVP or 5452 include the Session-Binding AVP with any of the bits set to a zero 5453 value. If present, this AVP MAY inform the Diameter client that if a 5454 re-auth or STR message fails due to a delivery problem, the Diameter 5455 client SHOULD issue a subsequent message without the Destination-Host 5456 AVP. When absent, the default value is REFUSE_SERVICE. 5458 The following values are supported: 5460 REFUSE_SERVICE 0 5462 If either the re-auth or the STR message delivery fails, terminate 5463 service with the user, and do not attempt any subsequent attempts. 5465 TRY_AGAIN 1 5467 If either the re-auth or the STR message delivery fails, resend 5468 the failed message without the Destination-Host AVP present. 5470 ALLOW_SERVICE 2 5472 If re-auth message delivery fails, assume that re-authorization 5473 succeeded. If STR message delivery fails, terminate the session. 5475 TRY_AGAIN_ALLOW_SERVICE 3 5477 If either the re-auth or the STR message delivery fails, resend 5478 the failed message without the Destination-Host AVP present. If 5479 the second delivery fails for re-auth, assume re-authorization 5480 succeeded. If the second delivery fails for STR, terminate the 5481 session. 5483 8.19. Multi-Round-Time-Out AVP 5485 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32, 5486 and SHOULD be present in application-specific authorization answer 5487 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. 5488 This AVP contains the maximum number of seconds that the access 5489 device MUST provide the user in responding to an authentication 5490 request. 5492 8.20. Class AVP 5494 The Class AVP (AVP Code 25) is of type OctetString and is used by 5495 Diameter servers to return state information to the access device. 5496 When one or more Class AVPs are present in application-specific 5497 authorization answer messages, they MUST be present in subsequent re- 5498 authorization, session termination and accounting messages. Class 5499 AVPs found in a re-authorization answer message override the ones 5500 found in any previous authorization answer message. Diameter server 5501 implementations SHOULD NOT return Class AVPs that require more than 5502 4096 bytes of storage on the Diameter client. A Diameter client that 5503 receives Class AVPs whose size exceeds local available storage MUST 5504 terminate the session. 5506 8.21. Event-Timestamp AVP 5508 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be 5509 included in an Accounting-Request and Accounting-Answer messages to 5510 record the time that the reported event occurred, in seconds since 5511 January 1, 1900 00:00 UTC. 5513 9. Accounting 5515 This accounting protocol is based on a server directed model with 5516 capabilities for real-time delivery of accounting information. 5517 Several fault resilience methods [RFC2975] have been built in to the 5518 protocol in order minimize loss of accounting data in various fault 5519 situations and under different assumptions about the capabilities of 5520 the used devices. 5522 9.1. Server Directed Model 5524 The server directed model means that the device generating the 5525 accounting data gets information from either the authorization server 5526 (if contacted) or the accounting server regarding the way accounting 5527 data shall be forwarded. This information includes accounting record 5528 timeliness requirements. 5530 As discussed in [RFC2975], real-time transfer of accounting records 5531 is a requirement, such as the need to perform credit limit checks and 5532 fraud detection. Note that batch accounting is not a requirement, 5533 and is therefore not supported by Diameter. Should batched 5534 accounting be required in the future, a new Diameter application will 5535 need to be created, or it could be handled using another protocol. 5536 Note, however, that even if at the Diameter layer accounting requests 5537 are processed one by one, transport protocols used under Diameter 5538 typically batch several requests in the same packet under heavy 5539 traffic conditions. This may be sufficient for many applications. 5541 The authorization server (chain) directs the selection of proper 5542 transfer strategy, based on its knowledge of the user and 5543 relationships of roaming partnerships. The server (or agents) uses 5544 the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to 5545 control the operation of the Diameter peer operating as a client. 5546 The Acct-Interim-Interval AVP, when present, instructs the Diameter 5547 node acting as a client to produce accounting records continuously 5548 even during a session. Accounting-Realtime-Required AVP is used to 5549 control the behavior of the client when the transfer of accounting 5550 records from the Diameter client is delayed or unsuccessful. 5552 The Diameter accounting server MAY override the interim interval or 5553 the realtime requirements by including the Acct-Interim-Interval or 5554 Accounting-Realtime-Required AVP in the Accounting-Answer message. 5555 When one of these AVPs is present, the latest value received SHOULD 5556 be used in further accounting activities for the same session. 5558 9.2. Protocol Messages 5560 A Diameter node that receives a successful authentication and/or 5561 authorization messages from the Diameter server SHOULD collect 5562 accounting information for the session. The Accounting-Request 5563 message is used to transmit the accounting information to the 5564 Diameter server, which MUST reply with the Accounting-Answer message 5565 to confirm reception. The Accounting-Answer message includes the 5566 Result-Code AVP, which MAY indicate that an error was present in the 5567 accounting message. The value of the Accounting-Realtime-Required 5568 AVP received earlier for the session in question may indicate that 5569 the user's session has to be terminated when a rejected Accounting- 5570 Request message was received. 5572 9.3. Accounting Application Extension and Requirements 5574 Each Diameter application (e.g., NASREQ, MobileIP), SHOULD define 5575 their Service-Specific AVPs that MUST be present in the Accounting- 5576 Request message in a section entitled "Accounting AVPs". The 5577 application MUST assume that the AVPs described in this document will 5578 be present in all Accounting messages, so only their respective 5579 service-specific AVPs need to be defined in that section. 5581 Applications have the option of using one or both of the following 5582 accounting application extension models: 5584 Split Accounting Service 5586 The accounting message will carry the Application Id of the 5587 Diameter base accounting application (see Section 2.4). 5588 Accounting messages maybe routed to Diameter nodes other than the 5589 corresponding Diameter application. These nodes might be 5590 centralized accounting servers that provide accounting service for 5591 multiple different Diameter applications. These nodes MUST 5592 advertise the Diameter base accounting Application Id during 5593 capabilities exchange. 5595 Coupled Accounting Service 5597 The accounting messages will carry the Application Id of the 5598 application that is using it. The application itself will process 5599 the received accounting records or forward them to an accounting 5600 server. There is no accounting application advertisement required 5601 during capabilities exchange and the accounting messages will be 5602 routed the same as any of the other application messages. 5604 In cases where an application does not define its own accounting 5605 service, it is preferred that the split accounting model be used. 5607 9.4. Fault Resilience 5609 Diameter Base protocol mechanisms are used to overcome small message 5610 loss and network faults of temporary nature. 5612 Diameter peers acting as clients MUST implement the use of failover 5613 to guard against server failures and certain network failures. 5614 Diameter peers acting as agents or related off-line processing 5615 systems MUST detect duplicate accounting records caused by the 5616 sending of same record to several servers and duplication of messages 5617 in transit. This detection MUST be based on the inspection of the 5618 Session-Id and Accounting-Record-Number AVP pairs. Appendix C 5619 discusses duplicate detection needs and implementation issues. 5621 Diameter clients MAY have non-volatile memory for the safe storage of 5622 accounting records over reboots or extended network failures, network 5623 partitions, and server failures. If such memory is available, the 5624 client SHOULD store new accounting records there as soon as the 5625 records are created and until a positive acknowledgement of their 5626 reception from the Diameter Server has been received. Upon a reboot, 5627 the client MUST starting sending the records in the non-volatile 5628 memory to the accounting server with appropriate modifications in 5629 termination cause, session length, and other relevant information in 5630 the records. 5632 A further application of this protocol may include AVPs to control 5633 how many accounting records may at most be stored in the Diameter 5634 client without committing them to the non-volatile memory or 5635 transferring them to the Diameter server. 5637 The client SHOULD NOT remove the accounting data from any of its 5638 memory areas before the correct Accounting-Answer has been received. 5639 The client MAY remove oldest, undelivered or yet unacknowledged 5640 accounting data if it runs out of resources such as memory. It is an 5641 implementation dependent matter for the client to accept new sessions 5642 under this condition. 5644 9.5. Accounting Records 5646 In all accounting records, the Session-Id AVP MUST be present; the 5647 User-Name AVP MUST be present if it is available to the Diameter 5648 client. 5650 Different types of accounting records are sent depending on the 5651 actual type of accounted service and the authorization server's 5652 directions for interim accounting. If the accounted service is a 5653 one-time event, meaning that the start and stop of the event are 5654 simultaneous, then the Accounting-Record-Type AVP MUST be present and 5655 set to the value EVENT_RECORD. 5657 If the accounted service is of a measurable length, then the AVP MUST 5658 use the values START_RECORD, STOP_RECORD, and possibly, 5659 INTERIM_RECORD. If the authorization server has not directed interim 5660 accounting to be enabled for the session, two accounting records MUST 5661 be generated for each service of type session. When the initial 5662 Accounting-Request for a given session is sent, the Accounting- 5663 Record-Type AVP MUST be set to the value START_RECORD. When the last 5664 Accounting-Request is sent, the value MUST be STOP_RECORD. 5666 If the authorization server has directed interim accounting to be 5667 enabled, the Diameter client MUST produce additional records between 5668 the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The 5669 production of these records is directed by Acct-Interim-Interval as 5670 well as any re-authentication or re-authorization of the session. 5671 The Diameter client MUST overwrite any previous interim accounting 5672 records that are locally stored for delivery, if a new record is 5673 being generated for the same session. This ensures that only one 5674 pending interim record can exist on an access device for any given 5675 session. 5677 A particular value of Accounting-Sub-Session-Id MUST appear only in 5678 one sequence of accounting records from a DIAMETER client, except for 5679 the purposes of retransmission. The one sequence that is sent MUST 5680 be either one record with Accounting-Record-Type AVP set to the value 5681 EVENT_RECORD, or several records starting with one having the value 5682 START_RECORD, followed by zero or more INTERIM_RECORD and a single 5683 STOP_RECORD. A particular Diameter application specification MUST 5684 define the type of sequences that MUST be used. 5686 9.6. Correlation of Accounting Records 5688 If an application uses accounting messages, it can correlate 5689 accounting records with a specific application session by using the 5690 Session-Id of the particular application session in the accounting 5691 messages. Accounting messages MAY also use a different Session-Id 5692 from that of the application sessions in which case other session 5693 related information is needed to perform correlation. 5695 In cases where an application requires multiple accounting sub- 5696 session, an Accounting-Sub-Session-Id AVP is used to differentiate 5697 each sub-session. The Session-Id would remain constant for all sub- 5698 sessions and is be used to correlate all the sub-sessions to a 5699 particular application session. Note that receiving a STOP_RECORD 5700 with no Accounting-Sub-Session-Id AVP when sub-sessions were 5701 originally used in the START_RECORD messages implies that all sub- 5702 sessions are terminated. 5704 There are also cases where an application needs to correlate multiple 5705 application sessions into a single accounting record; the accounting 5706 record may span multiple different Diameter applications and sessions 5707 used by the same user at a given time. In such cases, the Acct- 5708 Multi-Session- Id AVP is used. The Acct-Multi-Session-Id AVP SHOULD 5709 be signaled by the server to the access device (typically during 5710 authorization) when it determines that a request belongs to an 5711 existing session. The access device MUST then include the Acct- 5712 Multi-Session-Id AVP in all subsequent accounting messages. 5714 The Acct-Multi-Session-Id AVP MAY include the value of the original 5715 Session-Id. It's contents are implementation specific, but MUST be 5716 globally unique across other Acct-Multi-Session-Id, and MUST NOT 5717 change during the life of a session. 5719 A Diameter application document MUST define the exact concept of a 5720 session that is being accounted, and MAY define the concept of a 5721 multi-session. For instance, the NASREQ DIAMETER application treats 5722 a single PPP connection to a Network Access Server as one session, 5723 and a set of Multilink PPP sessions as one multi-session. 5725 9.7. Accounting Command-Codes 5727 This section defines Command-Code values that MUST be supported by 5728 all Diameter implementations that provide Accounting services. 5730 9.7.1. Accounting-Request 5732 The Accounting-Request (ACR) command, indicated by the Command-Code 5733 field set to 271 and the Command Flags' 'R' bit set, is sent by a 5734 Diameter node, acting as a client, in order to exchange accounting 5735 information with a peer. 5737 The AVP listed below SHOULD include service-specific accounting AVPs, 5738 as described in Section 9.3. 5740 Message Format 5742 ::= < Diameter Header: 271, REQ, PXY > 5743 < Session-Id > 5744 { Origin-Host } 5745 { Origin-Realm } 5746 { Destination-Realm } 5747 { Accounting-Record-Type } 5748 { Accounting-Record-Number } 5749 [ Acct-Application-Id ] 5750 [ Vendor-Specific-Application-Id ] 5751 [ User-Name ] 5752 [ Destination-Host ] 5753 [ Accounting-Sub-Session-Id ] 5754 [ Acct-Session-Id ] 5755 [ Acct-Multi-Session-Id ] 5756 [ Acct-Interim-Interval ] 5757 [ Accounting-Realtime-Required ] 5758 [ Origin-State-Id ] 5759 [ Event-Timestamp ] 5760 * [ Proxy-Info ] 5761 * [ Route-Record ] 5762 * [ AVP ] 5764 9.7.2. Accounting-Answer 5766 The Accounting-Answer (ACA) command, indicated by the Command-Code 5767 field set to 271 and the Command Flags' 'R' bit cleared, is used to 5768 acknowledge an Accounting-Request command. The Accounting-Answer 5769 command contains the same Session-Id as the corresponding request. 5771 Only the target Diameter Server, known as the home Diameter Server, 5772 SHOULD respond with the Accounting-Answer command. 5774 The AVP listed below SHOULD include service-specific accounting AVPs, 5775 as described in Section 9.3. 5777 Message Format 5779 ::= < Diameter Header: 271, PXY > 5780 < Session-Id > 5781 { Result-Code } 5782 { Origin-Host } 5783 { Origin-Realm } 5784 { Accounting-Record-Type } 5785 { Accounting-Record-Number } 5786 [ Acct-Application-Id ] 5787 [ Vendor-Specific-Application-Id ] 5788 [ User-Name ] 5789 [ Accounting-Sub-Session-Id ] 5790 [ Acct-Session-Id ] 5791 [ Acct-Multi-Session-Id ] 5792 [ Error-Message ] 5793 [ Error-Reporting-Host ] 5794 [ Failed-AVP ] 5795 [ Acct-Interim-Interval ] 5796 [ Accounting-Realtime-Required ] 5797 [ Origin-State-Id ] 5798 [ Event-Timestamp ] 5799 * [ Proxy-Info ] 5800 * [ AVP ] 5802 9.8. Accounting AVPs 5804 This section contains AVPs that describe accounting usage information 5805 related to a specific session. 5807 9.8.1. Accounting-Record-Type AVP 5809 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated 5810 and contains the type of accounting record being sent. The following 5811 values are currently defined for the Accounting-Record-Type AVP: 5813 EVENT_RECORD 1 5815 An Accounting Event Record is used to indicate that a one-time 5816 event has occurred (meaning that the start and end of the event 5817 are simultaneous). This record contains all information relevant 5818 to the service, and is the only record of the service. 5820 START_RECORD 2 5822 An Accounting Start, Interim, and Stop Records are used to 5823 indicate that a service of a measurable length has been given. An 5824 Accounting Start Record is used to initiate an accounting session, 5825 and contains accounting information that is relevant to the 5826 initiation of the session. 5828 INTERIM_RECORD 3 5830 An Interim Accounting Record contains cumulative accounting 5831 information for an existing accounting session. Interim 5832 Accounting Records SHOULD be sent every time a re-authentication 5833 or re-authorization occurs. Further, additional interim record 5834 triggers MAY be defined by application-specific Diameter 5835 applications. The selection of whether to use INTERIM_RECORD 5836 records is done by the Acct-Interim-Interval AVP. 5838 STOP_RECORD 4 5840 An Accounting Stop Record is sent to terminate an accounting 5841 session and contains cumulative accounting information relevant to 5842 the existing session. 5844 9.8.2. Acct-Interim-Interval AVP 5846 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and 5847 is sent from the Diameter home authorization server to the Diameter 5848 client. The client uses information in this AVP to decide how and 5849 when to produce accounting records. With different values in this 5850 AVP, service sessions can result in one, two, or two+N accounting 5851 records, based on the needs of the home-organization. The following 5852 accounting record production behavior is directed by the inclusion of 5853 this AVP: 5855 1. The omission of the Acct-Interim-Interval AVP or its inclusion 5856 with Value field set to 0 means that EVENT_RECORD, START_RECORD, 5857 and STOP_RECORD are produced, as appropriate for the service. 5859 2. The inclusion of the AVP with Value field set to a non-zero value 5860 means that INTERIM_RECORD records MUST be produced between the 5861 START_RECORD and STOP_RECORD records. The Value field of this 5862 AVP is the nominal interval between these records in seconds. 5864 The Diameter node that originates the accounting information, 5865 known as the client, MUST produce the first INTERIM_RECORD record 5866 roughly at the time when this nominal interval has elapsed from 5867 the START_RECORD, the next one again as the interval has elapsed 5868 once more, and so on until the session ends and a STOP_RECORD 5869 record is produced. 5871 The client MUST ensure that the interim record production times 5872 are randomized so that large accounting message storms are not 5873 created either among records or around a common service start 5874 time. 5876 9.8.3. Accounting-Record-Number AVP 5878 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 5879 and identifies this record within one session. As Session-Id AVPs 5880 are globally unique, the combination of Session-Id and Accounting- 5881 Record-Number AVPs is also globally unique, and can be used in 5882 matching accounting records with confirmations. An easy way to 5883 produce unique numbers is to set the value to 0 for records of type 5884 EVENT_RECORD and START_RECORD, and set the value to 1 for the first 5885 INTERIM_RECORD, 2 for the second, and so on until the value for 5886 STOP_RECORD is one more than for the last INTERIM_RECORD. 5888 9.8.4. Acct-Session-Id AVP 5890 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only 5891 used when RADIUS/Diameter translation occurs. This AVP contains the 5892 contents of the RADIUS Acct-Session-Id attribute. 5894 9.8.5. Acct-Multi-Session-Id AVP 5896 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String, 5897 following the format specified in Section 8.8. The Acct-Multi- 5898 Session-Id AVP is used to link together multiple related accounting 5899 sessions, where each session would have a unique Session-Id, but the 5900 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the 5901 Diameter server in an authorization answer, and MUST be used in all 5902 accounting messages for the given session. 5904 9.8.6. Accounting-Sub-Session-Id AVP 5906 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type 5907 Unsigned64 and contains the accounting sub-session identifier. The 5908 combination of the Session-Id and this AVP MUST be unique per sub- 5909 session, and the value of this AVP MUST be monotonically increased by 5910 one for all new sub-sessions. The absence of this AVP implies no 5911 sub-sessions are in use, with the exception of an Accounting-Request 5912 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD 5913 message with no Accounting-Sub-Session-Id AVP present will signal the 5914 termination of all sub-sessions for a given Session-Id. 5916 9.8.7. Accounting-Realtime-Required AVP 5918 The Accounting-Realtime-Required AVP (AVP Code 483) is of type 5919 Enumerated and is sent from the Diameter home authorization server to 5920 the Diameter client or in the Accounting-Answer from the accounting 5921 server. The client uses information in this AVP to decide what to do 5922 if the sending of accounting records to the accounting server has 5923 been temporarily prevented due to, for instance, a network problem. 5925 DELIVER_AND_GRANT 1 5927 The AVP with Value field set to DELIVER_AND_GRANT means that the 5928 service MUST only be granted as long as there is a connection to 5929 an accounting server. Note that the set of alternative accounting 5930 servers are treated as one server in this sense. Having to move 5931 the accounting record stream to a backup server is not a reason to 5932 discontinue the service to the user. 5934 GRANT_AND_STORE 2 5936 The AVP with Value field set to GRANT_AND_STORE means that service 5937 SHOULD be granted if there is a connection, or as long as records 5938 can still be stored as described in Section 9.4. 5940 This is the default behavior if the AVP isn't included in the 5941 reply from the authorization server. 5943 GRANT_AND_LOSE 3 5945 The AVP with Value field set to GRANT_AND_LOSE means that service 5946 SHOULD be granted even if the records cannot be delivered or 5947 stored. 5949 10. AVP Occurrence Table 5951 The following tables presents the AVPs defined in this document, and 5952 specifies in which Diameter messages they MAY be present or not. 5953 AVPs that occur only inside a Grouped AVP are not shown in this 5954 table. 5956 The table uses the following symbols: 5958 0 The AVP MUST NOT be present in the message. 5960 0+ Zero or more instances of the AVP MAY be present in the 5961 message. 5963 0-1 Zero or one instance of the AVP MAY be present in the message. 5964 It is considered an error if there are more than one instance of 5965 the AVP. 5967 1 One instance of the AVP MUST be present in the message. 5969 1+ At least one instance of the AVP MUST be present in the 5970 message. 5972 10.1. Base Protocol Command AVP Table 5974 The table in this section is limited to the non-accounting Command 5975 Codes defined in this specification. 5977 +-----------------------------------------------+ 5978 | Command-Code | 5979 +---+---+---+---+---+---+---+---+---+---+---+---+ 5980 Attribute Name |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA| 5981 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 5982 Acct-Interim- |0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5983 Interval | | | | | | | | | | | | | 5984 Accounting-Realtime-|0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5985 Required | | | | | | | | | | | | | 5986 Acct-Application-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5987 Auth-Application-Id |0+ |0+ |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5988 Auth-Grace-Period |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5989 Auth-Request-Type |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5990 Auth-Session-State |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5991 Authorization- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5992 Lifetime | | | | | | | | | | | | | 5993 Class |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0+ |0+ | 5994 Destination-Host |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0-1|0 | 5995 Destination-Realm |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5996 Disconnect-Cause |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5997 Error-Message |0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1| 5998 Error-Reporting-Host|0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 5999 Failed-AVP |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ | 6000 Firmware-Revision |0-1|0-1|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6001 Host-IP-Address |1+ |1+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6002 Inband-Security-Id |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6003 Multi-Round-Time-Out|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6004 Origin-Host |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6005 Origin-Realm |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6006 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| 6007 Product-Name |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6008 Proxy-Info |0 |0 |0 |0 |0 |0 |0+ |0+ |0+ |0+ |0+ |0+ | 6009 Redirect-Host |0 |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ | 6010 Redirect-Host-Usage |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6011 Redirect-Max-Cache- |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6012 Time | | | | | | | | | | | | | 6013 Result-Code |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 | 6014 Re-Auth-Request-Type|0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 | 6015 Route-Record |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |0 | 6016 Session-Binding |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6017 Session-Id |0 |0 |0 |0 |0 |0 |1 |1 |1 |1 |1 |1 | 6018 Session-Server- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6019 Failover | | | | | | | | | | | | | 6020 Session-Timeout |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6021 Supported-Vendor-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6022 Termination-Cause |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |1 |0 | 6023 User-Name |0 |0 |0 |0 |0 |0 |0-1|0-1|0-1|0-1|0-1|0-1| 6024 Vendor-Id |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6025 Vendor-Specific- |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6026 Application-Id | | | | | | | | | | | | | 6027 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 6029 10.2. Accounting AVP Table 6031 The table in this section is used to represent which AVPs defined in 6032 this document are to be present in the Accounting messages. These 6033 AVP occurrence requirements are guidelines, which may be expanded, 6034 and/or overridden by application-specific requirements in the 6035 Diameter applications documents. 6037 +-----------+ 6038 | Command | 6039 | Code | 6040 +-----+-----+ 6041 Attribute Name | ACR | ACA | 6042 ------------------------------+-----+-----+ 6043 Acct-Interim-Interval | 0-1 | 0-1 | 6044 Acct-Multi-Session-Id | 0-1 | 0-1 | 6045 Accounting-Record-Number | 1 | 1 | 6046 Accounting-Record-Type | 1 | 1 | 6047 Acct-Session-Id | 0-1 | 0-1 | 6048 Accounting-Sub-Session-Id | 0-1 | 0-1 | 6049 Accounting-Realtime-Required | 0-1 | 0-1 | 6050 Acct-Application-Id | 0-1 | 0-1 | 6051 Auth-Application-Id | 0 | 0 | 6052 Class | 0+ | 0+ | 6053 Destination-Host | 0-1 | 0 | 6054 Destination-Realm | 1 | 0 | 6055 Error-Reporting-Host | 0 | 0+ | 6056 Event-Timestamp | 0-1 | 0-1 | 6057 Origin-Host | 1 | 1 | 6058 Origin-Realm | 1 | 1 | 6059 Proxy-Info | 0+ | 0+ | 6060 Route-Record | 0+ | 0 | 6061 Result-Code | 0 | 1 | 6062 Session-Id | 1 | 1 | 6063 Termination-Cause | 0 | 0 | 6064 User-Name | 0-1 | 0-1 | 6065 Vendor-Specific-Application-Id| 0-1 | 0-1 | 6066 ------------------------------+-----+-----+ 6068 11. IANA Considerations 6070 This section provides guidance to the Internet Assigned Numbers 6071 Authority (IANA) regarding registration of values related to the 6072 Diameter protocol, in accordance with BCP 26 [RFC5226]. The 6073 following policies are used here with the meanings defined in BCP 26: 6074 "Private Use", "First Come First Served", "Expert Review", 6075 "Specification Required", "IETF Review", "Standards Action". 6077 This section explains the criteria to be used by the IANA for 6078 assignment of numbers within namespaces defined within this document. 6080 For registration requests where a Designated Expert should be 6081 consulted, the responsible IESG area director should appoint the 6082 Designated Expert. For Designated Expert with Specification 6083 Required, the request is posted to the DIME WG mailing list (or, if 6084 it has been disbanded, a successor designated by the Area Director) 6085 for comment and review, and MUST include a pointer to a public 6086 specification. Before a period of 30 days has passed, the Designated 6087 Expert will either approve or deny the registration request and 6088 publish a notice of the decision to the DIME WG mailing list or its 6089 successor. A denial notice MUST be justified by an explanation and, 6090 in the cases where it is possible, concrete suggestions on how the 6091 request can be modified so as to become acceptable. 6093 11.1. AVP Header 6095 As defined in Section 4, the AVP header contains three fields that 6096 requires IANA namespace management; the AVP Code, Vendor-ID and Flags 6097 field. 6099 11.1.1. AVP Codes 6101 The AVP Code namespace is used to identify attributes. There are 6102 multiple namespaces. Vendors can have their own AVP Codes namespace 6103 which will be identified by their Vendor-ID (also known as 6104 Enterprise-Number) and they control the assignments of their vendor- 6105 specific AVP codes within their own namespace. The absence of a 6106 Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA 6107 controlled AVP Codes namespace. The AVP Codes and sometimes also 6108 possible values in an AVP are controlled and maintained by IANA. 6110 AVP Code 0 is not used. AVP Codes 1-255 are managed separately as 6111 RADIUS Attribute Types [RADTYPE]. This document defines the AVP 6112 Codes 257-274, 276-285, 287, 291-300, 480, 483 and 485-486. See 6113 Section 4.5 for the assignment of the namespace in this 6114 specification. 6116 AVPs may be allocated following Designated Expert with Specification 6117 Required [RFC5226]. Release of blocks of AVPs (more than 3 at a time 6118 for a given purpose) should require IETF Review. 6120 Note that Diameter defines a mechanism for Vendor-Specific AVPs, 6121 where the Vendor-Id field in the AVP header is set to a non-zero 6122 value. Vendor-Specific AVPs codes are for Private Use and should be 6123 encouraged instead of allocation of global attribute types, for 6124 functions specific only to one vendor's implementation of Diameter, 6125 where no interoperability is deemed useful. Where a Vendor-Specific 6126 AVP is implemented by more than one vendor, allocation of global AVPs 6127 should be encouraged instead. 6129 11.1.2. AVP Flags 6131 There are 8 bits in the AVP Flags field of the AVP header, defined in 6132 Section 4. This document assigns bit 0 ('V'endor Specific), bit 1 6133 ('M'andatory) and bit 2 ('P'rotected). The remaining bits should 6134 only be assigned via a Standards Action [RFC5226]. 6136 11.2. Diameter Header 6138 As defined in Section 3, the Diameter header contains two fields that 6139 require IANA namespace management; Command Code and Command Flags. 6141 11.2.1. Command Codes 6143 The Command Code namespace is used to identify Diameter commands. 6144 The values 0-255 (0x00-0xff) are reserved for RADIUS backward 6145 compatibility, and are defined as "RADIUS Packet Type Codes" in 6146 [RADTYPE]. Values 256 - 8,388,607 (0x100 to 0x7fffff) are for 6147 permanent, standard commands, allocated by IETF Review [RFC5226]. 6148 This document defines the Command Codes 257, 258, 271, 274-275, 280 6149 and 282. See Section 3.1 for the assignment of the namespace in this 6150 specification. 6152 The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved 6153 for vendor-specific command codes, to be allocated on a First Come, 6154 First Served basis by IANA [RFC5226]. The request to IANA for a 6155 Vendor-Specific Command Code SHOULD include a reference to a publicly 6156 available specification which documents the command in sufficient 6157 detail to aid in interoperability between independent 6158 implementations. If the specification cannot be made publicly 6159 available, the request for a vendor-specific command code MUST 6160 include the contact information of persons and/or entities 6161 responsible for authoring and maintaining the command. 6163 The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe - 6164 0xffffff) are reserved for experimental commands. As these codes are 6165 only for experimental and testing purposes, no guarantee is made for 6166 interoperability between Diameter peers using experimental commands, 6167 as outlined in [IANA-EXP]. 6169 11.2.2. Command Flags 6171 There are eight bits in the Command Flags field of the Diameter 6172 header. This document assigns bit 0 ('R'equest), bit 1 ('P'roxy), 6173 bit 2 ('E'rror) and bit 3 ('T'). Bits 4 through 7 MUST only be 6174 assigned via a Standards Action [RFC5226]. 6176 11.3. Application Identifiers 6178 As defined in Section 2.4, the Application Id is used to identify a 6179 specific Diameter Application. There are standards-track Application 6180 Ids and vendor specific Application Ids. 6182 IANA [RFC5226] has assigned the range 0x00000001 to 0x00ffffff for 6183 standards-track applications; and 0x01000000 - 0xfffffffe for vendor 6184 specific applications, on a first-come, first-served basis. The 6185 following values are allocated. 6187 Diameter Common Messages 0 6188 Diameter Base Accounting 3 6189 Relay 0xffffffff 6191 Assignment of standards-track Application Ids are by Designated 6192 Expert with Specification Required [RFC5226]. 6194 Both Auth-Application-Id and Acct-Application-Id AVPs use the same 6195 Application Id space. A Diameter node advertising itself as a relay 6196 agent MUST set either Application-Id or Acct-Application-Id to 6197 0xffffffff. 6199 Vendor-Specific Application Ids, are for Private Use. Vendor-Specific 6200 Application Ids are assigned on a First Come, First Served basis by 6201 IANA. 6203 11.4. AVP Values 6205 Certain AVPs in Diameter define a list of values with various 6206 meanings. This section lists such attributes in the Diameter base 6207 protocol and their IANA allocation rules. 6209 Allocation of Application Ids was discussed in Section 2.4. Other 6210 attributes in the base protocol do not take enumerated values or bit 6211 masks or employ existing name spaces such as SMI Network Management 6212 Private Enterprise Codes [RFC3232] or IP addresses. The allocation 6213 of new values for these existing name spaces is done in accordance 6214 with the rules already defined for them. 6216 11.4.1. Result-Code AVP Values 6218 As defined in Section 7.1, the Result-Code AVP (AVP Code 268) defines 6219 the values 1001, 2001-2002, 3001-3012, 4001-4003 and 5001-5021. 6221 All remaining values are available for assignment via IETF Review 6222 [RFC5226]. 6224 11.4.2. Experimental-Result-Code AVP 6226 Values for this AVP are purely local to the indicated vendor, and no 6227 IANA registry is maintained for them. 6229 11.4.3. Accounting-Record-Type AVP Values 6231 As defined in Section 9.8.1, the Accounting-Record-Type AVP (AVP Code 6232 480) defines the values 1-4. All remaining values are available for 6233 assignment via IETF Review [RFC5226]. 6235 11.4.4. Termination-Cause AVP Values 6237 As defined in Section 8.15, the Termination-Cause AVP (AVP Code 295) 6238 defines the values 1-8. All remaining values are available for 6239 assignment via IETF Review [RFC5226]. 6241 11.4.5. Redirect-Host-Usage AVP Values 6243 As defined in Section 6.13, the Redirect-Host-Usage AVP (AVP Code 6244 261) defines the values 0-5. All remaining values are available for 6245 assignment via IETF Review [RFC5226]. 6247 11.4.6. Session-Server-Failover AVP Values 6249 As defined in Section 8.18, the Session-Server-Failover AVP (AVP Code 6250 271) defines the values 0-3. All remaining values are available for 6251 assignment via IETF Review [RFC5226]. 6253 11.4.7. Session-Binding AVP Values 6255 As defined in Section 8.17, the Session-Binding AVP (AVP Code 270) 6256 defines the bits 1-4. All remaining bits are available for 6257 assignment via IETF Review [RFC5226]. 6259 11.4.8. Disconnect-Cause AVP Values 6261 As defined in Section 5.4.3, the Disconnect-Cause AVP (AVP Code 273) 6262 defines the values 0-2. All remaining values are available for 6263 assignment via IETF Review [RFC5226]. 6265 11.4.9. Auth-Request-Type AVP Values 6267 As defined in Section 8.7, the Auth-Request-Type AVP (AVP Code 274) 6268 defines the values 1-3. All remaining values are available for 6269 assignment via IETF Review [RFC5226]. 6271 11.4.10. Auth-Session-State AVP Values 6273 As defined in Section 8.11, the Auth-Session-State AVP (AVP Code 277) 6274 defines the values 0-1. All remaining values are available for 6275 assignment via IETF Review [RFC5226]. 6277 11.4.11. Re-Auth-Request-Type AVP Values 6279 As defined in Section 8.12, the Re-Auth-Request-Type AVP (AVP Code 6280 285) defines the values 0-1. All remaining values are available for 6281 assignment via IETF Review [RFC5226]. 6283 11.4.12. Accounting-Realtime-Required AVP Values 6285 As defined in Section 9.8.7, the Accounting-Realtime-Required AVP 6286 (AVP Code 483) defines the values 1-3. All remaining values are 6287 available for assignment via IETF Review [RFC5226]. 6289 11.4.13. Inband-Security-Id AVP (code 299) 6291 As defined in Section 6.10, the Inband-Security-Id AVP (AVP Code 299) 6292 defines the values 0-1. All remaining values are available for 6293 assignment via IETF Review. [RFC5226]. 6295 11.5. Diameter TCP, SCTP and TLS/TCP Port Numbers 6297 The IANA has assigned port number 3868 for TCP and SCTP. The port 6298 number [TBD] has been assigned for TLS/TCP. 6300 11.6. S-NAPTR Parameters 6302 This document registers a S-NAPTR Application Service Tag value of 6303 "aaa". 6305 This document also registers the following S-NAPTR Application 6306 Protocol Tags: 6308 Tag | Protocol 6309 -------------------|--------- 6310 diameter.tcp | TCP 6311 diameter.sctp | SCTP 6312 diameter.tls.tcp | TLS/TCP 6314 12. Diameter protocol related configurable parameters 6316 This section contains the configurable parameters that are found 6317 throughout this document: 6319 Diameter Peer 6321 A Diameter entity MAY communicate with peers that are statically 6322 configured. A statically configured Diameter peer would require 6323 that either the IP address or the fully qualified domain name 6324 (FQDN) be supplied, which would then be used to resolve through 6325 DNS. 6327 Routing Table 6329 A Diameter proxy server routes messages based on the realm portion 6330 of a Network Access Identifier (NAI). The server MUST have a 6331 table of Realm Names, and the address of the peer to which the 6332 message must be forwarded to. The routing table MAY also include 6333 a "default route", which is typically used for all messages that 6334 cannot be locally processed. 6336 Tc timer 6338 The Tc timer controls the frequency that transport connection 6339 attempts are done to a peer with whom no active transport 6340 connection exists. The recommended value is 30 seconds. 6342 13. Security Considerations 6344 The Diameter base protocol messages SHOULD be secured by using TLS 6345 [RFC5246]. Additional security mechanisms such as IPsec [RFC4301] 6346 MAY also be deployed to secure connections between peers. However, 6347 all Diameter base protocol implementations MUST support the use of 6348 TLS and the Diameter protocol MUST NOT be used without any security 6349 mechanism. 6351 If a Diameter connection is to be protected via TLS or IPsec, then 6352 TLS or IPsec handshake SHOULD begin prior to any Diameter message 6353 exchange. All security parameters for TLS or IPsec are configured 6354 independent of the Diameter protocol. All Diameter message will be 6355 sent through the TLS or IPsec connection after a successful setup. 6357 For TLS connections to be established in the open state, the CER/CEA 6358 exchange MUST include an Inband-Security-ID AVP with a value of TLS. 6359 The TLS handshake will begin when both ends successfully reached the 6360 open state, after completion of the CER/CEA exchange. If the TLS 6361 handshake is successful, all further messages will be sent via TLS. 6362 If the handshake fails, both ends move to the closed state. See 6363 Sections 13.1 for more details. 6365 13.1. TLS Usage 6367 Diameter nodes using TLS for security MUST mutually authenticate as 6368 part of TLS session establishment. In order to ensure mutual 6369 authentication, the Diameter node acting as TLS server MUST request a 6370 certificate from the Diameter node acting as TLS client, and the 6371 Diameter node acting as TLS client MUST be prepared to supply a 6372 certificate on request. 6374 Diameter nodes MUST be able to negotiate the following TLS cipher 6375 suites: 6377 TLS_RSA_WITH_RC4_128_MD5 6378 TLS_RSA_WITH_RC4_128_SHA 6379 TLS_RSA_WITH_3DES_EDE_CBC_SHA 6381 Diameter nodes SHOULD be able to negotiate the following TLS cipher 6382 suite: 6384 TLS_RSA_WITH_AES_128_CBC_SHA 6386 Diameter nodes MAY negotiate other TLS cipher suites. 6388 13.2. Peer-to-Peer Considerations 6390 As with any peer-to-peer protocol, proper configuration of the trust 6391 model within a Diameter peer is essential to security. When 6392 certificates are used, it is necessary to configure the root 6393 certificate authorities trusted by the Diameter peer. These root CAs 6394 are likely to be unique to Diameter usage and distinct from the root 6395 CAs that might be trusted for other purposes such as Web browsing. 6396 In general, it is expected that those root CAs will be configured so 6397 as to reflect the business relationships between the organization 6398 hosting the Diameter peer and other organizations. As a result, a 6399 Diameter peer will typically not be configured to allow connectivity 6400 with any arbitrary peer. With certificate authentication, Diameter 6401 peers may not be known beforehand and therefore peer discovery may be 6402 required. 6404 14. References 6406 14.1. Normative References 6408 [FLOATPOINT] 6409 Institute of Electrical and Electronics Engineers, "IEEE 6410 Standard for Binary Floating-Point Arithmetic, ANSI/IEEE 6411 Standard 754-1985", August 1985. 6413 [IANAADFAM] 6414 IANA,, "Address Family Numbers", 6415 http://www.iana.org/assignments/address-family-numbers. 6417 [RADTYPE] IANA,, "RADIUS Types", 6418 http://www.iana.org/assignments/radius-types. 6420 [RFC791] Postel, J., "Internet Protocol", RFC 791, September 1981. 6422 [RFC793] Postel, J., "Transmission Control Protocol", RFC 793, 6423 January 1981. 6425 [RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and 6426 Accounting (AAA) Transport Profile", RFC 3539, June 2003. 6428 [RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and 6429 P. McCann, "Diameter Mobile IPv4 Application", RFC 4004, 6430 August 2005. 6432 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton, 6433 "Diameter Network Access Server Application", RFC 4005, 6434 August 2005. 6436 [RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J. 6437 Loughney, "Diameter Credit-Control Application", RFC 4006, 6438 August 2005. 6440 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 6441 Specifications: ABNF", STD 68, RFC 5234, January 2008. 6443 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J. 6444 Arkko, "Diameter Base Protocol", RFC 3588, September 2003. 6446 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 6447 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 6448 May 2008. 6450 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 6451 Architecture", RFC 4291, February 2006. 6453 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 6454 Requirement Levels", BCP 14, RFC 2119, March 1997. 6456 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The 6457 Network Access Identifier", RFC 4282, December 2005. 6459 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 6460 Requirements for Security", BCP 106, RFC 4086, June 2005. 6462 [RFC4960] Stewart, R., "Stream Control Transmission Protocol", 6463 RFC 4960, September 2007. 6465 [RFC3958] Daigle, L. and A. Newton, "Domain-Based Application 6466 Service Location Using SRV RRs and the Dynamic Delegation 6467 Discovery Service (DDDS)", RFC 3958, January 2005. 6469 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 6470 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 6472 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 6473 Resource Identifier (URI): Generic Syntax", STD 66, 6474 RFC 3986, January 2005. 6476 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 6477 10646", STD 63, RFC 3629, November 2003. 6479 [RFC5890] Klensin, J., "Internationalized Domain Names for 6480 Applications (IDNA): Definitions and Document Framework", 6481 RFC 5890, August 2010. 6483 [RFC5891] Klensin, J., "Internationalized Domain Names in 6484 Applications (IDNA): Protocol", RFC 5891, August 2010. 6486 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 6487 for Internationalized Domain Names in Applications 6488 (IDNA)", RFC 3492, March 2003. 6490 14.2. Informational References 6492 [RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P., 6493 Shiino, H., Zorn, G., Dommety, G., Perkins, C., Patil, B., 6494 Mitton, D., Manning, S., Beadles, M., Walsh, P., Chen, X., 6495 Sivalingham, S., Hameed, A., Munson, M., Jacobs, S., Lim, 6496 B., Hirschman, B., Hsu, R., Xu, Y., and E., "Criteria for 6497 Evaluating AAA Protocols for Network Access", RFC 2989, 6498 November 2000. 6500 [RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to 6501 Accounting Management", RFC 2975, October 2000. 6503 [RFC3232] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by 6504 an On-line Database", RFC 3232, January 2002. 6506 [RFC5176] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B. 6507 Aboba, "Dynamic Authorization Extensions to Remote 6508 Authentication Dial In User Service (RADIUS)", RFC 5176, 6509 January 2008. 6511 [RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, 6512 RFC 1661, July 1994. 6514 [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000. 6516 [RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS 6517 Extensions", RFC 2869, June 2000. 6519 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, 6520 "Remote Authentication Dial In User Service (RADIUS)", 6521 RFC 2865, June 2000. 6523 [RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6", 6524 RFC 3162, August 2001. 6526 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 6527 Internet Protocol", RFC 4301, December 2005. 6529 [RFC5905] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network 6530 Time Protocol Version 4: Protocol and Algorithms 6531 Specification", RFC 5905, June 2010. 6533 [RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called 6534 TACACS", RFC 1492, July 1993. 6536 [RFC4690] Klensin, J., Faltstrom, P., Karp, C., and IAB, "Review and 6537 Recommendations for Internationalized Domain Names 6538 (IDNs)", RFC 4690, September 2006. 6540 [RFC5461] Gont, F., "TCP's Reaction to Soft Errors", RFC 5461, 6541 February 2009. 6543 [RFC5927] Gont, F., "ICMP Attacks against TCP", RFC 5927, July 2010. 6545 [IANA-EXP] 6546 Narten, T., "Assigning Experimental and Testing Numbers 6547 Considered Useful, Work in Progress.". 6549 Appendix A. Acknowledgements 6551 A.1. RFC3588bis 6553 The authors would like to thank the following people that have 6554 provided proposals and contributions to this document: 6556 To Vishnu Ram and Satendra Gera for their contributions on 6557 Capabilities Updates, Predictive Loop Avoidance as well as many other 6558 technical proposals. To Tolga Asveren for his insights and 6559 contributions on almost all of the proposed solutions incorporated 6560 into this document. To Timothy Smith for helping on the Capabilities 6561 Updates and other topics. To Tony Zhang for providing fixes to loop 6562 holes on composing Failed-AVPs as well as many other issues and 6563 topics. To Jan Nordqvist for clearly stating the usage of 6564 Application Ids. To Anders Kristensen for providing needed technical 6565 opinions. To David Frascone for providing invaluable review of the 6566 document. To Mark Jones for providing clarifying text on vendor 6567 command codes and other vendor specific indicators. 6569 Special thanks to the Diameter extensibility design team which helped 6570 resolve the tricky question of mandatory AVPs and ABNF semantics. 6571 The members of this team are as follows: 6573 Avi Lior, Jari Arkko, Glen Zorn, Lionel Morand, Mark Jones, Tolga 6574 Asveren Jouni Korhonen, Glenn McGregor. 6576 Special thanks also to people who have provided invaluable comments 6577 and inputs especially in resolving controversial issues: 6579 Glen Zorn, Yoshihiro Ohba, Marco Stura, and Pasi Eronen. 6581 Finally, we would like to thank the original authors of this 6582 document: 6584 Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman and Glen Zorn. 6586 Their invaluable knowledge and experience has given us a robust and 6587 flexible AAA protocol that many people have seen great value in 6588 adopting. We greatly appreciate their support and stewardship for 6589 the continued improvements of Diameter as a protocol. We would also 6590 like to extend our gratitude to folks aside from the authors who have 6591 assisted and contributed to the original version of this document. 6592 Their efforts significantly contributed to the success of Diameter. 6594 A.2. RFC3588 6596 The authors would like to thank Nenad Trifunovic, Tony Johansson and 6597 Pankaj Patel for their participation in the pre-IETF Document Reading 6598 Party. Allison Mankin, Jonathan Wood and Bernard Aboba provided 6599 invaluable assistance in working out transport issues, and similarly 6600 with Steven Bellovin in the security area. 6602 Paul Funk and David Mitton were instrumental in getting the Peer 6603 State Machine correct, and our deep thanks go to them for their time. 6605 Text in this document was also provided by Paul Funk, Mark Eklund, 6606 Mark Jones and Dave Spence. Jacques Caron provided many great 6607 comments as a result of a thorough review of the spec. 6609 The authors would also like to acknowledge the following people for 6610 their contribution in the development of the Diameter protocol: 6612 Allan C. Rubens, Haseeb Akhtar, William Bulley, Stephen Farrell, 6613 David Frascone, Daniel C. Fox, Lol Grant, Ignacio Goyret, Nancy 6614 Greene, Peter Heitman, Fredrik Johansson, Mark Jones, Martin Julien, 6615 Bob Kopacz, Paul Krumviede, Fergal Ladley, Ryan Moats, Victor Muslin, 6616 Kenneth Peirce, John Schnizlein, Sumit Vakil, John R. Vollbrecht and 6617 Jeff Weisberg. 6619 Finally, Pat Calhoun would like to thank Sun Microsystems since most 6620 of the effort put into this document was done while he was in their 6621 employ. 6623 Appendix B. S-NAPTR Example 6625 As an example, consider a client that wishes to resolve aaa: 6626 example1.com. The client performs a NAPTR query for that domain, and 6627 the following NAPTR records are returned: 6629 ;; order pref flags service regexp replacement 6630 IN NAPTR 50 50 "s" "aaa:diameter.tls.tcp" "" 6631 _diameter._tls.example1.com 6632 IN NAPTR 100 50 "s" "aaa:diameter.tcp" "" 6633 _aaa._tcp.example1.com 6634 IN NAPTR 150 50 "s" "aaa:diameter.sctp" "" 6635 _diameter._sctp.example1.com 6637 This indicates that the server supports TLS, TCP and SCTP in that 6638 order. If the client supports TLS, TLS will be used, targeted to a 6639 host determined by an SRV lookup of _diameter._tls.example1.com. 6640 That lookup would return: 6642 ;; Priority Weight Port Target 6643 IN SRV 0 1 5060 server1.example1.com 6644 IN SRV 0 2 5060 server2.example1.com 6646 As an alternative example, a client that wishes to resolve aaa: 6647 example2.com. The client performs a NAPTR query for that domain, and 6648 the following NAPTR records are returned: 6650 ;; order pref flags service regexp replacement 6651 IN NAPTR 150 50 "a" "aaa:diameter.tls.tcp" "" 6652 server1.example2.com 6653 IN NAPTR 150 50 "a" "aaa:diameter.tls.tcp" "" 6654 server2.example2.com 6656 This indicates that the server supports TCP available at the returned 6657 host names. 6659 Appendix C. Duplicate Detection 6661 As described in Section 9.4, accounting record duplicate detection is 6662 based on session identifiers. Duplicates can appear for various 6663 reasons: 6665 o Failover to an alternate server. Where close to real-time 6666 performance is required, failover thresholds need to be kept low 6667 and this may lead to an increased likelihood of duplicates. 6668 Failover can occur at the client or within Diameter agents. 6670 o Failure of a client or agent after sending of a record from non- 6671 volatile memory, but prior to receipt of an application layer ACK 6672 and deletion of the record. record to be sent. This will result 6673 in retransmission of the record soon after the client or agent has 6674 rebooted. 6676 o Duplicates received from RADIUS gateways. Since the 6677 retransmission behavior of RADIUS is not defined within [RFC2865], 6678 the likelihood of duplication will vary according to the 6679 implementation. 6681 o Implementation problems and misconfiguration. 6683 The T flag is used as an indication of an application layer 6684 retransmission event, e.g., due to failover to an alternate server. 6685 It is defined only for request messages sent by Diameter clients or 6686 agents. For instance, after a reboot, a client may not know whether 6687 it has already tried to send the accounting records in its non- 6688 volatile memory before the reboot occurred. Diameter servers MAY use 6689 the T flag as an aid when processing requests and detecting duplicate 6690 messages. However, servers that do this MUST ensure that duplicates 6691 are found even when the first transmitted request arrives at the 6692 server after the retransmitted request. It can be used only in cases 6693 where no answer has been received from the Server for a request and 6694 the request is sent again, (e.g., due to a failover to an alternate 6695 peer, due to a recovered primary peer or due to a client re-sending a 6696 stored record from non-volatile memory such as after reboot of a 6697 client or agent). 6699 In some cases the Diameter accounting server can delay the duplicate 6700 detection and accounting record processing until a post-processing 6701 phase takes place. At that time records are likely to be sorted 6702 according to the included User-Name and duplicate elimination is easy 6703 in this case. In other situations it may be necessary to perform 6704 real-time duplicate detection, such as when credit limits are imposed 6705 or real-time fraud detection is desired. 6707 In general, only generation of duplicates due to failover or re- 6708 sending of records in non-volatile storage can be reliably detected 6709 by Diameter clients or agents. In such cases the Diameter client or 6710 agents can mark the message as possible duplicate by setting the T 6711 flag. Since the Diameter server is responsible for duplicate 6712 detection, it can choose to make use of the T flag or not, in order 6713 to optimize duplicate detection. Since the T flag does not affect 6714 interoperability, and may not be needed by some servers, generation 6715 of the T flag is REQUIRED for Diameter clients and agents, but MAY be 6716 implemented by Diameter servers. 6718 As an example, it can be usually be assumed that duplicates appear 6719 within a time window of longest recorded network partition or device 6720 fault, perhaps a day. So only records within this time window need 6721 to be looked at in the backward direction. Secondly, hashing 6722 techniques or other schemes, such as the use of the T flag in the 6723 received messages, may be used to eliminate the need to do a full 6724 search even in this set except for rare cases. 6726 The following is an example of how the T flag may be used by the 6727 server to detect duplicate requests. 6729 A Diameter server MAY check the T flag of the received message to 6730 determine if the record is a possible duplicate. If the T flag is 6731 set in the request message, the server searches for a duplicate 6732 within a configurable duplication time window backward and 6733 forward. This limits database searching to those records where 6734 the T flag is set. In a well run network, network partitions and 6735 device faults will presumably be rare events, so this approach 6736 represents a substantial optimization of the duplicate detection 6737 process. During failover, it is possible for the original record 6738 to be received after the T flag marked record, due to differences 6739 in network delays experienced along the path by the original and 6740 duplicate transmissions. The likelihood of this occurring 6741 increases as the failover interval is decreased. In order to be 6742 able to detect out of order duplicates, the Diameter server should 6743 use backward and forward time windows when performing duplicate 6744 checking for the T flag marked request. For example, in order to 6745 allow time for the original record to exit the network and be 6746 recorded by the accounting server, the Diameter server can delay 6747 processing records with the T flag set until a time period 6748 TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing 6749 of the original transport connection. After this time period has 6750 expired, then it may check the T flag marked records against the 6751 database with relative assurance that the original records, if 6752 sent, have been received and recorded. 6754 Appendix D. Internationalized Domain Names 6756 To be compatible with the existing DNS infrastructure and simplify 6757 host and domain name comparison, Diameter identities (FQDNs) are 6758 represented in ASCII form. This allows the Diameter protocol to fall 6759 in-line with the DNS strategy of being transparent from the effects 6760 of Internationalized Domain Names (IDNs) by following the 6761 recommendations in [RFC4690] and [RFC5890]. Applications that 6762 provide support for IDNs outside of the Diameter protocol but 6763 interacting with it SHOULD use the representation and conversion 6764 framework described in [RFC5890], [RFC5891] and [RFC3492]. 6766 Authors' Addresses 6768 Victor Fajardo (editor) 6769 Telcordia Technologies 6770 One Telcordia Drive, 1S-222 6771 Piscataway, NJ 08854 6772 USA 6774 Phone: 1 908-421-1845 6775 Email: vf0213@gmail.com 6777 Jari Arkko 6778 Ericsson Research 6779 02420 Jorvas 6780 Finland 6782 Phone: +358 40 5079256 6783 Email: jari.arkko@ericsson.com 6785 John Loughney 6786 Nokia Research Center 6787 955 Page Mill Road 6788 Palo Alto, CA 94304 6789 US 6791 Phone: 1-650-283-8068 6792 Email: john.loughney@nokia.com 6794 Glenn Zorn 6795 Network Zen 6796 1310 East Thomas Street 6797 Seattle, WA 98102 6798 US 6800 Phone: 6801 Email: gwz@net-zen.net