idnits 2.17.1 draft-ietf-dime-rfc3588bis-21.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 5 instances of too long lines in the document, the longest one being 14 characters in excess of 72. == There are 1 instance of lines with non-RFC2606-compliant FQDNs in the document. == There are 2 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. -- The draft header indicates that this document obsoletes RFC3588, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 4512 has weird spacing: '...ly with wit...' == Line 4719 has weird spacing: '...ealtime user...' == Line 4747 has weird spacing: '... record inter...' == Line 4757 has weird spacing: '...ealtime user...' == Line 4765 has weird spacing: '...ealtime user...' == (2 more instances...) -- 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 (June 2, 2010) is 5076 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 972, but not defined == Missing Reference: 'PXY' is mentioned on line 4225, but not defined == Unused Reference: 'RFC4072' is defined on line 6436, but no explicit reference was found in the text == Unused Reference: 'RFC4740' is defined on line 6440, but no explicit reference was found in the text == Unused Reference: 'RFC4306' is defined on line 6455, but no explicit reference was found in the text == Unused Reference: 'RFC3403' is defined on line 6467, but no explicit reference was found in the text == Unused Reference: 'RFC5280' is defined on line 6491, but no explicit reference was found in the text == Unused Reference: 'RFC3261' is defined on line 6547, but no explicit reference was found in the text -- 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 4306 (Obsoleted by RFC 5996) ** 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) ** Obsolete normative reference: RFC 3490 (Obsoleted by RFC 5890, RFC 5891) ** Obsolete normative reference: RFC 3491 (Obsoleted by RFC 5891) -- Obsolete informational reference (is this intentional?): RFC 4330 (Obsoleted by RFC 5905) == Outdated reference: A later version (-12) exists of draft-ietf-tcpm-icmp-attacks-04 Summary: 12 errors (**), 0 flaws (~~), 18 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: December 4, 2010 J. Loughney 7 Nokia Research Center 8 G. Zorn 9 Network Zen 10 June 2, 2010 12 Diameter Base Protocol 13 draft-ietf-dime-rfc3588bis-21.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 December 4, 2010. 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 . . . . . . . . . . . . . . . . 151 246 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 153 247 A.1. RFC3588bis . . . . . . . . . . . . . . . . . . . . . . . 153 248 A.2. RFC3588 . . . . . . . . . . . . . . . . . . . . . . . . . 154 249 Appendix B. S-NAPTR Example . . . . . . . . . . . . . . . . . . 155 250 Appendix C. Duplicate Detection . . . . . . . . . . . . . . . . 156 251 Appendix D. Internationalized Domain Names . . . . . . . . . . . 158 252 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 159 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 [I-D.ietf-tcpm-icmp-attacks] and [RFC5461]. Diameter 993 implementations SHOULD also be able to interpret a reset from the 994 transport and timed-out connection attempts. If Diameter receives 995 data from the lower layer that cannot be parsed or identified as a 996 Diameter error made by the peer, the stream is compromised and cannot 997 be recovered. The transport connection MUST be closed using a RESET 998 call (send a TCP RST bit) or an SCTP ABORT message (graceful closure 999 is compromised). 1001 2.1.1. SCTP Guidelines 1003 The following are guidelines for Diameter implementations that 1004 support SCTP: 1006 1. For interoperability: All Diameter nodes MUST be prepared to 1007 receive Diameter messages on any SCTP stream in the association. 1008 These messages can be out-of-order and belong to different 1009 Diameter sessions. 1011 2. To prevent blocking: All Diameter nodes SHOULD utilize all SCTP 1012 streams available to the association to prevent head-of-the-line 1013 blocking. 1015 2.2. Securing Diameter Messages 1017 Connections between Diameter peers SHOULD be protected by TLS. All 1018 Diameter base protocol implementations MUST support the use of TLS. 1019 If desired, alternative security mechanisms that are independent of 1020 Diameter, such as IPsec [RFC4301], can be deployed to secure 1021 connections between peers. The Diameter protocol MUST NOT be used 1022 without any security mechanism. 1024 2.3. Diameter Application Compliance 1026 Application Ids are advertised during the capabilities exchange phase 1027 (see Section 5.3). Advertising support of an application implies 1028 that the sender supports the functionality specified in the 1029 respective Diameter application specification. 1031 Implementations MAY add arbitrary optional AVPs with the M-bit 1032 cleared (including vendor-specific AVPs) to a command defined in an 1033 application, but only if the command's ABNF syntax specification 1034 allows for it. Please refer to Section 11.1.1 for details. 1036 2.4. Application Identifiers 1038 Each Diameter application MUST have an IANA assigned Application Id 1039 (see Section 11.3). The base protocol does not require an 1040 Application Id since its support is mandatory. During the 1041 capabilities exchange, Diameter nodes inform their peers of locally 1042 supported applications. Furthermore, all Diameter messages contain 1043 an Application Id, which is used in the message forwarding process. 1045 The following Application Id values are defined: 1047 Diameter Common Messages 0 1048 Diameter Base Accounting 3 1049 Relay 0xffffffff 1051 Relay and redirect agents MUST advertise the Relay Application 1052 Identifier, while all other Diameter nodes MUST advertise locally 1053 supported applications. The receiver of a Capabilities Exchange 1054 message advertising Relay service MUST assume that the sender 1055 supports all current and future applications. 1057 Diameter relay and proxy agents are responsible for finding an 1058 upstream server that supports the application of a particular 1059 message. If none can be found, an error message is returned with the 1060 Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1062 2.5. Connections vs. Sessions 1064 This section attempts to provide the reader with an understanding of 1065 the difference between connection and session, which are terms used 1066 extensively throughout this document. 1068 A connection refers to a transport level connection between two peers 1069 that is used to send and receive Diameter messages. A session is a 1070 logical concept at the application layer existing between the 1071 Diameter client and the Diameter server; it is identified via the 1072 Session-Id AVP. 1074 +--------+ +-------+ +--------+ 1075 | Client | | Relay | | Server | 1076 +--------+ +-------+ +--------+ 1077 <----------> <----------> 1078 peer connection A peer connection B 1080 <-----------------------------> 1081 User session x 1083 Figure 1: Diameter connections and sessions 1085 In the example provided in Figure 1, peer connection A is established 1086 between the Client and the Relay. Peer connection B is established 1087 between the Relay and the Server. User session X spans from the 1088 Client via the Relay to the Server. Each "user" of a service causes 1089 an auth request to be sent, with a unique session identifier. Once 1090 accepted by the server, both the client and the server are aware of 1091 the session. 1093 It is important to note that there is no relationship between a 1094 connection and a session, and that Diameter messages for multiple 1095 sessions are all multiplexed through a single connection. Also note 1096 that Diameter messages pertaining to the session, both application 1097 specific and those that are defined in this document such as ASR/ASA, 1098 RAR/RAA and STR/STA MUST carry the Application Id of the application. 1099 Diameter messages pertaining to peer connection establishment and 1100 maintenance such as CER/CEA, DWR/DWA and DPR/DPA MUST carry an 1101 Application Id of zero (0). 1103 2.6. Peer Table 1105 The Diameter Peer Table is used in message forwarding, and referenced 1106 by the Routing Table. A Peer Table entry contains the following 1107 fields: 1109 Host identity 1111 Following the conventions described for the DiameterIdentity 1112 derived AVP data format in Section 4.3. This field contains the 1113 contents of the Origin-Host (Section 6.3) AVP found in the CER or 1114 CEA message. 1116 StatusT 1118 This is the state of the peer entry, and MUST match one of the 1119 values listed in Section 5.6. 1121 Static or Dynamic 1123 Specifies whether a peer entry was statically configured or 1124 dynamically discovered. 1126 Expiration time 1128 Specifies the time at which dynamically discovered peer table 1129 entries are to be either refreshed, or expired. 1131 TLS Enabled 1133 Specifies whether TLS is to be used when communicating with the 1134 peer. 1136 Additional security information, when needed (e.g., keys, 1137 certificates) 1139 2.7. Routing Table 1141 All Realm-Based routing lookups are performed against what is 1142 commonly known as the Routing Table (see Section 12). A Routing 1143 Table Entry contains the following fields: 1145 Realm Name 1147 This is the field that is MUST be used as a primary key in the 1148 routing table lookups. Note that some implementations perform 1149 their lookups based on longest-match-from-the-right on the realm 1150 rather than requiring an exact match. 1152 Application Identifier 1154 An application is identified by an Application Id. A route entry 1155 can have a different destination based on the Application Id in 1156 the message header. This field MUST be used as a secondary key 1157 field in routing table lookups. 1159 Local Action 1161 The Local Action field is used to identify how a message should be 1162 treated. The following actions are supported: 1164 1. LOCAL - Diameter messages that can be satisfied locally, and 1165 do not need to be routed to another Diameter entity. 1167 2. RELAY - All Diameter messages that fall within this category 1168 MUST be routed to a next hop Diameter entity that is indicated 1169 by the identifier described below. Routing is done without 1170 modifying any non-routing AVPs. See Section 6.1.9 for 1171 relaying guidelines 1173 3. PROXY - All Diameter messages that fall within this category 1174 MUST be routed to a next Diameter entity that is indicated by 1175 the identifier described below. The local server MAY apply 1176 its local policies to the message by including new AVPs to the 1177 message prior to routing. See Section 6.1.9 for proxying 1178 guidelines. 1180 4. REDIRECT - Diameter messages that fall within this category 1181 MUST have the identity of the home Diameter server(s) 1182 appended, and returned to the sender of the message. See 1183 Section 6.1.8 for redirect guidelines. 1185 Server Identifier 1187 One or more servers to which the message is to be routed. These 1188 servers MUST also be present in the Peer table. When the Local 1189 Action is set to RELAY or PROXY, this field contains the identity 1190 of the server(s) the message MUST be routed to. When the Local 1191 Action field is set to REDIRECT, this field contains the identity 1192 of one or more servers the message MUST be redirected to. 1194 Static or Dynamic 1196 Specifies whether a route entry was statically configured or 1197 dynamically discovered. 1199 Expiration time 1201 Specifies the time at which a dynamically discovered route table 1202 entry expires. 1204 It is important to note that Diameter agents MUST support at least 1205 one of the LOCAL, RELAY, PROXY or REDIRECT modes of operation. 1206 Agents do not need to support all modes of operation in order to 1207 conform with the protocol specification, but MUST follow the protocol 1208 compliance guidelines in Section 2. Relay agents and proxies MUST 1209 NOT reorder AVPs. 1211 The routing table MAY include a default entry that MUST be used for 1212 any requests not matching any of the other entries. The routing 1213 table MAY consist of only such an entry. 1215 When a request is routed, the target server MUST have advertised the 1216 Application Id (see Section 2.4) for the given message, or have 1217 advertised itself as a relay or proxy agent. Otherwise, an error is 1218 returned with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1220 2.8. Role of Diameter Agents 1222 In addition to clients and servers, the Diameter protocol introduces 1223 relay, proxy, redirect, and translation agents, each of which is 1224 defined in Section 1.3. These Diameter agents are useful for several 1225 reasons: 1227 o They can distribute administration of systems to a configurable 1228 grouping, including the maintenance of security associations. 1230 o They can be used for concentration of requests from an number of 1231 co-located or distributed NAS equipment sets to a set of like user 1232 groups. 1234 o They can do value-added processing to the requests or responses. 1236 o They can be used for load balancing. 1238 o A complex network will have multiple authentication sources, they 1239 can sort requests and forward towards the correct target. 1241 The Diameter protocol requires that agents maintain transaction 1242 state, which is used for failover purposes. Transaction state 1243 implies that upon forwarding a request, its Hop-by-Hop identifier is 1244 saved; the field is replaced with a locally unique identifier, which 1245 is restored to its original value when the corresponding answer is 1246 received. The request's state is released upon receipt of the 1247 answer. A stateless agent is one that only maintains transaction 1248 state. 1250 The Proxy-Info AVP allows stateless agents to add local state to a 1251 Diameter request, with the guarantee that the same state will be 1252 present in the answer. However, the protocol's failover procedures 1253 require that agents maintain a copy of pending requests. 1255 A stateful agent is one that maintains session state information by 1256 keeping track of all authorized active sessions. Each authorized 1257 session is bound to a particular service, and its state is considered 1258 active either until the agent is notified otherwise, or the session 1259 expires. Each authorized session has an expiration, which is 1260 communicated by Diameter servers via the Session-Timeout AVP. 1262 Maintaining session state may be useful in certain applications, such 1263 as: 1265 o Protocol translation (e.g., RADIUS <-> Diameter) 1267 o Limiting resources authorized to a particular user 1269 o Per user or transaction auditing 1271 A Diameter agent MAY act in a stateful manner for some requests and 1272 be stateless for others. A Diameter implementation MAY act as one 1273 type of agent for some requests, and as another type of agent for 1274 others. 1276 2.8.1. Relay Agents 1278 Relay Agents are Diameter agents that accept requests and route 1279 messages to other Diameter nodes based on information found in the 1280 messages (e.g., Destination-Realm). This routing decision is 1281 performed using a list of supported realms, and known peers. This is 1282 known as the Routing Table, as is defined further in Section 2.7. 1284 Relays may, for example, be used to aggregate requests from multiple 1285 Network Access Servers (NASes) within a common geographical area 1286 (POP). The use of Relays is advantageous since it eliminates the 1287 need for NASes to be configured with the necessary security 1288 information they would otherwise require to communicate with Diameter 1289 servers in other realms. Likewise, this reduces the configuration 1290 load on Diameter servers that would otherwise be necessary when NASes 1291 are added, changed or deleted. 1293 Relays modify Diameter messages by inserting and removing routing 1294 information, but do not modify any other portion of a message. 1295 Relays SHOULD NOT maintain session state but MUST maintain 1296 transaction state. 1298 +------+ ---------> +------+ ---------> +------+ 1299 | | 1. Request | | 2. Request | | 1300 | NAS | | DRL | | HMS | 1301 | | 4. Answer | | 3. Answer | | 1302 +------+ <--------- +------+ <--------- +------+ 1303 example.net example.net example.com 1305 Figure 2: Relaying of Diameter messages 1307 The example provided in Figure 2 depicts a request issued from NAS, 1308 which is an access device, for the user bob@example.com. Prior to 1309 issuing the request, NAS performs a Diameter route lookup, using 1310 "example.com" as the key, and determines that the message is to be 1311 relayed to DRL, which is a Diameter Relay. DRL performs the same 1312 route lookup as NAS, and relays the message to HMS, which is 1313 example.com's Home Diameter Server. HMS identifies that the request 1314 can be locally supported (via the realm), processes the 1315 authentication and/or authorization request, and replies with an 1316 answer, which is routed back to NAS using saved transaction state. 1318 Since Relays do not perform any application level processing, they 1319 provide relaying services for all Diameter applications, and 1320 therefore MUST advertise the Relay Application Id. 1322 2.8.2. Proxy Agents 1324 Similarly to relays, proxy agents route Diameter messages using the 1325 Diameter Routing Table. However, they differ since they modify 1326 messages to implement policy enforcement. This requires that proxies 1327 maintain the state of their downstream peers (e.g., access devices) 1328 to enforce resource usage, provide admission control, and 1329 provisioning. 1331 Proxies may, for example, be used in call control centers or access 1332 ISPs that provide outsourced connections, they can monitor the number 1333 and types of ports in use, and make allocation and admission 1334 decisions according to their configuration. 1336 Since enforcing policies requires an understanding of the service 1337 being provided, Proxies MUST only advertise the Diameter applications 1338 they support. 1340 2.8.3. Redirect Agents 1342 Redirect agents are useful in scenarios where the Diameter routing 1343 configuration needs to be centralized. An example is a redirect 1344 agent that provides services to all members of a consortium, but does 1345 not wish to be burdened with relaying all messages between realms. 1346 This scenario is advantageous since it does not require that the 1347 consortium provide routing updates to its members when changes are 1348 made to a member's infrastructure. 1350 Since redirect agents do not relay messages, and only return an 1351 answer with the information necessary for Diameter agents to 1352 communicate directly, they do not modify messages. Since redirect 1353 agents do not receive answer messages, they cannot maintain session 1354 state. 1356 The example provided in Figure 3 depicts a request issued from the 1357 access device, NAS, for the user bob@example.com. The message is 1358 forwarded by the NAS to its relay, DRL, which does not have a routing 1359 entry in its Diameter Routing Table for example.com. DRL has a 1360 default route configured to DRD, which is a redirect agent that 1361 returns a redirect notification to DRL, as well as HMS' contact 1362 information. Upon receipt of the redirect notification, DRL 1363 establishes a transport connection with HMS, if one doesn't already 1364 exist, and forwards the request to it. 1366 +------+ 1367 | | 1368 | DRD | 1369 | | 1370 +------+ 1371 ^ | 1372 2. Request | | 3. Redirection 1373 | | Notification 1374 | v 1375 +------+ ---------> +------+ ---------> +------+ 1376 | | 1. Request | | 4. Request | | 1377 | NAS | | DRL | | HMS | 1378 | | 6. Answer | | 5. Answer | | 1379 +------+ <--------- +------+ <--------- +------+ 1380 example.net example.net example.com 1382 Figure 3: Redirecting a Diameter Message 1384 Since redirect agents do not perform any application level 1385 processing, they provide relaying services for all Diameter 1386 applications, and therefore MUST advertise the Relay Application 1387 Identifier. 1389 2.8.4. Translation Agents 1391 A translation agent is a device that provides translation between two 1392 protocols (e.g., RADIUS<->Diameter, TACACS+<->Diameter). Translation 1393 agents are likely to be used as aggregation servers to communicate 1394 with a Diameter infrastructure, while allowing for the embedded 1395 systems to be migrated at a slower pace. 1397 Given that the Diameter protocol introduces the concept of long-lived 1398 authorized sessions, translation agents MUST be session stateful and 1399 MUST maintain transaction state. 1401 Translation of messages can only occur if the agent recognizes the 1402 application of a particular request, and therefore translation agents 1403 MUST only advertise their locally supported applications. 1405 +------+ ---------> +------+ ---------> +------+ 1406 | | RADIUS Request | | Diameter Request | | 1407 | NAS | | TLA | | HMS | 1408 | | RADIUS Answer | | Diameter Answer | | 1409 +------+ <--------- +------+ <--------- +------+ 1410 example.net example.net example.com 1412 Figure 4: Translation of RADIUS to Diameter 1414 2.9. Diameter Path Authorization 1416 As noted in Section 2.2, Diameter provides transmission level 1417 security for each connection using TLS. Therefore, each connection 1418 can be authenticated, replay and integrity protected. 1420 In addition to authenticating each connection, each connection as 1421 well as the entire session MUST also be authorized. Before 1422 initiating a connection, a Diameter Peer MUST check that its peers 1423 are authorized to act in their roles. For example, a Diameter peer 1424 may be authentic, but that does not mean that it is authorized to act 1425 as a Diameter Server advertising a set of Diameter applications. 1427 Prior to bringing up a connection, authorization checks are performed 1428 at each connection along the path. Diameter capabilities negotiation 1429 (CER/CEA) also MUST be carried out, in order to determine what 1430 Diameter applications are supported by each peer. Diameter sessions 1431 MUST be routed only through authorized nodes that have advertised 1432 support for the Diameter application required by the session. 1434 As noted in Section 6.1.9, a relay or proxy agent MUST append a 1435 Route-Record AVP to all requests forwarded. The AVP contains the 1436 identity of the peer the request was received from. 1438 The home Diameter server, prior to authorizing a session, MUST check 1439 the Route-Record AVPs to make sure that the route traversed by the 1440 request is acceptable. For example, administrators within the home 1441 realm may not wish to honor requests that have been routed through an 1442 untrusted realm. By authorizing a request, the home Diameter server 1443 is implicitly indicating its willingness to engage in the business 1444 transaction as specified by the contractual relationship between the 1445 server and the previous hop. A DIAMETER_AUTHORIZATION_REJECTED error 1446 message (see Section 7.1.5) is sent if the route traversed by the 1447 request is unacceptable. 1449 A home realm may also wish to check that each accounting request 1450 message corresponds to a Diameter response authorizing the session. 1451 Accounting requests without corresponding authorization responses 1452 SHOULD be subjected to further scrutiny, as should accounting 1453 requests indicating a difference between the requested and provided 1454 service. 1456 Forwarding of an authorization response is considered evidence of a 1457 willingness to take on financial risk relative to the session. A 1458 local realm may wish to limit this exposure, for example, by 1459 establishing credit limits for intermediate realms and refusing to 1460 accept responses which would violate those limits. By issuing an 1461 accounting request corresponding to the authorization response, the 1462 local realm implicitly indicates its agreement to provide the service 1463 indicated in the authorization response. If the service cannot be 1464 provided by the local realm, then a DIAMETER_UNABLE_TO_COMPLY error 1465 message MUST be sent within the accounting request; a Diameter client 1466 receiving an authorization response for a service that it cannot 1467 perform MUST NOT substitute an alternate service, and then send 1468 accounting requests for the alternate service instead. 1470 3. Diameter Header 1472 A summary of the Diameter header format is shown below. The fields 1473 are transmitted in network byte order. 1475 0 1 2 3 1476 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 1477 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1478 | Version | Message Length | 1479 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1480 | command flags | Command-Code | 1481 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1482 | Application-ID | 1483 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1484 | Hop-by-Hop Identifier | 1485 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1486 | End-to-End Identifier | 1487 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1488 | AVPs ... 1489 +-+-+-+-+-+-+-+-+-+-+-+-+- 1491 Version 1493 This Version field MUST be set to 1 to indicate Diameter Version 1494 1. 1496 Message Length 1498 The Message Length field is three octets and indicates the length 1499 of the Diameter message including the header fields. 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 backward compatibility with RADIUS, without setting the Vendor-Id 1811 field. 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 [RFC4330]. 1972 This represents the number of seconds since 0h on 1 January 1900 1973 with respect to the Coordinated Universal Time (UTC). 1975 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow. 1976 SNTP [RFC4330] describes a procedure to extend the time to 2104. 1977 This procedure MUST be supported by all Diameter nodes. 1979 UTF8String 1981 The UTF8String format is derived from the OctetString AVP Base 1982 Format. This is a human readable string represented using the 1983 ISO/IEC IS 10646-1 character set, encoded as an OctetString using 1984 the UTF-8 [RFC3629] transformation format described in RFC 3629. 1986 Since additional code points are added by amendments to the 10646 1987 standard from time to time, implementations MUST be prepared to 1988 encounter any code point from 0x00000001 to 0x7fffffff. Byte 1989 sequences that do not correspond to the valid encoding of a code 1990 point into UTF-8 charset or are outside this range are prohibited. 1992 The use of control codes SHOULD be avoided. When it is necessary 1993 to represent a new line, the control code sequence CR LF SHOULD be 1994 used. 1996 The use of leading or trailing white space SHOULD be avoided. 1998 For code points not directly supported by user interface hardware 1999 or software, an alternative means of entry and display, such as 2000 hexadecimal, MAY be provided. 2002 For information encoded in 7-bit US-ASCII, the UTF-8 charset is 2003 identical to the US-ASCII charset. 2005 UTF-8 may require multiple bytes to represent a single character / 2006 code point; thus the length of an UTF8String in octets may be 2007 different from the number of characters encoded. 2009 Note that the AVP Length field of an UTF8String is measured in 2010 octets, not characters. 2012 DiameterIdentity 2014 The DiameterIdentity format is derived from the OctetString AVP 2015 Base Format. 2017 DiameterIdentity = FQDN/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 1.2.3.4/24. In 2140 this case, all IP numbers from 2141 1.2.3.0 to 1.2.3.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 in. This 2565 could 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] which means that the SERVICE field includes tags for 2571 the 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 follows the resolution process defined by the S-NAPTR 2577 DDDS [RFC3958] application to find a matching SRV or A record of 2578 a suitable peer. The domain suffixes in the NAPTR replacement 2579 field SHOULD match the domain of the original query. 2581 3. If no NAPTR records are found, the requester directly queries for 2582 SRV records '_diameter._sctp'.realm, '_diameter._tcp'.realm and 2583 '_diameter._tls'.realm depending on the requesters network 2584 protocol capabilities. If SRV records are found then the 2585 requester can perform address record query (A RR's and/or AAAA 2586 RR's) for the target hostname specified in the SRV records. If 2587 no SRV records are found, the requester gives up. 2589 If the server is using a site certificate, the domain name in the 2590 NAPTR query and the domain name in the replacement field MUST both be 2591 valid based on the site certificate handed out by the server in the 2592 TLS or IKE exchange. Similarly, the domain name in the SRV query and 2593 the domain name in the target in the SRV record MUST both be valid 2594 based on the same site certificate. Otherwise, an attacker could 2595 modify the DNS records to contain replacement values in a different 2596 domain, and the client could not validate that this was the desired 2597 behavior, or the result of an attack. 2599 Also, the Diameter Peer MUST check to make sure that the discovered 2600 peers are authorized to act in its role. Authentication via IKE or 2601 TLS, or validation of DNS RRs via DNSSEC is not sufficient to 2602 conclude this. For example, a web server may have obtained a valid 2603 TLS certificate, and secured RRs may be included in the DNS, but this 2604 does not imply that it is authorized to act as a Diameter Server. 2606 Authorization can be achieved for example, by configuration of a 2607 Diameter Server CA. Alternatively this can be achieved by definition 2608 of OIDs within TLS or IKE certificates so as to signify Diameter 2609 Server authorization. 2611 A dynamically discovered peer causes an entry in the Peer Table (see 2612 Section 2.6) to be created. Note that entries created via DNS MUST 2613 expire (or be refreshed) within the DNS TTL. If a peer is discovered 2614 outside of the local realm, a routing table entry (see Section 2.7) 2615 for the peer's realm is created. The routing table entry's 2616 expiration MUST match the peer's expiration value. 2618 5.3. Capabilities Exchange 2620 When two Diameter peers establish a transport connection, they MUST 2621 exchange the Capabilities Exchange messages, as specified in the peer 2622 state machine (see Section 5.6). This message allows the discovery 2623 of a peer's identity and its capabilities (protocol version number, 2624 supported Diameter applications, security mechanisms, etc.) 2626 The receiver only issues commands to its peers that have advertised 2627 support for the Diameter application that defines the command. A 2628 Diameter node MUST cache the supported applications in order to 2629 ensure that unrecognized commands and/or AVPs are not unnecessarily 2630 sent to a peer. 2632 A receiver of a Capabilities-Exchange-Req (CER) message that does not 2633 have any applications in common with the sender MUST return a 2634 Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to 2635 DIAMETER_NO_COMMON_APPLICATION, and SHOULD disconnect the transport 2636 layer connection. Note that receiving a CER or CEA from a peer 2637 advertising itself as a Relay (see Section 2.4) MUST be interpreted 2638 as having common applications with the peer. 2640 The receiver of the Capabilities-Exchange-Request (CER) MUST 2641 determine common applications by computing the intersection of its 2642 own set of supported Application Id against all of the application 2643 identifier AVPs (Auth-Application-Id, Acct-Application-Id and Vendor- 2644 Specific-Application-Id) present in the CER. The value of the 2645 Vendor-Id AVP in the Vendor-Specific-Application-Id MUST NOT be used 2646 during computation. The sender of the Capabilities-Exchange-Answer 2647 (CEA) SHOULD include all of its supported applications as a hint to 2648 the receiver regarding all of its application capabilities. 2650 Diameter implementations SHOULD first attempt to establish a TLS 2651 connection prior to the CER/CEA exchange. This protects the 2652 capabilities information of both peers. To support older Diameter 2653 implementations that do not fully conform to this document, the 2654 transport security MAY still be negotiated via Inband-Security AVP. 2655 In this case, the receiver of a Capabilities-Exchange-Req (CER) 2656 message that does not have any security mechanisms in common with the 2657 sender MUST return a Capabilities-Exchange-Answer (CEA) with the 2658 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY, and SHOULD 2659 disconnect the transport layer connection. 2661 CERs received from unknown peers MAY be silently discarded, or a CEA 2662 MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER. 2663 In both cases, the transport connection is closed. If the local 2664 policy permits receiving CERs from unknown hosts, a successful CEA 2665 MAY be returned. If a CER from an unknown peer is answered with a 2666 successful CEA, the lifetime of the peer entry is equal to the 2667 lifetime of the transport connection. In case of a transport 2668 failure, all the pending transactions destined to the unknown peer 2669 can be discarded. 2671 The CER and CEA messages MUST NOT be proxied, redirected or relayed. 2673 Since the CER/CEA messages cannot be proxied, it is still possible 2674 that an upstream agent receives a message for which it has no 2675 available peers to handle the application that corresponds to the 2676 Command-Code. In such instances, the 'E' bit is set in the answer 2677 message (see Section 7.) with the Result-Code AVP set to 2678 DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action 2679 (e.g., re-routing request to an alternate peer). 2681 With the exception of the Capabilities-Exchange-Request message, a 2682 message of type Request that includes the Auth-Application-Id or 2683 Acct-Application-Id AVPs, or a message with an application-specific 2684 command code, MAY only be forwarded to a host that has explicitly 2685 advertised support for the application (or has advertised the Relay 2686 Application Id). 2688 5.3.1. Capabilities-Exchange-Request 2690 The Capabilities-Exchange-Request (CER), indicated by the Command- 2691 Code set to 257 and the Command Flags' 'R' bit set, is sent to 2692 exchange local capabilities. Upon detection of a transport failure, 2693 this message MUST NOT be sent to an alternate peer. 2695 When Diameter is run over SCTP [RFC4960], which allows for 2696 connections to span multiple interfaces and multiple IP addresses, 2697 the Capabilities-Exchange-Request message MUST contain one Host-IP- 2698 Address AVP for each potential IP address that MAY be locally used 2699 when transmitting Diameter messages. 2701 Message Format 2703 ::= < Diameter Header: 257, REQ > 2704 { Origin-Host } 2705 { Origin-Realm } 2706 1* { Host-IP-Address } 2707 { Vendor-Id } 2708 { Product-Name } 2709 [ Origin-State-Id ] 2710 * [ Supported-Vendor-Id ] 2711 * [ Auth-Application-Id ] 2712 * [ Inband-Security-Id ] 2713 * [ Acct-Application-Id ] 2714 * [ Vendor-Specific-Application-Id ] 2715 [ Firmware-Revision ] 2716 * [ AVP ] 2718 5.3.2. Capabilities-Exchange-Answer 2720 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code 2721 set to 257 and the Command Flags' 'R' bit cleared, is sent in 2722 response to a CER message. 2724 When Diameter is run over SCTP [RFC4960], which allows connections to 2725 span multiple interfaces, hence, multiple IP addresses, the 2726 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address 2727 AVP for each potential IP address that MAY be locally used when 2728 transmitting Diameter messages. 2730 Message Format 2732 ::= < Diameter Header: 257 > 2733 { Result-Code } 2734 { Origin-Host } 2735 { Origin-Realm } 2736 1* { Host-IP-Address } 2737 { Vendor-Id } 2738 { Product-Name } 2739 [ Origin-State-Id ] 2740 [ Error-Message ] 2741 [ Failed-AVP ] 2742 * [ Supported-Vendor-Id ] 2743 * [ Auth-Application-Id ] 2744 * [ Inband-Security-Id ] 2745 * [ Acct-Application-Id ] 2746 * [ Vendor-Specific-Application-Id ] 2747 [ Firmware-Revision ] 2748 * [ AVP ] 2750 5.3.3. Vendor-Id AVP 2752 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains 2753 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232] 2754 value assigned to the vendor of the Diameter device. It is 2755 envisioned that the combination of the Vendor-Id, Product-Name 2756 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may 2757 provide useful debugging information. 2759 A Vendor-Id value of zero in the CER or CEA messages is reserved and 2760 indicates that this field is ignored. 2762 5.3.4. Firmware-Revision AVP 2764 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is 2765 used to inform a Diameter peer of the firmware revision of the 2766 issuing device. 2768 For devices that do not have a firmware revision (general purpose 2769 computers running Diameter software modules, for instance), the 2770 revision of the Diameter software module may be reported instead. 2772 5.3.5. Host-IP-Address AVP 2774 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used 2775 to inform a Diameter peer of the sender's IP address. All source 2776 addresses that a Diameter node expects to use with SCTP [RFC4960] 2777 MUST be advertised in the CER and CEA messages by including a Host- 2778 IP-Address AVP for each address. 2780 5.3.6. Supported-Vendor-Id AVP 2782 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and 2783 contains the IANA "SMI Network Management Private Enterprise Codes" 2784 [RFC3232] value assigned to a vendor other than the device vendor but 2785 including the application vendor. This is used in the CER and CEA 2786 messages in order to inform the peer that the sender supports (a 2787 subset of) the vendor-specific AVPs defined by the vendor identified 2788 in this AVP. The value of this AVP MUST NOT be set to zero. 2789 Multiple instances of this AVP containing the same value SHOULD NOT 2790 be sent. 2792 5.3.7. Product-Name AVP 2794 The Product-Name AVP (AVP Code 269) is of type UTF8String, and 2795 contains the vendor assigned name for the product. The Product-Name 2796 AVP SHOULD remain constant across firmware revisions for the same 2797 product. 2799 5.4. Disconnecting Peer connections 2801 When a Diameter node disconnects one of its transport connections, 2802 its peer cannot know the reason for the disconnect, and will most 2803 likely assume that a connectivity problem occurred, or that the peer 2804 has rebooted. In these cases, the peer may periodically attempt to 2805 reconnect, as stated in Section 2.1. In the event that the 2806 disconnect was a result of either a shortage of internal resources, 2807 or simply that the node in question has no intentions of forwarding 2808 any Diameter messages to the peer in the foreseeable future, a 2809 periodic connection request would not be welcomed. The 2810 Disconnection-Reason AVP contains the reason the Diameter node issued 2811 the Disconnect-Peer-Request message. 2813 The Disconnect-Peer-Request message is used by a Diameter node to 2814 inform its peer of its intent to disconnect the transport layer, and 2815 that the peer shouldn't reconnect unless it has a valid reason to do 2816 so (e.g., message to be forwarded). Upon receipt of the message, the 2817 Disconnect-Peer-Answer is returned, which SHOULD contain an error if 2818 messages have recently been forwarded, and are likely in flight, 2819 which would otherwise cause a race condition. 2821 The receiver of the Disconnect-Peer-Answer initiates the transport 2822 disconnect. The sender of the Disconnect-Peer-Answer should be able 2823 to detect the transport closure and cleanup the connection. 2825 5.4.1. Disconnect-Peer-Request 2827 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set 2828 to 282 and the Command Flags' 'R' bit set, is sent to a peer to 2829 inform its intentions to shutdown the transport connection. Upon 2830 detection of a transport failure, this message MUST NOT be sent to an 2831 alternate peer. 2833 Message Format 2835 ::= < Diameter Header: 282, REQ > 2836 { Origin-Host } 2837 { Origin-Realm } 2838 { Disconnect-Cause } 2839 * [ AVP ] 2841 5.4.2. Disconnect-Peer-Answer 2843 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set 2844 to 282 and the Command Flags' 'R' bit cleared, is sent as a response 2845 to the Disconnect-Peer-Request message. Upon receipt of this 2846 message, the transport connection is shutdown. 2848 Message Format 2850 ::= < Diameter Header: 282 > 2851 { Result-Code } 2852 { Origin-Host } 2853 { Origin-Realm } 2854 [ Error-Message ] 2855 [ Failed-AVP ] 2856 * [ AVP ] 2858 5.4.3. Disconnect-Cause AVP 2860 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A 2861 Diameter node MUST include this AVP in the Disconnect-Peer-Request 2862 message to inform the peer of the reason for its intention to 2863 shutdown the transport connection. The following values are 2864 supported: 2866 REBOOTING 0 2867 A scheduled reboot is imminent. Receiver of DPR with above result 2868 code MAY attempt reconnection. 2870 BUSY 1 2871 The peer's internal resources are constrained, and it has 2872 determined that the transport connection needs to be closed. 2873 Receiver of DPR with above result code SHOULD NOT attempt 2874 reconnection. 2876 DO_NOT_WANT_TO_TALK_TO_YOU 2 2877 The peer has determined that it does not see a need for the 2878 transport connection to exist, since it does not expect any 2879 messages to be exchanged in the near future. Receiver of DPR 2880 with above result code SHOULD NOT attempt reconnection. 2882 5.5. Transport Failure Detection 2884 Given the nature of the Diameter protocol, it is recommended that 2885 transport failures be detected as soon as possible. Detecting such 2886 failures will minimize the occurrence of messages sent to unavailable 2887 agents, resulting in unnecessary delays, and will provide better 2888 failover performance. The Device-Watchdog-Request and Device- 2889 Watchdog-Answer messages, defined in this section, are used to pro- 2890 actively detect transport failures. 2892 5.5.1. Device-Watchdog-Request 2894 The Device-Watchdog-Request (DWR), indicated by the Command-Code set 2895 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no 2896 traffic has been exchanged between two peers (see Section 5.5.3). 2897 Upon detection of a transport failure, this message MUST NOT be sent 2898 to an alternate peer. 2900 Message Format 2902 ::= < Diameter Header: 280, REQ > 2903 { Origin-Host } 2904 { Origin-Realm } 2905 [ Origin-State-Id ] 2906 * [ AVP ] 2908 5.5.2. Device-Watchdog-Answer 2910 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set 2911 to 280 and the Command Flags' 'R' bit cleared, is sent as a response 2912 to the Device-Watchdog-Request message. 2914 Message Format 2916 ::= < Diameter Header: 280 > 2917 { Result-Code } 2918 { Origin-Host } 2919 { Origin-Realm } 2920 [ Error-Message ] 2921 [ Failed-AVP ] 2922 [ Origin-State-Id ] 2923 * [ AVP ] 2925 5.5.3. Transport Failure Algorithm 2927 The transport failure algorithm is defined in [RFC3539]. All 2928 Diameter implementations MUST support the algorithm defined in the 2929 specification in order to be compliant to the Diameter base protocol. 2931 5.5.4. Failover and Failback Procedures 2933 In the event that a transport failure is detected with a peer, it is 2934 necessary for all pending request messages to be forwarded to an 2935 alternate agent, if possible. This is commonly referred to as 2936 failover. 2938 In order for a Diameter node to perform failover procedures, it is 2939 necessary for the node to maintain a pending message queue for a 2940 given peer. When an answer message is received, the corresponding 2941 request is removed from the queue. The Hop-by-Hop Identifier field 2942 is used to match the answer with the queued request. 2944 When a transport failure is detected, if possible all messages in the 2945 queue are sent to an alternate agent with the T flag set. On booting 2946 a Diameter client or agent, the T flag is also set on any records 2947 still remaining to be transmitted in non-volatile storage. An 2948 example of a case where it is not possible to forward the message to 2949 an alternate server is when the message has a fixed destination, and 2950 the unavailable peer is the message's final destination (see 2951 Destination-Host AVP). Such an error requires that the agent return 2952 an answer message with the 'E' bit set and the Result-Code AVP set to 2953 DIAMETER_UNABLE_TO_DELIVER. 2955 It is important to note that multiple identical requests or answers 2956 MAY be received as a result of a failover. The End-to-End Identifier 2957 field in the Diameter header along with the Origin-Host AVP MUST be 2958 used to identify duplicate messages. 2960 As described in Section 2.1, a connection request should be 2961 periodically attempted with the failed peer in order to re-establish 2962 the transport connection. Once a connection has been successfully 2963 established, messages can once again be forwarded to the peer. This 2964 is commonly referred to as failback. 2966 5.6. Peer State Machine 2968 This section contains a finite state machine that MUST be observed by 2969 all Diameter implementations. Each Diameter node MUST follow the 2970 state machine described below when communicating with each peer. 2971 Multiple actions are separated by commas, and may continue on 2972 succeeding lines, as space requires. Similarly, state and next state 2973 may also span multiple lines, as space requires. 2975 This state machine is closely coupled with the state machine 2976 described in [RFC3539], which is used to open, close, failover, 2977 probe, and reopen transport connections. Note in particular that 2978 [RFC3539] requires the use of watchdog messages to probe connections. 2979 For Diameter, DWR and DWA messages are to be used. 2981 I- is used to represent the initiator (connecting) connection, while 2982 the R- is used to represent the responder (listening) connection. 2983 The lack of a prefix indicates that the event or action is the same 2984 regardless of the connection on which the event occurred. 2986 The stable states that a state machine may be in are Closed, I-Open 2987 and R-Open; all other states are intermediate. Note that I-Open and 2988 R-Open are equivalent except for whether the initiator or responder 2989 transport connection is used for communication. 2991 A CER message is always sent on the initiating connection immediately 2992 after the connection request is successfully completed. In the case 2993 of an election, one of the two connections will shut down. The 2994 responder connection will survive if the Origin-Host of the local 2995 Diameter entity is higher than that of the peer; the initiator 2996 connection will survive if the peer's Origin-Host is higher. All 2997 subsequent messages are sent on the surviving connection. Note that 2998 the results of an election on one peer are guaranteed to be the 2999 inverse of the results on the other. 3001 For TLS usage, TLS handshake SHOULD begin when both ends are in the 3002 closed state prior to any Diameter message exchanges. The TLS 3003 connection SHOULD be established before sending any CER or CEA 3004 message to secure and protect the capabilities information of both 3005 peers. The TLS connection SHOULD be disconnected when the state 3006 machine moves to the closed state. When connecting to responders 3007 that do not conform to this document (i.e. older Diameter 3008 implementations that are not prepared to received TLS connections in 3009 the closed state), the initial TLS connection attempt will fail. The 3010 initiator MAY then attempt to connect via TCP or SCTP and initiate 3011 the TLS handshake when both ends are in the open state. If the 3012 handshake is successful, all further messages will be sent via TLS. 3013 If the handshake fails, both ends moves to the closed state. 3015 The state machine constrains only the behavior of a Diameter 3016 implementation as seen by Diameter peers through events on the wire. 3018 Any implementation that produces equivalent results is considered 3019 compliant. 3021 state event action next state 3022 ----------------------------------------------------------------- 3023 Closed Start I-Snd-Conn-Req Wait-Conn-Ack 3024 R-Conn-CER R-Accept, R-Open 3025 Process-CER, 3026 R-Snd-CEA 3028 Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA 3029 I-Rcv-Conn-Nack Cleanup Closed 3030 R-Conn-CER R-Accept, Wait-Conn-Ack/ 3031 Process-CER Elect 3032 Timeout Error Closed 3034 Wait-I-CEA I-Rcv-CEA Process-CEA I-Open 3035 R-Conn-CER R-Accept, Wait-Returns 3036 Process-CER, 3037 Elect 3038 I-Peer-Disc I-Disc Closed 3039 I-Rcv-Non-CEA Error Closed 3040 Timeout Error Closed 3042 Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns 3043 Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open 3044 R-Peer-Disc R-Disc Wait-Conn-Ack 3045 R-Conn-CER R-Reject Wait-Conn-Ack/ 3046 Elect 3047 Timeout Error Closed 3049 Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open 3050 I-Peer-Disc I-Disc, R-Open 3051 R-Snd-CEA 3052 I-Rcv-CEA R-Disc I-Open 3053 R-Peer-Disc R-Disc Wait-I-CEA 3054 R-Conn-CER R-Reject Wait-Returns 3055 Timeout Error Closed 3057 R-Open Send-Message R-Snd-Message R-Open 3058 R-Rcv-Message Process R-Open 3059 R-Rcv-DWR Process-DWR, R-Open 3060 R-Snd-DWA 3061 R-Rcv-DWA Process-DWA R-Open 3062 R-Conn-CER R-Reject R-Open 3063 Stop R-Snd-DPR Closing 3064 R-Rcv-DPR R-Snd-DPA, Closed 3065 R-Disc 3066 R-Peer-Disc R-Disc Closed 3068 I-Open Send-Message I-Snd-Message I-Open 3069 I-Rcv-Message Process I-Open 3070 I-Rcv-DWR Process-DWR, I-Open 3071 I-Snd-DWA 3072 I-Rcv-DWA Process-DWA I-Open 3073 R-Conn-CER R-Reject I-Open 3074 Stop I-Snd-DPR Closing 3075 I-Rcv-DPR I-Snd-DPA, Closed 3076 I-Disc 3077 I-Peer-Disc I-Disc Closed 3079 Closing I-Rcv-DPA I-Disc Closed 3080 R-Rcv-DPA R-Disc Closed 3081 Timeout Error Closed 3082 I-Peer-Disc I-Disc Closed 3083 R-Peer-Disc R-Disc Closed 3085 5.6.1. Incoming connections 3087 When a connection request is received from a Diameter peer, it is 3088 not, in the general case, possible to know the identity of that peer 3089 until a CER is received from it. This is because host and port 3090 determine the identity of a Diameter peer; and the source port of an 3091 incoming connection is arbitrary. Upon receipt of CER, the identity 3092 of the connecting peer can be uniquely determined from Origin-Host. 3094 For this reason, a Diameter peer must employ logic separate from the 3095 state machine to receive connection requests, accept them, and await 3096 CER. Once CER arrives on a new connection, the Origin-Host that 3097 identifies the peer is used to locate the state machine associated 3098 with that peer, and the new connection and CER are passed to the 3099 state machine as an R-Conn-CER event. 3101 The logic that handles incoming connections SHOULD close and discard 3102 the connection if any message other than CER arrives, or if an 3103 implementation-defined timeout occurs prior to receipt of CER. 3105 Because handling of incoming connections up to and including receipt 3106 of CER requires logic, separate from that of any individual state 3107 machine associated with a particular peer, it is described separately 3108 in this section rather than in the state machine above. 3110 5.6.2. Events 3112 Transitions and actions in the automaton are caused by events. In 3113 this section, we will ignore the -I and -R prefix, since the actual 3114 event would be identical, but would occur on one of two possible 3115 connections. 3117 Start The Diameter application has signaled that a 3118 connection should be initiated with the peer. 3120 R-Conn-CER An acknowledgement is received stating that the 3121 transport connection has been established, and the 3122 associated CER has arrived. 3124 Rcv-Conn-Ack A positive acknowledgement is received confirming that 3125 the transport connection is established. 3127 Rcv-Conn-Nack A negative acknowledgement was received stating that 3128 the transport connection was not established. 3130 Timeout An application-defined timer has expired while waiting 3131 for some event. 3133 Rcv-CER A CER message from the peer was received. 3135 Rcv-CEA A CEA message from the peer was received. 3137 Rcv-Non-CEA A message other than CEA from the peer was received. 3139 Peer-Disc A disconnection indication from the peer was received. 3141 Rcv-DPR A DPR message from the peer was received. 3143 Rcv-DPA A DPA message from the peer was received. 3145 Win-Election An election was held, and the local node was the 3146 winner. 3148 Send-Message A message is to be sent. 3150 Rcv-Message A message other than CER, CEA, DPR, DPA, DWR or DWA 3151 was received. 3153 Stop The Diameter application has signaled that a 3154 connection should be terminated (e.g., on system 3155 shutdown). 3157 5.6.3. Actions 3159 Actions in the automaton are caused by events and typically indicate 3160 the transmission of packets and/or an action to be taken on the 3161 connection. In this section we will ignore the I- and R-prefix, 3162 since the actual action would be identical, but would occur on one of 3163 two possible connections. 3165 Snd-Conn-Req A transport connection is initiated with the peer. 3167 Accept The incoming connection associated with the R-Conn-CER 3168 is accepted as the responder connection. 3170 Reject The incoming connection associated with the R-Conn-CER 3171 is disconnected. 3173 Process-CER The CER associated with the R-Conn-CER is processed. 3174 Snd-CER A CER message is sent to the peer. 3176 Snd-CEA A CEA message is sent to the peer. 3178 Cleanup If necessary, the connection is shutdown, and any 3179 local resources are freed. 3181 Error The transport layer connection is disconnected, 3182 either politely or abortively, in response to 3183 an error condition. Local resources are freed. 3185 Process-CEA A received CEA is processed. 3187 Snd-DPR A DPR message is sent to the peer. 3189 Snd-DPA A DPA message is sent to the peer. 3191 Disc The transport layer connection is disconnected, 3192 and local resources are freed. 3194 Elect An election occurs (see Section 5.6.4 for more 3195 information). 3197 Snd-Message A message is sent. 3199 Snd-DWR A DWR message is sent. 3201 Snd-DWA A DWA message is sent. 3203 Process-DWR The DWR message is serviced. 3205 Process-DWA The DWA message is serviced. 3207 Process A message is serviced. 3209 5.6.4. The Election Process 3211 The election is performed on the responder. The responder compares 3212 the Origin-Host received in the CER with its own Origin-Host as two 3213 streams of octets. If the local Origin-Host lexicographically 3214 succeeds the received Origin-Host a Win-Election event is issued 3215 locally. Diameter identities are in ASCII form therefore the lexical 3216 comparison is consistent with DNS case insensitivity where octets 3217 that fall in the ASCII range 'a' through 'z' MUST compare equally to 3218 their upper-case counterparts between 'A' and 'Z'. See Appendix D 3219 for interactions between the Diameter protocol and Internationalized 3220 Domain Name (IDNs). 3222 The winner of the election MUST close the connection it initiated. 3223 Historically, maintaining the responder side of a connection was more 3224 efficient than maintaining the initiator side. However, current 3225 practices makes this distinction irrelevant. 3227 6. Diameter message processing 3229 This section describes how Diameter requests and answers are created 3230 and processed. 3232 6.1. Diameter Request Routing Overview 3234 A request is sent towards its final destination using a combination 3235 of the Destination-Realm and Destination-Host AVPs, in one of these 3236 three combinations: 3238 o a request that is not able to be proxied (such as CER) MUST NOT 3239 contain either Destination-Realm or Destination-Host AVPs. 3241 o a request that needs to be sent to a home server serving a 3242 specific realm, but not to a specific server (such as the first 3243 request of a series of round-trips), MUST contain a Destination- 3244 Realm AVP, but MUST NOT contain a Destination-Host AVP. For 3245 Diameter clients, the value of the Destination-Realm AVP MAY be 3246 extracted from the User-Name AVP, or other methods. 3248 o otherwise, a request that needs to be sent to a specific home 3249 server among those serving a given realm, MUST contain both the 3250 Destination-Realm and Destination-Host AVPs. 3252 The Destination-Host AVP is used as described above when the 3253 destination of the request is fixed, which includes: 3255 o Authentication requests that span multiple round trips 3257 o A Diameter message that uses a security mechanism that makes use 3258 of a pre-established session key shared between the source and the 3259 final destination of the message. 3261 o Server initiated messages that MUST be received by a specific 3262 Diameter client (e.g., access device), such as the Abort-Session- 3263 Request message, which is used to request that a particular user's 3264 session be terminated. 3266 Note that an agent can forward a request to a host described in the 3267 Destination-Host AVP only if the host in question is included in its 3268 peer table (see Section 2.7). Otherwise, the request is routed based 3269 on the Destination-Realm only (see Sections 6.1.6). 3271 When a message is received, the message is processed in the following 3272 order: 3274 o If the message is destined for the local host, the procedures 3275 listed in Section 6.1.4 are followed. 3277 o If the message is intended for a Diameter peer with whom the local 3278 host is able to directly communicate, the procedures listed in 3279 Section 6.1.5 are followed. This is known as Request Forwarding. 3281 o The procedures listed in Section 6.1.6 are followed, which is 3282 known as Request Routing. 3284 o If none of the above is successful, an answer is returned with the 3285 Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the E-bit set. 3287 For routing of Diameter messages to work within an administrative 3288 domain, all Diameter nodes within the realm MUST be peers. 3290 Note the processing rules contained in this section are intended to 3291 be used as general guidelines to Diameter developers. Certain 3292 implementations MAY use different methods than the ones described 3293 here, and still comply with the protocol specification. See Section 3294 7 for more detail on error handling. 3296 6.1.1. Originating a Request 3298 When creating a request, in addition to any other procedures 3299 described in the application definition for that specific request, 3300 the following procedures MUST be followed: 3302 o the Command-Code is set to the appropriate value 3304 o the 'R' bit is set 3306 o the End-to-End Identifier is set to a locally unique value 3308 o the Origin-Host and Origin-Realm AVPs MUST be set to the 3309 appropriate values, used to identify the source of the message 3311 o the Destination-Host and Destination-Realm AVPs MUST be set to the 3312 appropriate values as described in Section 6.1. 3314 6.1.2. Sending a Request 3316 When sending a request, originated either locally, or as the result 3317 of a forwarding or routing operation, the following procedures SHOULD 3318 be followed: 3320 o The Hop-by-Hop Identifier SHOULD be set to a locally unique value. 3322 o The message SHOULD be saved in the list of pending requests. 3324 Other actions to perform on the message based on the particular role 3325 the agent is playing are described in the following sections. 3327 6.1.3. Receiving Requests 3329 A relay or proxy agent MUST check for forwarding loops when receiving 3330 requests. A loop is detected if the server finds its own identity in 3331 a Route-Record AVP. When such an event occurs, the agent MUST answer 3332 with the Result-Code AVP set to DIAMETER_LOOP_DETECTED. 3334 6.1.4. Processing Local Requests 3336 A request is known to be for local consumption when one of the 3337 following conditions occur: 3339 o The Destination-Host AVP contains the local host's identity, 3341 o The Destination-Host AVP is not present, the Destination-Realm AVP 3342 contains a realm the server is configured to process locally, and 3343 the Diameter application is locally supported, or 3345 o Both the Destination-Host and the Destination-Realm are not 3346 present. 3348 When a request is locally processed, the rules in Section 6.2 should 3349 be used to generate the corresponding answer. 3351 6.1.5. Request Forwarding 3353 Request forwarding is done using the Diameter Peer Table. The 3354 Diameter peer table contains all of the peers that the local node is 3355 able to directly communicate with. 3357 When a request is received, and the host encoded in the Destination- 3358 Host AVP is one that is present in the peer table, the message SHOULD 3359 be forwarded to the peer. 3361 6.1.6. Request Routing 3363 Diameter request message routing is done via realms and application 3364 identifiers. A Diameter message that may be forwarded by Diameter 3365 agents (proxies, redirect or relay agents) MUST include the target 3366 realm in the Destination-Realm AVP. Request routing SHOULD rely on 3367 the Destination-Realm AVP and the Application Id present in the 3368 request message header to aid in the routing decision. The realm MAY 3369 be retrieved from the User-Name AVP, which is in the form of a 3370 Network Access Identifier (NAI). The realm portion of the NAI is 3371 inserted in the Destination-Realm AVP. 3373 Diameter agents MAY have a list of locally supported realms and 3374 applications, and MAY have a list of externally supported realms and 3375 applications. When a request is received that includes a realm 3376 and/or application that is not locally supported, the message is 3377 routed to the peer configured in the Routing Table (see Section 2.7). 3379 Realm names and Application Ids are the minimum supported routing 3380 criteria, additional information may be needed to support redirect 3381 semantics. 3383 6.1.7. Predictive Loop Avoidance 3385 Before forwarding or routing a request, Diameter agents, in addition 3386 to processing done in Section 6.1.3, SHOULD check for the presence of 3387 candidate route's peer identity in any of the Route-Record AVPs. In 3388 an event of the agent detecting the presence of a candidate route's 3389 peer identity in a Route-Record AVP, the agent MUST ignore such route 3390 for the Diameter request message and attempt alternate routes if any. 3391 In case all the candidate routes are eliminated by the above 3392 criteria, the agent SHOULD return DIAMETER_UNABLE_TO_DELIVER message. 3394 6.1.8. Redirecting Requests 3396 When a redirect agent receives a request whose routing entry is set 3397 to REDIRECT, it MUST reply with an answer message with the 'E' bit 3398 set, while maintaining the Hop-by-Hop Identifier in the header, and 3399 include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of 3400 the servers associated with the routing entry are added in separate 3401 Redirect-Host AVP. 3403 +------------------+ 3404 | Diameter | 3405 | Redirect Agent | 3406 +------------------+ 3407 ^ | 2. command + 'E' bit 3408 1. Request | | Result-Code = 3409 joe@example.com | | DIAMETER_REDIRECT_INDICATION + 3410 | | Redirect-Host AVP(s) 3411 | v 3412 +-------------+ 3. Request +-------------+ 3413 | example.com |------------->| example.net | 3414 | Relay | | Diameter | 3415 | Agent |<-------------| Server | 3416 +-------------+ 4. Answer +-------------+ 3417 Figure 5: Diameter Redirect Agent 3419 The receiver of the answer message with the 'E' bit set, and the 3420 Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-by- 3421 hop field in the Diameter header to identify the request in the 3422 pending message queue (see Section 5.3) that is to be redirected. If 3423 no transport connection exists with the new agent, one is created, 3424 and the request is sent directly to it. 3426 Multiple Redirect-Host AVPs are allowed. The receiver of the answer 3427 message with the 'E' bit set selects exactly one of these hosts as 3428 the destination of the redirected message. 3430 When the Redirect-Host-Usage AVP included in the answer message has a 3431 non-zero value, a route entry for the redirect indications is created 3432 and cached by the receiver. The redirect usage for such route entry 3433 is set by the value of Redirect-Host-Usage AVP and the lifetime of 3434 the cached route entry is set by Redirect-Max-Cache-Time AVP value. 3436 It is possible that multiple redirect indications can create multiple 3437 cached route entries differing only in their redirect usage and the 3438 peer to forward messages to. As an example, two(2) route entries 3439 that are created by two(2) redirect indications results in two(2) 3440 cached routes for the same realm and Application Id. However, one 3441 has a redirect usage of ALL_SESSION where matching request will be 3442 forwarded to one peer and the other has a redirect usage of ALL_REALM 3443 where request are forwarded to another peer. Therefore, an incoming 3444 request that matches the realm and Application Id of both routes will 3445 need additional resolution. In such a case, a routing precedence 3446 rule MUST be used against the redirect usage value to resolve the 3447 contention. The precedence rule can be found in Section 6.13. 3449 6.1.9. Relaying and Proxying Requests 3451 A relay or proxy agent MUST append a Route-Record AVP to all requests 3452 forwarded. The AVP contains the identity of the peer the request was 3453 received from. 3455 The Hop-by-Hop identifier in the request is saved, and replaced with 3456 a locally unique value. The source of the request is also saved, 3457 which includes the IP address, port and protocol. 3459 A relay or proxy agent MAY include the Proxy-Info AVP in requests if 3460 it requires access to any local state information when the 3461 corresponding response is received. The Proxy-Info AVP has security 3462 implications as state information is distribute to other entities. 3463 As such, it is RECOMMMENDED to protect the content of the Proxy-Info 3464 AVP with cryptographic mechanisms, for example by using a keyed 3465 message digest. Such a mechanism, however, requires the management 3466 of keys, although only locally at the Diameter server. Still, a full 3467 description of the management of the keys used to protect the Proxy- 3468 Info AVP is beyond the scope of this document. Below is a list of 3469 commonly recommended: 3471 o The keys should be generated securely following the randomness 3472 recommendations in [RFC4086]. 3474 o The keys and cryptographic protection algorithms should be at 3475 least 128 bits in strength. 3477 o The keys should not be used for any other purpose than generating 3478 and verifying tickets. 3480 o The keys should be changed regularly. 3482 o The keys should be changed if the ticket format or cryptographic 3483 protection algorithms change. 3485 The message is then forwarded to the next hop, as identified in the 3486 Routing Table. 3488 Figure 6 provides an example of message routing using the procedures 3489 listed in these sections. 3491 (Origin-Host=nas.mno.net) (Origin-Host=nas.mno.net) 3492 (Origin-Realm=mno.net) (Origin-Realm=mno.net) 3493 (Destination-Realm=example.com) (Destination- 3494 Realm=example.com) 3495 (Route-Record=nas.example.net) 3496 +------+ ------> +------+ ------> +------+ 3497 | | (Request) | | (Request) | | 3498 | NAS +-------------------+ DRL +-------------------+ HMS | 3499 | | | | | | 3500 +------+ <------ +------+ <------ +------+ 3501 example.net (Answer) example.net (Answer) example.com 3502 (Origin-Host=hms.example.com) (Origin-Host=hms.example.com) 3503 (Origin-Realm=example.com) (Origin-Realm=example.com) 3505 Figure 6: Routing of Diameter messages 3507 Relay and proxy agents are not required to perform full inspection of 3508 incoming messages. At a minimum, validation of the message header 3509 and relevant routing AVPs has to be done when relaying messages. 3510 Proxy agents may optionally perform more in-depth message validation 3511 for applications it is interested in. 3513 6.2. Diameter Answer Processing 3515 When a request is locally processed, the following procedures MUST be 3516 applied to create the associated answer, in addition to any 3517 additional procedures that MAY be discussed in the Diameter 3518 application defining the command: 3520 o The same Hop-by-Hop identifier in the request is used in the 3521 answer. 3523 o The local host's identity is encoded in the Origin-Host AVP. 3525 o The Destination-Host and Destination-Realm AVPs MUST NOT be 3526 present in the answer message. 3528 o The Result-Code AVP is added with its value indicating success or 3529 failure. 3531 o If the Session-Id is present in the request, it MUST be included 3532 in the answer. 3534 o Any Proxy-Info AVPs in the request MUST be added to the answer 3535 message, in the same order they were present in the request. 3537 o The 'P' bit is set to the same value as the one in the request. 3539 o The same End-to-End identifier in the request is used in the 3540 answer. 3542 Note that the error messages (see Section 7.3) are also subjected to 3543 the above processing rules. 3545 6.2.1. Processing received Answers 3547 A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an 3548 answer received against the list of pending requests. The 3549 corresponding message should be removed from the list of pending 3550 requests. It SHOULD ignore answers received that do not match a 3551 known Hop-by-Hop Identifier. 3553 6.2.2. Relaying and Proxying Answers 3555 If the answer is for a request which was proxied or relayed, the 3556 agent MUST restore the original value of the Diameter header's Hop- 3557 by-Hop Identifier field. 3559 If the last Proxy-Info AVP in the message is targeted to the local 3560 Diameter server, the AVP MUST be removed before the answer is 3561 forwarded. 3563 If a relay or proxy agent receives an answer with a Result-Code AVP 3564 indicating a failure, it MUST NOT modify the contents of the AVP. 3565 Any additional local errors detected SHOULD be logged, but not 3566 reflected in the Result-Code AVP. If the agent receives an answer 3567 message with a Result-Code AVP indicating success, and it wishes to 3568 modify the AVP to indicate an error, it MUST modify the Result-Code 3569 AVP to contain the appropriate error in the message destined towards 3570 the access device as well as include the Error-Reporting-Host AVP and 3571 it MUST issue an STR on behalf of the access device towards the 3572 Diameter server. 3574 The agent MUST then send the answer to the host that it received the 3575 original request from. 3577 6.3. Origin-Host AVP 3579 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and 3580 MUST be present in all Diameter messages. This AVP identifies the 3581 endpoint that originated the Diameter message. Relay agents MUST NOT 3582 modify this AVP. 3584 The value of the Origin-Host AVP is guaranteed to be unique within a 3585 single host. 3587 Note that the Origin-Host AVP may resolve to more than one address as 3588 the Diameter peer may support more than one address. 3590 This AVP SHOULD be placed as close to the Diameter header as 3591 possible. 3593 6.4. Origin-Realm AVP 3595 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity. 3596 This AVP contains the Realm of the originator of any Diameter message 3597 and MUST be present in all messages. 3599 This AVP SHOULD be placed as close to the Diameter header as 3600 possible. 3602 6.5. Destination-Host AVP 3604 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. 3605 This AVP MUST be present in all unsolicited agent initiated messages, 3606 MAY be present in request messages, and MUST NOT be present in Answer 3607 messages. 3609 The absence of the Destination-Host AVP will cause a message to be 3610 sent to any Diameter server supporting the application within the 3611 realm specified in Destination-Realm AVP. 3613 This AVP SHOULD be placed as close to the Diameter header as 3614 possible. 3616 6.6. Destination-Realm AVP 3618 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity, 3619 and contains the realm the message is to be routed to. The 3620 Destination-Realm AVP MUST NOT be present in Answer messages. 3621 Diameter Clients insert the realm portion of the User-Name AVP. 3622 Diameter servers initiating a request message use the value of the 3623 Origin-Realm AVP from a previous message received from the intended 3624 target host (unless it is known a priori). When present, the 3625 Destination-Realm AVP is used to perform message routing decisions. 3627 An ABNF for a request message that includes the Destination-Realm AVP 3628 SHOULD list the Destination-Realm AVP as a required AVP (an AVP 3629 indicated as {AVP}) otherwise the message is inherently a non- 3630 routable messages. 3632 This AVP SHOULD be placed as close to the Diameter header as 3633 possible. 3635 6.7. Routing AVPs 3637 The AVPs defined in this section are Diameter AVPs used for routing 3638 purposes. These AVPs change as Diameter messages are processed by 3639 agents. 3641 6.7.1. Route-Record AVP 3643 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The 3644 identity added in this AVP MUST be the same as the one received in 3645 the Origin-Host of the Capabilities Exchange message. 3647 6.7.2. Proxy-Info AVP 3649 The Proxy-Info AVP (AVP Code 284) is of type Grouped. This AVP 3650 contains the identity and local state information of Diameter node 3651 that creates and adds it to a message. The Grouped Data field has 3652 the following ABNF grammar: 3654 Proxy-Info ::= < AVP Header: 284 > 3655 { Proxy-Host } 3656 { Proxy-State } 3658 * [ AVP ] 3660 6.7.3. Proxy-Host AVP 3662 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This 3663 AVP contains the identity of the host that added the Proxy-Info AVP. 3665 6.7.4. Proxy-State AVP 3667 The Proxy-State AVP (AVP Code 33) is of type OctetString. It 3668 contains state information that would otherwise be stored at the 3669 Diameter entity that created it. As such, this AVP MUST be treated 3670 as opaque data by entities other Diameter entities. 3672 6.8. Auth-Application-Id AVP 3674 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and 3675 is used in order to advertise support of the Authentication and 3676 Authorization portion of an application (see Section 2.4). If 3677 present in a message other than CER and CEA, the value of the Auth- 3678 Application-Id AVP MUST match the Application Id present in the 3679 Diameter message header. 3681 6.9. Acct-Application-Id AVP 3683 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and 3684 is used in order to advertise support of the Accounting portion of an 3685 application (see Section 2.4). If present in a message other than 3686 CER and CEA, the value of the Acct-Application-Id AVP MUST match the 3687 Application Id present in the Diameter message header. 3689 6.10. Inband-Security-Id AVP 3691 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and 3692 is used in order to advertise support of the security portion of the 3693 application. The use of this AVP in CER and CEA messages is no 3694 longer recommended. Instead, discovery of a Diameter entities 3695 security capabilities can be done either through static configuration 3696 or via Diameter Peer Discovery described in Section 5.2. 3698 The following values are supported: 3700 NO_INBAND_SECURITY 0 3702 This peer does not support TLS. This is the default value, if the 3703 AVP is omitted. 3705 TLS 1 3707 This node supports TLS security, as defined by [RFC5246]. 3709 6.11. Vendor-Specific-Application-Id AVP 3711 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type 3712 Grouped and is used to advertise support of a vendor-specific 3713 Diameter Application. Exactly one instance of either Auth- 3714 Application-Id or Acct-Application-Id AVP MUST be present. The 3715 Application Id carried by either Auth-Application-Id or Acct- 3716 Application-Id AVP MUST comply with vendor specific Application Id 3717 assignment described in Sec 11.3. It MUST also match the Application 3718 Id present in the Diameter header except when used in a CER or CEA 3719 messages. 3721 The Vendor-Id AVP is an informational AVP pertaining to the vendor 3722 who may have authorship of the vendor-specific Diameter application. 3723 It MUST NOT be used as a means of defining a completely separate 3724 vendor-specific Application Id space. 3726 The Vendor-Specific-Application-Id AVP SHOULD be placed as close to 3727 the Diameter header as possible. 3729 AVP Format 3731 ::= < AVP Header: 260 > 3732 { Vendor-Id } 3733 [ Auth-Application-Id ] 3734 [ Acct-Application-Id ] 3736 A Vendor-Specific-Application-Id AVP MUST contain exactly one of 3737 either Auth-Application-Id or Acct-Application-Id. If a Vendor- 3738 Specific-Application-Id is received without any of these two AVPs, 3739 then the recipient SHOULD issue an answer with a Result-Code set to 3740 DIAMETER_MISSING_AVP. The answer SHOULD also include a Failed-AVP 3741 which MUST contain an example of an Auth-Application-Id AVP and an 3742 Acct-Application-Id AVP. 3744 If a Vendor-Specific-Application-Id is received that contains both 3745 Auth-Application-Id and Acct-Application-Id, then the recipient MUST 3746 issue an answer with Result-Code set to 3747 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. The answer MUST also include a 3748 Failed-AVP which MUST contain the received Auth-Application-Id AVP 3749 and Acct-Application-Id AVP. 3751 6.12. Redirect-Host AVP 3753 The Redirect-Host AVP (AVP Code 292) is of type DiameterURI. One or 3754 more of instances of this AVP MUST be present if the answer message's 3755 'E' bit is set and the Result-Code AVP is set to 3756 DIAMETER_REDIRECT_INDICATION. 3758 Upon receiving the above, the receiving Diameter node SHOULD forward 3759 the request directly to one of the hosts identified in these AVPs. 3760 The server contained in the selected Redirect-Host AVP SHOULD be used 3761 for all messages matching the criteria set by the Redirect-Host-Usage 3762 AVP. 3764 6.13. Redirect-Host-Usage AVP 3766 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated. 3767 This AVP MAY be present in answer messages whose 'E' bit is set and 3768 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION. 3770 When present, this AVP provides a hints about how the routing entry 3771 resulting from the Redirect-Host is to be used. The following values 3772 are supported: 3774 DONT_CACHE 0 3776 The host specified in the Redirect-Host AVP SHOULD NOT be cached. 3777 This is the default value. 3779 ALL_SESSION 1 3781 All messages within the same session, as defined by the same value 3782 of the Session-ID AVP SHOULD be sent to the host specified in the 3783 Redirect-Host AVP. 3785 ALL_REALM 2 3787 All messages destined for the realm requested SHOULD be sent to 3788 the host specified in the Redirect-Host AVP. 3790 REALM_AND_APPLICATION 3 3792 All messages for the application requested to the realm specified 3793 SHOULD be sent to the host specified in the Redirect-Host AVP. 3795 ALL_APPLICATION 4 3797 All messages for the application requested SHOULD be sent to the 3798 host specified in the Redirect-Host AVP. 3800 ALL_HOST 5 3802 All messages that would be sent to the host that generated the 3803 Redirect-Host SHOULD be sent to the host specified in the 3804 Redirect- Host AVP. 3806 ALL_USER 6 3808 All messages for the user requested SHOULD be sent to the host 3809 specified in the Redirect-Host AVP. 3811 When multiple cached routes are created by redirect indications and 3812 they differ only in redirect usage and peers to forward requests to 3813 (see Section 6.1.8), a precedence rule MUST be applied to the 3814 redirect usage values of the cached routes during normal routing to 3815 resolve contentions that may occur. The precedence rule is the order 3816 that dictate which redirect usage should be considered before any 3817 other as they appear. The order is as follows: 3819 1. ALL_SESSION 3821 2. ALL_USER 3823 3. REALM_AND_APPLICATION 3825 4. ALL_REALM 3827 5. ALL_APPLICATION 3829 6. ALL_HOST 3831 6.14. Redirect-Max-Cache-Time AVP 3833 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. 3834 This AVP MUST be present in answer messages whose 'E' bit is set, the 3835 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the 3836 Redirect-Host-Usage AVP set to a non-zero value. 3838 This AVP contains the maximum number of seconds the peer and route 3839 table entries, created as a result of the Redirect-Host, SHOULD be 3840 cached. Note that once a host is no longer reachable, any associated 3841 cache, peer and routing table entries MUST be deleted. 3843 7. Error Handling 3845 There are two different types of errors in Diameter; protocol and 3846 application errors. A protocol error is one that occurs at the base 3847 protocol level, and MAY require per hop attention (e.g., message 3848 routing error). Application errors, on the other hand, generally 3849 occur due to a problem with a function specified in a Diameter 3850 application (e.g., user authentication, missing AVP). 3852 Result-Code AVP values that are used to report protocol errors MUST 3853 only be present in answer messages whose 'E' bit is set. When a 3854 request message is received that causes a protocol error, an answer 3855 message is returned with the 'E' bit set, and the Result-Code AVP is 3856 set to the appropriate protocol error value. As the answer is sent 3857 back towards the originator of the request, each proxy or relay agent 3858 MAY take action on the message. 3860 1. Request +---------+ Link Broken 3861 +-------------------------->|Diameter |----///----+ 3862 | +---------------------| | v 3863 +------+--+ | 2. answer + 'E' set | Relay 2 | +--------+ 3864 |Diameter |<-+ (Unable to Forward) +---------+ |Diameter| 3865 | | | Home | 3866 | Relay 1 |--+ +---------+ | Server | 3867 +---------+ | 3. Request |Diameter | +--------+ 3868 +-------------------->| | ^ 3869 | Relay 3 |-----------+ 3870 +---------+ 3872 Figure 7: Example of Protocol Error causing answer message 3874 Figure 7 provides an example of a message forwarded upstream by a 3875 Diameter relay. When the message is received by Relay 2, and it 3876 detects that it cannot forward the request to the home server, an 3877 answer message is returned with the 'E' bit set and the Result-Code 3878 AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls 3879 within the protocol error category, Relay 1 would take special 3880 action, and given the error, attempt to route the message through its 3881 alternate Relay 3. 3883 +---------+ 1. Request +---------+ 2. Request +---------+ 3884 | Access |------------>|Diameter |------------>|Diameter | 3885 | | | | | Home | 3886 | Device |<------------| Relay |<------------| Server | 3887 +---------+ 4. Answer +---------+ 3. Answer +---------+ 3888 (Missing AVP) (Missing AVP) 3890 Figure 8: Example of Application Error Answer message 3892 Figure 8 provides an example of a Diameter message that caused an 3893 application error. When application errors occur, the Diameter 3894 entity reporting the error clears the 'R' bit in the Command Flags, 3895 and adds the Result-Code AVP with the proper value. Application 3896 errors do not require any proxy or relay agent involvement, and 3897 therefore the message would be forwarded back to the originator of 3898 the request. 3900 In the case where the answer message itself contains errors, any 3901 related session SHOULD be terminated by sending an STR or ASR 3902 message. The Termination-Cause AVP in the STR MAY be filled with the 3903 appropriate value to indicate the cause of the error. An application 3904 MAY also send an application-specific request instead of STR or ASR 3905 to signal the error in the case where no state is maintained or to 3906 allow for some form of error recovery with the corresponding Diameter 3907 entity. 3909 There are certain Result-Code AVP application errors that require 3910 additional AVPs to be present in the answer. In these cases, the 3911 Diameter node that sets the Result-Code AVP to indicate the error 3912 MUST add the AVPs. Examples are: 3914 o A request with an unrecognized AVP is received with the 'M' bit 3915 (Mandatory bit) set, causes an answer to be sent with the Result- 3916 Code AVP set to DIAMETER_AVP_UNSUPPORTED, and the Failed-AVP AVP 3917 containing the offending AVP. 3919 o A request with an AVP that is received with an unrecognized value 3920 causes an answer to be returned with the Result-Code AVP set to 3921 DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the 3922 AVP causing the error. 3924 o A command is received that is missing AVP(s) that are defined as 3925 required in the commands ABNF; examples are AVPs indicated as 3926 {AVP}. The receiver issues an answer with the Result-Code set to 3927 DIAMETER_MISSING_AVP, and creates an AVP with the AVP Code and 3928 other fields set as expected in the missing AVP. The created AVP 3929 is then added to the Failed- AVP AVP. 3931 The Result-Code AVP describes the error that the Diameter node 3932 encountered in its processing. In case there are multiple errors, 3933 the Diameter node MUST report only the first error it encountered 3934 (detected possibly in some implementation dependent order). The 3935 specific errors that can be described by this AVP are described in 3936 the following section. 3938 7.1. Result-Code AVP 3940 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and 3941 indicates whether a particular request was completed successfully or 3942 whether an error occurred. All Diameter answer messages in IETF 3943 defined Diameter application specification MUST include one Result- 3944 Code AVP. A non-successful Result-Code AVP (one containing a non 3945 2xxx value other than DIAMETER_REDIRECT_INDICATION) MUST include the 3946 Error-Reporting-Host AVP if the host setting the Result-Code AVP is 3947 different from the identity encoded in the Origin-Host AVP. 3949 The Result-Code data field contains an IANA-managed 32-bit address 3950 space representing errors (see Section 11.4). Diameter provides the 3951 following classes of errors, all identified by the thousands digit in 3952 the decimal notation: 3954 o 1xxx (Informational) 3956 o 2xxx (Success) 3958 o 3xxx (Protocol Errors) 3960 o 4xxx (Transient Failures) 3962 o 5xxx (Permanent Failure) 3964 A non-recognized class (one whose first digit is not defined in this 3965 section) MUST be handled as a permanent failure. 3967 7.1.1. Informational 3969 Errors that fall within this category are used to inform the 3970 requester that a request could not be satisfied, and additional 3971 action is required on its part before access is granted. 3973 DIAMETER_MULTI_ROUND_AUTH 1001 3975 This informational error is returned by a Diameter server to 3976 inform the access device that the authentication mechanism being 3977 used requires multiple round trips, and a subsequent request needs 3978 to be issued in order for access to be granted. 3980 7.1.2. Success 3982 Errors that fall within the Success category are used to inform a 3983 peer that a request has been successfully completed. 3985 DIAMETER_SUCCESS 2001 3987 The request was successfully completed. 3989 DIAMETER_LIMITED_SUCCESS 2002 3991 When returned, the request was successfully completed, but 3992 additional processing is required by the application in order to 3993 provide service to the user. 3995 7.1.3. Protocol Errors 3997 Errors that fall within the Protocol Error category SHOULD be treated 3998 on a per-hop basis, and Diameter proxies MAY attempt to correct the 3999 error, if it is possible. Note that these errors MUST only be used 4000 in answer messages whose 'E' bit is set. This document omits some 4001 error codes defined in [RFC3588]. To provide backward compatibility 4002 with [RFC3588] implementations these error code values are not re- 4003 used and hence the error codes values enumerated below are non- 4004 sequential. 4006 DIAMETER_UNABLE_TO_DELIVER 3002 4008 This error is given when Diameter can not deliver the message to 4009 the destination, either because no host within the realm 4010 supporting the required application was available to process the 4011 request, or because Destination-Host AVP was given without the 4012 associated Destination-Realm AVP. 4014 DIAMETER_REALM_NOT_SERVED 3003 4016 The intended realm of the request is not recognized. 4018 DIAMETER_TOO_BUSY 3004 4020 When returned, a Diameter node SHOULD attempt to send the message 4021 to an alternate peer. This error MUST only be used when a 4022 specific server is requested, and it cannot provide the requested 4023 service. 4025 DIAMETER_LOOP_DETECTED 3005 4027 An agent detected a loop while trying to get the message to the 4028 intended recipient. The message MAY be sent to an alternate peer, 4029 if one is available, but the peer reporting the error has 4030 identified a configuration problem. 4032 DIAMETER_REDIRECT_INDICATION 3006 4034 A redirect agent has determined that the request could not be 4035 satisfied locally and the initiator of the request SHOULD direct 4036 the request directly to the server, whose contact information has 4037 been added to the response. When set, the Redirect-Host AVP MUST 4038 be present. 4040 DIAMETER_APPLICATION_UNSUPPORTED 3007 4042 A request was sent for an application that is not supported. 4044 DIAMETER_INVALID_BIT_IN_HEADER 3011 4046 This error is returned when a reserved bit in the Diameter header 4047 is set to one (1) or the bits in the Diameter header defined in 4048 Section 3 are set incorrectly. 4050 DIAMETER_INVALID_MESSAGE_LENGTH 3012 4052 This error is returned when a request is received with an invalid 4053 message length. 4055 7.1.4. Transient Failures 4057 Errors that fall within the transient failures category are used to 4058 inform a peer that the request could not be satisfied at the time it 4059 was received, but MAY be able to satisfy the request in the future. 4060 Note that these errors MUST be used in answer messages whose 'E' bit 4061 is not set. 4063 DIAMETER_AUTHENTICATION_REJECTED 4001 4065 The authentication process for the user failed, most likely due to 4066 an invalid password used by the user. Further attempts MUST only 4067 be tried after prompting the user for a new password. 4069 DIAMETER_OUT_OF_SPACE 4002 4071 A Diameter node received the accounting request but was unable to 4072 commit it to stable storage due to a temporary lack of space. 4074 ELECTION_LOST 4003 4076 The peer has determined that it has lost the election process and 4077 has therefore disconnected the transport connection. 4079 7.1.5. Permanent Failures 4081 Errors that fall within the permanent failures category are used to 4082 inform the peer that the request failed, and should not be attempted 4083 again. Note that these errors SHOULD be used in answer messages 4084 whose 'E' bit is not set. In error conditions where it is not 4085 possible or efficient to compose application-specific answer grammar 4086 then answer messages with E-bit set and complying to the grammar 4087 described in 7.2 MAY also be used for permanent errors. 4089 To provide backward compatibility with existing implementations that 4090 follow [RFC3588], some of the error values that have previously been 4091 used in this category by [RFC3588] will not be re-used. Therefore 4092 the error values enumerated here maybe non-sequential. 4094 DIAMETER_AVP_UNSUPPORTED 5001 4096 The peer received a message that contained an AVP that is not 4097 recognized or supported and was marked with the Mandatory bit. A 4098 Diameter message with this error MUST contain one or more Failed- 4099 AVP AVP containing the AVPs that caused the failure. 4101 DIAMETER_UNKNOWN_SESSION_ID 5002 4103 The request contained an unknown Session-Id. 4105 DIAMETER_AUTHORIZATION_REJECTED 5003 4107 A request was received for which the user could not be authorized. 4108 This error could occur if the service requested is not permitted 4109 to the user. 4111 DIAMETER_INVALID_AVP_VALUE 5004 4113 The request contained an AVP with an invalid value in its data 4114 portion. A Diameter message indicating this error MUST include 4115 the offending AVPs within a Failed-AVP AVP. 4117 DIAMETER_MISSING_AVP 5005 4119 The request did not contain an AVP that is required by the Command 4120 Code definition. If this value is sent in the Result-Code AVP, a 4121 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP 4122 AVP MUST contain an example of the missing AVP complete with the 4123 Vendor-Id if applicable. The value field of the missing AVP 4124 should be of correct minimum length and contain zeroes. 4126 DIAMETER_RESOURCES_EXCEEDED 5006 4128 A request was received that cannot be authorized because the user 4129 has already expended allowed resources. An example of this error 4130 condition is a user that is restricted to one dial-up PPP port, 4131 attempts to establish a second PPP connection. 4133 DIAMETER_CONTRADICTING_AVPS 5007 4135 The Home Diameter server has detected AVPs in the request that 4136 contradicted each other, and is not willing to provide service to 4137 the user. The Failed-AVP AVPs MUST be present which contains the 4138 AVPs that contradicted each other. 4140 DIAMETER_AVP_NOT_ALLOWED 5008 4142 A message was received with an AVP that MUST NOT be present. The 4143 Failed-AVP AVP MUST be included and contain a copy of the 4144 offending AVP. 4146 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009 4148 A message was received that included an AVP that appeared more 4149 often than permitted in the message definition. The Failed-AVP 4150 AVP MUST be included and contain a copy of the first instance of 4151 the offending AVP that exceeded the maximum number of occurrences 4153 DIAMETER_NO_COMMON_APPLICATION 5010 4155 This error is returned by a Diameter node that receives a CER 4156 whereby no applications are common between the CER sending peer 4157 and the CER receiving peer. 4159 DIAMETER_UNSUPPORTED_VERSION 5011 4161 This error is returned when a request was received, whose version 4162 number is unsupported. 4164 DIAMETER_UNABLE_TO_COMPLY 5012 4166 This error is returned when a request is rejected for unspecified 4167 reasons. 4169 DIAMETER_INVALID_AVP_LENGTH 5014 4171 The request contained an AVP with an invalid length. A Diameter 4172 message indicating this error MUST include the offending AVPs 4173 within a Failed-AVP AVP. In cases where the erroneous avp length 4174 value exceeds the message length or is less than the minimum AVP 4175 header length, it is sufficient to include the offending AVP 4176 header and a zero filled payload of the minimum required length 4177 for the payloads data type. If the AVP is a grouped AVP, the 4178 grouped AVP header with an empty payload would be sufficient to 4179 indicate the offending AVP. In the case where the offending AVP 4180 header cannot be fully decoded when the AVP length is less than 4181 the minimum AVP header length, it is sufficient to include an 4182 offending AVP header that is formulated by padding the incomplete 4183 AVP header with zero up to the minimum AVP header length. 4185 DIAMETER_NO_COMMON_SECURITY 5017 4187 This error is returned when a CER message is received, and there 4188 are no common security mechanisms supported between the peers. A 4189 Capabilities-Exchange-Answer (CEA) MUST be returned with the 4190 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY. 4192 DIAMETER_UNKNOWN_PEER 5018 4194 A CER was received from an unknown peer. 4196 DIAMETER_COMMAND_UNSUPPORTED 5019 4198 This error code is used when a Diameter entity receives a message 4199 with a Command Code that it does not support. 4201 DIAMETER_INVALID_HDR_BITS 5020 4203 A request was received whose bits in the Diameter header were 4204 either set to an invalid combination, or to a value that is 4205 inconsistent with the command code's definition. 4207 DIAMETER_INVALID_AVP_BITS 5021 4209 A request was received that included an AVP whose flag bits are 4210 set to an unrecognized value, or that is inconsistent with the 4211 AVP's definition. 4213 7.2. Error Bit 4215 The 'E' (Error Bit) in the Diameter header is set when the request 4216 caused a protocol-related error (see Section 7.1.3). A message with 4217 the 'E' bit MUST NOT be sent as a response to an answer message. 4218 Note that a message with the 'E' bit set is still subjected to the 4219 processing rules defined in Section 6.2. When set, the answer 4220 message will not conform to the ABNF specification for the command, 4221 and will instead conform to the following ABNF: 4223 Message Format 4225 ::= < Diameter Header: code, ERR [PXY] > 4226 0*1< Session-Id > 4227 { Origin-Host } 4228 { Origin-Realm } 4229 { Result-Code } 4230 [ Origin-State-Id ] 4231 [ Error-Message ] 4232 [ Error-Reporting-Host ] 4233 [ Failed-AVP ] 4234 * [ Proxy-Info ] 4235 * [ AVP ] 4237 Note that the code used in the header is the same than the one found 4238 in the request message, but with the 'R' bit cleared and the 'E' bit 4239 set. The 'P' bit in the header is set to the same value as the one 4240 found in the request message. 4242 7.3. Error-Message AVP 4244 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY 4245 accompany a Result-Code AVP as a human readable error message. The 4246 Error-Message AVP is not intended to be useful in an environment 4247 where error messages are processed automatically. It SHOULD NOT be 4248 expected that the content of this AVP is parsed by network entities. 4250 7.4. Error-Reporting-Host AVP 4252 The Error-Reporting-Host AVP (AVP Code 294) is of type 4253 DiameterIdentity. This AVP contains the identity of the Diameter 4254 host that sent the Result-Code AVP to a value other than 2001 4255 (Success), only if the host setting the Result-Code is different from 4256 the one encoded in the Origin-Host AVP. This AVP is intended to be 4257 used for troubleshooting purposes, and MUST be set when the Result- 4258 Code AVP indicates a failure. 4260 7.5. Failed-AVP AVP 4262 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides 4263 debugging information in cases where a request is rejected or not 4264 fully processed due to erroneous information in a specific AVP. The 4265 value of the Result-Code AVP will provide information on the reason 4266 for the Failed-AVP AVP. A Diameter message SHOULD contain only one 4267 Failed-AVP that corresponds to the error indicated by the Result-Code 4268 AVP. For practical purposes, this Failed-AVP would typically refer 4269 to the first AVP processing error that a Diameter node encounters. 4271 The possible reasons for this AVP are the presence of an improperly 4272 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP 4273 value, the omission of a required AVP, the presence of an explicitly 4274 excluded AVP (see tables in Section 10), or the presence of two or 4275 more occurrences of an AVP which is restricted to 0, 1, or 0-1 4276 occurrences. 4278 A Diameter message SHOULD contain one Failed-AVP AVP, containing the 4279 entire AVP that could not be processed successfully. If the failure 4280 reason is omission of a required AVP, an AVP with the missing AVP 4281 code, the missing vendor id, and a zero filled payload of the minimum 4282 required length for the omitted AVP will be added. If the failure 4283 reason is an invalid AVP length where the reported length is less 4284 than the minimum AVP header length or greater than the reported 4285 message length, a copy of the offending AVP header and a zero filled 4286 payload of the minimum required length SHOULD be added. 4288 In the case where the offending AVP is embedded within a grouped AVP, 4289 the Failed-AVP MAY contain the grouped AVP which in turn contains the 4290 single offending AVP. The same method MAY be employed if the grouped 4291 AVP itself is embedded in yet another grouped AVP and so on. In this 4292 case, the Failed-AVP MAY contain the grouped AVP hierarchy up to the 4293 single offending AVP. This enables the recipient to detect the 4294 location of the offending AVP when embedded in a group. 4296 AVP Format 4298 ::= < AVP Header: 279 > 4299 1* {AVP} 4301 7.6. Experimental-Result AVP 4303 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and 4304 indicates whether a particular vendor-specific request was completed 4305 successfully or whether an error occurred. This AVP has the 4306 following structure: 4308 AVP Format 4310 Experimental-Result ::= < AVP Header: 297 > 4311 { Vendor-Id } 4312 { Experimental-Result-Code } 4314 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies 4315 the vendor responsible for the assignment of the result code which 4316 follows. All Diameter answer messages defined in vendor-specific 4317 applications MUST include either one Result-Code AVP or one 4318 Experimental-Result AVP. 4320 7.7. Experimental-Result-Code AVP 4322 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 4323 and contains a vendor-assigned value representing the result of 4324 processing the request. 4326 It is recommended that vendor-specific result codes follow the same 4327 conventions given for the Result-Code AVP regarding the different 4328 types of result codes and the handling of errors (for non 2xxx 4329 values). 4331 8. Diameter User Sessions 4333 In general, Diameter can provide two different types of services to 4334 applications. The first involves authentication and authorization, 4335 and can optionally make use of accounting. The second only makes use 4336 of accounting. 4338 When a service makes use of the authentication and/or authorization 4339 portion of an application, and a user requests access to the network, 4340 the Diameter client issues an auth request to its local server. The 4341 auth request is defined in a service-specific Diameter application 4342 (e.g., NASREQ). The request contains a Session-Id AVP, which is used 4343 in subsequent messages (e.g., subsequent authorization, accounting, 4344 etc) relating to the user's session. The Session-Id AVP is a means 4345 for the client and servers to correlate a Diameter message with a 4346 user session. 4348 When a Diameter server authorizes a user to use network resources for 4349 a finite amount of time, and it is willing to extend the 4350 authorization via a future request, it MUST add the Authorization- 4351 Lifetime AVP to the answer message. The Authorization-Lifetime AVP 4352 defines the maximum number of seconds a user MAY make use of the 4353 resources before another authorization request is expected by the 4354 server. The Auth-Grace-Period AVP contains the number of seconds 4355 following the expiration of the Authorization-Lifetime, after which 4356 the server will release all state information related to the user's 4357 session. Note that if payment for services is expected by the 4358 serving realm from the user's home realm, the Authorization-Lifetime 4359 AVP, combined with the Auth-Grace-Period AVP, implies the maximum 4360 length of the session the home realm is willing to be fiscally 4361 responsible for. Services provided past the expiration of the 4362 Authorization-Lifetime and Auth-Grace-Period AVPs are the 4363 responsibility of the access device. Of course, the actual cost of 4364 services rendered is clearly outside the scope of the protocol. 4366 An access device that does not expect to send a re-authorization or a 4367 session termination request to the server MAY include the Auth- 4368 Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint 4369 to the server. If the server accepts the hint, it agrees that since 4370 no session termination message will be received once service to the 4371 user is terminated, it cannot maintain state for the session. If the 4372 answer message from the server contains a different value in the 4373 Auth-Session-State AVP (or the default value if the AVP is absent), 4374 the access device MUST follow the server's directives. Note that the 4375 value NO_STATE_MAINTAINED MUST NOT be set in subsequent re- 4376 authorization requests and answers. 4378 The base protocol does not include any authorization request 4379 messages, since these are largely application-specific and are 4380 defined in a Diameter application document. However, the base 4381 protocol does define a set of messages that are used to terminate 4382 user sessions. These are used to allow servers that maintain state 4383 information to free resources. 4385 When a service only makes use of the Accounting portion of the 4386 Diameter protocol, even in combination with an application, the 4387 Session-Id is still used to identify user sessions. However, the 4388 session termination messages are not used, since a session is 4389 signaled as being terminated by issuing an accounting stop message. 4391 Diameter may also be used for services that cannot be easily 4392 categorized as authentication, authorization or accounting (e.g., 4393 certain 3GPP IMS interfaces). In such cases, the finite state 4394 machine defined in subsequent sections may not be applicable. 4395 Therefore, the applications itself MAY need to define its own finite 4396 state machine. However, such application-specific state machines 4397 SHOULD follow the general state machine framework outlined in this 4398 document such as the use of Session-Id AVPs and the use of STR/STA, 4399 ASR/ASA messages for stateful sessions. 4401 8.1. Authorization Session State Machine 4403 This section contains a set of finite state machines, representing 4404 the life cycle of Diameter sessions, and which MUST be observed by 4405 all Diameter implementations that make use of the authentication 4406 and/or authorization portion of a Diameter application. The term 4407 Service-Specific below refers to a message defined in a Diameter 4408 application (e.g., Mobile IPv4, NASREQ). 4410 There are four different authorization session state machines 4411 supported in the Diameter base protocol. The first two describe a 4412 session in which the server is maintaining session state, indicated 4413 by the value of the Auth-Session-State AVP (or its absence). One 4414 describes the session from a client perspective, the other from a 4415 server perspective. The second two state machines are used when the 4416 server does not maintain session state. Here again, one describes 4417 the session from a client perspective, the other from a server 4418 perspective. 4420 When a session is moved to the Idle state, any resources that were 4421 allocated for the particular session must be released. Any event not 4422 listed in the state machines MUST be considered as an error 4423 condition, and an answer, if applicable, MUST be returned to the 4424 originator of the message. 4426 In the case that an application does not support re-auth, the state 4427 transitions related to server-initiated re-auth when both client and 4428 server sessions maintains state (e.g., Send RAR, Pending, Receive 4429 RAA) MAY be ignored. 4431 In the state table, the event 'Failure to send X' means that the 4432 Diameter agent is unable to send command X to the desired 4433 destination. This could be due to the peer being down, or due to the 4434 peer sending back a transient failure or temporary protocol error 4435 notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the 4436 Result-Code AVP of the corresponding Answer command. The event 'X 4437 successfully sent' is the complement of 'Failure to send X'. 4439 The following state machine is observed by a client when state is 4440 maintained on the server: 4442 CLIENT, STATEFUL 4443 State Event Action New State 4444 ------------------------------------------------------------- 4445 Idle Client or Device Requests Send Pending 4446 access service 4447 specific 4448 auth req 4450 Idle ASR Received Send ASA Idle 4451 for unknown session with 4452 Result-Code 4453 = UNKNOWN_ 4454 SESSION_ID 4456 Idle RAR Received Send RAA Idle 4457 for unknown session with 4458 Result-Code 4459 = UNKNOWN_ 4460 SESSION_ID 4462 Pending Successful Service-specific Grant Open 4463 authorization answer Access 4464 received with default 4465 Auth-Session-State value 4467 Pending Successful Service-specific Sent STR Discon 4468 authorization answer received 4469 but service not provided 4471 Pending Error processing successful Sent STR Discon 4472 Service-specific authorization 4473 answer 4475 Pending Failed Service-specific Cleanup Idle 4476 authorization answer received 4478 Open User or client device Send Open 4479 requests access to service service 4480 specific 4481 auth req 4483 Open Successful Service-specific Provide Open 4484 authorization answer received Service 4486 Open Failed Service-specific Discon. Idle 4487 authorization answer user/device 4488 received. 4490 Open RAR received and client will Send RAA Open 4491 perform subsequent re-auth with 4492 Result-Code 4493 = SUCCESS 4495 Open RAR received and client will Send RAA Idle 4496 not perform subsequent with 4497 re-auth Result-Code 4498 != SUCCESS, 4499 Discon. 4500 user/device 4502 Open Session-Timeout Expires on Send STR Discon 4503 Access Device 4505 Open ASR Received, Send ASA Discon 4506 client will comply with with 4507 request to end the session Result-Code 4508 = SUCCESS, 4509 Send STR. 4511 Open ASR Received, Send ASA Open 4512 client will not comply with with 4513 request to end the session Result-Code 4514 != SUCCESS 4516 Open Authorization-Lifetime + Send STR Discon 4517 Auth-Grace-Period expires on 4518 access device 4520 Discon ASR Received Send ASA Discon 4522 Discon STA Received Discon. Idle 4523 user/device 4525 The following state machine is observed by a server when it is 4526 maintaining state for the session: 4528 SERVER, STATEFUL 4529 State Event Action New State 4530 ------------------------------------------------------------- 4531 Idle Service-specific authorization Send Open 4532 request received, and successful 4533 user is authorized serv. 4534 specific 4535 answer 4537 Idle Service-specific authorization Send Idle 4538 request received, and failed serv. 4539 user is not authorized specific 4540 answer 4542 Open Service-specific authorization Send Open 4543 request received, and user successful 4544 is authorized serv. specific 4545 answer 4547 Open Service-specific authorization Send Idle 4548 request received, and user failed serv. 4549 is not authorized specific 4550 answer, 4551 Cleanup 4553 Open Home server wants to confirm Send RAR Pending 4554 authentication and/or 4555 authorization of the user 4557 Pending Received RAA with a failed Cleanup Idle 4558 Result-Code 4560 Pending Received RAA with Result-Code Update Open 4561 = SUCCESS session 4563 Open Home server wants to Send ASR Discon 4564 terminate the service 4566 Open Authorization-Lifetime (and Cleanup Idle 4567 Auth-Grace-Period) expires 4568 on home server. 4570 Open Session-Timeout expires on Cleanup Idle 4571 home server 4573 Discon Failure to send ASR Wait, Discon 4574 resend ASR 4576 Discon ASR successfully sent and Cleanup Idle 4577 ASA Received with Result-Code 4579 Not ASA Received None No Change. 4580 Discon 4582 Any STR Received Send STA, Idle 4583 Cleanup. 4585 The following state machine is observed by a client when state is not 4586 maintained on the server: 4588 CLIENT, STATELESS 4589 State Event Action New State 4590 ------------------------------------------------------------- 4591 Idle Client or Device Requests Send Pending 4592 access service 4593 specific 4594 auth req 4596 Pending Successful Service-specific Grant Open 4597 authorization answer Access 4598 received with Auth-Session- 4599 State set to 4600 NO_STATE_MAINTAINED 4602 Pending Failed Service-specific Cleanup Idle 4603 authorization answer 4604 received 4606 Open Session-Timeout Expires on Discon. Idle 4607 Access Device user/device 4609 Open Service to user is terminated Discon. Idle 4610 user/device 4612 The following state machine is observed by a server when it is not 4613 maintaining state for the session: 4615 SERVER, STATELESS 4616 State Event Action New State 4617 ------------------------------------------------------------- 4618 Idle Service-specific authorization Send serv. Idle 4619 request received, and specific 4620 successfully processed answer 4622 8.2. Accounting Session State Machine 4624 The following state machines MUST be supported for applications that 4625 have an accounting portion or that require only accounting services. 4626 The first state machine is to be observed by clients. 4628 See Section 9.7 for Accounting Command Codes and Section 9.8 for 4629 Accounting AVPs. 4631 The server side in the accounting state machine depends in some cases 4632 on the particular application. The Diameter base protocol defines a 4633 default state machine that MUST be followed by all applications that 4634 have not specified other state machines. This is the second state 4635 machine in this section described below. 4637 The default server side state machine requires the reception of 4638 accounting records in any order and at any time, and does not place 4639 any standards requirement on the processing of these records. 4640 Implementations of Diameter may perform checking, ordering, 4641 correlation, fraud detection, and other tasks based on these records. 4642 AVPs may need to be inspected as a part of these tasks. The tasks 4643 can happen either immediately after record reception or in a post- 4644 processing phase. However, as these tasks are typically application 4645 or even policy dependent, they are not standardized by the Diameter 4646 specifications. Applications MAY define requirements on when to 4647 accept accounting records based on the used value of Accounting- 4648 Realtime-Required AVP, credit limits checks, and so on. 4650 However, the Diameter base protocol defines one optional server side 4651 state machine that MAY be followed by applications that require 4652 keeping track of the session state at the accounting server. Note 4653 that such tracking is incompatible with the ability to sustain long 4654 duration connectivity problems. Therefore, the use of this state 4655 machine is recommended only in applications where the value of the 4656 Accounting-Realtime-Required AVP is DELIVER_AND_GRANT, and hence 4657 accounting connectivity problems are required to cause the serviced 4658 user to be disconnected. Otherwise, records produced by the client 4659 may be lost by the server which no longer accepts them after the 4660 connectivity is re-established. This state machine is the third 4661 state machine in this section. The state machine is supervised by a 4662 supervision session timer Ts, which the value should be reasonably 4663 higher than the Acct_Interim_Interval value. Ts MAY be set to two 4664 times the value of the Acct_Interim_Interval so as to avoid the 4665 accounting session in the Diameter server to change to Idle state in 4666 case of short transient network failure. 4668 Any event not listed in the state machines MUST be considered as an 4669 error condition, and a corresponding answer, if applicable, MUST be 4670 returned to the originator of the message. 4672 In the state table, the event 'Failure to send' means that the 4673 Diameter client is unable to communicate with the desired 4674 destination. This could be due to the peer being down, or due to the 4675 peer sending back a transient failure or temporary protocol error 4676 notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or 4677 DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting 4678 Answer command. 4680 The event 'Failed answer' means that the Diameter client received a 4681 non-transient failure notification in the Accounting Answer command. 4683 Note that the action 'Disconnect user/dev' MUST have an effect also 4684 to the authorization session state table, e.g., cause the STR message 4685 to be sent, if the given application has both authentication/ 4686 authorization and accounting portions. 4688 The states PendingS, PendingI, PendingL, PendingE and PendingB stand 4689 for pending states to wait for an answer to an accounting request 4690 related to a Start, Interim, Stop, Event or buffered record, 4691 respectively. 4693 CLIENT, ACCOUNTING 4694 State Event Action New State 4695 ------------------------------------------------------------- 4696 Idle Client or device requests Send PendingS 4697 access accounting 4698 start req. 4700 Idle Client or device requests Send PendingE 4701 a one-time service accounting 4702 event req 4704 Idle Records in storage Send PendingB 4705 record 4707 PendingS Successful accounting Open 4708 start answer received 4710 PendingS Failure to send and buffer Store Open 4711 space available and realtime Start 4712 not equal to DELIVER_AND_GRANT Record 4714 PendingS Failure to send and no buffer Open 4715 space available and realtime 4716 equal to GRANT_AND_LOSE 4718 PendingS Failure to send and no buffer Disconnect Idle 4719 space available and realtime user/dev 4720 not equal to 4721 GRANT_AND_LOSE 4723 PendingS Failed accounting start answer Open 4724 received and realtime equal 4725 to GRANT_AND_LOSE 4727 PendingS Failed accounting start answer Disconnect Idle 4728 received and realtime not user/dev 4729 equal to GRANT_AND_LOSE 4731 PendingS User service terminated Store PendingS 4732 stop 4733 record 4735 Open Interim interval elapses Send PendingI 4736 accounting 4737 interim 4738 record 4739 Open User service terminated Send PendingL 4740 accounting 4741 stop req. 4743 PendingI Successful accounting interim Open 4744 answer received 4746 PendingI Failure to send and (buffer Store Open 4747 space available or old record interim 4748 can be overwritten) and record 4749 realtime not equal to 4750 DELIVER_AND_GRANT 4752 PendingI Failure to send and no buffer Open 4753 space available and realtime 4754 equal to GRANT_AND_LOSE 4756 PendingI Failure to send and no buffer Disconnect Idle 4757 space available and realtime user/dev 4758 not equal to GRANT_AND_LOSE 4760 PendingI Failed accounting interim Open 4761 answer received and realtime 4762 equal to GRANT_AND_LOSE 4764 PendingI Failed accounting interim Disconnect Idle 4765 answer received and realtime user/dev 4766 not equal to GRANT_AND_LOSE 4768 PendingI User service terminated Store PendingI 4769 stop 4770 record 4771 PendingE Successful accounting Idle 4772 event answer received 4774 PendingE Failure to send and buffer Store Idle 4775 space available event 4776 record 4778 PendingE Failure to send and no buffer Idle 4779 space available 4781 PendingE Failed accounting event answer Idle 4782 received 4784 PendingB Successful accounting answer Delete Idle 4785 received record 4787 PendingB Failure to send Idle 4789 PendingB Failed accounting answer Delete Idle 4790 received record 4792 PendingL Successful accounting Idle 4793 stop answer received 4795 PendingL Failure to send and buffer Store Idle 4796 space available stop 4797 record 4799 PendingL Failure to send and no buffer Idle 4800 space available 4802 PendingL Failed accounting stop answer Idle 4803 received 4804 SERVER, STATELESS ACCOUNTING 4805 State Event Action New State 4806 ------------------------------------------------------------- 4808 Idle Accounting start request Send Idle 4809 received, and successfully accounting 4810 processed. start 4811 answer 4813 Idle Accounting event request Send Idle 4814 received, and successfully accounting 4815 processed. event 4816 answer 4818 Idle Interim record received, Send Idle 4819 and successfully processed. accounting 4820 interim 4821 answer 4823 Idle Accounting stop request Send Idle 4824 received, and successfully accounting 4825 processed stop answer 4827 Idle Accounting request received, Send Idle 4828 no space left to store accounting 4829 records answer, 4830 Result-Code 4831 = OUT_OF_ 4832 SPACE 4834 SERVER, STATEFUL ACCOUNTING 4835 State Event Action New State 4836 ------------------------------------------------------------- 4838 Idle Accounting start request Send Open 4839 received, and successfully accounting 4840 processed. start 4841 answer, 4842 Start Ts 4844 Idle Accounting event request Send Idle 4845 received, and successfully accounting 4846 processed. event 4847 answer 4849 Idle Accounting request received, Send Idle 4850 no space left to store accounting 4851 records answer, 4852 Result-Code 4853 = OUT_OF_ 4854 SPACE 4856 Open Interim record received, Send Open 4857 and successfully processed. accounting 4858 interim 4859 answer, 4860 Restart Ts 4862 Open Accounting stop request Send Idle 4863 received, and successfully accounting 4864 processed stop answer, 4865 Stop Ts 4867 Open Accounting request received, Send Idle 4868 no space left to store accounting 4869 records answer, 4870 Result-Code 4871 = OUT_OF_ 4872 SPACE, 4873 Stop Ts 4875 Open Session supervision timer Ts Stop Ts Idle 4876 expired 4878 8.3. Server-Initiated Re-Auth 4880 A Diameter server may initiate a re-authentication and/or re- 4881 authorization service for a particular session by issuing a Re-Auth- 4882 Request (RAR). 4884 For example, for pre-paid services, the Diameter server that 4885 originally authorized a session may need some confirmation that the 4886 user is still using the services. 4888 An access device that receives a RAR message with Session-Id equal to 4889 a currently active session MUST initiate a re-auth towards the user, 4890 if the service supports this particular feature. Each Diameter 4891 application MUST state whether server-initiated re-auth is supported, 4892 since some applications do not allow access devices to prompt the 4893 user for re-auth. 4895 8.3.1. Re-Auth-Request 4897 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258 4898 and the message flags' 'R' bit set, may be sent by any server to the 4899 access device that is providing session service, to request that the 4900 user be re-authenticated and/or re-authorized. 4902 Message Format 4904 ::= < Diameter Header: 258, REQ, PXY > 4905 < Session-Id > 4906 { Origin-Host } 4907 { Origin-Realm } 4908 { Destination-Realm } 4909 { Destination-Host } 4910 { Auth-Application-Id } 4911 { Re-Auth-Request-Type } 4912 [ User-Name ] 4913 [ Origin-State-Id ] 4914 * [ Proxy-Info ] 4915 * [ Route-Record ] 4916 * [ AVP ] 4918 8.3.2. Re-Auth-Answer 4920 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258 4921 and the message flags' 'R' bit clear, is sent in response to the RAR. 4922 The Result-Code AVP MUST be present, and indicates the disposition of 4923 the request. 4925 A successful RAA message MUST be followed by an application-specific 4926 authentication and/or authorization message. 4928 Message Format 4930 ::= < Diameter Header: 258, PXY > 4931 < Session-Id > 4932 { Result-Code } 4933 { Origin-Host } 4934 { Origin-Realm } 4935 [ User-Name ] 4936 [ Origin-State-Id ] 4937 [ Error-Message ] 4938 [ Error-Reporting-Host ] 4939 [ Failed-AVP ] 4940 * [ Redirect-Host ] 4941 [ Redirect-Host-Usage ] 4942 [ Redirect-Max-Cache-Time ] 4943 * [ Proxy-Info ] 4944 * [ AVP ] 4946 8.4. Session Termination 4948 It is necessary for a Diameter server that authorized a session, for 4949 which it is maintaining state, to be notified when that session is no 4950 longer active, both for tracking purposes as well as to allow 4951 stateful agents to release any resources that they may have provided 4952 for the user's session. For sessions whose state is not being 4953 maintained, this section is not used. 4955 When a user session that required Diameter authorization terminates, 4956 the access device that provided the service MUST issue a Session- 4957 Termination-Request (STR) message to the Diameter server that 4958 authorized the service, to notify it that the session is no longer 4959 active. An STR MUST be issued when a user session terminates for any 4960 reason, including user logoff, expiration of Session-Timeout, 4961 administrative action, termination upon receipt of an Abort-Session- 4962 Request (see below), orderly shutdown of the access device, etc. 4964 The access device also MUST issue an STR for a session that was 4965 authorized but never actually started. This could occur, for 4966 example, due to a sudden resource shortage in the access device, or 4967 because the access device is unwilling to provide the type of service 4968 requested in the authorization, or because the access device does not 4969 support a mandatory AVP returned in the authorization, etc. 4971 It is also possible that a session that was authorized is never 4972 actually started due to action of a proxy. For example, a proxy may 4973 modify an authorization answer, converting the result from success to 4974 failure, prior to forwarding the message to the access device. If 4975 the answer did not contain an Auth-Session-State AVP with the value 4976 NO_STATE_MAINTAINED, a proxy that causes an authorized session not to 4977 be started MUST issue an STR to the Diameter server that authorized 4978 the session, since the access device has no way of knowing that the 4979 session had been authorized. 4981 A Diameter server that receives an STR message MUST clean up 4982 resources (e.g., session state) associated with the Session-Id 4983 specified in the STR, and return a Session-Termination-Answer. 4985 A Diameter server also MUST clean up resources when the Session- 4986 Timeout expires, or when the Authorization-Lifetime and the Auth- 4987 Grace-Period AVPs expires without receipt of a re-authorization 4988 request, regardless of whether an STR for that session is received. 4989 The access device is not expected to provide service beyond the 4990 expiration of these timers; thus, expiration of either of these 4991 timers implies that the access device may have unexpectedly shut 4992 down. 4994 8.4.1. Session-Termination-Request 4996 The Session-Termination-Request (STR), indicated by the Command-Code 4997 set to 275 and the Command Flags' 'R' bit set, is sent by a Diameter 4998 client or by a Diameter proxy to inform the Diameter Server that an 4999 authenticated and/or authorized session is being terminated. 5001 Message Format 5003 ::= < Diameter Header: 275, REQ, PXY > 5004 < Session-Id > 5005 { Origin-Host } 5006 { Origin-Realm } 5007 { Destination-Realm } 5008 { Auth-Application-Id } 5009 { Termination-Cause } 5010 [ User-Name ] 5011 [ Destination-Host ] 5012 * [ Class ] 5013 [ Origin-State-Id ] 5014 * [ Proxy-Info ] 5015 * [ Route-Record ] 5016 * [ AVP ] 5018 8.4.2. Session-Termination-Answer 5020 The Session-Termination-Answer (STA), indicated by the Command-Code 5021 set to 275 and the message flags' 'R' bit clear, is sent by the 5022 Diameter Server to acknowledge the notification that the session has 5023 been terminated. The Result-Code AVP MUST be present, and MAY 5024 contain an indication that an error occurred while servicing the STR. 5026 Upon sending or receipt of the STA, the Diameter Server MUST release 5027 all resources for the session indicated by the Session-Id AVP. Any 5028 intermediate server in the Proxy-Chain MAY also release any 5029 resources, if necessary. 5031 Message Format 5033 ::= < Diameter Header: 275, PXY > 5034 < Session-Id > 5035 { Result-Code } 5036 { Origin-Host } 5037 { Origin-Realm } 5038 [ User-Name ] 5039 * [ Class ] 5040 [ Error-Message ] 5041 [ Error-Reporting-Host ] 5042 [ Failed-AVP ] 5043 [ Origin-State-Id ] 5044 * [ Redirect-Host ] 5045 [ Redirect-Host-Usage ] 5046 [ Redirect-Max-Cache-Time ] 5047 * [ Proxy-Info ] 5048 * [ AVP ] 5050 8.5. Aborting a Session 5052 A Diameter server may request that the access device stop providing 5053 service for a particular session by issuing an Abort-Session-Request 5054 (ASR). 5056 For example, the Diameter server that originally authorized the 5057 session may be required to cause that session to be stopped for lack 5058 of credit or other reasons that were not anticipated when the session 5059 was first authorized. 5061 An access device that receives an ASR with Session-ID equal to a 5062 currently active session MAY stop the session. Whether the access 5063 device stops the session or not is implementation- and/or 5064 configuration-dependent. For example, an access device may honor 5065 ASRs from certain agents only. In any case, the access device MUST 5066 respond with an Abort-Session-Answer, including a Result-Code AVP to 5067 indicate what action it took. 5069 8.5.1. Abort-Session-Request 5071 The Abort-Session-Request (ASR), indicated by the Command-Code set to 5072 274 and the message flags' 'R' bit set, may be sent by any Diameter 5073 server or any Diameter proxy to the access device that is providing 5074 session service, to request that the session identified by the 5075 Session-Id be stopped. 5077 Message Format 5079 ::= < Diameter Header: 274, REQ, PXY > 5080 < Session-Id > 5081 { Origin-Host } 5082 { Origin-Realm } 5083 { Destination-Realm } 5084 { Destination-Host } 5085 { Auth-Application-Id } 5086 [ User-Name ] 5087 [ Origin-State-Id ] 5088 * [ Proxy-Info ] 5089 * [ Route-Record ] 5090 * [ AVP ] 5092 8.5.2. Abort-Session-Answer 5094 The Abort-Session-Answer (ASA), indicated by the Command-Code set to 5095 274 and the message flags' 'R' bit clear, is sent in response to the 5096 ASR. The Result-Code AVP MUST be present, and indicates the 5097 disposition of the request. 5099 If the session identified by Session-Id in the ASR was successfully 5100 terminated, Result-Code is set to DIAMETER_SUCCESS. If the session 5101 is not currently active, Result-Code is set to 5102 DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the 5103 session for any other reason, Result-Code is set to 5104 DIAMETER_UNABLE_TO_COMPLY. 5106 Message Format 5108 ::= < Diameter Header: 274, PXY > 5109 < Session-Id > 5110 { Result-Code } 5111 { Origin-Host } 5112 { Origin-Realm } 5113 [ User-Name ] 5114 [ Origin-State-Id ] 5115 [ Error-Message ] 5116 [ Error-Reporting-Host ] 5117 [ Failed-AVP ] 5118 * [ Redirect-Host ] 5119 [ Redirect-Host-Usage ] 5120 [ Redirect-Max-Cache-Time ] 5121 * [ Proxy-Info ] 5122 * [ AVP ] 5124 8.6. Inferring Session Termination from Origin-State-Id 5126 The Origin-State-Id is used to allow detection of terminated sessions 5127 for which no STR would have been issued, due to unanticipated 5128 shutdown of an access device. 5130 A Diameter client or access device increments the value of the 5131 Origin-State-Id every time it is started or powered-up. The new 5132 Origin-State-Id is then sent in the CER/CEA message immediately upon 5133 connection to the server. The Diameter server receiving the new 5134 Origin-State-Id can determine whether the sending Diameter client had 5135 abruptly shutdown by comparing the old value of the Origin-State-Id 5136 it has kept for that specific client is less than the new value and 5137 whether it has un-terminated sessions originating from that client. 5139 An access device can also include the Origin-State-Id in request 5140 messages other than CER if there are relays or proxies in between the 5141 access device and the server. In this case, however, the server 5142 cannot discover that the access device has been restarted unless and 5143 until it receives a new request from it. Therefore this mechanism is 5144 more opportunistic across proxies and relays. 5146 The Diameter server may assume that all sessions that were active 5147 prior to detection of a client restart have been terminated. The 5148 Diameter server MAY clean up all session state associated with such 5149 lost sessions, and MAY also issues STRs for all such lost sessions 5150 that were authorized on upstream servers, to allow session state to 5151 be cleaned up globally. 5153 8.7. Auth-Request-Type AVP 5155 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is 5156 included in application-specific auth requests to inform the peers 5157 whether a user is to be authenticated only, authorized only or both. 5158 Note any value other than both MAY cause RADIUS interoperability 5159 issues. The following values are defined: 5161 AUTHENTICATE_ONLY 1 5163 The request being sent is for authentication only, and MUST 5164 contain the relevant application specific authentication AVPs that 5165 are needed by the Diameter server to authenticate the user. 5167 AUTHORIZE_ONLY 2 5169 The request being sent is for authorization only, and MUST contain 5170 the application-specific authorization AVPs that are necessary to 5171 identify the service being requested/offered. 5173 AUTHORIZE_AUTHENTICATE 3 5175 The request contains a request for both authentication and 5176 authorization. The request MUST include both the relevant 5177 application-specific authentication information, and authorization 5178 information necessary to identify the service being requested/ 5179 offered. 5181 8.8. Session-Id AVP 5183 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used 5184 to identify a specific session (see Section 8). All messages 5185 pertaining to a specific session MUST include only one Session-Id AVP 5186 and the same value MUST be used throughout the life of a session. 5187 When present, the Session-Id SHOULD appear immediately following the 5188 Diameter Header (see Section 3). 5190 The Session-Id MUST be globally and eternally unique, as it is meant 5191 to uniquely identify a user session without reference to any other 5192 information, and may be needed to correlate historical authentication 5193 information with accounting information. The Session-Id includes a 5194 mandatory portion and an implementation-defined portion; a 5195 recommended format for the implementation-defined portion is outlined 5196 below. 5198 The Session-Id MUST begin with the sender's identity encoded in the 5199 DiameterIdentity type (see Section 4.4). The remainder of the 5200 Session-Id is delimited by a ";" character, and MAY be any sequence 5201 that the client can guarantee to be eternally unique; however, the 5202 following format is recommended, (square brackets [] indicate an 5203 optional element): 5205 ;;[;] 5207 and are decimal representations of the 5208 high and low 32 bits of a monotonically increasing 64-bit value. The 5209 64-bit value is rendered in two part to simplify formatting by 32-bit 5210 processors. At startup, the high 32 bits of the 64-bit value MAY be 5211 initialized to the time in NTP format [RFC4330], and the low 32 bits 5212 MAY be initialized to zero. This will for practical purposes 5213 eliminate the possibility of overlapping Session-Ids after a reboot, 5214 assuming the reboot process takes longer than a second. 5215 Alternatively, an implementation MAY keep track of the increasing 5216 value in non-volatile memory. 5218 is implementation specific but may include a modem's 5219 device Id, a layer 2 address, timestamp, etc. 5221 Example, in which there is no optional value: 5223 accesspoint7.example.com;1876543210;523 5225 Example, in which there is an optional value: 5227 accesspoint7.example.com;1876543210;523;mobile@200.1.1.88 5229 The Session-Id is created by the Diameter application initiating the 5230 session, which in most cases is done by the client. Note that a 5231 Session-Id MAY be used for both the authentication, authorization and 5232 accounting commands of a given application. 5234 8.9. Authorization-Lifetime AVP 5236 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 5237 and contains the maximum number of seconds of service to be provided 5238 to the user before the user is to be re-authenticated and/or re- 5239 authorized. Care should be taken when the Authorization- Lifetime 5240 value is determined, since a low, non-zero, value could create 5241 significant Diameter traffic, which could congest both the network 5242 and the agents. 5244 A value of zero (0) means that immediate re-auth is necessary by the 5245 access device. The absence of this AVP, or a value of all ones 5246 (meaning all bits in the 32 bit field are set to one) means no re- 5247 auth is expected. 5249 If both this AVP and the Session-Timeout AVP are present in a 5250 message, the value of the latter MUST NOT be smaller than the 5251 Authorization-Lifetime AVP. 5253 An Authorization-Lifetime AVP MAY be present in re-authorization 5254 messages, and contains the number of seconds the user is authorized 5255 to receive service from the time the re-auth answer message is 5256 received by the access device. 5258 This AVP MAY be provided by the client as a hint of the maximum 5259 lifetime that it is willing to accept. The server MUST return a 5260 value that is equal to, or smaller, than the one provided by the 5261 client. 5263 8.10. Auth-Grace-Period AVP 5265 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and 5266 contains the number of seconds the Diameter server will wait 5267 following the expiration of the Authorization-Lifetime AVP before 5268 cleaning up resources for the session. 5270 8.11. Auth-Session-State AVP 5272 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and 5273 specifies whether state is maintained for a particular session. The 5274 client MAY include this AVP in requests as a hint to the server, but 5275 the value in the server's answer message is binding. The following 5276 values are supported: 5278 STATE_MAINTAINED 0 5280 This value is used to specify that session state is being 5281 maintained, and the access device MUST issue a session termination 5282 message when service to the user is terminated. This is the 5283 default value. 5285 NO_STATE_MAINTAINED 1 5287 This value is used to specify that no session termination messages 5288 will be sent by the access device upon expiration of the 5289 Authorization-Lifetime. 5291 8.12. Re-Auth-Request-Type AVP 5293 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and 5294 is included in application-specific auth answers to inform the client 5295 of the action expected upon expiration of the Authorization-Lifetime. 5296 If the answer message contains an Authorization-Lifetime AVP with a 5297 positive value, the Re-Auth-Request-Type AVP MUST be present in an 5298 answer message. The following values are defined: 5300 AUTHORIZE_ONLY 0 5302 An authorization only re-auth is expected upon expiration of the 5303 Authorization-Lifetime. This is the default value if the AVP is 5304 not present in answer messages that include the Authorization- 5305 Lifetime. 5307 AUTHORIZE_AUTHENTICATE 1 5309 An authentication and authorization re-auth is expected upon 5310 expiration of the Authorization-Lifetime. 5312 8.13. Session-Timeout AVP 5314 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32 5315 and contains the maximum number of seconds of service to be provided 5316 to the user before termination of the session. When both the 5317 Session-Timeout and the Authorization-Lifetime AVPs are present in an 5318 answer message, the former MUST be equal to or greater than the value 5319 of the latter. 5321 A session that terminates on an access device due to the expiration 5322 of the Session-Timeout MUST cause an STR to be issued, unless both 5323 the access device and the home server had previously agreed that no 5324 session termination messages would be sent (see Section 8.11). 5326 A Session-Timeout AVP MAY be present in a re-authorization answer 5327 message, and contains the remaining number of seconds from the 5328 beginning of the re-auth. 5330 A value of zero, or the absence of this AVP, means that this session 5331 has an unlimited number of seconds before termination. 5333 This AVP MAY be provided by the client as a hint of the maximum 5334 timeout that it is willing to accept. However, the server MAY return 5335 a value that is equal to, or smaller, than the one provided by the 5336 client. 5338 8.14. User-Name AVP 5340 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which 5341 contains the User-Name, in a format consistent with the NAI 5342 specification [RFC4282]. 5344 8.15. Termination-Cause AVP 5346 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and 5347 is used to indicate the reason why a session was terminated on the 5348 access device. The following values are defined: 5350 DIAMETER_LOGOUT 1 5352 The user initiated a disconnect 5354 DIAMETER_SERVICE_NOT_PROVIDED 2 5356 This value is used when the user disconnected prior to the receipt 5357 of the authorization answer message. 5359 DIAMETER_BAD_ANSWER 3 5361 This value indicates that the authorization answer received by the 5362 access device was not processed successfully. 5364 DIAMETER_ADMINISTRATIVE 4 5366 The user was not granted access, or was disconnected, due to 5367 administrative reasons, such as the receipt of a Abort-Session- 5368 Request message. 5370 DIAMETER_LINK_BROKEN 5 5372 The communication to the user was abruptly disconnected. 5374 DIAMETER_AUTH_EXPIRED 6 5376 The user's access was terminated since its authorized session time 5377 has expired. 5379 DIAMETER_USER_MOVED 7 5381 The user is receiving services from another access device. 5383 DIAMETER_SESSION_TIMEOUT 8 5385 The user's session has timed out, and service has been terminated. 5387 8.16. Origin-State-Id AVP 5389 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a 5390 monotonically increasing value that is advanced whenever a Diameter 5391 entity restarts with loss of previous state, for example upon reboot. 5392 Origin-State-Id MAY be included in any Diameter message, including 5393 CER. 5395 A Diameter entity issuing this AVP MUST create a higher value for 5396 this AVP each time its state is reset. A Diameter entity MAY set 5397 Origin-State-Id to the time of startup, or it MAY use an incrementing 5398 counter retained in non-volatile memory across restarts. 5400 The Origin-State-Id, if present, MUST reflect the state of the entity 5401 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST 5402 either remove Origin-State-Id or modify it appropriately as well. 5403 Typically, Origin-State-Id is used by an access device that always 5404 starts up with no active sessions; that is, any session active prior 5405 to restart will have been lost. By including Origin-State-Id in a 5406 message, it allows other Diameter entities to infer that sessions 5407 associated with a lower Origin-State-Id are no longer active. If an 5408 access device does not intend for such inferences to be made, it MUST 5409 either not include Origin-State-Id in any message, or set its value 5410 to 0. 5412 8.17. Session-Binding AVP 5414 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY 5415 be present in application-specific authorization answer messages. If 5416 present, this AVP MAY inform the Diameter client that all future 5417 application-specific re-auth and Session-Termination-Request messages 5418 for this session MUST be sent to the same authorization server. 5420 This field is a bit mask, and the following bits have been defined: 5422 RE_AUTH 1 5424 When set, future re-auth messages for this session MUST NOT 5425 include the Destination-Host AVP. When cleared, the default 5426 value, the Destination-Host AVP MUST be present in all re-auth 5427 messages for this session. 5429 STR 2 5431 When set, the STR message for this session MUST NOT include the 5432 Destination-Host AVP. When cleared, the default value, the 5433 Destination-Host AVP MUST be present in the STR message for this 5434 session. 5436 ACCOUNTING 4 5438 When set, all accounting messages for this session MUST NOT 5439 include the Destination-Host AVP. When cleared, the default 5440 value, the Destination-Host AVP, if known, MUST be present in all 5441 accounting messages for this session. 5443 8.18. Session-Server-Failover AVP 5445 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated, 5446 and MAY be present in application-specific authorization answer 5447 messages that either do not include the Session-Binding AVP or 5448 include the Session-Binding AVP with any of the bits set to a zero 5449 value. If present, this AVP MAY inform the Diameter client that if a 5450 re-auth or STR message fails due to a delivery problem, the Diameter 5451 client SHOULD issue a subsequent message without the Destination-Host 5452 AVP. When absent, the default value is REFUSE_SERVICE. 5454 The following values are supported: 5456 REFUSE_SERVICE 0 5458 If either the re-auth or the STR message delivery fails, terminate 5459 service with the user, and do not attempt any subsequent attempts. 5461 TRY_AGAIN 1 5463 If either the re-auth or the STR message delivery fails, resend 5464 the failed message without the Destination-Host AVP present. 5466 ALLOW_SERVICE 2 5468 If re-auth message delivery fails, assume that re-authorization 5469 succeeded. If STR message delivery fails, terminate the session. 5471 TRY_AGAIN_ALLOW_SERVICE 3 5473 If either the re-auth or the STR message delivery fails, resend 5474 the failed message without the Destination-Host AVP present. If 5475 the second delivery fails for re-auth, assume re-authorization 5476 succeeded. If the second delivery fails for STR, terminate the 5477 session. 5479 8.19. Multi-Round-Time-Out AVP 5481 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32, 5482 and SHOULD be present in application-specific authorization answer 5483 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. 5484 This AVP contains the maximum number of seconds that the access 5485 device MUST provide the user in responding to an authentication 5486 request. 5488 8.20. Class AVP 5490 The Class AVP (AVP Code 25) is of type OctetString and is used by 5491 Diameter servers to return state information to the access device. 5492 When one or more Class AVPs are present in application-specific 5493 authorization answer messages, they MUST be present in subsequent re- 5494 authorization, session termination and accounting messages. Class 5495 AVPs found in a re-authorization answer message override the ones 5496 found in any previous authorization answer message. Diameter server 5497 implementations SHOULD NOT return Class AVPs that require more than 5498 4096 bytes of storage on the Diameter client. A Diameter client that 5499 receives Class AVPs whose size exceeds local available storage MUST 5500 terminate the session. 5502 8.21. Event-Timestamp AVP 5504 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be 5505 included in an Accounting-Request and Accounting-Answer messages to 5506 record the time that the reported event occurred, in seconds since 5507 January 1, 1900 00:00 UTC. 5509 9. Accounting 5511 This accounting protocol is based on a server directed model with 5512 capabilities for real-time delivery of accounting information. 5513 Several fault resilience methods [RFC2975] have been built in to the 5514 protocol in order minimize loss of accounting data in various fault 5515 situations and under different assumptions about the capabilities of 5516 the used devices. 5518 9.1. Server Directed Model 5520 The server directed model means that the device generating the 5521 accounting data gets information from either the authorization server 5522 (if contacted) or the accounting server regarding the way accounting 5523 data shall be forwarded. This information includes accounting record 5524 timeliness requirements. 5526 As discussed in [RFC2975], real-time transfer of accounting records 5527 is a requirement, such as the need to perform credit limit checks and 5528 fraud detection. Note that batch accounting is not a requirement, 5529 and is therefore not supported by Diameter. Should batched 5530 accounting be required in the future, a new Diameter application will 5531 need to be created, or it could be handled using another protocol. 5532 Note, however, that even if at the Diameter layer accounting requests 5533 are processed one by one, transport protocols used under Diameter 5534 typically batch several requests in the same packet under heavy 5535 traffic conditions. This may be sufficient for many applications. 5537 The authorization server (chain) directs the selection of proper 5538 transfer strategy, based on its knowledge of the user and 5539 relationships of roaming partnerships. The server (or agents) uses 5540 the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to 5541 control the operation of the Diameter peer operating as a client. 5542 The Acct-Interim-Interval AVP, when present, instructs the Diameter 5543 node acting as a client to produce accounting records continuously 5544 even during a session. Accounting-Realtime-Required AVP is used to 5545 control the behavior of the client when the transfer of accounting 5546 records from the Diameter client is delayed or unsuccessful. 5548 The Diameter accounting server MAY override the interim interval or 5549 the realtime requirements by including the Acct-Interim-Interval or 5550 Accounting-Realtime-Required AVP in the Accounting-Answer message. 5551 When one of these AVPs is present, the latest value received SHOULD 5552 be used in further accounting activities for the same session. 5554 9.2. Protocol Messages 5556 A Diameter node that receives a successful authentication and/or 5557 authorization messages from the Diameter server SHOULD collect 5558 accounting information for the session. The Accounting-Request 5559 message is used to transmit the accounting information to the 5560 Diameter server, which MUST reply with the Accounting-Answer message 5561 to confirm reception. The Accounting-Answer message includes the 5562 Result-Code AVP, which MAY indicate that an error was present in the 5563 accounting message. The value of the Accounting-Realtime-Required 5564 AVP received earlier for the session in question may indicate that 5565 the user's session has to be terminated when a rejected Accounting- 5566 Request message was received. 5568 9.3. Accounting Application Extension and Requirements 5570 Each Diameter application (e.g., NASREQ, MobileIP), SHOULD define 5571 their Service-Specific AVPs that MUST be present in the Accounting- 5572 Request message in a section entitled "Accounting AVPs". The 5573 application MUST assume that the AVPs described in this document will 5574 be present in all Accounting messages, so only their respective 5575 service-specific AVPs need to be defined in that section. 5577 Applications have the option of using one or both of the following 5578 accounting application extension models: 5580 Split Accounting Service 5582 The accounting message will carry the Application Id of the 5583 Diameter base accounting application (see Section 2.4). 5584 Accounting messages maybe routed to Diameter nodes other than the 5585 corresponding Diameter application. These nodes might be 5586 centralized accounting servers that provide accounting service for 5587 multiple different Diameter applications. These nodes MUST 5588 advertise the Diameter base accounting Application Id during 5589 capabilities exchange. 5591 Coupled Accounting Service 5593 The accounting messages will carry the Application Id of the 5594 application that is using it. The application itself will process 5595 the received accounting records or forward them to an accounting 5596 server. There is no accounting application advertisement required 5597 during capabilities exchange and the accounting messages will be 5598 routed the same as any of the other application messages. 5600 In cases where an application does not define its own accounting 5601 service, it is preferred that the split accounting model be used. 5603 9.4. Fault Resilience 5605 Diameter Base protocol mechanisms are used to overcome small message 5606 loss and network faults of temporary nature. 5608 Diameter peers acting as clients MUST implement the use of failover 5609 to guard against server failures and certain network failures. 5610 Diameter peers acting as agents or related off-line processing 5611 systems MUST detect duplicate accounting records caused by the 5612 sending of same record to several servers and duplication of messages 5613 in transit. This detection MUST be based on the inspection of the 5614 Session-Id and Accounting-Record-Number AVP pairs. Appendix C 5615 discusses duplicate detection needs and implementation issues. 5617 Diameter clients MAY have non-volatile memory for the safe storage of 5618 accounting records over reboots or extended network failures, network 5619 partitions, and server failures. If such memory is available, the 5620 client SHOULD store new accounting records there as soon as the 5621 records are created and until a positive acknowledgement of their 5622 reception from the Diameter Server has been received. Upon a reboot, 5623 the client MUST starting sending the records in the non-volatile 5624 memory to the accounting server with appropriate modifications in 5625 termination cause, session length, and other relevant information in 5626 the records. 5628 A further application of this protocol may include AVPs to control 5629 how many accounting records may at most be stored in the Diameter 5630 client without committing them to the non-volatile memory or 5631 transferring them to the Diameter server. 5633 The client SHOULD NOT remove the accounting data from any of its 5634 memory areas before the correct Accounting-Answer has been received. 5635 The client MAY remove oldest, undelivered or yet unacknowledged 5636 accounting data if it runs out of resources such as memory. It is an 5637 implementation dependent matter for the client to accept new sessions 5638 under this condition. 5640 9.5. Accounting Records 5642 In all accounting records, the Session-Id AVP MUST be present; the 5643 User-Name AVP MUST be present if it is available to the Diameter 5644 client. 5646 Different types of accounting records are sent depending on the 5647 actual type of accounted service and the authorization server's 5648 directions for interim accounting. If the accounted service is a 5649 one-time event, meaning that the start and stop of the event are 5650 simultaneous, then the Accounting-Record-Type AVP MUST be present and 5651 set to the value EVENT_RECORD. 5653 If the accounted service is of a measurable length, then the AVP MUST 5654 use the values START_RECORD, STOP_RECORD, and possibly, 5655 INTERIM_RECORD. If the authorization server has not directed interim 5656 accounting to be enabled for the session, two accounting records MUST 5657 be generated for each service of type session. When the initial 5658 Accounting-Request for a given session is sent, the Accounting- 5659 Record-Type AVP MUST be set to the value START_RECORD. When the last 5660 Accounting-Request is sent, the value MUST be STOP_RECORD. 5662 If the authorization server has directed interim accounting to be 5663 enabled, the Diameter client MUST produce additional records between 5664 the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The 5665 production of these records is directed by Acct-Interim-Interval as 5666 well as any re-authentication or re-authorization of the session. 5667 The Diameter client MUST overwrite any previous interim accounting 5668 records that are locally stored for delivery, if a new record is 5669 being generated for the same session. This ensures that only one 5670 pending interim record can exist on an access device for any given 5671 session. 5673 A particular value of Accounting-Sub-Session-Id MUST appear only in 5674 one sequence of accounting records from a DIAMETER client, except for 5675 the purposes of retransmission. The one sequence that is sent MUST 5676 be either one record with Accounting-Record-Type AVP set to the value 5677 EVENT_RECORD, or several records starting with one having the value 5678 START_RECORD, followed by zero or more INTERIM_RECORD and a single 5679 STOP_RECORD. A particular Diameter application specification MUST 5680 define the type of sequences that MUST be used. 5682 9.6. Correlation of Accounting Records 5684 If an application uses accounting messages, it can correlate 5685 accounting records with a specific application session by using the 5686 Session-Id of the particular application session in the accounting 5687 messages. Accounting messages MAY also use a different Session-Id 5688 from that of the application sessions in which case other session 5689 related information is needed to perform correlation. 5691 In cases where an application requires multiple accounting sub- 5692 session, an Accounting-Sub-Session-Id AVP is used to differentiate 5693 each sub-session. The Session-Id would remain constant for all sub- 5694 sessions and is be used to correlate all the sub-sessions to a 5695 particular application session. Note that receiving a STOP_RECORD 5696 with no Accounting-Sub-Session-Id AVP when sub-sessions were 5697 originally used in the START_RECORD messages implies that all sub- 5698 sessions are terminated. 5700 There are also cases where an application needs to correlate multiple 5701 application sessions into a single accounting record; the accounting 5702 record may span multiple different Diameter applications and sessions 5703 used by the same user at a given time. In such cases, the Acct- 5704 Multi-Session- Id AVP is used. The Acct-Multi-Session-Id AVP SHOULD 5705 be signaled by the server to the access device (typically during 5706 authorization) when it determines that a request belongs to an 5707 existing session. The access device MUST then include the Acct- 5708 Multi-Session-Id AVP in all subsequent accounting messages. 5710 The Acct-Multi-Session-Id AVP MAY include the value of the original 5711 Session-Id. It's contents are implementation specific, but MUST be 5712 globally unique across other Acct-Multi-Session-Id, and MUST NOT 5713 change during the life of a session. 5715 A Diameter application document MUST define the exact concept of a 5716 session that is being accounted, and MAY define the concept of a 5717 multi-session. For instance, the NASREQ DIAMETER application treats 5718 a single PPP connection to a Network Access Server as one session, 5719 and a set of Multilink PPP sessions as one multi-session. 5721 9.7. Accounting Command-Codes 5723 This section defines Command-Code values that MUST be supported by 5724 all Diameter implementations that provide Accounting services. 5726 9.7.1. Accounting-Request 5728 The Accounting-Request (ACR) command, indicated by the Command-Code 5729 field set to 271 and the Command Flags' 'R' bit set, is sent by a 5730 Diameter node, acting as a client, in order to exchange accounting 5731 information with a peer. 5733 The AVP listed below SHOULD include service-specific accounting AVPs, 5734 as described in Section 9.3. 5736 Message Format 5738 ::= < Diameter Header: 271, REQ, PXY > 5739 < Session-Id > 5740 { Origin-Host } 5741 { Origin-Realm } 5742 { Destination-Realm } 5743 { Accounting-Record-Type } 5744 { Accounting-Record-Number } 5745 [ Acct-Application-Id ] 5746 [ Vendor-Specific-Application-Id ] 5747 [ User-Name ] 5748 [ Destination-Host ] 5749 [ Accounting-Sub-Session-Id ] 5750 [ Acct-Session-Id ] 5751 [ Acct-Multi-Session-Id ] 5752 [ Acct-Interim-Interval ] 5753 [ Accounting-Realtime-Required ] 5754 [ Origin-State-Id ] 5755 [ Event-Timestamp ] 5756 * [ Proxy-Info ] 5757 * [ Route-Record ] 5758 * [ AVP ] 5760 9.7.2. Accounting-Answer 5762 The Accounting-Answer (ACA) command, indicated by the Command-Code 5763 field set to 271 and the Command Flags' 'R' bit cleared, is used to 5764 acknowledge an Accounting-Request command. The Accounting-Answer 5765 command contains the same Session-Id as the corresponding request. 5767 Only the target Diameter Server, known as the home Diameter Server, 5768 SHOULD respond with the Accounting-Answer command. 5770 The AVP listed below SHOULD include service-specific accounting AVPs, 5771 as described in Section 9.3. 5773 Message Format 5775 ::= < Diameter Header: 271, PXY > 5776 < Session-Id > 5777 { Result-Code } 5778 { Origin-Host } 5779 { Origin-Realm } 5780 { Accounting-Record-Type } 5781 { Accounting-Record-Number } 5782 [ Acct-Application-Id ] 5783 [ Vendor-Specific-Application-Id ] 5784 [ User-Name ] 5785 [ Accounting-Sub-Session-Id ] 5786 [ Acct-Session-Id ] 5787 [ Acct-Multi-Session-Id ] 5788 [ Error-Message ] 5789 [ Error-Reporting-Host ] 5790 [ Failed-AVP ] 5791 [ Acct-Interim-Interval ] 5792 [ Accounting-Realtime-Required ] 5793 [ Origin-State-Id ] 5794 [ Event-Timestamp ] 5795 * [ Proxy-Info ] 5796 * [ AVP ] 5798 9.8. Accounting AVPs 5800 This section contains AVPs that describe accounting usage information 5801 related to a specific session. 5803 9.8.1. Accounting-Record-Type AVP 5805 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated 5806 and contains the type of accounting record being sent. The following 5807 values are currently defined for the Accounting-Record-Type AVP: 5809 EVENT_RECORD 1 5811 An Accounting Event Record is used to indicate that a one-time 5812 event has occurred (meaning that the start and end of the event 5813 are simultaneous). This record contains all information relevant 5814 to the service, and is the only record of the service. 5816 START_RECORD 2 5818 An Accounting Start, Interim, and Stop Records are used to 5819 indicate that a service of a measurable length has been given. An 5820 Accounting Start Record is used to initiate an accounting session, 5821 and contains accounting information that is relevant to the 5822 initiation of the session. 5824 INTERIM_RECORD 3 5826 An Interim Accounting Record contains cumulative accounting 5827 information for an existing accounting session. Interim 5828 Accounting Records SHOULD be sent every time a re-authentication 5829 or re-authorization occurs. Further, additional interim record 5830 triggers MAY be defined by application-specific Diameter 5831 applications. The selection of whether to use INTERIM_RECORD 5832 records is done by the Acct-Interim-Interval AVP. 5834 STOP_RECORD 4 5836 An Accounting Stop Record is sent to terminate an accounting 5837 session and contains cumulative accounting information relevant to 5838 the existing session. 5840 9.8.2. Acct-Interim-Interval AVP 5842 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and 5843 is sent from the Diameter home authorization server to the Diameter 5844 client. The client uses information in this AVP to decide how and 5845 when to produce accounting records. With different values in this 5846 AVP, service sessions can result in one, two, or two+N accounting 5847 records, based on the needs of the home-organization. The following 5848 accounting record production behavior is directed by the inclusion of 5849 this AVP: 5851 1. The omission of the Acct-Interim-Interval AVP or its inclusion 5852 with Value field set to 0 means that EVENT_RECORD, START_RECORD, 5853 and STOP_RECORD are produced, as appropriate for the service. 5855 2. The inclusion of the AVP with Value field set to a non-zero value 5856 means that INTERIM_RECORD records MUST be produced between the 5857 START_RECORD and STOP_RECORD records. The Value field of this 5858 AVP is the nominal interval between these records in seconds. 5860 The Diameter node that originates the accounting information, 5861 known as the client, MUST produce the first INTERIM_RECORD record 5862 roughly at the time when this nominal interval has elapsed from 5863 the START_RECORD, the next one again as the interval has elapsed 5864 once more, and so on until the session ends and a STOP_RECORD 5865 record is produced. 5867 The client MUST ensure that the interim record production times 5868 are randomized so that large accounting message storms are not 5869 created either among records or around a common service start 5870 time. 5872 9.8.3. Accounting-Record-Number AVP 5874 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 5875 and identifies this record within one session. As Session-Id AVPs 5876 are globally unique, the combination of Session-Id and Accounting- 5877 Record-Number AVPs is also globally unique, and can be used in 5878 matching accounting records with confirmations. An easy way to 5879 produce unique numbers is to set the value to 0 for records of type 5880 EVENT_RECORD and START_RECORD, and set the value to 1 for the first 5881 INTERIM_RECORD, 2 for the second, and so on until the value for 5882 STOP_RECORD is one more than for the last INTERIM_RECORD. 5884 9.8.4. Acct-Session-Id AVP 5886 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only 5887 used when RADIUS/Diameter translation occurs. This AVP contains the 5888 contents of the RADIUS Acct-Session-Id attribute. 5890 9.8.5. Acct-Multi-Session-Id AVP 5892 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String, 5893 following the format specified in Section 8.8. The Acct-Multi- 5894 Session-Id AVP is used to link together multiple related accounting 5895 sessions, where each session would have a unique Session-Id, but the 5896 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the 5897 Diameter server in an authorization answer, and MUST be used in all 5898 accounting messages for the given session. 5900 9.8.6. Accounting-Sub-Session-Id AVP 5902 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type 5903 Unsigned64 and contains the accounting sub-session identifier. The 5904 combination of the Session-Id and this AVP MUST be unique per sub- 5905 session, and the value of this AVP MUST be monotonically increased by 5906 one for all new sub-sessions. The absence of this AVP implies no 5907 sub-sessions are in use, with the exception of an Accounting-Request 5908 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD 5909 message with no Accounting-Sub-Session-Id AVP present will signal the 5910 termination of all sub-sessions for a given Session-Id. 5912 9.8.7. Accounting-Realtime-Required AVP 5914 The Accounting-Realtime-Required AVP (AVP Code 483) is of type 5915 Enumerated and is sent from the Diameter home authorization server to 5916 the Diameter client or in the Accounting-Answer from the accounting 5917 server. The client uses information in this AVP to decide what to do 5918 if the sending of accounting records to the accounting server has 5919 been temporarily prevented due to, for instance, a network problem. 5921 DELIVER_AND_GRANT 1 5923 The AVP with Value field set to DELIVER_AND_GRANT means that the 5924 service MUST only be granted as long as there is a connection to 5925 an accounting server. Note that the set of alternative accounting 5926 servers are treated as one server in this sense. Having to move 5927 the accounting record stream to a backup server is not a reason to 5928 discontinue the service to the user. 5930 GRANT_AND_STORE 2 5932 The AVP with Value field set to GRANT_AND_STORE means that service 5933 SHOULD be granted if there is a connection, or as long as records 5934 can still be stored as described in Section 9.4. 5936 This is the default behavior if the AVP isn't included in the 5937 reply from the authorization server. 5939 GRANT_AND_LOSE 3 5941 The AVP with Value field set to GRANT_AND_LOSE means that service 5942 SHOULD be granted even if the records cannot be delivered or 5943 stored. 5945 10. AVP Occurrence Table 5947 The following tables presents the AVPs defined in this document, and 5948 specifies in which Diameter messages they MAY be present or not. 5949 AVPs that occur only inside a Grouped AVP are not shown in this 5950 table. 5952 The table uses the following symbols: 5954 0 The AVP MUST NOT be present in the message. 5956 0+ Zero or more instances of the AVP MAY be present in the 5957 message. 5959 0-1 Zero or one instance of the AVP MAY be present in the message. 5960 It is considered an error if there are more than one instance of 5961 the AVP. 5963 1 One instance of the AVP MUST be present in the message. 5965 1+ At least one instance of the AVP MUST be present in the 5966 message. 5968 10.1. Base Protocol Command AVP Table 5970 The table in this section is limited to the non-accounting Command 5971 Codes defined in this specification. 5973 +-----------------------------------------------+ 5974 | Command-Code | 5975 +---+---+---+---+---+---+---+---+---+---+---+---+ 5976 Attribute Name |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA| 5977 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 5978 Acct-Interim- |0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5979 Interval | | | | | | | | | | | | | 5980 Accounting-Realtime-|0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5981 Required | | | | | | | | | | | | | 5982 Acct-Application-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5983 Auth-Application-Id |0+ |0+ |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5984 Auth-Grace-Period |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5985 Auth-Request-Type |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5986 Auth-Session-State |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5987 Authorization- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5988 Lifetime | | | | | | | | | | | | | 5989 Class |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0+ |0+ | 5990 Destination-Host |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0-1|0 | 5991 Destination-Realm |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5992 Disconnect-Cause |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5993 Error-Message |0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1| 5994 Error-Reporting-Host|0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 5995 Failed-AVP |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ | 5996 Firmware-Revision |0-1|0-1|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5997 Host-IP-Address |1+ |1+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5998 Inband-Security-Id |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5999 Multi-Round-Time-Out|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6000 Origin-Host |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6001 Origin-Realm |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6002 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| 6003 Product-Name |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6004 Proxy-Info |0 |0 |0 |0 |0 |0 |0+ |0+ |0+ |0+ |0+ |0+ | 6005 Redirect-Host |0 |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ | 6006 Redirect-Host-Usage |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6007 Redirect-Max-Cache- |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6008 Time | | | | | | | | | | | | | 6009 Result-Code |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 | 6010 Re-Auth-Request-Type|0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 | 6011 Route-Record |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |0 | 6012 Session-Binding |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6013 Session-Id |0 |0 |0 |0 |0 |0 |1 |1 |1 |1 |1 |1 | 6014 Session-Server- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6015 Failover | | | | | | | | | | | | | 6016 Session-Timeout |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6017 Supported-Vendor-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6018 Termination-Cause |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |1 |0 | 6019 User-Name |0 |0 |0 |0 |0 |0 |0-1|0-1|0-1|0-1|0-1|0-1| 6020 Vendor-Id |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6021 Vendor-Specific- |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6022 Application-Id | | | | | | | | | | | | | 6023 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 6025 10.2. Accounting AVP Table 6027 The table in this section is used to represent which AVPs defined in 6028 this document are to be present in the Accounting messages. These 6029 AVP occurrence requirements are guidelines, which may be expanded, 6030 and/or overridden by application-specific requirements in the 6031 Diameter applications documents. 6033 +-----------+ 6034 | Command | 6035 | Code | 6036 +-----+-----+ 6037 Attribute Name | ACR | ACA | 6038 ------------------------------+-----+-----+ 6039 Acct-Interim-Interval | 0-1 | 0-1 | 6040 Acct-Multi-Session-Id | 0-1 | 0-1 | 6041 Accounting-Record-Number | 1 | 1 | 6042 Accounting-Record-Type | 1 | 1 | 6043 Acct-Session-Id | 0-1 | 0-1 | 6044 Accounting-Sub-Session-Id | 0-1 | 0-1 | 6045 Accounting-Realtime-Required | 0-1 | 0-1 | 6046 Acct-Application-Id | 0-1 | 0-1 | 6047 Auth-Application-Id | 0 | 0 | 6048 Class | 0+ | 0+ | 6049 Destination-Host | 0-1 | 0 | 6050 Destination-Realm | 1 | 0 | 6051 Error-Reporting-Host | 0 | 0+ | 6052 Event-Timestamp | 0-1 | 0-1 | 6053 Origin-Host | 1 | 1 | 6054 Origin-Realm | 1 | 1 | 6055 Proxy-Info | 0+ | 0+ | 6056 Route-Record | 0+ | 0 | 6057 Result-Code | 0 | 1 | 6058 Session-Id | 1 | 1 | 6059 Termination-Cause | 0 | 0 | 6060 User-Name | 0-1 | 0-1 | 6061 Vendor-Specific-Application-Id| 0-1 | 0-1 | 6062 ------------------------------+-----+-----+ 6064 11. IANA Considerations 6066 This section provides guidance to the Internet Assigned Numbers 6067 Authority (IANA) regarding registration of values related to the 6068 Diameter protocol, in accordance with BCP 26 [RFC5226]. The 6069 following policies are used here with the meanings defined in BCP 26: 6070 "Private Use", "First Come First Served", "Expert Review", 6071 "Specification Required", "IETF Review", "Standards Action". 6073 This section explains the criteria to be used by the IANA for 6074 assignment of numbers within namespaces defined within this document. 6076 For registration requests where a Designated Expert should be 6077 consulted, the responsible IESG area director should appoint the 6078 Designated Expert. For Designated Expert with Specification 6079 Required, the request is posted to the DIME WG mailing list (or, if 6080 it has been disbanded, a successor designated by the Area Director) 6081 for comment and review, and MUST include a pointer to a public 6082 specification. Before a period of 30 days has passed, the Designated 6083 Expert will either approve or deny the registration request and 6084 publish a notice of the decision to the DIME WG mailing list or its 6085 successor. A denial notice MUST be justified by an explanation and, 6086 in the cases where it is possible, concrete suggestions on how the 6087 request can be modified so as to become acceptable. 6089 11.1. AVP Header 6091 As defined in Section 4, the AVP header contains three fields that 6092 requires IANA namespace management; the AVP Code, Vendor-ID and Flags 6093 field. 6095 11.1.1. AVP Codes 6097 The AVP Code namespace is used to identify attributes. There are 6098 multiple namespaces. Vendors can have their own AVP Codes namespace 6099 which will be identified by their Vendor-ID (also known as 6100 Enterprise-Number) and they control the assignments of their vendor- 6101 specific AVP codes within their own namespace. The absence of a 6102 Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA 6103 controlled AVP Codes namespace. The AVP Codes and sometimes also 6104 possible values in an AVP are controlled and maintained by IANA. 6106 AVP Code 0 is not used. AVP Codes 1-255 are managed separately as 6107 RADIUS Attribute Types [RADTYPE]. This document defines the AVP 6108 Codes 257-274, 276-285, 287, 291-300, 480, 483 and 485-486. See 6109 Section 4.5 for the assignment of the namespace in this 6110 specification. 6112 AVPs may be allocated following Designated Expert with Specification 6113 Required [RFC5226]. Release of blocks of AVPs (more than 3 at a time 6114 for a given purpose) should require IETF Review. 6116 Note that Diameter defines a mechanism for Vendor-Specific AVPs, 6117 where the Vendor-Id field in the AVP header is set to a non-zero 6118 value. Vendor-Specific AVPs codes are for Private Use and should be 6119 encouraged instead of allocation of global attribute types, for 6120 functions specific only to one vendor's implementation of Diameter, 6121 where no interoperability is deemed useful. Where a Vendor-Specific 6122 AVP is implemented by more than one vendor, allocation of global AVPs 6123 should be encouraged instead. 6125 11.1.2. AVP Flags 6127 There are 8 bits in the AVP Flags field of the AVP header, defined in 6128 Section 4. This document assigns bit 0 ('V'endor Specific), bit 1 6129 ('M'andatory) and bit 2 ('P'rotected). The remaining bits should 6130 only be assigned via a Standards Action [RFC5226]. 6132 11.2. Diameter Header 6134 As defined in Section 3, the Diameter header contains two fields that 6135 require IANA namespace management; Command Code and Command Flags. 6137 11.2.1. Command Codes 6139 The Command Code namespace is used to identify Diameter commands. 6140 The values 0-255 (0x00-0xff) are reserved for RADIUS backward 6141 compatibility, and are defined as "RADIUS Packet Type Codes" in 6142 [RADTYPE]. Values 256 - 8,388,607 (0x100 to 0x7fffff) are for 6143 permanent, standard commands, allocated by IETF Review [RFC5226]. 6144 This document defines the Command Codes 257, 258, 271, 274-275, 280 6145 and 282. See Section 3.1 for the assignment of the namespace in this 6146 specification. 6148 The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved 6149 for vendor-specific command codes, to be allocated on a First Come, 6150 First Served basis by IANA [RFC5226]. The request to IANA for a 6151 Vendor-Specific Command Code SHOULD include a reference to a publicly 6152 available specification which documents the command in sufficient 6153 detail to aid in interoperability between independent 6154 implementations. If the specification cannot be made publicly 6155 available, the request for a vendor-specific command code MUST 6156 include the contact information of persons and/or entities 6157 responsible for authoring and maintaining the command. 6159 The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe - 6160 0xffffff) are reserved for experimental commands. As these codes are 6161 only for experimental and testing purposes, no guarantee is made for 6162 interoperability between Diameter peers using experimental commands, 6163 as outlined in [IANA-EXP]. 6165 11.2.2. Command Flags 6167 There are eight bits in the Command Flags field of the Diameter 6168 header. This document assigns bit 0 ('R'equest), bit 1 ('P'roxy), 6169 bit 2 ('E'rror) and bit 3 ('T'). Bits 4 through 7 MUST only be 6170 assigned via a Standards Action [RFC5226]. 6172 11.3. Application Identifiers 6174 As defined in Section 2.4, the Application Id is used to identify a 6175 specific Diameter Application. There are standards-track Application 6176 Ids and vendor specific Application Ids. 6178 IANA [RFC5226] has assigned the range 0x00000001 to 0x00ffffff for 6179 standards-track applications; and 0x01000000 - 0xfffffffe for vendor 6180 specific applications, on a first-come, first-served basis. The 6181 following values are allocated. 6183 Diameter Common Messages 0 6184 Diameter Base Accounting 3 6185 Relay 0xffffffff 6187 Assignment of standards-track Application Ids are by Designated 6188 Expert with Specification Required [RFC5226]. 6190 Both Auth-Application-Id and Acct-Application-Id AVPs use the same 6191 Application Id space. A Diameter node advertising itself as a relay 6192 agent MUST set either Application-Id or Acct-Application-Id to 6193 0xffffffff. 6195 Vendor-Specific Application Ids, are for Private Use. Vendor-Specific 6196 Application Ids are assigned on a First Come, First Served basis by 6197 IANA. 6199 11.4. AVP Values 6201 Certain AVPs in Diameter define a list of values with various 6202 meanings. This section lists such attributes in the Diameter base 6203 protocol and their IANA allocation rules. 6205 Allocation of Application Ids was discussed in Section 2.4. Other 6206 attributes in the base protocol do not take enumerated values or bit 6207 masks or employ existing name spaces such as SMI Network Management 6208 Private Enterprise Codes [RFC3232] or IP addresses. The allocation 6209 of new values for these existing name spaces is done in accordance 6210 with the rules already defined for them. 6212 11.4.1. Result-Code AVP Values 6214 As defined in Section 7.1, the Result-Code AVP (AVP Code 268) defines 6215 the values 1001, 2001-2002, 3001-3012, 4001-4003 and 5001-5021. 6217 All remaining values are available for assignment via IETF Review 6218 [RFC5226]. 6220 11.4.2. Experimental-Result-Code AVP 6222 Values for this AVP are purely local to the indicated vendor, and no 6223 IANA registry is maintained for them. 6225 11.4.3. Accounting-Record-Type AVP Values 6227 As defined in Section 9.8.1, the Accounting-Record-Type AVP (AVP Code 6228 480) defines the values 1-4. All remaining values are available for 6229 assignment via IETF Review [RFC5226]. 6231 11.4.4. Termination-Cause AVP Values 6233 As defined in Section 8.15, the Termination-Cause AVP (AVP Code 295) 6234 defines the values 1-8. All remaining values are available for 6235 assignment via IETF Review [RFC5226]. 6237 11.4.5. Redirect-Host-Usage AVP Values 6239 As defined in Section 6.13, the Redirect-Host-Usage AVP (AVP Code 6240 261) defines the values 0-5. All remaining values are available for 6241 assignment via IETF Review [RFC5226]. 6243 11.4.6. Session-Server-Failover AVP Values 6245 As defined in Section 8.18, the Session-Server-Failover AVP (AVP Code 6246 271) defines the values 0-3. All remaining values are available for 6247 assignment via IETF Review [RFC5226]. 6249 11.4.7. Session-Binding AVP Values 6251 As defined in Section 8.17, the Session-Binding AVP (AVP Code 270) 6252 defines the bits 1-4. All remaining bits are available for 6253 assignment via IETF Review [RFC5226]. 6255 11.4.8. Disconnect-Cause AVP Values 6257 As defined in Section 5.4.3, the Disconnect-Cause AVP (AVP Code 273) 6258 defines the values 0-2. All remaining values are available for 6259 assignment via IETF Review [RFC5226]. 6261 11.4.9. Auth-Request-Type AVP Values 6263 As defined in Section 8.7, the Auth-Request-Type AVP (AVP Code 274) 6264 defines the values 1-3. All remaining values are available for 6265 assignment via IETF Review [RFC5226]. 6267 11.4.10. Auth-Session-State AVP Values 6269 As defined in Section 8.11, the Auth-Session-State AVP (AVP Code 277) 6270 defines the values 0-1. All remaining values are available for 6271 assignment via IETF Review [RFC5226]. 6273 11.4.11. Re-Auth-Request-Type AVP Values 6275 As defined in Section 8.12, the Re-Auth-Request-Type AVP (AVP Code 6276 285) defines the values 0-1. All remaining values are available for 6277 assignment via IETF Review [RFC5226]. 6279 11.4.12. Accounting-Realtime-Required AVP Values 6281 As defined in Section 9.8.7, the Accounting-Realtime-Required AVP 6282 (AVP Code 483) defines the values 1-3. All remaining values are 6283 available for assignment via IETF Review [RFC5226]. 6285 11.4.13. Inband-Security-Id AVP (code 299) 6287 As defined in Section 6.10, the Inband-Security-Id AVP (AVP Code 299) 6288 defines the values 0-1. All remaining values are available for 6289 assignment via IETF Review. [RFC5226]. 6291 11.5. Diameter TCP, SCTP and TLS/TCP Port Numbers 6293 The IANA has assigned port number 3868 for TCP and SCTP. The IANA is 6294 requested to allocate a port number for TLS/TCP. 6296 11.6. S-NAPTR Parameters 6298 This document registers a S-NAPTR Application Service Tag value of 6299 "aaa". 6301 This document also registers the following S-NAPTR Application 6302 Protocol Tags: 6304 Tag | Protocol 6305 -------------------|--------- 6306 diameter.tcp | TCP 6307 diameter.sctp | SCTP 6308 diameter.tls.tcp | TLS/TCP 6310 12. Diameter protocol related configurable parameters 6312 This section contains the configurable parameters that are found 6313 throughout this document: 6315 Diameter Peer 6317 A Diameter entity MAY communicate with peers that are statically 6318 configured. A statically configured Diameter peer would require 6319 that either the IP address or the fully qualified domain name 6320 (FQDN) be supplied, which would then be used to resolve through 6321 DNS. 6323 Routing Table 6325 A Diameter proxy server routes messages based on the realm portion 6326 of a Network Access Identifier (NAI). The server MUST have a 6327 table of Realm Names, and the address of the peer to which the 6328 message must be forwarded to. The routing table MAY also include 6329 a "default route", which is typically used for all messages that 6330 cannot be locally processed. 6332 Tc timer 6334 The Tc timer controls the frequency that transport connection 6335 attempts are done to a peer with whom no active transport 6336 connection exists. The recommended value is 30 seconds. 6338 13. Security Considerations 6340 The Diameter base protocol messages SHOULD be secured by using TLS 6341 [RFC5246]. Additional security mechanisms such as IPsec [RFC4301] 6342 MAY also be deployed to secure connections between peers. However, 6343 all Diameter base protocol implementations MUST support the use of 6344 TLS and the Diameter protocol MUST NOT be used without any security 6345 mechanism. 6347 If a Diameter connection is to be protected via TLS or IPsec, then 6348 TLS or IPsec handshake SHOULD begin prior to any Diameter message 6349 exchange. All security parameters for TLS or IPsec are configured 6350 independent of the Diameter protocol. All Diameter message will be 6351 sent through the TLS or IPsec connection after a successful setup. 6353 For TLS connections to be established in the open state, the CER/CEA 6354 exchange MUST include an Inband-Security-ID AVP with a value of TLS. 6355 The TLS handshake will begin when both ends successfully reached the 6356 open state, after completion of the CER/CEA exchange. If the TLS 6357 handshake is successful, all further messages will be sent via TLS. 6358 If the handshake fails, both ends move to the closed state. See 6359 Sections 13.1 for more details. 6361 13.1. TLS Usage 6363 Diameter nodes using TLS for security MUST mutually authenticate as 6364 part of TLS session establishment. In order to ensure mutual 6365 authentication, the Diameter node acting as TLS server MUST request a 6366 certificate from the Diameter node acting as TLS client, and the 6367 Diameter node acting as TLS client MUST be prepared to supply a 6368 certificate on request. 6370 Diameter nodes MUST be able to negotiate the following TLS cipher 6371 suites: 6373 TLS_RSA_WITH_RC4_128_MD5 6374 TLS_RSA_WITH_RC4_128_SHA 6375 TLS_RSA_WITH_3DES_EDE_CBC_SHA 6377 Diameter nodes SHOULD be able to negotiate the following TLS cipher 6378 suite: 6380 TLS_RSA_WITH_AES_128_CBC_SHA 6382 Diameter nodes MAY negotiate other TLS cipher suites. 6384 13.2. Peer-to-Peer Considerations 6386 As with any peer-to-peer protocol, proper configuration of the trust 6387 model within a Diameter peer is essential to security. When 6388 certificates are used, it is necessary to configure the root 6389 certificate authorities trusted by the Diameter peer. These root CAs 6390 are likely to be unique to Diameter usage and distinct from the root 6391 CAs that might be trusted for other purposes such as Web browsing. 6392 In general, it is expected that those root CAs will be configured so 6393 as to reflect the business relationships between the organization 6394 hosting the Diameter peer and other organizations. As a result, a 6395 Diameter peer will typically not be configured to allow connectivity 6396 with any arbitrary peer. With certificate authentication, Diameter 6397 peers may not be known beforehand and therefore peer discovery may be 6398 required. 6400 14. References 6402 14.1. Normative References 6404 [FLOATPOINT] 6405 Institute of Electrical and Electronics Engineers, "IEEE 6406 Standard for Binary Floating-Point Arithmetic, ANSI/IEEE 6407 Standard 754-1985", August 1985. 6409 [IANAADFAM] 6410 IANA,, "Address Family Numbers", 6411 http://www.iana.org/assignments/address-family-numbers. 6413 [RADTYPE] IANA,, "RADIUS Types", 6414 http://www.iana.org/assignments/radius-types. 6416 [RFC791] Postel, J., "Internet Protocol", RFC 791, September 1981. 6418 [RFC793] Postel, J., "Transmission Control Protocol", RFC 793, 6419 January 1981. 6421 [RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and 6422 Accounting (AAA) Transport Profile", RFC 3539, June 2003. 6424 [RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and 6425 P. McCann, "Diameter Mobile IPv4 Application", RFC 4004, 6426 August 2005. 6428 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton, 6429 "Diameter Network Access Server Application", RFC 4005, 6430 August 2005. 6432 [RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J. 6433 Loughney, "Diameter Credit-Control Application", RFC 4006, 6434 August 2005. 6436 [RFC4072] Eronen, P., Hiller, T., and G. Zorn, "Diameter Extensible 6437 Authentication Protocol (EAP) Application", RFC 4072, 6438 August 2005. 6440 [RFC4740] Garcia-Martin, M., Belinchon, M., Pallares-Lopez, M., 6441 Canales-Valenzuela, C., and K. Tammi, "Diameter Session 6442 Initiation Protocol (SIP) Application", RFC 4740, 6443 November 2006. 6445 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 6446 Specifications: ABNF", STD 68, RFC 5234, January 2008. 6448 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J. 6449 Arkko, "Diameter Base Protocol", RFC 3588, September 2003. 6451 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 6452 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 6453 May 2008. 6455 [RFC4306] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol", 6456 RFC 4306, December 2005. 6458 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 6459 Architecture", RFC 4291, February 2006. 6461 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 6462 Requirement Levels", BCP 14, RFC 2119, March 1997. 6464 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The 6465 Network Access Identifier", RFC 4282, December 2005. 6467 [RFC3403] Mealling, M., "Dynamic Delegation Discovery System (DDDS) 6468 Part Three: The Domain Name System (DNS) Database", 6469 RFC 3403, October 2002. 6471 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 6472 Requirements for Security", BCP 106, RFC 4086, June 2005. 6474 [RFC4960] Stewart, R., "Stream Control Transmission Protocol", 6475 RFC 4960, September 2007. 6477 [RFC3958] Daigle, L. and A. Newton, "Domain-Based Application 6478 Service Location Using SRV RRs and the Dynamic Delegation 6479 Discovery Service (DDDS)", RFC 3958, January 2005. 6481 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 6482 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 6484 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 6485 Resource Identifier (URI): Generic Syntax", STD 66, 6486 RFC 3986, January 2005. 6488 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 6489 10646", STD 63, RFC 3629, November 2003. 6491 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 6492 Housley, R., and W. Polk, "Internet X.509 Public Key 6493 Infrastructure Certificate and Certificate Revocation List 6494 (CRL) Profile", RFC 5280, May 2008. 6496 [RFC3490] Faltstrom, P., Hoffman, P., and A. Costello, 6497 "Internationalizing Domain Names in Applications (IDNA)", 6498 RFC 3490, March 2003. 6500 [RFC3491] Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep 6501 Profile for Internationalized Domain Names (IDN)", 6502 RFC 3491, March 2003. 6504 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 6505 for Internationalized Domain Names in Applications 6506 (IDNA)", RFC 3492, March 2003. 6508 14.2. Informational References 6510 [RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P., 6511 Shiino, H., Zorn, G., Dommety, G., C.Perkins, B.Patil, 6512 D.Mitton, S.Manning, M.Beadles, P.Walsh, X.Chen, 6513 S.Sivalingham, A.Hameed, M.Munson, S.Jacobs, B.Lim, 6514 B.Hirschman, R.Hsu, Y.Xu, E.Campell, S.Baba, and E.Jaques, 6515 "Criteria for Evaluating AAA Protocols for Network 6516 Access", RFC 2989, November 2000. 6518 [RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to 6519 Accounting Management", RFC 2975, October 2000. 6521 [RFC3232] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by 6522 an On-line Database", RFC 3232, January 2002. 6524 [RFC5176] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B. 6525 Aboba, "Dynamic Authorization Extensions to Remote 6526 Authentication Dial In User Service (RADIUS)", RFC 5176, 6527 January 2008. 6529 [RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, 6530 RFC 1661, July 1994. 6532 [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000. 6534 [RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS 6535 Extensions", RFC 2869, June 2000. 6537 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, 6538 "Remote Authentication Dial In User Service (RADIUS)", 6539 RFC 2865, June 2000. 6541 [RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6", 6542 RFC 3162, August 2001. 6544 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 6545 Internet Protocol", RFC 4301, December 2005. 6547 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 6548 A., Peterson, J., Sparks, R., Handley, M., and E. 6549 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 6550 June 2002. 6552 [RFC4330] Mills, D., "Simple Network Time Protocol (SNTP) Version 4 6553 for IPv4, IPv6 and OSI", RFC 4330, January 2006. 6555 [RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called 6556 TACACS", RFC 1492, July 1993. 6558 [RFC4690] Klensin, J., Faltstrom, P., Karp, C., and IAB, "Review and 6559 Recommendations for Internationalized Domain Names 6560 (IDNs)", RFC 4690, September 2006. 6562 [RFC5461] Gont, F., "TCP's Reaction to Soft Errors", RFC 5461, 6563 February 2009. 6565 [I-D.ietf-tcpm-icmp-attacks] 6566 Gont, F., "ICMP attacks against TCP", 6567 draft-ietf-tcpm-icmp-attacks-04 (work in progress), 6568 October 2008. 6570 [IANA-EXP] 6571 Narten, T., "Assigning Experimental and Testing Numbers 6572 Considered Useful, Work in Progress.". 6574 Appendix A. Acknowledgements 6576 A.1. RFC3588bis 6578 The authors would like to thank the following people that have 6579 provided proposals and contributions to this document: 6581 To Vishnu Ram and Satendra Gera for their contributions on 6582 Capabilities Updates, Predictive Loop Avoidance as well as many other 6583 technical proposals. To Tolga Asveren for his insights and 6584 contributions on almost all of the proposed solutions incorporated 6585 into this document. To Timothy Smith for helping on the Capabilities 6586 Updates and other topics. To Tony Zhang for providing fixes to loop 6587 holes on composing Failed-AVPs as well as many other issues and 6588 topics. To Jan Nordqvist for clearly stating the usage of 6589 Application Ids. To Anders Kristensen for providing needed technical 6590 opinions. To David Frascone for providing invaluable review of the 6591 document. To Mark Jones for providing clarifying text on vendor 6592 command codes and other vendor specific indicators. 6594 Special thanks to the Diameter extensibility design team which helped 6595 resolve the tricky question of mandatory AVPs and ABNF semantics. 6596 The members of this team are as follows: 6598 Avi Lior, Jari Arkko, Glen Zorn, Lionel Morand, Mark Jones, Tolga 6599 Asveren Jouni Korhonen, Glenn McGregor. 6601 Special thanks also to people who have provided invaluable comments 6602 and inputs especially in resolving controversial issues: 6604 Glen Zorn, Yoshihiro Ohba, Marco Stura, and Pasi Eronen. 6606 Finally, we would like to thank the original authors of this 6607 document: 6609 Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman and Glen Zorn. 6611 Their invaluable knowledge and experience has given us a robust and 6612 flexible AAA protocol that many people have seen great value in 6613 adopting. We greatly appreciate their support and stewardship for 6614 the continued improvements of Diameter as a protocol. We would also 6615 like to extend our gratitude to folks aside from the authors who have 6616 assisted and contributed to the original version of this document. 6617 Their efforts significantly contributed to the success of Diameter. 6619 A.2. RFC3588 6621 The authors would like to thank Nenad Trifunovic, Tony Johansson and 6622 Pankaj Patel for their participation in the pre-IETF Document Reading 6623 Party. Allison Mankin, Jonathan Wood and Bernard Aboba provided 6624 invaluable assistance in working out transport issues, and similarly 6625 with Steven Bellovin in the security area. 6627 Paul Funk and David Mitton were instrumental in getting the Peer 6628 State Machine correct, and our deep thanks go to them for their time. 6630 Text in this document was also provided by Paul Funk, Mark Eklund, 6631 Mark Jones and Dave Spence. Jacques Caron provided many great 6632 comments as a result of a thorough review of the spec. 6634 The authors would also like to acknowledge the following people for 6635 their contribution in the development of the Diameter protocol: 6637 Allan C. Rubens, Haseeb Akhtar, William Bulley, Stephen Farrell, 6638 David Frascone, Daniel C. Fox, Lol Grant, Ignacio Goyret, Nancy 6639 Greene, Peter Heitman, Fredrik Johansson, Mark Jones, Martin Julien, 6640 Bob Kopacz, Paul Krumviede, Fergal Ladley, Ryan Moats, Victor Muslin, 6641 Kenneth Peirce, John Schnizlein, Sumit Vakil, John R. Vollbrecht and 6642 Jeff Weisberg. 6644 Finally, Pat Calhoun would like to thank Sun Microsystems since most 6645 of the effort put into this document was done while he was in their 6646 employ. 6648 Appendix B. S-NAPTR Example 6650 As an example, consider a client that wishes to resolve aaa: 6651 example1.com. The client performs a NAPTR query for that domain, and 6652 the following NAPTR records are returned: 6654 ;; order pref flags service regexp replacement 6655 IN NAPTR 50 50 "s" "aaa:diameter.tls.tcp" "" _diameter._tls.example1.com 6656 IN NAPTR 100 50 "s" "aaa:diameter.tcp" "" _aaa._tcp.example1.com 6657 IN NAPTR 150 50 "s" "aaa:diameter.sctp" "" _diameter._sctp.example1.com 6659 This indicates that the server supports TLS, TCP and SCTP in that 6660 order. If the client supports TLS, TLS will be used, targeted to a 6661 host determined by an SRV lookup of _diameter._tls.example1.com. 6662 That lookup would return: 6664 ;; Priority Weight Port Target 6665 IN SRV 0 1 5060 server1.example1.com 6666 IN SRV 0 2 5060 server2.example1.com 6668 As an alternative example, a client that wishes to resolve aaa: 6669 example2.com. The client performs a NAPTR query for that domain, and 6670 the following NAPTR records are returned: 6672 ;; order pref flags service regexp replacement 6673 IN NAPTR 150 50 "a" "aaa:diameter.tls.tcp" "" server1.example2.com 6674 IN NAPTR 150 50 "a" "aaa:diameter.tls.tcp" "" server2.example2.com 6676 This indicates that the server supports TCP available at the returned 6677 host names. 6679 Appendix C. Duplicate Detection 6681 As described in Section 9.4, accounting record duplicate detection is 6682 based on session identifiers. Duplicates can appear for various 6683 reasons: 6685 o Failover to an alternate server. Where close to real-time 6686 performance is required, failover thresholds need to be kept low 6687 and this may lead to an increased likelihood of duplicates. 6688 Failover can occur at the client or within Diameter agents. 6690 o Failure of a client or agent after sending of a record from non- 6691 volatile memory, but prior to receipt of an application layer ACK 6692 and deletion of the record. record to be sent. This will result 6693 in retransmission of the record soon after the client or agent has 6694 rebooted. 6696 o Duplicates received from RADIUS gateways. Since the 6697 retransmission behavior of RADIUS is not defined within [RFC2865], 6698 the likelihood of duplication will vary according to the 6699 implementation. 6701 o Implementation problems and misconfiguration. 6703 The T flag is used as an indication of an application layer 6704 retransmission event, e.g., due to failover to an alternate server. 6705 It is defined only for request messages sent by Diameter clients or 6706 agents. For instance, after a reboot, a client may not know whether 6707 it has already tried to send the accounting records in its non- 6708 volatile memory before the reboot occurred. Diameter servers MAY use 6709 the T flag as an aid when processing requests and detecting duplicate 6710 messages. However, servers that do this MUST ensure that duplicates 6711 are found even when the first transmitted request arrives at the 6712 server after the retransmitted request. It can be used only in cases 6713 where no answer has been received from the Server for a request and 6714 the request is sent again, (e.g., due to a failover to an alternate 6715 peer, due to a recovered primary peer or due to a client re-sending a 6716 stored record from non-volatile memory such as after reboot of a 6717 client or agent). 6719 In some cases the Diameter accounting server can delay the duplicate 6720 detection and accounting record processing until a post-processing 6721 phase takes place. At that time records are likely to be sorted 6722 according to the included User-Name and duplicate elimination is easy 6723 in this case. In other situations it may be necessary to perform 6724 real-time duplicate detection, such as when credit limits are imposed 6725 or real-time fraud detection is desired. 6727 In general, only generation of duplicates due to failover or re- 6728 sending of records in non-volatile storage can be reliably detected 6729 by Diameter clients or agents. In such cases the Diameter client or 6730 agents can mark the message as possible duplicate by setting the T 6731 flag. Since the Diameter server is responsible for duplicate 6732 detection, it can choose to make use of the T flag or not, in order 6733 to optimize duplicate detection. Since the T flag does not affect 6734 interoperability, and may not be needed by some servers, generation 6735 of the T flag is REQUIRED for Diameter clients and agents, but MAY be 6736 implemented by Diameter servers. 6738 As an example, it can be usually be assumed that duplicates appear 6739 within a time window of longest recorded network partition or device 6740 fault, perhaps a day. So only records within this time window need 6741 to be looked at in the backward direction. Secondly, hashing 6742 techniques or other schemes, such as the use of the T flag in the 6743 received messages, may be used to eliminate the need to do a full 6744 search even in this set except for rare cases. 6746 The following is an example of how the T flag may be used by the 6747 server to detect duplicate requests. 6749 A Diameter server MAY check the T flag of the received message to 6750 determine if the record is a possible duplicate. If the T flag is 6751 set in the request message, the server searches for a duplicate 6752 within a configurable duplication time window backward and 6753 forward. This limits database searching to those records where 6754 the T flag is set. In a well run network, network partitions and 6755 device faults will presumably be rare events, so this approach 6756 represents a substantial optimization of the duplicate detection 6757 process. During failover, it is possible for the original record 6758 to be received after the T flag marked record, due to differences 6759 in network delays experienced along the path by the original and 6760 duplicate transmissions. The likelihood of this occurring 6761 increases as the failover interval is decreased. In order to be 6762 able to detect out of order duplicates, the Diameter server should 6763 use backward and forward time windows when performing duplicate 6764 checking for the T flag marked request. For example, in order to 6765 allow time for the original record to exit the network and be 6766 recorded by the accounting server, the Diameter server can delay 6767 processing records with the T flag set until a time period 6768 TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing 6769 of the original transport connection. After this time period has 6770 expired, then it may check the T flag marked records against the 6771 database with relative assurance that the original records, if 6772 sent, have been received and recorded. 6774 Appendix D. Internationalized Domain Names 6776 To be compatible with the existing DNS infrastructure and simplify 6777 host and domain name comparison, Diameter identities (FQDNs) are 6778 represented in ASCII form. This allows the Diameter protocol to fall 6779 in-line with the DNS strategy of being transparent from the effects 6780 of Internationalized Domain Names (IDNs) by following the 6781 recommendations in [RFC4690] and [RFC3490]. Applications that 6782 provide support for IDNs outside of the Diameter protocol but 6783 interacting with it SHOULD use the representation and conversion 6784 framework described in [RFC3490], [RFC3491] and [RFC3492]. 6786 Authors' Addresses 6788 Victor Fajardo (editor) 6789 Telcordia Technologies 6790 One Telcordia Drive, 1S-222 6791 Piscataway, NJ 08854 6792 USA 6794 Phone: 1 908-421-1845 6795 Email: vf0213@gmail.com 6797 Jari Arkko 6798 Ericsson Research 6799 02420 Jorvas 6800 Finland 6802 Phone: +358 40 5079256 6803 Email: jari.arkko@ericsson.com 6805 John Loughney 6806 Nokia Research Center 6807 955 Page Mill Road 6808 Palo Alto, CA 94304 6809 US 6811 Phone: 1-650-283-8068 6812 Email: john.loughney@nokia.com 6814 Glenn Zorn 6815 Network Zen 6816 1310 East Thomas Street 6817 Seattle, WA 98102 6818 US 6820 Phone: 6821 Email: gwz@net-zen.net