idnits 2.17.1 draft-ietf-dime-rfc3588bis-22.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 4515 has weird spacing: '...ly with wit...' == Line 4722 has weird spacing: '...ealtime user...' == Line 4750 has weird spacing: '... record inter...' == Line 4760 has weird spacing: '...ealtime user...' == Line 4768 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 (August 4, 2010) is 5007 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 6297, but not defined == Missing Reference: 'PXY' is mentioned on line 4227, but not defined == Unused Reference: 'RFC4072' is defined on line 6439, but no explicit reference was found in the text == Unused Reference: 'RFC4740' is defined on line 6443, but no explicit reference was found in the text == Unused Reference: 'RFC4306' is defined on line 6458, but no explicit reference was found in the text == Unused Reference: 'RFC3403' is defined on line 6470, but no explicit reference was found in the text == Unused Reference: 'RFC5280' is defined on line 6494, but no explicit reference was found in the text == Unused Reference: 'RFC3261' is defined on line 6550, 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: February 5, 2011 J. Loughney 7 Nokia Research Center 8 G. Zorn 9 Network Zen 10 August 4, 2010 12 Diameter Base Protocol 13 draft-ietf-dime-rfc3588bis-22.txt 15 Abstract 17 The Diameter base protocol is intended to provide an Authentication, 18 Authorization and Accounting (AAA) framework for applications such as 19 network access or IP mobility in both local and roaming situations. 20 This document specifies the message format, transport, error 21 reporting, accounting and security services used by all Diameter 22 applications. The Diameter base protocol as defined in this document 23 must be supported by all Diameter implementations. 25 Status of this Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on February 5, 2011. 42 Copyright Notice 44 Copyright (c) 2010 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 60 1.1. Diameter Protocol . . . . . . . . . . . . . . . . . . . . 9 61 1.1.1. Description of the Document Set . . . . . . . . . . 10 62 1.1.2. Conventions Used in This Document . . . . . . . . . 11 63 1.1.3. Changes from RFC3588 . . . . . . . . . . . . . . . . 11 64 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 12 65 1.3. Approach to Extensibility . . . . . . . . . . . . . . . . 18 66 1.3.1. Defining New AVP Values . . . . . . . . . . . . . . 19 67 1.3.2. Creating New AVPs . . . . . . . . . . . . . . . . . 19 68 1.3.3. Creating New Commands . . . . . . . . . . . . . . . 19 69 1.3.4. Creating New Diameter Applications . . . . . . . . . 20 70 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 22 71 2.1. Transport . . . . . . . . . . . . . . . . . . . . . . . . 23 72 2.1.1. SCTP Guidelines . . . . . . . . . . . . . . . . . . 24 73 2.2. Securing Diameter Messages . . . . . . . . . . . . . . . 24 74 2.3. Diameter Application Compliance . . . . . . . . . . . . . 24 75 2.4. Application Identifiers . . . . . . . . . . . . . . . . . 25 76 2.5. Connections vs. Sessions . . . . . . . . . . . . . . . . 25 77 2.6. Peer Table . . . . . . . . . . . . . . . . . . . . . . . 26 78 2.7. Routing Table . . . . . . . . . . . . . . . . . . . . . . 27 79 2.8. Role of Diameter Agents . . . . . . . . . . . . . . . . . 29 80 2.8.1. Relay Agents . . . . . . . . . . . . . . . . . . . . 30 81 2.8.2. Proxy Agents . . . . . . . . . . . . . . . . . . . . 31 82 2.8.3. Redirect Agents . . . . . . . . . . . . . . . . . . 31 83 2.8.4. Translation Agents . . . . . . . . . . . . . . . . . 32 84 2.9. Diameter Path Authorization . . . . . . . . . . . . . . . 33 85 3. Diameter Header . . . . . . . . . . . . . . . . . . . . . . . 35 86 3.1. Command Codes . . . . . . . . . . . . . . . . . . . . . . 38 87 3.2. Command Code ABNF specification . . . . . . . . . . . . . 38 88 3.3. Diameter Command Naming Conventions . . . . . . . . . . . 41 89 4. Diameter AVPs . . . . . . . . . . . . . . . . . . . . . . . . 42 90 4.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 42 91 4.1.1. Optional Header Elements . . . . . . . . . . . . . . 43 92 4.2. Basic AVP Data Formats . . . . . . . . . . . . . . . . . 44 93 4.3. Derived AVP Data Formats . . . . . . . . . . . . . . . . 45 94 4.3.1. Common Derived AVPs . . . . . . . . . . . . . . . . 45 95 4.4. Grouped AVP Values . . . . . . . . . . . . . . . . . . . 52 96 4.4.1. Example AVP with a Grouped Data type . . . . . . . . 53 97 4.5. Diameter Base Protocol AVPs . . . . . . . . . . . . . . . 56 98 5. Diameter Peers . . . . . . . . . . . . . . . . . . . . . . . 59 99 5.1. Peer Connections . . . . . . . . . . . . . . . . . . . . 59 100 5.2. Diameter Peer Discovery . . . . . . . . . . . . . . . . . 60 101 5.3. Capabilities Exchange . . . . . . . . . . . . . . . . . . 61 102 5.3.1. Capabilities-Exchange-Request . . . . . . . . . . . 63 103 5.3.2. Capabilities-Exchange-Answer . . . . . . . . . . . . 63 104 5.3.3. Vendor-Id AVP . . . . . . . . . . . . . . . . . . . 64 105 5.3.4. Firmware-Revision AVP . . . . . . . . . . . . . . . 64 106 5.3.5. Host-IP-Address AVP . . . . . . . . . . . . . . . . 64 107 5.3.6. Supported-Vendor-Id AVP . . . . . . . . . . . . . . 65 108 5.3.7. Product-Name AVP . . . . . . . . . . . . . . . . . . 65 109 5.4. Disconnecting Peer connections . . . . . . . . . . . . . 65 110 5.4.1. Disconnect-Peer-Request . . . . . . . . . . . . . . 66 111 5.4.2. Disconnect-Peer-Answer . . . . . . . . . . . . . . . 66 112 5.4.3. Disconnect-Cause AVP . . . . . . . . . . . . . . . . 66 113 5.5. Transport Failure Detection . . . . . . . . . . . . . . . 67 114 5.5.1. Device-Watchdog-Request . . . . . . . . . . . . . . 67 115 5.5.2. Device-Watchdog-Answer . . . . . . . . . . . . . . . 67 116 5.5.3. Transport Failure Algorithm . . . . . . . . . . . . 68 117 5.5.4. Failover and Failback Procedures . . . . . . . . . . 68 118 5.6. Peer State Machine . . . . . . . . . . . . . . . . . . . 69 119 5.6.1. Incoming connections . . . . . . . . . . . . . . . . 71 120 5.6.2. Events . . . . . . . . . . . . . . . . . . . . . . . 72 121 5.6.3. Actions . . . . . . . . . . . . . . . . . . . . . . 73 122 5.6.4. The Election Process . . . . . . . . . . . . . . . . 75 123 6. Diameter message processing . . . . . . . . . . . . . . . . . 76 124 6.1. Diameter Request Routing Overview . . . . . . . . . . . . 76 125 6.1.1. Originating a Request . . . . . . . . . . . . . . . 77 126 6.1.2. Sending a Request . . . . . . . . . . . . . . . . . 77 127 6.1.3. Receiving Requests . . . . . . . . . . . . . . . . . 78 128 6.1.4. Processing Local Requests . . . . . . . . . . . . . 78 129 6.1.5. Request Forwarding . . . . . . . . . . . . . . . . . 78 130 6.1.6. Request Routing . . . . . . . . . . . . . . . . . . 78 131 6.1.7. Predictive Loop Avoidance . . . . . . . . . . . . . 79 132 6.1.8. Redirecting Requests . . . . . . . . . . . . . . . . 79 133 6.1.9. Relaying and Proxying Requests . . . . . . . . . . . 80 134 6.2. Diameter Answer Processing . . . . . . . . . . . . . . . 82 135 6.2.1. Processing received Answers . . . . . . . . . . . . 82 136 6.2.2. Relaying and Proxying Answers . . . . . . . . . . . 82 137 6.3. Origin-Host AVP . . . . . . . . . . . . . . . . . . . . . 83 138 6.4. Origin-Realm AVP . . . . . . . . . . . . . . . . . . . . 83 139 6.5. Destination-Host AVP . . . . . . . . . . . . . . . . . . 83 140 6.6. Destination-Realm AVP . . . . . . . . . . . . . . . . . . 84 141 6.7. Routing AVPs . . . . . . . . . . . . . . . . . . . . . . 84 142 6.7.1. Route-Record AVP . . . . . . . . . . . . . . . . . . 84 143 6.7.2. Proxy-Info AVP . . . . . . . . . . . . . . . . . . . 84 144 6.7.3. Proxy-Host AVP . . . . . . . . . . . . . . . . . . . 85 145 6.7.4. Proxy-State AVP . . . . . . . . . . . . . . . . . . 85 146 6.8. Auth-Application-Id AVP . . . . . . . . . . . . . . . . . 85 147 6.9. Acct-Application-Id AVP . . . . . . . . . . . . . . . . . 85 148 6.10. Inband-Security-Id AVP . . . . . . . . . . . . . . . . . 85 149 6.11. Vendor-Specific-Application-Id AVP . . . . . . . . . . . 86 150 6.12. Redirect-Host AVP . . . . . . . . . . . . . . . . . . . . 87 151 6.13. Redirect-Host-Usage AVP . . . . . . . . . . . . . . . . . 87 152 6.14. Redirect-Max-Cache-Time AVP . . . . . . . . . . . . . . . 88 153 7. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 90 154 7.1. Result-Code AVP . . . . . . . . . . . . . . . . . . . . . 92 155 7.1.1. Informational . . . . . . . . . . . . . . . . . . . 92 156 7.1.2. Success . . . . . . . . . . . . . . . . . . . . . . 93 157 7.1.3. Protocol Errors . . . . . . . . . . . . . . . . . . 93 158 7.1.4. Transient Failures . . . . . . . . . . . . . . . . . 94 159 7.1.5. Permanent Failures . . . . . . . . . . . . . . . . . 95 160 7.2. Error Bit . . . . . . . . . . . . . . . . . . . . . . . . 98 161 7.3. Error-Message AVP . . . . . . . . . . . . . . . . . . . . 99 162 7.4. Error-Reporting-Host AVP . . . . . . . . . . . . . . . . 99 163 7.5. Failed-AVP AVP . . . . . . . . . . . . . . . . . . . . . 99 164 7.6. Experimental-Result AVP . . . . . . . . . . . . . . . . . 100 165 7.7. Experimental-Result-Code AVP . . . . . . . . . . . . . . 100 166 8. Diameter User Sessions . . . . . . . . . . . . . . . . . . . 101 167 8.1. Authorization Session State Machine . . . . . . . . . . . 102 168 8.2. Accounting Session State Machine . . . . . . . . . . . . 107 169 8.3. Server-Initiated Re-Auth . . . . . . . . . . . . . . . . 112 170 8.3.1. Re-Auth-Request . . . . . . . . . . . . . . . . . . 112 171 8.3.2. Re-Auth-Answer . . . . . . . . . . . . . . . . . . . 113 172 8.4. Session Termination . . . . . . . . . . . . . . . . . . . 114 173 8.4.1. Session-Termination-Request . . . . . . . . . . . . 115 174 8.4.2. Session-Termination-Answer . . . . . . . . . . . . . 115 175 8.5. Aborting a Session . . . . . . . . . . . . . . . . . . . 116 176 8.5.1. Abort-Session-Request . . . . . . . . . . . . . . . 116 177 8.5.2. Abort-Session-Answer . . . . . . . . . . . . . . . . 117 178 8.6. Inferring Session Termination from Origin-State-Id . . . 118 179 8.7. Auth-Request-Type AVP . . . . . . . . . . . . . . . . . . 118 180 8.8. Session-Id AVP . . . . . . . . . . . . . . . . . . . . . 119 181 8.9. Authorization-Lifetime AVP . . . . . . . . . . . . . . . 120 182 8.10. Auth-Grace-Period AVP . . . . . . . . . . . . . . . . . . 121 183 8.11. Auth-Session-State AVP . . . . . . . . . . . . . . . . . 121 184 8.12. Re-Auth-Request-Type AVP . . . . . . . . . . . . . . . . 121 185 8.13. Session-Timeout AVP . . . . . . . . . . . . . . . . . . . 122 186 8.14. User-Name AVP . . . . . . . . . . . . . . . . . . . . . . 122 187 8.15. Termination-Cause AVP . . . . . . . . . . . . . . . . . . 122 188 8.16. Origin-State-Id AVP . . . . . . . . . . . . . . . . . . . 124 189 8.17. Session-Binding AVP . . . . . . . . . . . . . . . . . . . 124 190 8.18. Session-Server-Failover AVP . . . . . . . . . . . . . . . 125 191 8.19. Multi-Round-Time-Out AVP . . . . . . . . . . . . . . . . 126 192 8.20. Class AVP . . . . . . . . . . . . . . . . . . . . . . . . 126 193 8.21. Event-Timestamp AVP . . . . . . . . . . . . . . . . . . . 126 194 9. Accounting . . . . . . . . . . . . . . . . . . . . . . . . . 127 195 9.1. Server Directed Model . . . . . . . . . . . . . . . . . . 127 196 9.2. Protocol Messages . . . . . . . . . . . . . . . . . . . . 128 197 9.3. Accounting Application Extension and Requirements . . . . 128 198 9.4. Fault Resilience . . . . . . . . . . . . . . . . . . . . 129 199 9.5. Accounting Records . . . . . . . . . . . . . . . . . . . 129 200 9.6. Correlation of Accounting Records . . . . . . . . . . . . 130 201 9.7. Accounting Command-Codes . . . . . . . . . . . . . . . . 131 202 9.7.1. Accounting-Request . . . . . . . . . . . . . . . . . 131 203 9.7.2. Accounting-Answer . . . . . . . . . . . . . . . . . 132 204 9.8. Accounting AVPs . . . . . . . . . . . . . . . . . . . . . 133 205 9.8.1. Accounting-Record-Type AVP . . . . . . . . . . . . . 133 206 9.8.2. Acct-Interim-Interval AVP . . . . . . . . . . . . . 134 207 9.8.3. Accounting-Record-Number AVP . . . . . . . . . . . . 135 208 9.8.4. Acct-Session-Id AVP . . . . . . . . . . . . . . . . 135 209 9.8.5. Acct-Multi-Session-Id AVP . . . . . . . . . . . . . 135 210 9.8.6. Accounting-Sub-Session-Id AVP . . . . . . . . . . . 135 211 9.8.7. Accounting-Realtime-Required AVP . . . . . . . . . . 136 212 10. AVP Occurrence Table . . . . . . . . . . . . . . . . . . . . 137 213 10.1. Base Protocol Command AVP Table . . . . . . . . . . . . . 137 214 10.2. Accounting AVP Table . . . . . . . . . . . . . . . . . . 138 215 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 140 216 11.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 140 217 11.1.1. AVP Codes . . . . . . . . . . . . . . . . . . . . . 140 218 11.1.2. AVP Flags . . . . . . . . . . . . . . . . . . . . . 141 219 11.2. Diameter Header . . . . . . . . . . . . . . . . . . . . . 141 220 11.2.1. Command Codes . . . . . . . . . . . . . . . . . . . 141 221 11.2.2. Command Flags . . . . . . . . . . . . . . . . . . . 142 222 11.3. Application Identifiers . . . . . . . . . . . . . . . . . 142 223 11.4. AVP Values . . . . . . . . . . . . . . . . . . . . . . . 142 224 11.4.1. Result-Code AVP Values . . . . . . . . . . . . . . . 143 225 11.4.2. Experimental-Result-Code AVP . . . . . . . . . . . . 143 226 11.4.3. Accounting-Record-Type AVP Values . . . . . . . . . 143 227 11.4.4. Termination-Cause AVP Values . . . . . . . . . . . . 143 228 11.4.5. Redirect-Host-Usage AVP Values . . . . . . . . . . . 143 229 11.4.6. Session-Server-Failover AVP Values . . . . . . . . . 143 230 11.4.7. Session-Binding AVP Values . . . . . . . . . . . . . 143 231 11.4.8. Disconnect-Cause AVP Values . . . . . . . . . . . . 144 232 11.4.9. Auth-Request-Type AVP Values . . . . . . . . . . . . 144 233 11.4.10. Auth-Session-State AVP Values . . . . . . . . . . . 144 234 11.4.11. Re-Auth-Request-Type AVP Values . . . . . . . . . . 144 235 11.4.12. Accounting-Realtime-Required AVP Values . . . . . . 144 236 11.4.13. Inband-Security-Id AVP (code 299) . . . . . . . . . 144 237 11.5. Diameter TCP, SCTP and TLS/TCP Port Numbers . . . . . . . 144 238 11.6. S-NAPTR Parameters . . . . . . . . . . . . . . . . . . . 144 239 12. Diameter protocol related configurable parameters . . . . . . 146 240 13. Security Considerations . . . . . . . . . . . . . . . . . . . 147 241 13.1. TLS Usage . . . . . . . . . . . . . . . . . . . . . . . . 147 242 13.2. Peer-to-Peer Considerations . . . . . . . . . . . . . . . 148 243 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 149 244 14.1. Normative References . . . . . . . . . . . . . . . . . . 149 245 14.2. Informational References . . . . . . . . . . . . . . . . 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 and the padded 1500 AVPs. Thus the message length field is always a multiple of 4. 1502 Command Flags 1504 The Command Flags field is eight bits. The following bits are 1505 assigned: 1507 0 1 2 3 4 5 6 7 1508 +-+-+-+-+-+-+-+-+ 1509 |R P E T r r r r| 1510 +-+-+-+-+-+-+-+-+ 1512 R(equest) 1514 If set, the message is a request. If cleared, the message is 1515 an answer. 1517 P(roxiable) 1519 If set, the message MAY be proxied, relayed or redirected. If 1520 cleared, the message MUST be locally processed. 1522 E(rror) 1524 If set, the message contains a protocol error, and the message 1525 will not conform to the ABNF described for this command. 1526 Messages with the 'E' bit set are commonly referred to as error 1527 messages. This bit MUST NOT be set in request messages. See 1528 Section 7.2. 1530 T(Potentially re-transmitted message) 1532 This flag is set after a link failover procedure, to aid the 1533 removal of duplicate requests. It is set when resending 1534 requests not yet acknowledged, as an indication of a possible 1535 duplicate due to a link failure. This bit MUST be cleared when 1536 sending a request for the first time, otherwise the sender MUST 1537 set this flag. Diameter agents only need to be concerned about 1538 the number of requests they send based on a single received 1539 request; retransmissions by other entities need not be tracked. 1540 Diameter agents that receive a request with the T flag set, 1541 MUST keep the T flag set in the forwarded request. This flag 1542 MUST NOT be set if an error answer message (e.g., a protocol 1543 error) has been received for the earlier message. It can be 1544 set only in cases where no answer has been received from the 1545 server for a request and the request is sent again. This flag 1546 MUST NOT be set in answer messages. 1548 r(eserved) 1550 These flag bits are reserved for future use, and MUST be set to 1551 zero, and ignored by the receiver. 1553 Command-Code 1555 The Command-Code field is three octets, and is used in order to 1556 communicate the command associated with the message. The 24-bit 1557 address space is managed by IANA (see Section 11.2.1). 1559 Command-Code values 16,777,214 and 16,777,215 (hexadecimal values 1560 FFFFFE -FFFFFF) are reserved for experimental use (See Section 1561 11.3). 1563 Application-ID 1565 Application-ID is four octets and is used to identify to which 1566 application the message is applicable for. The application can be 1567 an authentication application, an accounting application or a 1568 vendor specific application. See Section 11.3 for the possible 1569 values that the application-id may use. 1571 The value of the application-id field in the header MUST be the 1572 same as any relevant application-id AVPs contained in the message. 1574 Hop-by-Hop Identifier 1576 The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in 1577 network byte order) and aids in matching requests and replies. 1578 The sender MUST ensure that the Hop-by-Hop identifier in a request 1579 is unique on a given connection at any given time, and MAY attempt 1580 to ensure that the number is unique across reboots. The sender of 1581 an Answer message MUST ensure that the Hop-by-Hop Identifier field 1582 contains the same value that was found in the corresponding 1583 request. The Hop-by-Hop identifier is normally a monotonically 1584 increasing number, whose start value was randomly generated. An 1585 answer message that is received with an unknown Hop-by-Hop 1586 Identifier MUST be discarded. 1588 End-to-End Identifier 1590 The End-to-End Identifier is an unsigned 32-bit integer field (in 1591 network byte order) and is used to detect duplicate messages. 1592 Upon reboot implementations MAY set the high order 12 bits to 1593 contain the low order 12 bits of current time, and the low order 1594 20 bits to a random value. Senders of request messages MUST 1595 insert a unique identifier on each message. The identifier MUST 1596 remain locally unique for a period of at least 4 minutes, even 1597 across reboots. The originator of an Answer message MUST ensure 1598 that the End-to-End Identifier field contains the same value that 1599 was found in the corresponding request. The End-to-End Identifier 1600 MUST NOT be modified by Diameter agents of any kind. The 1601 combination of the Origin-Host (see Section 6.3) and this field is 1602 used to detect duplicates. Duplicate requests SHOULD cause the 1603 same answer to be transmitted (modulo the hop-by-hop Identifier 1604 field and any routing AVPs that may be present), and MUST NOT 1605 affect any state that was set when the original request was 1606 processed. Duplicate answer messages that are to be locally 1607 consumed (see Section 6.2) SHOULD be silently discarded. 1609 AVPs 1611 AVPs are a method of encapsulating information relevant to the 1612 Diameter message. See Section 4 for more information on AVPs. 1614 3.1. Command Codes 1616 Each command Request/Answer pair is assigned a command code, and the 1617 sub-type (i.e., request or answer) is identified via the 'R' bit in 1618 the Command Flags field of the Diameter header. 1620 Every Diameter message MUST contain a command code in its header's 1621 Command-Code field, which is used to determine the action that is to 1622 be taken for a particular message. The following Command Codes are 1623 defined in the Diameter base protocol: 1625 Command-Name Abbrev. Code Reference 1626 -------------------------------------------------------- 1627 Abort-Session-Request ASR 274 8.5.1 1628 Abort-Session-Answer ASA 274 8.5.2 1629 Accounting-Request ACR 271 9.7.1 1630 Accounting-Answer ACA 271 9.7.2 1631 Capabilities-Exchange- CER 257 5.3.1 1632 Request 1633 Capabilities-Exchange- CEA 257 5.3.2 1634 Answer 1635 Device-Watchdog-Request DWR 280 5.5.1 1636 Device-Watchdog-Answer DWA 280 5.5.2 1637 Disconnect-Peer-Request DPR 282 5.4.1 1638 Disconnect-Peer-Answer DPA 282 5.4.2 1639 Re-Auth-Request RAR 258 8.3.1 1640 Re-Auth-Answer RAA 258 8.3.2 1641 Session-Termination- STR 275 8.4.1 1642 Request 1643 Session-Termination- STA 275 8.4.2 1644 Answer 1646 3.2. Command Code ABNF specification 1648 Every Command Code defined MUST include a corresponding ABNF 1649 specification, which is used to define the AVPs that MUST or MAY be 1650 present when sending the message. The following format is used in 1651 the definition: 1653 command-def = "::=" diameter-message 1655 command-name = diameter-name 1656 diameter-name = ALPHA *(ALPHA / DIGIT / "-") 1658 diameter-message = header [ *fixed] [ *required] [ *optional] 1660 header = "<" "Diameter Header:" command-id 1661 [r-bit] [p-bit] [e-bit] [application-id] ">" 1663 application-id = 1*DIGIT 1665 command-id = 1*DIGIT 1666 ; The Command Code assigned to the command 1668 r-bit = ", REQ" 1669 ; If present, the 'R' bit in the Command 1670 ; Flags is set, indicating that the message 1671 ; is a request, as opposed to an answer. 1673 p-bit = ", PXY" 1674 ; If present, the 'P' bit in the Command 1675 ; Flags is set, indicating that the message 1676 ; is proxiable. 1678 e-bit = ", ERR" 1679 ; If present, the 'E' bit in the Command 1680 ; Flags is set, indicating that the answer 1681 ; message contains a Result-Code AVP in 1682 ; the "protocol error" class. 1684 fixed = [qual] "<" avp-spec ">" 1685 ; Defines the fixed position of an AVP 1687 required = [qual] "{" avp-spec "}" 1688 ; The AVP MUST be present and can appear 1689 ; anywhere in the message. 1691 optional = [qual] "[" avp-name "]" 1692 ; The avp-name in the 'optional' rule cannot 1693 ; evaluate to any AVP Name which is included 1694 ; in a fixed or required rule. The AVP can 1695 ; appear anywhere in the message. 1696 ; 1697 ; NOTE: "[" and "]" have a slightly different 1698 ; meaning than in ABNF (RFC 5234]). These braces 1699 ; cannot be used to express optional fixed rules 1700 ; (such as an optional ICV at the end). To do this, 1701 ; the convention is '0*1fixed'. 1703 qual = [min] "*" [max] 1704 ; See ABNF conventions, RFC 5234 Section 4. 1705 ; The absence of any qualifiers depends on 1706 ; whether it precedes a fixed, required, or 1707 ; optional rule. If a fixed or required rule has 1708 ; no qualifier, then exactly one such AVP MUST 1709 ; be present. If an optional rule has no 1710 ; qualifier, then 0 or 1 such AVP may be 1711 ; present. If an optional rule has a qualifier, 1712 ; then the value of min MUST be 0 if present. 1714 min = 1*DIGIT 1715 ; The minimum number of times the element may 1716 ; be present. If absent, the default value is zero 1717 ; for fixed and optional rules and one for required 1718 ; rules. The value MUST be at least one for for 1719 ; required rules. 1721 max = 1*DIGIT 1722 ; The maximum number of times the element may 1723 ; be present. If absent, the default value is 1724 ; infinity. A value of zero implies the AVP MUST 1725 ; NOT be present. 1727 avp-spec = diameter-name 1728 ; The avp-spec has to be an AVP Name, defined 1729 ; in the base or extended Diameter 1730 ; specifications. 1732 avp-name = avp-spec / "AVP" 1733 ; The string "AVP" stands for *any* arbitrary AVP 1734 ; Name, not otherwise listed in that command code 1735 ; definition. Addition this AVP is recommended for 1736 ; all command ABNFs to allow for extensibility. 1738 The following is a definition of a fictitious command code: 1740 Example-Request ::= < Diameter Header: 9999999, REQ, PXY > 1741 { User-Name } 1742 * { Origin-Host } 1743 * [ AVP ] 1745 3.3. Diameter Command Naming Conventions 1747 Diameter command names typically includes one or more English words 1748 followed by the verb Request or Answer. Each English word is 1749 delimited by a hyphen. A three-letter acronym for both the request 1750 and answer is also normally provided. 1752 An example is a message set used to terminate a session. The command 1753 name is Session-Terminate-Request and Session-Terminate-Answer, while 1754 the acronyms are STR and STA, respectively. 1756 Both the request and the answer for a given command share the same 1757 command code. The request is identified by the R(equest) bit in the 1758 Diameter header set to one (1), to ask that a particular action be 1759 performed, such as authorizing a user or terminating a session. Once 1760 the receiver has completed the request it issues the corresponding 1761 answer, which includes a result code that communicates one of the 1762 following: 1764 o The request was successful 1766 o The request failed 1768 o An additional request has to be sent to provide information the 1769 peer requires prior to returning a successful or failed answer. 1771 o The receiver could not process the request, but provides 1772 information about a Diameter peer that is able to satisfy the 1773 request, known as redirect. 1775 Additional information, encoded within AVPs, may also be included in 1776 answer messages. 1778 4. Diameter AVPs 1780 Diameter AVPs carry specific authentication, accounting, 1781 authorization and routing information as well as configuration 1782 details for the request and reply. 1784 Each AVP of type OctetString MUST be padded to align on a 32-bit 1785 boundary, while other AVP types align naturally. A number of zero- 1786 valued bytes are added to the end of the AVP Data field till a word 1787 boundary is reached. The length of the padding is not reflected in 1788 the AVP Length field. 1790 4.1. AVP Header 1792 The fields in the AVP header MUST be sent in network byte order. The 1793 format of the header is: 1795 0 1 2 3 1796 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 1797 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1798 | AVP Code | 1799 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1800 |V M P r r r r r| AVP Length | 1801 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1802 | Vendor-ID (opt) | 1803 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1804 | Data ... 1805 +-+-+-+-+-+-+-+-+ 1807 AVP Code 1809 The AVP Code, combined with the Vendor-Id field, identifies the 1810 attribute uniquely. AVP numbers 1 through 255 are reserved for 1811 backward compatibility with RADIUS, without setting the Vendor-Id 1812 field. AVP numbers 256 and above are used for Diameter, which are 1813 allocated by IANA (see Section 11.1). 1815 AVP Flags 1817 The AVP Flags field informs the receiver how each attribute must 1818 be handled. The 'r' (reserved) bits are unused and SHOULD be set 1819 to 0. Note that subsequent Diameter applications MAY define 1820 additional bits within the AVP Header, and an unrecognized bit 1821 SHOULD be considered an error. The 'P' bit has been reserved for 1822 future usage of end-to-end security. At the time of writing there 1823 are no end-to-end security mechanisms specified therefore the 'P' 1824 bit SHOULD be set to 0. 1826 The 'M' Bit, known as the Mandatory bit, indicates whether the 1827 receiver of the AVP MUST parse and understand the semantic of the 1828 AVP including its content. The receiving entity MUST return an 1829 appropriate error message if it receives an AVP that has the M-bit 1830 set but does not understand it. An exception applies when the AVP 1831 is embedded within a Grouped AVP. See Section 4.4 for details. 1832 Diameter Relay and redirect agents MUST NOT reject messages with 1833 unrecognized AVPs. 1835 The 'M' bit MUST be set according to the rules defined in the 1836 application specification which introduces or re-uses this AVP. 1837 Within a given application, the M-bit setting for an AVP is either 1838 defined for all command types or for each command type. 1840 AVPs with the 'M' bit cleared are informational only and a 1841 receiver that receives a message with such an AVP that is not 1842 supported, or whose value is not supported, MAY simply ignore the 1843 AVP. 1845 The 'V' bit, known as the Vendor-Specific bit, indicates whether 1846 the optional Vendor-ID field is present in the AVP header. When 1847 set the AVP Code belongs to the specific vendor code address 1848 space. 1850 AVP Length 1852 The AVP Length field is three octets, and indicates the number of 1853 octets in this AVP including the AVP Code, AVP Length, AVP Flags, 1854 Vendor-ID field (if present) and the AVP data. If a message is 1855 received with an invalid attribute length, the message MUST be 1856 rejected. 1858 4.1.1. Optional Header Elements 1860 The AVP Header contains one optional field. This field is only 1861 present if the respective bit-flag is enabled. 1863 Vendor-ID 1865 The Vendor-ID field is present if the 'V' bit is set in the AVP 1866 Flags field. The optional four-octet Vendor-ID field contains the 1867 IANA assigned "SMI Network Management Private Enterprise Codes" 1868 [RFC3232] value, encoded in network byte order. Any vendor or 1869 standardization organization that are also treated like vendors in 1870 the IANA managed "SMI Network Management Private Enterprise Codes" 1871 space wishing to implement a vendor-specific Diameter AVP MUST use 1872 their own Vendor-ID along with their privately managed AVP address 1873 space, guaranteeing that they will not collide with any other 1874 vendor's vendor-specific AVP(s), nor with future IETF AVPs. 1876 A vendor ID value of zero (0) corresponds to the IETF adopted AVP 1877 values, as managed by the IANA. Since the absence of the vendor 1878 ID field implies that the AVP in question is not vendor specific, 1879 implementations MUST NOT use the zero (0) vendor ID. 1881 4.2. Basic AVP Data Formats 1883 The Data field is zero or more octets and contains information 1884 specific to the Attribute. The format and length of the Data field 1885 is determined by the AVP Code and AVP Length fields. The format of 1886 the Data field MUST be one of the following base data types or a data 1887 type derived from the base data types. In the event that a new Basic 1888 AVP Data Format is needed, a new version of this RFC MUST be created. 1890 OctetString 1892 The data contains arbitrary data of variable length. Unless 1893 otherwise noted, the AVP Length field MUST be set to at least 8 1894 (12 if the 'V' bit is enabled). AVP Values of this type that are 1895 not a multiple of four-octets in length is followed by the 1896 necessary padding so that the next AVP (if any) will start on a 1897 32-bit boundary. 1899 Integer32 1901 32 bit signed value, in network byte order. The AVP Length field 1902 MUST be set to 12 (16 if the 'V' bit is enabled). 1904 Integer64 1906 64 bit signed value, in network byte order. The AVP Length field 1907 MUST be set to 16 (20 if the 'V' bit is enabled). 1909 Unsigned32 1911 32 bit unsigned value, in network byte order. The AVP Length 1912 field MUST be set to 12 (16 if the 'V' bit is enabled). 1914 Unsigned64 1916 64 bit unsigned value, in network byte order. The AVP Length 1917 field MUST be set to 16 (20 if the 'V' bit is enabled). 1919 Float32 1921 This represents floating point values of single precision as 1922 described by [FLOATPOINT]. The 32-bit value is transmitted in 1923 network byte order. The AVP Length field MUST be set to 12 (16 if 1924 the 'V' bit is enabled). 1926 Float64 1928 This represents floating point values of double precision as 1929 described by [FLOATPOINT]. The 64-bit value is transmitted in 1930 network byte order. The AVP Length field MUST be set to 16 (20 if 1931 the 'V' bit is enabled). 1933 Grouped 1935 The Data field is specified as a sequence of AVPs. Each of these 1936 AVPs follows - in the order in which they are specified - 1937 including their headers and padding. The AVP Length field is set 1938 to 8 (12 if the 'V' bit is enabled) plus the total length of all 1939 included AVPs, including their headers and padding. Thus the AVP 1940 length field of an AVP of type Grouped is always a multiple of 4. 1942 4.3. Derived AVP Data Formats 1944 In addition to using the Basic AVP Data Formats, applications may 1945 define data formats derived from the Basic AVP Data Formats. An 1946 application that defines new Derived AVP Data Formats MUST include 1947 them in a section entitled "Derived AVP Data Formats", using the same 1948 format as the definitions below. Each new definition MUST be either 1949 defined or listed with a reference to the RFC that defines the 1950 format. 1952 4.3.1. Common Derived AVPs 1954 The following are commonly used Derived AVP Data Formats. 1956 Address 1958 The Address format is derived from the OctetString AVP Base 1959 Format. It is a discriminated union, representing, for example a 1960 32-bit (IPv4) [RFC791] or 128-bit (IPv6) [RFC4291] address, most 1961 significant octet first. The first two octets of the Address AVP 1962 represents the AddressType, which contains an Address Family 1963 defined in [IANAADFAM]. The AddressType is used to discriminate 1964 the content and format of the remaining octets. 1966 Time 1968 The Time format is derived from the OctetString AVP Base Format. 1969 The string MUST contain four octets, in the same format as the 1970 first four bytes are in the NTP timestamp format. The NTP 1971 Timestamp format is defined in Chapter 3 of [RFC4330]. 1973 This represents the number of seconds since 0h on 1 January 1900 1974 with respect to the Coordinated Universal Time (UTC). 1976 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow. 1977 SNTP [RFC4330] describes a procedure to extend the time to 2104. 1978 This procedure MUST be supported by all Diameter nodes. 1980 UTF8String 1982 The UTF8String format is derived from the OctetString AVP Base 1983 Format. This is a human readable string represented using the 1984 ISO/IEC IS 10646-1 character set, encoded as an OctetString using 1985 the UTF-8 [RFC3629] transformation format described in RFC 3629. 1987 Since additional code points are added by amendments to the 10646 1988 standard from time to time, implementations MUST be prepared to 1989 encounter any code point from 0x00000001 to 0x7fffffff. Byte 1990 sequences that do not correspond to the valid encoding of a code 1991 point into UTF-8 charset or are outside this range are prohibited. 1993 The use of control codes SHOULD be avoided. When it is necessary 1994 to represent a new line, the control code sequence CR LF SHOULD be 1995 used. 1997 The use of leading or trailing white space SHOULD be avoided. 1999 For code points not directly supported by user interface hardware 2000 or software, an alternative means of entry and display, such as 2001 hexadecimal, MAY be provided. 2003 For information encoded in 7-bit US-ASCII, the UTF-8 charset is 2004 identical to the US-ASCII charset. 2006 UTF-8 may require multiple bytes to represent a single character / 2007 code point; thus the length of an UTF8String in octets may be 2008 different from the number of characters encoded. 2010 Note that the AVP Length field of an UTF8String is measured in 2011 octets, not characters. 2013 DiameterIdentity 2015 The DiameterIdentity format is derived from the OctetString AVP 2016 Base Format. 2018 DiameterIdentity = FQDN/Realm 2020 DiameterIdentity value is used to uniquely identify either: 2022 * A Diameter node for purposes of duplicate connection and 2023 routing loop detection. 2025 * A Realm to determine whether messages can be satisfied locally, 2026 or whether they must be routed or redirected. 2028 When a DiameterIdentity is used to identify a Diameter node the 2029 contents of the string MUST be the FQDN of the Diameter node. If 2030 multiple Diameter nodes run on the same host, each Diameter node 2031 MUST be assigned a unique DiameterIdentity. If a Diameter node 2032 can be identified by several FQDNs, a single FQDN should be picked 2033 at startup, and used as the only DiameterIdentity for that node, 2034 whatever the connection it is sent on. Note that in this 2035 document, DiameterIdentity is in ASCII form in order to be 2036 compatible with existing DNS infrastructure. See Appendix D for 2037 interactions between the Diameter protocol and Internationalized 2038 Domain Name (IDNs). 2040 DiameterURI 2042 The DiameterURI MUST follow the Uniform Resource Identifiers (URI) 2043 syntax [RFC3986] rules specified below: 2045 "aaa://" FQDN [ port ] [ transport ] [ protocol ] 2047 ; No transport security 2049 "aaas://" FQDN [ port ] [ transport ] [ protocol ] 2051 ; Transport security used 2053 FQDN = Fully Qualified Host Name 2055 port = ":" 1*DIGIT 2057 ; One of the ports used to listen for 2058 ; incoming connections. 2059 ; If absent, the default Diameter port 2060 ; (3868) is assumed if no transport 2061 ; security is used and port (TBD) when 2062 ; transport security (TLS) is used. 2064 transport = ";transport=" transport-protocol 2066 ; One of the transports used to listen 2067 ; for incoming connections. If absent, 2068 ; the default protocol is assumed to be TCP. 2069 ; UDP MUST NOT be used when the aaa-protocol 2070 ; field is set to diameter. 2072 transport-protocol = ( "tcp" / "sctp" / "udp" ) 2074 protocol = ";protocol=" aaa-protocol 2076 ; If absent, the default AAA protocol 2077 ; is Diameter. 2079 aaa-protocol = ( "diameter" / "radius" / "tacacs+" ) 2081 The following are examples of valid Diameter host identities: 2083 aaa://host.example.com;transport=tcp 2084 aaa://host.example.com:6666;transport=tcp 2085 aaa://host.example.com;protocol=diameter 2086 aaa://host.example.com:6666;protocol=diameter 2087 aaa://host.example.com:6666;transport=tcp;protocol=diameter 2088 aaa://host.example.com:1813;transport=udp;protocol=radius 2090 Enumerated 2092 Enumerated is derived from the Integer32 AVP Base Format. The 2093 definition contains a list of valid values and their 2094 interpretation and is described in the Diameter application 2095 introducing the AVP. 2097 IPFilterRule 2099 The IPFilterRule format is derived from the OctetString AVP Base 2100 Format and uses the ASCII charset. The rule syntax is a modified 2101 subset of ipfw(8) from FreeBSD. Packets may be filtered based on 2102 the following information that is associated with it: 2104 Direction (in or out) 2105 Source and destination IP address (possibly masked) 2106 Protocol 2107 Source and destination port (lists or ranges) 2108 TCP flags 2109 IP fragment flag 2110 IP options 2111 ICMP types 2113 Rules for the appropriate direction are evaluated in order, with 2114 the first matched rule terminating the evaluation. Each packet is 2115 evaluated once. If no rule matches, the packet is dropped if the 2116 last rule evaluated was a permit, and passed if the last rule was 2117 a deny. 2119 IPFilterRule filters MUST follow the format: 2121 action dir proto from src to dst [options] 2123 action permit - Allow packets that match the rule. 2124 deny - Drop packets that match the rule. 2126 dir "in" is from the terminal, "out" is to the 2127 terminal. 2129 proto An IP protocol specified by number. The "ip" 2130 keyword means any protocol will match. 2132 src and dst
[ports] 2134 The
may be specified as: 2135 ipno An IPv4 or IPv6 number in dotted- 2136 quad or canonical IPv6 form. Only 2137 this exact IP number will match the 2138 rule. 2139 ipno/bits An IP number as above with a mask 2140 width of the form 1.2.3.4/24. In 2141 this case, all IP numbers from 2142 1.2.3.0 to 1.2.3.255 will match. 2143 The bit width MUST be valid for the 2144 IP version and the IP number MUST 2145 NOT have bits set beyond the mask. 2146 For a match to occur, the same IP 2147 version must be present in the 2148 packet that was used in describing 2149 the IP address. To test for a 2150 particular IP version, the bits part 2151 can be set to zero. The keyword 2152 "any" is 0.0.0.0/0 or the IPv6 2153 equivalent. The keyword "assigned" 2154 is the address or set of addresses 2155 assigned to the terminal. For IPv4, 2156 a typical first rule is often "deny 2157 in ip! assigned" 2159 The sense of the match can be inverted by 2160 preceding an address with the not modifier (!), 2161 causing all other addresses to be matched 2162 instead. This does not affect the selection of 2163 port numbers. 2165 With the TCP, UDP and SCTP protocols, optional 2166 ports may be specified as: 2168 {port/port-port}[,ports[,...]] 2170 The '-' notation specifies a range of ports 2171 (including boundaries). 2173 Fragmented packets that have a non-zero offset 2174 (i.e., not the first fragment) will never match 2175 a rule that has one or more port 2176 specifications. See the frag option for 2177 details on matching fragmented packets. 2179 options: 2180 frag Match if the packet is a fragment and this is not 2181 the first fragment of the datagram. frag may not 2182 be used in conjunction with either tcpflags or 2183 TCP/UDP port specifications. 2185 ipoptions spec 2186 Match if the IP header contains the comma 2187 separated list of options specified in spec. The 2188 supported IP options are: 2190 ssrr (strict source route), lsrr (loose source 2191 route), rr (record packet route) and ts 2192 (timestamp). The absence of a particular option 2193 may be denoted with a '!'. 2195 tcpoptions spec 2196 Match if the TCP header contains the comma 2197 separated list of options specified in spec. The 2198 supported TCP options are: 2200 mss (maximum segment size), window (tcp window 2201 advertisement), sack (selective ack), ts (rfc1323 2202 timestamp) and cc (rfc1644 t/tcp connection 2203 count). The absence of a particular option may 2204 be denoted with a '!'. 2206 established 2207 TCP packets only. Match packets that have the RST 2208 or ACK bits set. 2210 setup TCP packets only. Match packets that have the SYN 2211 bit set but no ACK bit. 2213 tcpflags spec 2214 TCP packets only. Match if the TCP header 2215 contains the comma separated list of flags 2216 specified in spec. The supported TCP flags are: 2218 fin, syn, rst, psh, ack and urg. The absence of a 2219 particular flag may be denoted with a '!'. A rule 2220 that contains a tcpflags specification can never 2221 match a fragmented packet that has a non-zero 2222 offset. See the frag option for details on 2223 matching fragmented packets. 2225 icmptypes types 2226 ICMP packets only. Match if the ICMP type is in 2227 the list types. The list may be specified as any 2228 combination of ranges or individual types 2229 separated by commas. Both the numeric values and 2230 the symbolic values listed below can be used. The 2231 supported ICMP types are: 2233 echo reply (0), destination unreachable (3), 2234 source quench (4), redirect (5), echo request 2235 (8), router advertisement (9), router 2236 solicitation (10), time-to-live exceeded (11), IP 2237 header bad (12), timestamp request (13), 2238 timestamp reply (14), information request (15), 2239 information reply (16), address mask request (17) 2240 and address mask reply (18). 2242 There is one kind of packet that the access device MUST always 2243 discard, that is an IP fragment with a fragment offset of one. 2244 This is a valid packet, but it only has one use, to try to 2245 circumvent firewalls. 2247 An access device that is unable to interpret or apply a deny rule 2248 MUST terminate the session. An access device that is unable to 2249 interpret or apply a permit rule MAY apply a more restrictive 2250 rule. An access device MAY apply deny rules of its own before the 2251 supplied rules, for example to protect the access device owner's 2252 infrastructure. 2254 4.4. Grouped AVP Values 2256 The Diameter protocol allows AVP values of type 'Grouped'. This 2257 implies that the Data field is actually a sequence of AVPs. It is 2258 possible to include an AVP with a Grouped type within a Grouped type, 2259 that is, to nest them. AVPs within an AVP of type Grouped have the 2260 same padding requirements as non-Grouped AVPs, as defined in Section 2261 4. 2263 The AVP Code numbering space of all AVPs included in a Grouped AVP is 2264 the same as for non-grouped AVPs. Receivers of a Grouped AVP that 2265 does not have the 'M' (mandatory) bit set and one or more of the 2266 encapsulated AVPs within the group has the 'M' (mandatory) bit set 2267 MAY simply be ignored if the Grouped AVP itself is unrecognized. The 2268 rule applies even if the encapsulated AVP with its 'M' (mandatory) 2269 bit set is further encapsulated within other sub-groups; i.e. other 2270 Grouped AVPs embedded within the Grouped AVP. 2272 Every Grouped AVP defined MUST include a corresponding grammar, using 2273 ABNF [RFC5234] (with modifications), as defined below. 2275 grouped-avp-def = "::=" avp 2277 name-fmt = ALPHA *(ALPHA / DIGIT / "-") 2279 name = name-fmt 2280 ; The name has to be the name of an AVP, 2281 ; defined in the base or extended Diameter 2282 ; specifications. 2284 avp = header [ *fixed] [ *required] [ *optional] 2286 header = "<" "AVP-Header:" avpcode [vendor] ">" 2288 avpcode = 1*DIGIT 2289 ; The AVP Code assigned to the Grouped AVP 2291 vendor = 1*DIGIT 2292 ; The Vendor-ID assigned to the Grouped AVP. 2293 ; If absent, the default value of zero is 2294 ; used. 2296 4.4.1. Example AVP with a Grouped Data type 2298 The Example-AVP (AVP Code 999999) is of type Grouped and is used to 2299 clarify how Grouped AVP values work. The Grouped Data field has the 2300 following ABNF grammar: 2302 Example-AVP ::= < AVP Header: 999999 > 2303 { Origin-Host } 2304 1*{ Session-Id } 2305 *[ AVP ] 2307 An Example-AVP with Grouped Data follows. 2309 The Origin-Host AVP is required (Section 6.3). In this case: 2311 Origin-Host = "example.com". 2313 One or more Session-Ids must follow. Here there are two: 2315 Session-Id = 2316 "grump.example.com:33041;23432;893;0AF3B81" 2318 Session-Id = 2319 "grump.example.com:33054;23561;2358;0AF3B82" 2321 optional AVPs included are 2323 Recovery-Policy = 2324 2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35 2325 2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5 2326 c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd 2327 f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a 2328 cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119 2329 26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c 2330 1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92 2332 Futuristic-Acct-Record = 2333 fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0 2334 57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8 2335 17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c 2336 41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067 2337 d3427475e49968f841 2339 The data for the optional AVPs is represented in hex since the format 2340 of these AVPs is neither known at the time of definition of the 2341 Example-AVP group, nor (likely) at the time when the example instance 2342 of this AVP is interpreted - except by Diameter implementations which 2343 support the same set of AVPs. The encoding example illustrates how 2344 padding is used and how length fields are calculated. Also note that 2345 AVPs may be present in the Grouped AVP value which the receiver 2346 cannot interpret (here, the Recover-Policy and Futuristic-Acct-Record 2347 AVPs). The length of the Example-AVP is the sum of all the length of 2348 the member AVPs including their padding plus the Example-AVP header 2349 size. 2351 This AVP would be encoded as follows: 2353 0 1 2 3 4 5 6 7 2354 +-------+-------+-------+-------+-------+-------+-------+-------+ 2355 0 | Example AVP Header (AVP Code = 999999), Length = 496 | 2356 +-------+-------+-------+-------+-------+-------+-------+-------+ 2357 8 | Origin-Host AVP Header (AVP Code = 264), Length = 19 | 2358 +-------+-------+-------+-------+-------+-------+-------+-------+ 2359 16 | 'e' | 'x' | 'a' | 'm' | 'p' | 'l' | 'e' | '.' | 2360 +-------+-------+-------+-------+-------+-------+-------+-------+ 2361 24 | 'c' | 'o' | 'm' |Padding| Session-Id AVP Header | 2362 +-------+-------+-------+-------+-------+-------+-------+-------+ 2363 32 | (AVP Code = 263), Length = 49 | 'g' | 'r' | 'u' | 'm' | 2364 +-------+-------+-------+-------+-------+-------+-------+-------+ 2365 . . . 2366 +-------+-------+-------+-------+-------+-------+-------+-------+ 2367 72 | 'F' | '3' | 'B' | '8' | '1' |Padding|Padding|Padding| 2368 +-------+-------+-------+-------+-------+-------+-------+-------+ 2369 80 | Session-Id AVP Header (AVP Code = 263), Length = 50 | 2370 +-------+-------+-------+-------+-------+-------+-------+-------+ 2371 88 | 'g' | 'r' | 'u' | 'm' | 'p' | '.' | 'e' | 'x' | 2372 +-------+-------+-------+-------+-------+-------+-------+-------+ 2373 . . . 2374 +-------+-------+-------+-------+-------+-------+-------+-------+ 2375 120| '5' | '8' | ';' | '0' | 'A' | 'F' | '3' | 'B' | 2376 +-------+-------+-------+-------+-------+-------+-------+-------+ 2377 128| '8' | '2' |Padding|Padding| Recovery-Policy Header (AVP | 2378 +-------+-------+-------+-------+-------+-------+-------+-------+ 2379 136| Code = 8341), Length = 223 | 0x21 | 0x63 | 0xbc | 0x1d | 2380 +-------+-------+-------+-------+-------+-------+-------+-------+ 2381 144| 0x0a | 0xd8 | 0x23 | 0x71 | 0xf6 | 0xbc | 0x09 | 0x48 | 2382 +-------+-------+-------+-------+-------+-------+-------+-------+ 2383 . . . 2384 +-------+-------+-------+-------+-------+-------+-------+-------+ 2385 352| 0x8c | 0x7f | 0x92 |Padding| Futuristic-Acct-Record Header | 2386 +-------+-------+-------+-------+-------+-------+-------+-------+ 2387 328|(AVP Code = 15930),Length = 137| 0xfe | 0x19 | 0xda | 0x58 | 2388 +-------+-------+-------+-------+-------+-------+-------+-------+ 2389 336| 0x02 | 0xac | 0xd9 | 0x8b | 0x07 | 0xa5 | 0xb8 | 0xc6 | 2390 +-------+-------+-------+-------+-------+-------+-------+-------+ 2391 . . . 2392 +-------+-------+-------+-------+-------+-------+-------+-------+ 2393 488| 0xe4 | 0x99 | 0x68 | 0xf8 | 0x41 |Padding|Padding|Padding| 2394 +-------+-------+-------+-------+-------+-------+-------+-------+ 2396 4.5. Diameter Base Protocol AVPs 2398 The following table describes the Diameter AVPs defined in the base 2399 protocol, their AVP Code values, types, possible flag values. 2401 Due to space constraints, the short form DiamIdent is used to 2402 represent DiameterIdentity. 2404 +----------+ 2405 | AVP Flag | 2406 | rules | 2407 |----+-----| 2408 AVP Section | |MUST | 2409 Attribute Name Code Defined Data Type |MUST| NOT | 2410 -----------------------------------------|----+-----| 2411 Acct- 85 9.8.2 Unsigned32 | M | V | 2412 Interim-Interval | | | 2413 Accounting- 483 9.8.7 Enumerated | M | V | 2414 Realtime-Required | | | 2415 Acct- 50 9.8.5 UTF8String | M | V | 2416 Multi-Session-Id | | | 2417 Accounting- 485 9.8.3 Unsigned32 | M | V | 2418 Record-Number | | | 2419 Accounting- 480 9.8.1 Enumerated | M | V | 2420 Record-Type | | | 2421 Accounting- 44 9.8.4 OctetString| M | V | 2422 Session-Id | | | 2423 Accounting- 287 9.8.6 Unsigned64 | M | V | 2424 Sub-Session-Id | | | 2425 Acct- 259 6.9 Unsigned32 | M | V | 2426 Application-Id | | | 2427 Auth- 258 6.8 Unsigned32 | M | V | 2428 Application-Id | | | 2429 Auth-Request- 274 8.7 Enumerated | M | V | 2430 Type | | | 2431 Authorization- 291 8.9 Unsigned32 | M | V | 2432 Lifetime | | | 2433 Auth-Grace- 276 8.10 Unsigned32 | M | V | 2434 Period | | | 2435 Auth-Session- 277 8.11 Enumerated | M | V | 2436 State | | | 2437 Re-Auth-Request- 285 8.12 Enumerated | M | V | 2438 Type | | | 2439 Class 25 8.20 OctetString| M | V | 2440 Destination-Host 293 6.5 DiamIdent | M | V | 2441 Destination- 283 6.6 DiamIdent | M | V | 2442 Realm | | | 2443 Disconnect-Cause 273 5.4.3 Enumerated | M | V | 2444 Error-Message 281 7.3 UTF8String | | V,M | 2445 Error-Reporting- 294 7.4 DiamIdent | | V,M | 2446 Host | | | 2447 Event-Timestamp 55 8.21 Time | M | V | 2448 Experimental- 297 7.6 Grouped | M | V | 2449 Result | | | 2450 -----------------------------------------|----+-----| 2451 +----------+ 2452 | AVP Flag | 2453 | rules | 2454 |----+-----| 2455 AVP Section | |MUST | 2456 Attribute Name Code Defined Data Type |MUST| NOT | 2457 -----------------------------------------|----+-----| 2458 Experimental- 298 7.7 Unsigned32 | M | V | 2459 Result-Code | | | 2460 Failed-AVP 279 7.5 Grouped | M | V | 2461 Firmware- 267 5.3.4 Unsigned32 | | V,M | 2462 Revision | | | 2463 Host-IP-Address 257 5.3.5 Address | M | V | 2464 Inband-Security | M | V | 2465 -Id 299 6.10 Unsigned32 | | | 2466 Multi-Round- 272 8.19 Unsigned32 | M | V | 2467 Time-Out | | | 2468 Origin-Host 264 6.3 DiamIdent | M | V | 2469 Origin-Realm 296 6.4 DiamIdent | M | V | 2470 Origin-State-Id 278 8.16 Unsigned32 | M | V | 2471 Product-Name 269 5.3.7 UTF8String | | V,M | 2472 Proxy-Host 280 6.7.3 DiamIdent | M | V | 2473 Proxy-Info 284 6.7.2 Grouped | M | V | 2474 Proxy-State 33 6.7.4 OctetString| M | V | 2475 Redirect-Host 292 6.12 DiamURI | M | V | 2476 Redirect-Host- 261 6.13 Enumerated | M | V | 2477 Usage | | | 2478 Redirect-Max- 262 6.14 Unsigned32 | M | V | 2479 Cache-Time | | | 2480 Result-Code 268 7.1 Unsigned32 | M | V | 2481 Route-Record 282 6.7.1 DiamIdent | M | V | 2482 Session-Id 263 8.8 UTF8String | M | V | 2483 Session-Timeout 27 8.13 Unsigned32 | M | V | 2484 Session-Binding 270 8.17 Unsigned32 | M | V | 2485 Session-Server- 271 8.18 Enumerated | M | V | 2486 Failover | | | 2487 Supported- 265 5.3.6 Unsigned32 | M | V | 2488 Vendor-Id | | | 2489 Termination- 295 8.15 Enumerated | M | V | 2490 Cause | | | 2491 User-Name 1 8.14 UTF8String | M | V | 2492 Vendor-Id 266 5.3.3 Unsigned32 | M | V | 2493 Vendor-Specific- 260 6.11 Grouped | M | V | 2494 Application-Id | | | 2495 -----------------------------------------|----+-----| 2497 5. Diameter Peers 2499 This section describes how Diameter nodes establish connections and 2500 communicate with peers. 2502 5.1. Peer Connections 2504 Connections between diameter peers are established using their valid 2505 DiameterIdentity. A Diameter node initiating a connection to a peer 2506 MUST know the peers DiameterIdentity. Methods for discovering a 2507 Diameter peer can be found in Section 5.2. 2509 Although a Diameter node may have many possible peers that it is able 2510 to communicate with, it may not be economical to have an established 2511 connection to all of them. At a minimum, a Diameter node SHOULD have 2512 an established connection with two peers per realm, known as the 2513 primary and secondary peers. Of course, a node MAY have additional 2514 connections, if it is deemed necessary. Typically, all messages for 2515 a realm are sent to the primary peer, but in the event that failover 2516 procedures are invoked, any pending requests are sent to the 2517 secondary peer. However, implementations are free to load balance 2518 requests between a set of peers. 2520 Note that a given peer MAY act as a primary for a given realm, while 2521 acting as a secondary for another realm. 2523 When a peer is deemed suspect, which could occur for various reasons, 2524 including not receiving a DWA within an allotted timeframe, no new 2525 requests should be forwarded to the peer, but failover procedures are 2526 invoked. When an active peer is moved to this mode, additional 2527 connections SHOULD be established to ensure that the necessary number 2528 of active connections exists. 2530 There are two ways that a peer is removed from the suspect peer list: 2532 1. The peer is no longer reachable, causing the transport connection 2533 to be shutdown. The peer is moved to the closed state. 2535 2. Three watchdog messages are exchanged with accepted round trip 2536 times, and the connection to the peer is considered stabilized. 2538 In the event the peer being removed is either the primary or 2539 secondary, an alternate peer SHOULD replace the deleted peer, and 2540 assume the role of either primary or secondary. 2542 5.2. Diameter Peer Discovery 2544 Allowing for dynamic Diameter agent discovery will make it possible 2545 for simpler and more robust deployment of Diameter services. In 2546 order to promote interoperable implementations of Diameter peer 2547 discovery, the following mechanisms are described. These are based 2548 on existing IETF standards. The first option (manual configuration) 2549 MUST be supported by all Diameter nodes, while the latter option 2550 (DNS) MAY be supported. 2552 There are two cases where Diameter peer discovery may be performed. 2553 The first is when a Diameter client needs to discover a first-hop 2554 Diameter agent. The second case is when a Diameter agent needs to 2555 discover another agent - for further handling of a Diameter 2556 operation. In both cases, the following 'search order' is 2557 recommended: 2559 1. The Diameter implementation consults its list of static 2560 (manually) configured Diameter agent locations. These will be 2561 used if they exist and respond. 2563 2. The Diameter implementation performs a NAPTR query for a server 2564 in a particular realm. The Diameter implementation has to know 2565 in advance which realm to look for a Diameter agent. This could 2566 be deduced, for example, from the 'realm' in a NAI that a 2567 Diameter implementation needed to perform a Diameter operation 2568 on. 2570 The NAPTR usage in Diameter follows the S-NAPTR DDDS application 2571 [RFC3958] in which the SERVICE field includes tags for the 2572 desired application and supported application protocol. The 2573 application service tag for a Diameter application is 'aaa' and 2574 the supported application protocol tags are 'diameter.tcp', 2575 'diameter.sctp' or 'diameter.tls'. 2577 The client can follow the resolution process defined by the 2578 S-NAPTR DDDS [RFC3958] application to find a matching SRV, A or 2579 AAAA record of a suitable peer. The domain suffixes in the NAPTR 2580 replacement field SHOULD match the domain of the original query. 2581 An example can be found in Appendix B. 2583 3. If no NAPTR records are found, the requester directly queries for 2584 SRV records '_diameter._sctp'.realm, '_diameter._tcp'.realm and 2585 '_diameter._tls'.realm depending on the requesters network 2586 protocol capabilities. If SRV records are found then the 2587 requester can perform address record query (A RR's and/or AAAA 2588 RR's) for the target hostname specified in the SRV records. If 2589 no SRV records are found, the requester gives up. 2591 If the server is using a site certificate, the domain name in the 2592 NAPTR query and the domain name in the replacement field MUST both be 2593 valid based on the site certificate handed out by the server in the 2594 TLS or IKE exchange. Similarly, the domain name in the SRV query and 2595 the domain name in the target in the SRV record MUST both be valid 2596 based on the same site certificate. Otherwise, an attacker could 2597 modify the DNS records to contain replacement values in a different 2598 domain, and the client could not validate that this was the desired 2599 behavior, or the result of an attack. 2601 Also, the Diameter Peer MUST check to make sure that the discovered 2602 peers are authorized to act in its role. Authentication via IKE or 2603 TLS, or validation of DNS RRs via DNSSEC is not sufficient to 2604 conclude this. For example, a web server may have obtained a valid 2605 TLS certificate, and secured RRs may be included in the DNS, but this 2606 does not imply that it is authorized to act as a Diameter Server. 2608 Authorization can be achieved for example, by configuration of a 2609 Diameter Server CA. Alternatively this can be achieved by definition 2610 of OIDs within TLS or IKE certificates so as to signify Diameter 2611 Server authorization. 2613 A dynamically discovered peer causes an entry in the Peer Table (see 2614 Section 2.6) to be created. Note that entries created via DNS MUST 2615 expire (or be refreshed) within the DNS TTL. If a peer is discovered 2616 outside of the local realm, a routing table entry (see Section 2.7) 2617 for the peer's realm is created. The routing table entry's 2618 expiration MUST match the peer's expiration value. 2620 5.3. Capabilities Exchange 2622 When two Diameter peers establish a transport connection, they MUST 2623 exchange the Capabilities Exchange messages, as specified in the peer 2624 state machine (see Section 5.6). This message allows the discovery 2625 of a peer's identity and its capabilities (protocol version number, 2626 supported Diameter applications, security mechanisms, etc.) 2628 The receiver only issues commands to its peers that have advertised 2629 support for the Diameter application that defines the command. A 2630 Diameter node MUST cache the supported applications in order to 2631 ensure that unrecognized commands and/or AVPs are not unnecessarily 2632 sent to a peer. 2634 A receiver of a Capabilities-Exchange-Req (CER) message that does not 2635 have any applications in common with the sender MUST return a 2636 Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to 2637 DIAMETER_NO_COMMON_APPLICATION, and SHOULD disconnect the transport 2638 layer connection. Note that receiving a CER or CEA from a peer 2639 advertising itself as a Relay (see Section 2.4) MUST be interpreted 2640 as having common applications with the peer. 2642 The receiver of the Capabilities-Exchange-Request (CER) MUST 2643 determine common applications by computing the intersection of its 2644 own set of supported Application Id against all of the application 2645 identifier AVPs (Auth-Application-Id, Acct-Application-Id and Vendor- 2646 Specific-Application-Id) present in the CER. The value of the 2647 Vendor-Id AVP in the Vendor-Specific-Application-Id MUST NOT be used 2648 during computation. The sender of the Capabilities-Exchange-Answer 2649 (CEA) SHOULD include all of its supported applications as a hint to 2650 the receiver regarding all of its application capabilities. 2652 Diameter implementations SHOULD first attempt to establish a TLS 2653 connection prior to the CER/CEA exchange. This protects the 2654 capabilities information of both peers. To support older Diameter 2655 implementations that do not fully conform to this document, the 2656 transport security MAY still be negotiated via Inband-Security AVP. 2657 In this case, the receiver of a Capabilities-Exchange-Req (CER) 2658 message that does not have any security mechanisms in common with the 2659 sender MUST return a Capabilities-Exchange-Answer (CEA) with the 2660 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY, and SHOULD 2661 disconnect the transport layer connection. 2663 CERs received from unknown peers MAY be silently discarded, or a CEA 2664 MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER. 2665 In both cases, the transport connection is closed. If the local 2666 policy permits receiving CERs from unknown hosts, a successful CEA 2667 MAY be returned. If a CER from an unknown peer is answered with a 2668 successful CEA, the lifetime of the peer entry is equal to the 2669 lifetime of the transport connection. In case of a transport 2670 failure, all the pending transactions destined to the unknown peer 2671 can be discarded. 2673 The CER and CEA messages MUST NOT be proxied, redirected or relayed. 2675 Since the CER/CEA messages cannot be proxied, it is still possible 2676 that an upstream agent receives a message for which it has no 2677 available peers to handle the application that corresponds to the 2678 Command-Code. In such instances, the 'E' bit is set in the answer 2679 message (see Section 7.) with the Result-Code AVP set to 2680 DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action 2681 (e.g., re-routing request to an alternate peer). 2683 With the exception of the Capabilities-Exchange-Request message, a 2684 message of type Request that includes the Auth-Application-Id or 2685 Acct-Application-Id AVPs, or a message with an application-specific 2686 command code, MAY only be forwarded to a host that has explicitly 2687 advertised support for the application (or has advertised the Relay 2688 Application Id). 2690 5.3.1. Capabilities-Exchange-Request 2692 The Capabilities-Exchange-Request (CER), indicated by the Command- 2693 Code set to 257 and the Command Flags' 'R' bit set, is sent to 2694 exchange local capabilities. Upon detection of a transport failure, 2695 this message MUST NOT be sent to an alternate peer. 2697 When Diameter is run over SCTP [RFC4960], which allows for 2698 connections to span multiple interfaces and multiple IP addresses, 2699 the Capabilities-Exchange-Request message MUST contain one Host-IP- 2700 Address AVP for each potential IP address that MAY be locally used 2701 when transmitting Diameter messages. 2703 Message Format 2705 ::= < Diameter Header: 257, REQ > 2706 { Origin-Host } 2707 { Origin-Realm } 2708 1* { Host-IP-Address } 2709 { Vendor-Id } 2710 { Product-Name } 2711 [ Origin-State-Id ] 2712 * [ Supported-Vendor-Id ] 2713 * [ Auth-Application-Id ] 2714 * [ Inband-Security-Id ] 2715 * [ Acct-Application-Id ] 2716 * [ Vendor-Specific-Application-Id ] 2717 [ Firmware-Revision ] 2718 * [ AVP ] 2720 5.3.2. Capabilities-Exchange-Answer 2722 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code 2723 set to 257 and the Command Flags' 'R' bit cleared, is sent in 2724 response to a CER message. 2726 When Diameter is run over SCTP [RFC4960], which allows connections to 2727 span multiple interfaces, hence, multiple IP addresses, the 2728 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address 2729 AVP for each potential IP address that MAY be locally used when 2730 transmitting Diameter messages. 2732 Message Format 2734 ::= < Diameter Header: 257 > 2735 { Result-Code } 2736 { Origin-Host } 2737 { Origin-Realm } 2738 1* { Host-IP-Address } 2739 { Vendor-Id } 2740 { Product-Name } 2741 [ Origin-State-Id ] 2742 [ Error-Message ] 2743 [ Failed-AVP ] 2744 * [ Supported-Vendor-Id ] 2745 * [ Auth-Application-Id ] 2746 * [ Inband-Security-Id ] 2747 * [ Acct-Application-Id ] 2748 * [ Vendor-Specific-Application-Id ] 2749 [ Firmware-Revision ] 2750 * [ AVP ] 2752 5.3.3. Vendor-Id AVP 2754 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains 2755 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232] 2756 value assigned to the vendor of the Diameter device. It is 2757 envisioned that the combination of the Vendor-Id, Product-Name 2758 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may 2759 provide useful debugging information. 2761 A Vendor-Id value of zero in the CER or CEA messages is reserved and 2762 indicates that this field is ignored. 2764 5.3.4. Firmware-Revision AVP 2766 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is 2767 used to inform a Diameter peer of the firmware revision of the 2768 issuing device. 2770 For devices that do not have a firmware revision (general purpose 2771 computers running Diameter software modules, for instance), the 2772 revision of the Diameter software module may be reported instead. 2774 5.3.5. Host-IP-Address AVP 2776 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used 2777 to inform a Diameter peer of the sender's IP address. All source 2778 addresses that a Diameter node expects to use with SCTP [RFC4960] 2779 MUST be advertised in the CER and CEA messages by including a Host- 2780 IP-Address AVP for each address. 2782 5.3.6. Supported-Vendor-Id AVP 2784 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and 2785 contains the IANA "SMI Network Management Private Enterprise Codes" 2786 [RFC3232] value assigned to a vendor other than the device vendor but 2787 including the application vendor. This is used in the CER and CEA 2788 messages in order to inform the peer that the sender supports (a 2789 subset of) the vendor-specific AVPs defined by the vendor identified 2790 in this AVP. The value of this AVP MUST NOT be set to zero. 2791 Multiple instances of this AVP containing the same value SHOULD NOT 2792 be sent. 2794 5.3.7. Product-Name AVP 2796 The Product-Name AVP (AVP Code 269) is of type UTF8String, and 2797 contains the vendor assigned name for the product. The Product-Name 2798 AVP SHOULD remain constant across firmware revisions for the same 2799 product. 2801 5.4. Disconnecting Peer connections 2803 When a Diameter node disconnects one of its transport connections, 2804 its peer cannot know the reason for the disconnect, and will most 2805 likely assume that a connectivity problem occurred, or that the peer 2806 has rebooted. In these cases, the peer may periodically attempt to 2807 reconnect, as stated in Section 2.1. In the event that the 2808 disconnect was a result of either a shortage of internal resources, 2809 or simply that the node in question has no intentions of forwarding 2810 any Diameter messages to the peer in the foreseeable future, a 2811 periodic connection request would not be welcomed. The 2812 Disconnection-Reason AVP contains the reason the Diameter node issued 2813 the Disconnect-Peer-Request message. 2815 The Disconnect-Peer-Request message is used by a Diameter node to 2816 inform its peer of its intent to disconnect the transport layer, and 2817 that the peer shouldn't reconnect unless it has a valid reason to do 2818 so (e.g., message to be forwarded). Upon receipt of the message, the 2819 Disconnect-Peer-Answer is returned, which SHOULD contain an error if 2820 messages have recently been forwarded, and are likely in flight, 2821 which would otherwise cause a race condition. 2823 The receiver of the Disconnect-Peer-Answer initiates the transport 2824 disconnect. The sender of the Disconnect-Peer-Answer should be able 2825 to detect the transport closure and cleanup the connection. 2827 5.4.1. Disconnect-Peer-Request 2829 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set 2830 to 282 and the Command Flags' 'R' bit set, is sent to a peer to 2831 inform its intentions to shutdown the transport connection. Upon 2832 detection of a transport failure, this message MUST NOT be sent to an 2833 alternate peer. 2835 Message Format 2837 ::= < Diameter Header: 282, REQ > 2838 { Origin-Host } 2839 { Origin-Realm } 2840 { Disconnect-Cause } 2841 * [ AVP ] 2843 5.4.2. Disconnect-Peer-Answer 2845 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set 2846 to 282 and the Command Flags' 'R' bit cleared, is sent as a response 2847 to the Disconnect-Peer-Request message. Upon receipt of this 2848 message, the transport connection is shutdown. 2850 Message Format 2852 ::= < Diameter Header: 282 > 2853 { Result-Code } 2854 { Origin-Host } 2855 { Origin-Realm } 2856 [ Error-Message ] 2857 [ Failed-AVP ] 2858 * [ AVP ] 2860 5.4.3. Disconnect-Cause AVP 2862 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A 2863 Diameter node MUST include this AVP in the Disconnect-Peer-Request 2864 message to inform the peer of the reason for its intention to 2865 shutdown the transport connection. The following values are 2866 supported: 2868 REBOOTING 0 2869 A scheduled reboot is imminent. Receiver of DPR with above result 2870 code MAY attempt reconnection. 2872 BUSY 1 2873 The peer's internal resources are constrained, and it has 2874 determined that the transport connection needs to be closed. 2875 Receiver of DPR with above result code SHOULD NOT attempt 2876 reconnection. 2878 DO_NOT_WANT_TO_TALK_TO_YOU 2 2879 The peer has determined that it does not see a need for the 2880 transport connection to exist, since it does not expect any 2881 messages to be exchanged in the near future. Receiver of DPR 2882 with above result code SHOULD NOT attempt reconnection. 2884 5.5. Transport Failure Detection 2886 Given the nature of the Diameter protocol, it is recommended that 2887 transport failures be detected as soon as possible. Detecting such 2888 failures will minimize the occurrence of messages sent to unavailable 2889 agents, resulting in unnecessary delays, and will provide better 2890 failover performance. The Device-Watchdog-Request and Device- 2891 Watchdog-Answer messages, defined in this section, are used to pro- 2892 actively detect transport failures. 2894 5.5.1. Device-Watchdog-Request 2896 The Device-Watchdog-Request (DWR), indicated by the Command-Code set 2897 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no 2898 traffic has been exchanged between two peers (see Section 5.5.3). 2899 Upon detection of a transport failure, this message MUST NOT be sent 2900 to an alternate peer. 2902 Message Format 2904 ::= < Diameter Header: 280, REQ > 2905 { Origin-Host } 2906 { Origin-Realm } 2907 [ Origin-State-Id ] 2908 * [ AVP ] 2910 5.5.2. Device-Watchdog-Answer 2912 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set 2913 to 280 and the Command Flags' 'R' bit cleared, is sent as a response 2914 to the Device-Watchdog-Request message. 2916 Message Format 2918 ::= < Diameter Header: 280 > 2919 { Result-Code } 2920 { Origin-Host } 2921 { Origin-Realm } 2922 [ Error-Message ] 2923 [ Failed-AVP ] 2924 [ Origin-State-Id ] 2925 * [ AVP ] 2927 5.5.3. Transport Failure Algorithm 2929 The transport failure algorithm is defined in [RFC3539]. All 2930 Diameter implementations MUST support the algorithm defined in the 2931 specification in order to be compliant to the Diameter base protocol. 2933 5.5.4. Failover and Failback Procedures 2935 In the event that a transport failure is detected with a peer, it is 2936 necessary for all pending request messages to be forwarded to an 2937 alternate agent, if possible. This is commonly referred to as 2938 failover. 2940 In order for a Diameter node to perform failover procedures, it is 2941 necessary for the node to maintain a pending message queue for a 2942 given peer. When an answer message is received, the corresponding 2943 request is removed from the queue. The Hop-by-Hop Identifier field 2944 is used to match the answer with the queued request. 2946 When a transport failure is detected, if possible all messages in the 2947 queue are sent to an alternate agent with the T flag set. On booting 2948 a Diameter client or agent, the T flag is also set on any records 2949 still remaining to be transmitted in non-volatile storage. An 2950 example of a case where it is not possible to forward the message to 2951 an alternate server is when the message has a fixed destination, and 2952 the unavailable peer is the message's final destination (see 2953 Destination-Host AVP). Such an error requires that the agent return 2954 an answer message with the 'E' bit set and the Result-Code AVP set to 2955 DIAMETER_UNABLE_TO_DELIVER. 2957 It is important to note that multiple identical requests or answers 2958 MAY be received as a result of a failover. The End-to-End Identifier 2959 field in the Diameter header along with the Origin-Host AVP MUST be 2960 used to identify duplicate messages. 2962 As described in Section 2.1, a connection request should be 2963 periodically attempted with the failed peer in order to re-establish 2964 the transport connection. Once a connection has been successfully 2965 established, messages can once again be forwarded to the peer. This 2966 is commonly referred to as failback. 2968 5.6. Peer State Machine 2970 This section contains a finite state machine that MUST be observed by 2971 all Diameter implementations. Each Diameter node MUST follow the 2972 state machine described below when communicating with each peer. 2973 Multiple actions are separated by commas, and may continue on 2974 succeeding lines, as space requires. Similarly, state and next state 2975 may also span multiple lines, as space requires. 2977 This state machine is closely coupled with the state machine 2978 described in [RFC3539], which is used to open, close, failover, 2979 probe, and reopen transport connections. Note in particular that 2980 [RFC3539] requires the use of watchdog messages to probe connections. 2981 For Diameter, DWR and DWA messages are to be used. 2983 I- is used to represent the initiator (connecting) connection, while 2984 the R- is used to represent the responder (listening) connection. 2985 The lack of a prefix indicates that the event or action is the same 2986 regardless of the connection on which the event occurred. 2988 The stable states that a state machine may be in are Closed, I-Open 2989 and R-Open; all other states are intermediate. Note that I-Open and 2990 R-Open are equivalent except for whether the initiator or responder 2991 transport connection is used for communication. 2993 A CER message is always sent on the initiating connection immediately 2994 after the connection request is successfully completed. In the case 2995 of an election, one of the two connections will shut down. The 2996 responder connection will survive if the Origin-Host of the local 2997 Diameter entity is higher than that of the peer; the initiator 2998 connection will survive if the peer's Origin-Host is higher. All 2999 subsequent messages are sent on the surviving connection. Note that 3000 the results of an election on one peer are guaranteed to be the 3001 inverse of the results on the other. 3003 For TLS usage, TLS handshake SHOULD begin when both ends are in the 3004 closed state prior to any Diameter message exchanges. The TLS 3005 connection SHOULD be established before sending any CER or CEA 3006 message to secure and protect the capabilities information of both 3007 peers. The TLS connection SHOULD be disconnected when the state 3008 machine moves to the closed state. When connecting to responders 3009 that do not conform to this document (i.e. older Diameter 3010 implementations that are not prepared to received TLS connections in 3011 the closed state), the initial TLS connection attempt will fail. The 3012 initiator MAY then attempt to connect via TCP or SCTP and initiate 3013 the TLS handshake when both ends are in the open state. If the 3014 handshake is successful, all further messages will be sent via TLS. 3015 If the handshake fails, both ends moves to the closed state. 3017 The state machine constrains only the behavior of a Diameter 3018 implementation as seen by Diameter peers through events on the wire. 3020 Any implementation that produces equivalent results is considered 3021 compliant. 3023 state event action next state 3024 ----------------------------------------------------------------- 3025 Closed Start I-Snd-Conn-Req Wait-Conn-Ack 3026 R-Conn-CER R-Accept, R-Open 3027 Process-CER, 3028 R-Snd-CEA 3030 Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA 3031 I-Rcv-Conn-Nack Cleanup Closed 3032 R-Conn-CER R-Accept, Wait-Conn-Ack/ 3033 Process-CER Elect 3034 Timeout Error Closed 3036 Wait-I-CEA I-Rcv-CEA Process-CEA I-Open 3037 R-Conn-CER R-Accept, Wait-Returns 3038 Process-CER, 3039 Elect 3040 I-Peer-Disc I-Disc Closed 3041 I-Rcv-Non-CEA Error Closed 3042 Timeout Error Closed 3044 Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns 3045 Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open 3046 R-Peer-Disc R-Disc Wait-Conn-Ack 3047 R-Conn-CER R-Reject Wait-Conn-Ack/ 3048 Elect 3049 Timeout Error Closed 3051 Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open 3052 I-Peer-Disc I-Disc, R-Open 3053 R-Snd-CEA 3054 I-Rcv-CEA R-Disc I-Open 3055 R-Peer-Disc R-Disc Wait-I-CEA 3056 R-Conn-CER R-Reject Wait-Returns 3057 Timeout Error Closed 3059 R-Open Send-Message R-Snd-Message R-Open 3060 R-Rcv-Message Process R-Open 3061 R-Rcv-DWR Process-DWR, R-Open 3062 R-Snd-DWA 3063 R-Rcv-DWA Process-DWA R-Open 3064 R-Conn-CER R-Reject R-Open 3065 Stop R-Snd-DPR Closing 3066 R-Rcv-DPR R-Snd-DPA, Closed 3067 R-Disc 3068 R-Peer-Disc R-Disc Closed 3070 I-Open Send-Message I-Snd-Message I-Open 3071 I-Rcv-Message Process I-Open 3072 I-Rcv-DWR Process-DWR, I-Open 3073 I-Snd-DWA 3074 I-Rcv-DWA Process-DWA I-Open 3075 R-Conn-CER R-Reject I-Open 3076 Stop I-Snd-DPR Closing 3077 I-Rcv-DPR I-Snd-DPA, Closed 3078 I-Disc 3079 I-Peer-Disc I-Disc Closed 3081 Closing I-Rcv-DPA I-Disc Closed 3082 R-Rcv-DPA R-Disc Closed 3083 Timeout Error Closed 3084 I-Peer-Disc I-Disc Closed 3085 R-Peer-Disc R-Disc Closed 3087 5.6.1. Incoming connections 3089 When a connection request is received from a Diameter peer, it is 3090 not, in the general case, possible to know the identity of that peer 3091 until a CER is received from it. This is because host and port 3092 determine the identity of a Diameter peer; and the source port of an 3093 incoming connection is arbitrary. Upon receipt of CER, the identity 3094 of the connecting peer can be uniquely determined from Origin-Host. 3096 For this reason, a Diameter peer must employ logic separate from the 3097 state machine to receive connection requests, accept them, and await 3098 CER. Once CER arrives on a new connection, the Origin-Host that 3099 identifies the peer is used to locate the state machine associated 3100 with that peer, and the new connection and CER are passed to the 3101 state machine as an R-Conn-CER event. 3103 The logic that handles incoming connections SHOULD close and discard 3104 the connection if any message other than CER arrives, or if an 3105 implementation-defined timeout occurs prior to receipt of CER. 3107 Because handling of incoming connections up to and including receipt 3108 of CER requires logic, separate from that of any individual state 3109 machine associated with a particular peer, it is described separately 3110 in this section rather than in the state machine above. 3112 5.6.2. Events 3114 Transitions and actions in the automaton are caused by events. In 3115 this section, we will ignore the -I and -R prefix, since the actual 3116 event would be identical, but would occur on one of two possible 3117 connections. 3119 Start The Diameter application has signaled that a 3120 connection should be initiated with the peer. 3122 R-Conn-CER An acknowledgement is received stating that the 3123 transport connection has been established, and the 3124 associated CER has arrived. 3126 Rcv-Conn-Ack A positive acknowledgement is received confirming that 3127 the transport connection is established. 3129 Rcv-Conn-Nack A negative acknowledgement was received stating that 3130 the transport connection was not established. 3132 Timeout An application-defined timer has expired while waiting 3133 for some event. 3135 Rcv-CER A CER message from the peer was received. 3137 Rcv-CEA A CEA message from the peer was received. 3139 Rcv-Non-CEA A message other than CEA from the peer was received. 3141 Peer-Disc A disconnection indication from the peer was received. 3143 Rcv-DPR A DPR message from the peer was received. 3145 Rcv-DPA A DPA message from the peer was received. 3147 Win-Election An election was held, and the local node was the 3148 winner. 3150 Send-Message A message is to be sent. 3152 Rcv-Message A message other than CER, CEA, DPR, DPA, DWR or DWA 3153 was received. 3155 Stop The Diameter application has signaled that a 3156 connection should be terminated (e.g., on system 3157 shutdown). 3159 5.6.3. Actions 3161 Actions in the automaton are caused by events and typically indicate 3162 the transmission of packets and/or an action to be taken on the 3163 connection. In this section we will ignore the I- and R-prefix, 3164 since the actual action would be identical, but would occur on one of 3165 two possible connections. 3167 Snd-Conn-Req A transport connection is initiated with the peer. 3169 Accept The incoming connection associated with the R-Conn-CER 3170 is accepted as the responder connection. 3172 Reject The incoming connection associated with the R-Conn-CER 3173 is disconnected. 3175 Process-CER The CER associated with the R-Conn-CER is processed. 3176 Snd-CER A CER message is sent to the peer. 3178 Snd-CEA A CEA message is sent to the peer. 3180 Cleanup If necessary, the connection is shutdown, and any 3181 local resources are freed. 3183 Error The transport layer connection is disconnected, 3184 either politely or abortively, in response to 3185 an error condition. Local resources are freed. 3187 Process-CEA A received CEA is processed. 3189 Snd-DPR A DPR message is sent to the peer. 3191 Snd-DPA A DPA message is sent to the peer. 3193 Disc The transport layer connection is disconnected, 3194 and local resources are freed. 3196 Elect An election occurs (see Section 5.6.4 for more 3197 information). 3199 Snd-Message A message is sent. 3201 Snd-DWR A DWR message is sent. 3203 Snd-DWA A DWA message is sent. 3205 Process-DWR The DWR message is serviced. 3207 Process-DWA The DWA message is serviced. 3209 Process A message is serviced. 3211 5.6.4. The Election Process 3213 The election is performed on the responder. The responder compares 3214 the Origin-Host received in the CER with its own Origin-Host as two 3215 streams of octets. If the local Origin-Host lexicographically 3216 succeeds the received Origin-Host a Win-Election event is issued 3217 locally. Diameter identities are in ASCII form therefore the lexical 3218 comparison is consistent with DNS case insensitivity where octets 3219 that fall in the ASCII range 'a' through 'z' MUST compare equally to 3220 their upper-case counterparts between 'A' and 'Z'. See Appendix D 3221 for interactions between the Diameter protocol and Internationalized 3222 Domain Name (IDNs). 3224 The winner of the election MUST close the connection it initiated. 3225 Historically, maintaining the responder side of a connection was more 3226 efficient than maintaining the initiator side. However, current 3227 practices makes this distinction irrelevant. 3229 6. Diameter message processing 3231 This section describes how Diameter requests and answers are created 3232 and processed. 3234 6.1. Diameter Request Routing Overview 3236 A request is sent towards its final destination using a combination 3237 of the Destination-Realm and Destination-Host AVPs, in one of these 3238 three combinations: 3240 o a request that is not able to be proxied (such as CER) MUST NOT 3241 contain either Destination-Realm or Destination-Host AVPs. 3243 o a request that needs to be sent to a home server serving a 3244 specific realm, but not to a specific server (such as the first 3245 request of a series of round-trips), MUST contain a Destination- 3246 Realm AVP, but MUST NOT contain a Destination-Host AVP. For 3247 Diameter clients, the value of the Destination-Realm AVP MAY be 3248 extracted from the User-Name AVP, or other methods. 3250 o otherwise, a request that needs to be sent to a specific home 3251 server among those serving a given realm, MUST contain both the 3252 Destination-Realm and Destination-Host AVPs. 3254 The Destination-Host AVP is used as described above when the 3255 destination of the request is fixed, which includes: 3257 o Authentication requests that span multiple round trips 3259 o A Diameter message that uses a security mechanism that makes use 3260 of a pre-established session key shared between the source and the 3261 final destination of the message. 3263 o Server initiated messages that MUST be received by a specific 3264 Diameter client (e.g., access device), such as the Abort-Session- 3265 Request message, which is used to request that a particular user's 3266 session be terminated. 3268 Note that an agent can forward a request to a host described in the 3269 Destination-Host AVP only if the host in question is included in its 3270 peer table (see Section 2.7). Otherwise, the request is routed based 3271 on the Destination-Realm only (see Sections 6.1.6). 3273 When a message is received, the message is processed in the following 3274 order: 3276 o If the message is destined for the local host, the procedures 3277 listed in Section 6.1.4 are followed. 3279 o If the message is intended for a Diameter peer with whom the local 3280 host is able to directly communicate, the procedures listed in 3281 Section 6.1.5 are followed. This is known as Request Forwarding. 3283 o The procedures listed in Section 6.1.6 are followed, which is 3284 known as Request Routing. 3286 o If none of the above is successful, an answer is returned with the 3287 Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the E-bit set. 3289 For routing of Diameter messages to work within an administrative 3290 domain, all Diameter nodes within the realm MUST be peers. 3292 Note the processing rules contained in this section are intended to 3293 be used as general guidelines to Diameter developers. Certain 3294 implementations MAY use different methods than the ones described 3295 here, and still comply with the protocol specification. See Section 3296 7 for more detail on error handling. 3298 6.1.1. Originating a Request 3300 When creating a request, in addition to any other procedures 3301 described in the application definition for that specific request, 3302 the following procedures MUST be followed: 3304 o the Command-Code is set to the appropriate value 3306 o the 'R' bit is set 3308 o the End-to-End Identifier is set to a locally unique value 3310 o the Origin-Host and Origin-Realm AVPs MUST be set to the 3311 appropriate values, used to identify the source of the message 3313 o the Destination-Host and Destination-Realm AVPs MUST be set to the 3314 appropriate values as described in Section 6.1. 3316 6.1.2. Sending a Request 3318 When sending a request, originated either locally, or as the result 3319 of a forwarding or routing operation, the following procedures SHOULD 3320 be followed: 3322 o The Hop-by-Hop Identifier SHOULD be set to a locally unique value. 3324 o The message SHOULD be saved in the list of pending requests. 3326 Other actions to perform on the message based on the particular role 3327 the agent is playing are described in the following sections. 3329 6.1.3. Receiving Requests 3331 A relay or proxy agent MUST check for forwarding loops when receiving 3332 requests. A loop is detected if the server finds its own identity in 3333 a Route-Record AVP. When such an event occurs, the agent MUST answer 3334 with the Result-Code AVP set to DIAMETER_LOOP_DETECTED. 3336 6.1.4. Processing Local Requests 3338 A request is known to be for local consumption when one of the 3339 following conditions occur: 3341 o The Destination-Host AVP contains the local host's identity, 3343 o The Destination-Host AVP is not present, the Destination-Realm AVP 3344 contains a realm the server is configured to process locally, and 3345 the Diameter application is locally supported, or 3347 o Both the Destination-Host and the Destination-Realm are not 3348 present. 3350 When a request is locally processed, the rules in Section 6.2 should 3351 be used to generate the corresponding answer. 3353 6.1.5. Request Forwarding 3355 Request forwarding is done using the Diameter Peer Table. The 3356 Diameter peer table contains all of the peers that the local node is 3357 able to directly communicate with. 3359 When a request is received, and the host encoded in the Destination- 3360 Host AVP is one that is present in the peer table, the message SHOULD 3361 be forwarded to the peer. 3363 6.1.6. Request Routing 3365 Diameter request message routing is done via realms and application 3366 identifiers. A Diameter message that may be forwarded by Diameter 3367 agents (proxies, redirect or relay agents) MUST include the target 3368 realm in the Destination-Realm AVP. Request routing SHOULD rely on 3369 the Destination-Realm AVP and the Application Id present in the 3370 request message header to aid in the routing decision. The realm MAY 3371 be retrieved from the User-Name AVP, which is in the form of a 3372 Network Access Identifier (NAI). The realm portion of the NAI is 3373 inserted in the Destination-Realm AVP. 3375 Diameter agents MAY have a list of locally supported realms and 3376 applications, and MAY have a list of externally supported realms and 3377 applications. When a request is received that includes a realm 3378 and/or application that is not locally supported, the message is 3379 routed to the peer configured in the Routing Table (see Section 2.7). 3381 Realm names and Application Ids are the minimum supported routing 3382 criteria, additional information may be needed to support redirect 3383 semantics. 3385 6.1.7. Predictive Loop Avoidance 3387 Before forwarding or routing a request, Diameter agents, in addition 3388 to processing done in Section 6.1.3, SHOULD check for the presence of 3389 candidate route's peer identity in any of the Route-Record AVPs. In 3390 an event of the agent detecting the presence of a candidate route's 3391 peer identity in a Route-Record AVP, the agent MUST ignore such route 3392 for the Diameter request message and attempt alternate routes if any. 3393 In case all the candidate routes are eliminated by the above 3394 criteria, the agent SHOULD return DIAMETER_UNABLE_TO_DELIVER message. 3396 6.1.8. Redirecting Requests 3398 When a redirect agent receives a request whose routing entry is set 3399 to REDIRECT, it MUST reply with an answer message with the 'E' bit 3400 set, while maintaining the Hop-by-Hop Identifier in the header, and 3401 include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of 3402 the servers associated with the routing entry are added in separate 3403 Redirect-Host AVP. 3405 +------------------+ 3406 | Diameter | 3407 | Redirect Agent | 3408 +------------------+ 3409 ^ | 2. command + 'E' bit 3410 1. Request | | Result-Code = 3411 joe@example.com | | DIAMETER_REDIRECT_INDICATION + 3412 | | Redirect-Host AVP(s) 3413 | v 3414 +-------------+ 3. Request +-------------+ 3415 | example.com |------------->| example.net | 3416 | Relay | | Diameter | 3417 | Agent |<-------------| Server | 3418 +-------------+ 4. Answer +-------------+ 3419 Figure 5: Diameter Redirect Agent 3421 The receiver of the answer message with the 'E' bit set, and the 3422 Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-by- 3423 hop field in the Diameter header to identify the request in the 3424 pending message queue (see Section 5.3) that is to be redirected. If 3425 no transport connection exists with the new agent, one is created, 3426 and the request is sent directly to it. 3428 Multiple Redirect-Host AVPs are allowed. The receiver of the answer 3429 message with the 'E' bit set selects exactly one of these hosts as 3430 the destination of the redirected message. 3432 When the Redirect-Host-Usage AVP included in the answer message has a 3433 non-zero value, a route entry for the redirect indications is created 3434 and cached by the receiver. The redirect usage for such route entry 3435 is set by the value of Redirect-Host-Usage AVP and the lifetime of 3436 the cached route entry is set by Redirect-Max-Cache-Time AVP value. 3438 It is possible that multiple redirect indications can create multiple 3439 cached route entries differing only in their redirect usage and the 3440 peer to forward messages to. As an example, two(2) route entries 3441 that are created by two(2) redirect indications results in two(2) 3442 cached routes for the same realm and Application Id. However, one 3443 has a redirect usage of ALL_SESSION where matching request will be 3444 forwarded to one peer and the other has a redirect usage of ALL_REALM 3445 where request are forwarded to another peer. Therefore, an incoming 3446 request that matches the realm and Application Id of both routes will 3447 need additional resolution. In such a case, a routing precedence 3448 rule MUST be used against the redirect usage value to resolve the 3449 contention. The precedence rule can be found in Section 6.13. 3451 6.1.9. Relaying and Proxying Requests 3453 A relay or proxy agent MUST append a Route-Record AVP to all requests 3454 forwarded. The AVP contains the identity of the peer the request was 3455 received from. 3457 The Hop-by-Hop identifier in the request is saved, and replaced with 3458 a locally unique value. The source of the request is also saved, 3459 which includes the IP address, port and protocol. 3461 A relay or proxy agent MAY include the Proxy-Info AVP in requests if 3462 it requires access to any local state information when the 3463 corresponding response is received. The Proxy-Info AVP has security 3464 implications as state information is distribute to other entities. 3465 As such, it is RECOMMMENDED to protect the content of the Proxy-Info 3466 AVP with cryptographic mechanisms, for example by using a keyed 3467 message digest. Such a mechanism, however, requires the management 3468 of keys, although only locally at the Diameter server. Still, a full 3469 description of the management of the keys used to protect the Proxy- 3470 Info AVP is beyond the scope of this document. Below is a list of 3471 commonly recommended: 3473 o The keys should be generated securely following the randomness 3474 recommendations in [RFC4086]. 3476 o The keys and cryptographic protection algorithms should be at 3477 least 128 bits in strength. 3479 o The keys should not be used for any other purpose than generating 3480 and verifying tickets. 3482 o The keys should be changed regularly. 3484 o The keys should be changed if the ticket format or cryptographic 3485 protection algorithms change. 3487 The message is then forwarded to the next hop, as identified in the 3488 Routing Table. 3490 Figure 6 provides an example of message routing using the procedures 3491 listed in these sections. 3493 (Origin-Host=nas.mno.net) (Origin-Host=nas.mno.net) 3494 (Origin-Realm=mno.net) (Origin-Realm=mno.net) 3495 (Destination-Realm=example.com) (Destination- 3496 Realm=example.com) 3497 (Route-Record=nas.example.net) 3498 +------+ ------> +------+ ------> +------+ 3499 | | (Request) | | (Request) | | 3500 | NAS +-------------------+ DRL +-------------------+ HMS | 3501 | | | | | | 3502 +------+ <------ +------+ <------ +------+ 3503 example.net (Answer) example.net (Answer) example.com 3504 (Origin-Host=hms.example.com) (Origin-Host=hms.example.com) 3505 (Origin-Realm=example.com) (Origin-Realm=example.com) 3507 Figure 6: Routing of Diameter messages 3509 Relay and proxy agents are not required to perform full inspection of 3510 incoming messages. At a minimum, validation of the message header 3511 and relevant routing AVPs has to be done when relaying messages. 3512 Proxy agents may optionally perform more in-depth message validation 3513 for applications it is interested in. 3515 6.2. Diameter Answer Processing 3517 When a request is locally processed, the following procedures MUST be 3518 applied to create the associated answer, in addition to any 3519 additional procedures that MAY be discussed in the Diameter 3520 application defining the command: 3522 o The same Hop-by-Hop identifier in the request is used in the 3523 answer. 3525 o The local host's identity is encoded in the Origin-Host AVP. 3527 o The Destination-Host and Destination-Realm AVPs MUST NOT be 3528 present in the answer message. 3530 o The Result-Code AVP is added with its value indicating success or 3531 failure. 3533 o If the Session-Id is present in the request, it MUST be included 3534 in the answer. 3536 o Any Proxy-Info AVPs in the request MUST be added to the answer 3537 message, in the same order they were present in the request. 3539 o The 'P' bit is set to the same value as the one in the request. 3541 o The same End-to-End identifier in the request is used in the 3542 answer. 3544 Note that the error messages (see Section 7.3) are also subjected to 3545 the above processing rules. 3547 6.2.1. Processing received Answers 3549 A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an 3550 answer received against the list of pending requests. The 3551 corresponding message should be removed from the list of pending 3552 requests. It SHOULD ignore answers received that do not match a 3553 known Hop-by-Hop Identifier. 3555 6.2.2. Relaying and Proxying Answers 3557 If the answer is for a request which was proxied or relayed, the 3558 agent MUST restore the original value of the Diameter header's Hop- 3559 by-Hop Identifier field. 3561 If the last Proxy-Info AVP in the message is targeted to the local 3562 Diameter server, the AVP MUST be removed before the answer is 3563 forwarded. 3565 If a relay or proxy agent receives an answer with a Result-Code AVP 3566 indicating a failure, it MUST NOT modify the contents of the AVP. 3567 Any additional local errors detected SHOULD be logged, but not 3568 reflected in the Result-Code AVP. If the agent receives an answer 3569 message with a Result-Code AVP indicating success, and it wishes to 3570 modify the AVP to indicate an error, it MUST modify the Result-Code 3571 AVP to contain the appropriate error in the message destined towards 3572 the access device as well as include the Error-Reporting-Host AVP and 3573 it MUST issue an STR on behalf of the access device towards the 3574 Diameter server. 3576 The agent MUST then send the answer to the host that it received the 3577 original request from. 3579 6.3. Origin-Host AVP 3581 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and 3582 MUST be present in all Diameter messages. This AVP identifies the 3583 endpoint that originated the Diameter message. Relay agents MUST NOT 3584 modify this AVP. 3586 The value of the Origin-Host AVP is guaranteed to be unique within a 3587 single host. 3589 Note that the Origin-Host AVP may resolve to more than one address as 3590 the Diameter peer may support more than one address. 3592 This AVP SHOULD be placed as close to the Diameter header as 3593 possible. 3595 6.4. Origin-Realm AVP 3597 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity. 3598 This AVP contains the Realm of the originator of any Diameter message 3599 and MUST be present in all messages. 3601 This AVP SHOULD be placed as close to the Diameter header as 3602 possible. 3604 6.5. Destination-Host AVP 3606 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. 3607 This AVP MUST be present in all unsolicited agent initiated messages, 3608 MAY be present in request messages, and MUST NOT be present in Answer 3609 messages. 3611 The absence of the Destination-Host AVP will cause a message to be 3612 sent to any Diameter server supporting the application within the 3613 realm specified in Destination-Realm AVP. 3615 This AVP SHOULD be placed as close to the Diameter header as 3616 possible. 3618 6.6. Destination-Realm AVP 3620 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity, 3621 and contains the realm the message is to be routed to. The 3622 Destination-Realm AVP MUST NOT be present in Answer messages. 3623 Diameter Clients insert the realm portion of the User-Name AVP. 3624 Diameter servers initiating a request message use the value of the 3625 Origin-Realm AVP from a previous message received from the intended 3626 target host (unless it is known a priori). When present, the 3627 Destination-Realm AVP is used to perform message routing decisions. 3629 An ABNF for a request message that includes the Destination-Realm AVP 3630 SHOULD list the Destination-Realm AVP as a required AVP (an AVP 3631 indicated as {AVP}) otherwise the message is inherently a non- 3632 routable messages. 3634 This AVP SHOULD be placed as close to the Diameter header as 3635 possible. 3637 6.7. Routing AVPs 3639 The AVPs defined in this section are Diameter AVPs used for routing 3640 purposes. These AVPs change as Diameter messages are processed by 3641 agents. 3643 6.7.1. Route-Record AVP 3645 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The 3646 identity added in this AVP MUST be the same as the one received in 3647 the Origin-Host of the Capabilities Exchange message. 3649 6.7.2. Proxy-Info AVP 3651 The Proxy-Info AVP (AVP Code 284) is of type Grouped. This AVP 3652 contains the identity and local state information of Diameter node 3653 that creates and adds it to a message. The Grouped Data field has 3654 the following ABNF grammar: 3656 Proxy-Info ::= < AVP Header: 284 > 3657 { Proxy-Host } 3658 { Proxy-State } 3660 * [ AVP ] 3662 6.7.3. Proxy-Host AVP 3664 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This 3665 AVP contains the identity of the host that added the Proxy-Info AVP. 3667 6.7.4. Proxy-State AVP 3669 The Proxy-State AVP (AVP Code 33) is of type OctetString. It 3670 contains state information that would otherwise be stored at the 3671 Diameter entity that created it. As such, this AVP MUST be treated 3672 as opaque data by entities other Diameter entities. 3674 6.8. Auth-Application-Id AVP 3676 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and 3677 is used in order to advertise support of the Authentication and 3678 Authorization portion of an application (see Section 2.4). If 3679 present in a message other than CER and CEA, the value of the Auth- 3680 Application-Id AVP MUST match the Application Id present in the 3681 Diameter message header. 3683 6.9. Acct-Application-Id AVP 3685 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and 3686 is used in order to advertise support of the Accounting portion of an 3687 application (see Section 2.4). If present in a message other than 3688 CER and CEA, the value of the Acct-Application-Id AVP MUST match the 3689 Application Id present in the Diameter message header. 3691 6.10. Inband-Security-Id AVP 3693 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and 3694 is used in order to advertise support of the security portion of the 3695 application. The use of this AVP in CER and CEA messages is no 3696 longer recommended. Instead, discovery of a Diameter entities 3697 security capabilities can be done either through static configuration 3698 or via Diameter Peer Discovery described in Section 5.2. 3700 The following values are supported: 3702 NO_INBAND_SECURITY 0 3704 This peer does not support TLS. This is the default value, if the 3705 AVP is omitted. 3707 TLS 1 3709 This node supports TLS security, as defined by [RFC5246]. 3711 6.11. Vendor-Specific-Application-Id AVP 3713 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type 3714 Grouped and is used to advertise support of a vendor-specific 3715 Diameter Application. Exactly one instance of either Auth- 3716 Application-Id or Acct-Application-Id AVP MUST be present. The 3717 Application Id carried by either Auth-Application-Id or Acct- 3718 Application-Id AVP MUST comply with vendor specific Application Id 3719 assignment described in Sec 11.3. It MUST also match the Application 3720 Id present in the Diameter header except when used in a CER or CEA 3721 messages. 3723 The Vendor-Id AVP is an informational AVP pertaining to the vendor 3724 who may have authorship of the vendor-specific Diameter application. 3725 It MUST NOT be used as a means of defining a completely separate 3726 vendor-specific Application Id space. 3728 The Vendor-Specific-Application-Id AVP SHOULD be placed as close to 3729 the Diameter header as possible. 3731 AVP Format 3733 ::= < AVP Header: 260 > 3734 { Vendor-Id } 3735 [ Auth-Application-Id ] 3736 [ Acct-Application-Id ] 3738 A Vendor-Specific-Application-Id AVP MUST contain exactly one of 3739 either Auth-Application-Id or Acct-Application-Id. If a Vendor- 3740 Specific-Application-Id is received without any of these two AVPs, 3741 then the recipient SHOULD issue an answer with a Result-Code set to 3742 DIAMETER_MISSING_AVP. The answer SHOULD also include a Failed-AVP 3743 which MUST contain an example of an Auth-Application-Id AVP and an 3744 Acct-Application-Id AVP. 3746 If a Vendor-Specific-Application-Id is received that contains both 3747 Auth-Application-Id and Acct-Application-Id, then the recipient MUST 3748 issue an answer with Result-Code set to 3749 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. The answer MUST also include a 3750 Failed-AVP which MUST contain the received Auth-Application-Id AVP 3751 and Acct-Application-Id AVP. 3753 6.12. Redirect-Host AVP 3755 The Redirect-Host AVP (AVP Code 292) is of type DiameterURI. One or 3756 more of instances of this AVP MUST be present if the answer message's 3757 'E' bit is set and the Result-Code AVP is set to 3758 DIAMETER_REDIRECT_INDICATION. 3760 Upon receiving the above, the receiving Diameter node SHOULD forward 3761 the request directly to one of the hosts identified in these AVPs. 3762 The server contained in the selected Redirect-Host AVP SHOULD be used 3763 for all messages matching the criteria set by the Redirect-Host-Usage 3764 AVP. 3766 6.13. Redirect-Host-Usage AVP 3768 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated. 3769 This AVP MAY be present in answer messages whose 'E' bit is set and 3770 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION. 3772 When present, this AVP provides a hints about how the routing entry 3773 resulting from the Redirect-Host is to be used. The following values 3774 are supported: 3776 DONT_CACHE 0 3778 The host specified in the Redirect-Host AVP SHOULD NOT be cached. 3779 This is the default value. 3781 ALL_SESSION 1 3783 All messages within the same session, as defined by the same value 3784 of the Session-ID AVP SHOULD be sent to the host specified in the 3785 Redirect-Host AVP. 3787 ALL_REALM 2 3789 All messages destined for the realm requested SHOULD be sent to 3790 the host specified in the Redirect-Host AVP. 3792 REALM_AND_APPLICATION 3 3794 All messages for the application requested to the realm specified 3795 SHOULD be sent to the host specified in the Redirect-Host AVP. 3797 ALL_APPLICATION 4 3799 All messages for the application requested SHOULD be sent to the 3800 host specified in the Redirect-Host AVP. 3802 ALL_HOST 5 3804 All messages that would be sent to the host that generated the 3805 Redirect-Host SHOULD be sent to the host specified in the 3806 Redirect- Host AVP. 3808 ALL_USER 6 3810 All messages for the user requested SHOULD be sent to the host 3811 specified in the Redirect-Host AVP. 3813 When multiple cached routes are created by redirect indications and 3814 they differ only in redirect usage and peers to forward requests to 3815 (see Section 6.1.8), a precedence rule MUST be applied to the 3816 redirect usage values of the cached routes during normal routing to 3817 resolve contentions that may occur. The precedence rule is the order 3818 that dictate which redirect usage should be considered before any 3819 other as they appear. The order is as follows: 3821 1. ALL_SESSION 3823 2. ALL_USER 3825 3. REALM_AND_APPLICATION 3827 4. ALL_REALM 3829 5. ALL_APPLICATION 3831 6. ALL_HOST 3833 6.14. Redirect-Max-Cache-Time AVP 3835 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. 3836 This AVP MUST be present in answer messages whose 'E' bit is set, the 3837 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the 3838 Redirect-Host-Usage AVP set to a non-zero value. 3840 This AVP contains the maximum number of seconds the peer and route 3841 table entries, created as a result of the Redirect-Host, SHOULD be 3842 cached. Note that once a host is no longer reachable, any associated 3843 cache, peer and routing table entries MUST be deleted. 3845 7. Error Handling 3847 There are two different types of errors in Diameter; protocol and 3848 application errors. A protocol error is one that occurs at the base 3849 protocol level, and MAY require per hop attention (e.g., message 3850 routing error). Application errors, on the other hand, generally 3851 occur due to a problem with a function specified in a Diameter 3852 application (e.g., user authentication, missing AVP). 3854 Result-Code AVP values that are used to report protocol errors MUST 3855 only be present in answer messages whose 'E' bit is set. When a 3856 request message is received that causes a protocol error, an answer 3857 message is returned with the 'E' bit set, and the Result-Code AVP is 3858 set to the appropriate protocol error value. As the answer is sent 3859 back towards the originator of the request, each proxy or relay agent 3860 MAY take action on the message. 3862 1. Request +---------+ Link Broken 3863 +-------------------------->|Diameter |----///----+ 3864 | +---------------------| | v 3865 +------+--+ | 2. answer + 'E' set | Relay 2 | +--------+ 3866 |Diameter |<-+ (Unable to Forward) +---------+ |Diameter| 3867 | | | Home | 3868 | Relay 1 |--+ +---------+ | Server | 3869 +---------+ | 3. Request |Diameter | +--------+ 3870 +-------------------->| | ^ 3871 | Relay 3 |-----------+ 3872 +---------+ 3874 Figure 7: Example of Protocol Error causing answer message 3876 Figure 7 provides an example of a message forwarded upstream by a 3877 Diameter relay. When the message is received by Relay 2, and it 3878 detects that it cannot forward the request to the home server, an 3879 answer message is returned with the 'E' bit set and the Result-Code 3880 AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls 3881 within the protocol error category, Relay 1 would take special 3882 action, and given the error, attempt to route the message through its 3883 alternate Relay 3. 3885 +---------+ 1. Request +---------+ 2. Request +---------+ 3886 | Access |------------>|Diameter |------------>|Diameter | 3887 | | | | | Home | 3888 | Device |<------------| Relay |<------------| Server | 3889 +---------+ 4. Answer +---------+ 3. Answer +---------+ 3890 (Missing AVP) (Missing AVP) 3892 Figure 8: Example of Application Error Answer message 3894 Figure 8 provides an example of a Diameter message that caused an 3895 application error. When application errors occur, the Diameter 3896 entity reporting the error clears the 'R' bit in the Command Flags, 3897 and adds the Result-Code AVP with the proper value. Application 3898 errors do not require any proxy or relay agent involvement, and 3899 therefore the message would be forwarded back to the originator of 3900 the request. 3902 In the case where the answer message itself contains errors, any 3903 related session SHOULD be terminated by sending an STR or ASR 3904 message. The Termination-Cause AVP in the STR MAY be filled with the 3905 appropriate value to indicate the cause of the error. An application 3906 MAY also send an application-specific request instead of STR or ASR 3907 to signal the error in the case where no state is maintained or to 3908 allow for some form of error recovery with the corresponding Diameter 3909 entity. 3911 There are certain Result-Code AVP application errors that require 3912 additional AVPs to be present in the answer. In these cases, the 3913 Diameter node that sets the Result-Code AVP to indicate the error 3914 MUST add the AVPs. Examples are: 3916 o A request with an unrecognized AVP is received with the 'M' bit 3917 (Mandatory bit) set, causes an answer to be sent with the Result- 3918 Code AVP set to DIAMETER_AVP_UNSUPPORTED, and the Failed-AVP AVP 3919 containing the offending AVP. 3921 o A request with an AVP that is received with an unrecognized value 3922 causes an answer to be returned with the Result-Code AVP set to 3923 DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the 3924 AVP causing the error. 3926 o A command is received that is missing AVP(s) that are defined as 3927 required in the commands ABNF; examples are AVPs indicated as 3928 {AVP}. The receiver issues an answer with the Result-Code set to 3929 DIAMETER_MISSING_AVP, and creates an AVP with the AVP Code and 3930 other fields set as expected in the missing AVP. The created AVP 3931 is then added to the Failed- AVP AVP. 3933 The Result-Code AVP describes the error that the Diameter node 3934 encountered in its processing. In case there are multiple errors, 3935 the Diameter node MUST report only the first error it encountered 3936 (detected possibly in some implementation dependent order). The 3937 specific errors that can be described by this AVP are described in 3938 the following section. 3940 7.1. Result-Code AVP 3942 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and 3943 indicates whether a particular request was completed successfully or 3944 whether an error occurred. All Diameter answer messages in IETF 3945 defined Diameter application specification MUST include one Result- 3946 Code AVP. A non-successful Result-Code AVP (one containing a non 3947 2xxx value other than DIAMETER_REDIRECT_INDICATION) MUST include the 3948 Error-Reporting-Host AVP if the host setting the Result-Code AVP is 3949 different from the identity encoded in the Origin-Host AVP. 3951 The Result-Code data field contains an IANA-managed 32-bit address 3952 space representing errors (see Section 11.4). Diameter provides the 3953 following classes of errors, all identified by the thousands digit in 3954 the decimal notation: 3956 o 1xxx (Informational) 3958 o 2xxx (Success) 3960 o 3xxx (Protocol Errors) 3962 o 4xxx (Transient Failures) 3964 o 5xxx (Permanent Failure) 3966 A non-recognized class (one whose first digit is not defined in this 3967 section) MUST be handled as a permanent failure. 3969 7.1.1. Informational 3971 Errors that fall within this category are used to inform the 3972 requester that a request could not be satisfied, and additional 3973 action is required on its part before access is granted. 3975 DIAMETER_MULTI_ROUND_AUTH 1001 3977 This informational error is returned by a Diameter server to 3978 inform the access device that the authentication mechanism being 3979 used requires multiple round trips, and a subsequent request needs 3980 to be issued in order for access to be granted. 3982 7.1.2. Success 3984 Errors that fall within the Success category are used to inform a 3985 peer that a request has been successfully completed. 3987 DIAMETER_SUCCESS 2001 3989 The request was successfully completed. 3991 DIAMETER_LIMITED_SUCCESS 2002 3993 When returned, the request was successfully completed, but 3994 additional processing is required by the application in order to 3995 provide service to the user. 3997 7.1.3. Protocol Errors 3999 Errors that fall within the Protocol Error category SHOULD be treated 4000 on a per-hop basis, and Diameter proxies MAY attempt to correct the 4001 error, if it is possible. Note that these errors MUST only be used 4002 in answer messages whose 'E' bit is set. This document omits some 4003 error codes defined in [RFC3588]. To provide backward compatibility 4004 with [RFC3588] implementations these error code values are not re- 4005 used and hence the error codes values enumerated below are non- 4006 sequential. 4008 DIAMETER_UNABLE_TO_DELIVER 3002 4010 This error is given when Diameter can not deliver the message to 4011 the destination, either because no host within the realm 4012 supporting the required application was available to process the 4013 request, or because Destination-Host AVP was given without the 4014 associated Destination-Realm AVP. 4016 DIAMETER_REALM_NOT_SERVED 3003 4018 The intended realm of the request is not recognized. 4020 DIAMETER_TOO_BUSY 3004 4022 When returned, a Diameter node SHOULD attempt to send the message 4023 to an alternate peer. This error MUST only be used when a 4024 specific server is requested, and it cannot provide the requested 4025 service. 4027 DIAMETER_LOOP_DETECTED 3005 4029 An agent detected a loop while trying to get the message to the 4030 intended recipient. The message MAY be sent to an alternate peer, 4031 if one is available, but the peer reporting the error has 4032 identified a configuration problem. 4034 DIAMETER_REDIRECT_INDICATION 3006 4036 A redirect agent has determined that the request could not be 4037 satisfied locally and the initiator of the request SHOULD direct 4038 the request directly to the server, whose contact information has 4039 been added to the response. When set, the Redirect-Host AVP MUST 4040 be present. 4042 DIAMETER_APPLICATION_UNSUPPORTED 3007 4044 A request was sent for an application that is not supported. 4046 DIAMETER_INVALID_BIT_IN_HEADER 3011 4048 This error is returned when a reserved bit in the Diameter header 4049 is set to one (1) or the bits in the Diameter header defined in 4050 Section 3 are set incorrectly. 4052 DIAMETER_INVALID_MESSAGE_LENGTH 3012 4054 This error is returned when a request is received with an invalid 4055 message length. 4057 7.1.4. Transient Failures 4059 Errors that fall within the transient failures category are used to 4060 inform a peer that the request could not be satisfied at the time it 4061 was received, but MAY be able to satisfy the request in the future. 4062 Note that these errors MUST be used in answer messages whose 'E' bit 4063 is not set. 4065 DIAMETER_AUTHENTICATION_REJECTED 4001 4067 The authentication process for the user failed, most likely due to 4068 an invalid password used by the user. Further attempts MUST only 4069 be tried after prompting the user for a new password. 4071 DIAMETER_OUT_OF_SPACE 4002 4073 A Diameter node received the accounting request but was unable to 4074 commit it to stable storage due to a temporary lack of space. 4076 ELECTION_LOST 4003 4078 The peer has determined that it has lost the election process and 4079 has therefore disconnected the transport connection. 4081 7.1.5. Permanent Failures 4083 Errors that fall within the permanent failures category are used to 4084 inform the peer that the request failed, and should not be attempted 4085 again. Note that these errors SHOULD be used in answer messages 4086 whose 'E' bit is not set. In error conditions where it is not 4087 possible or efficient to compose application-specific answer grammar 4088 then answer messages with E-bit set and complying to the grammar 4089 described in 7.2 MAY also be used for permanent errors. 4091 To provide backward compatibility with existing implementations that 4092 follow [RFC3588], some of the error values that have previously been 4093 used in this category by [RFC3588] will not be re-used. Therefore 4094 the error values enumerated here maybe non-sequential. 4096 DIAMETER_AVP_UNSUPPORTED 5001 4098 The peer received a message that contained an AVP that is not 4099 recognized or supported and was marked with the Mandatory bit. A 4100 Diameter message with this error MUST contain one or more Failed- 4101 AVP AVP containing the AVPs that caused the failure. 4103 DIAMETER_UNKNOWN_SESSION_ID 5002 4105 The request contained an unknown Session-Id. 4107 DIAMETER_AUTHORIZATION_REJECTED 5003 4109 A request was received for which the user could not be authorized. 4110 This error could occur if the service requested is not permitted 4111 to the user. 4113 DIAMETER_INVALID_AVP_VALUE 5004 4115 The request contained an AVP with an invalid value in its data 4116 portion. A Diameter message indicating this error MUST include 4117 the offending AVPs within a Failed-AVP AVP. 4119 DIAMETER_MISSING_AVP 5005 4121 The request did not contain an AVP that is required by the Command 4122 Code definition. If this value is sent in the Result-Code AVP, a 4123 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP 4124 AVP MUST contain an example of the missing AVP complete with the 4125 Vendor-Id if applicable. The value field of the missing AVP 4126 should be of correct minimum length and contain zeroes. 4128 DIAMETER_RESOURCES_EXCEEDED 5006 4130 A request was received that cannot be authorized because the user 4131 has already expended allowed resources. An example of this error 4132 condition is a user that is restricted to one dial-up PPP port, 4133 attempts to establish a second PPP connection. 4135 DIAMETER_CONTRADICTING_AVPS 5007 4137 The Home Diameter server has detected AVPs in the request that 4138 contradicted each other, and is not willing to provide service to 4139 the user. The Failed-AVP AVPs MUST be present which contains the 4140 AVPs that contradicted each other. 4142 DIAMETER_AVP_NOT_ALLOWED 5008 4144 A message was received with an AVP that MUST NOT be present. The 4145 Failed-AVP AVP MUST be included and contain a copy of the 4146 offending AVP. 4148 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009 4150 A message was received that included an AVP that appeared more 4151 often than permitted in the message definition. The Failed-AVP 4152 AVP MUST be included and contain a copy of the first instance of 4153 the offending AVP that exceeded the maximum number of occurrences 4155 DIAMETER_NO_COMMON_APPLICATION 5010 4157 This error is returned by a Diameter node that receives a CER 4158 whereby no applications are common between the CER sending peer 4159 and the CER receiving peer. 4161 DIAMETER_UNSUPPORTED_VERSION 5011 4163 This error is returned when a request was received, whose version 4164 number is unsupported. 4166 DIAMETER_UNABLE_TO_COMPLY 5012 4168 This error is returned when a request is rejected for unspecified 4169 reasons. 4171 DIAMETER_INVALID_AVP_LENGTH 5014 4173 The request contained an AVP with an invalid length. A Diameter 4174 message indicating this error MUST include the offending AVPs 4175 within a Failed-AVP AVP. In cases where the erroneous avp length 4176 value exceeds the message length or is less than the minimum AVP 4177 header length, it is sufficient to include the offending AVP 4178 header and a zero filled payload of the minimum required length 4179 for the payloads data type. If the AVP is a grouped AVP, the 4180 grouped AVP header with an empty payload would be sufficient to 4181 indicate the offending AVP. In the case where the offending AVP 4182 header cannot be fully decoded when the AVP length is less than 4183 the minimum AVP header length, it is sufficient to include an 4184 offending AVP header that is formulated by padding the incomplete 4185 AVP header with zero up to the minimum AVP header length. 4187 DIAMETER_NO_COMMON_SECURITY 5017 4189 This error is returned when a CER message is received, and there 4190 are no common security mechanisms supported between the peers. A 4191 Capabilities-Exchange-Answer (CEA) MUST be returned with the 4192 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY. 4194 DIAMETER_UNKNOWN_PEER 5018 4196 A CER was received from an unknown peer. 4198 DIAMETER_COMMAND_UNSUPPORTED 5019 4200 This error code is used when a Diameter entity receives a message 4201 with a Command Code that it does not support. 4203 DIAMETER_INVALID_HDR_BITS 5020 4205 A request was received whose bits in the Diameter header were 4206 either set to an invalid combination, or to a value that is 4207 inconsistent with the command code's definition. 4209 DIAMETER_INVALID_AVP_BITS 5021 4211 A request was received that included an AVP whose flag bits are 4212 set to an unrecognized value, or that is inconsistent with the 4213 AVP's definition. 4215 7.2. Error Bit 4217 The 'E' (Error Bit) in the Diameter header is set when the request 4218 caused a protocol-related error (see Section 7.1.3). A message with 4219 the 'E' bit MUST NOT be sent as a response to an answer message. 4220 Note that a message with the 'E' bit set is still subjected to the 4221 processing rules defined in Section 6.2. When set, the answer 4222 message will not conform to the ABNF specification for the command, 4223 and will instead conform to the following ABNF: 4225 Message Format 4227 ::= < Diameter Header: code, ERR [PXY] > 4228 0*1< Session-Id > 4229 { Origin-Host } 4230 { Origin-Realm } 4231 { Result-Code } 4232 [ Origin-State-Id ] 4233 [ Error-Message ] 4234 [ Error-Reporting-Host ] 4235 [ Failed-AVP ] 4236 [ Experimental-Result ] 4237 * [ Proxy-Info ] 4238 * [ AVP ] 4240 Note that the code used in the header is the same than the one found 4241 in the request message, but with the 'R' bit cleared and the 'E' bit 4242 set. The 'P' bit in the header is set to the same value as the one 4243 found in the request message. 4245 7.3. Error-Message AVP 4247 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY 4248 accompany a Result-Code AVP as a human readable error message. The 4249 Error-Message AVP is not intended to be useful in an environment 4250 where error messages are processed automatically. It SHOULD NOT be 4251 expected that the content of this AVP is parsed by network entities. 4253 7.4. Error-Reporting-Host AVP 4255 The Error-Reporting-Host AVP (AVP Code 294) is of type 4256 DiameterIdentity. This AVP contains the identity of the Diameter 4257 host that sent the Result-Code AVP to a value other than 2001 4258 (Success), only if the host setting the Result-Code is different from 4259 the one encoded in the Origin-Host AVP. This AVP is intended to be 4260 used for troubleshooting purposes, and MUST be set when the Result- 4261 Code AVP indicates a failure. 4263 7.5. Failed-AVP AVP 4265 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides 4266 debugging information in cases where a request is rejected or not 4267 fully processed due to erroneous information in a specific AVP. The 4268 value of the Result-Code AVP will provide information on the reason 4269 for the Failed-AVP AVP. A Diameter message SHOULD contain only one 4270 Failed-AVP that corresponds to the error indicated by the Result-Code 4271 AVP. For practical purposes, this Failed-AVP would typically refer 4272 to the first AVP processing error that a Diameter node encounters. 4274 The possible reasons for this AVP are the presence of an improperly 4275 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP 4276 value, the omission of a required AVP, the presence of an explicitly 4277 excluded AVP (see tables in Section 10), or the presence of two or 4278 more occurrences of an AVP which is restricted to 0, 1, or 0-1 4279 occurrences. 4281 A Diameter message SHOULD contain one Failed-AVP AVP, containing the 4282 entire AVP that could not be processed successfully. If the failure 4283 reason is omission of a required AVP, an AVP with the missing AVP 4284 code, the missing vendor id, and a zero filled payload of the minimum 4285 required length for the omitted AVP will be added. If the failure 4286 reason is an invalid AVP length where the reported length is less 4287 than the minimum AVP header length or greater than the reported 4288 message length, a copy of the offending AVP header and a zero filled 4289 payload of the minimum required length SHOULD be added. 4291 In the case where the offending AVP is embedded within a grouped AVP, 4292 the Failed-AVP MAY contain the grouped AVP which in turn contains the 4293 single offending AVP. The same method MAY be employed if the grouped 4294 AVP itself is embedded in yet another grouped AVP and so on. In this 4295 case, the Failed-AVP MAY contain the grouped AVP hierarchy up to the 4296 single offending AVP. This enables the recipient to detect the 4297 location of the offending AVP when embedded in a group. 4299 AVP Format 4301 ::= < AVP Header: 279 > 4302 1* {AVP} 4304 7.6. Experimental-Result AVP 4306 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and 4307 indicates whether a particular vendor-specific request was completed 4308 successfully or whether an error occurred. This AVP has the 4309 following structure: 4311 AVP Format 4313 Experimental-Result ::= < AVP Header: 297 > 4314 { Vendor-Id } 4315 { Experimental-Result-Code } 4317 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies 4318 the vendor responsible for the assignment of the result code which 4319 follows. All Diameter answer messages defined in vendor-specific 4320 applications MUST include either one Result-Code AVP or one 4321 Experimental-Result AVP. 4323 7.7. Experimental-Result-Code AVP 4325 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 4326 and contains a vendor-assigned value representing the result of 4327 processing the request. 4329 It is recommended that vendor-specific result codes follow the same 4330 conventions given for the Result-Code AVP regarding the different 4331 types of result codes and the handling of errors (for non 2xxx 4332 values). 4334 8. Diameter User Sessions 4336 In general, Diameter can provide two different types of services to 4337 applications. The first involves authentication and authorization, 4338 and can optionally make use of accounting. The second only makes use 4339 of accounting. 4341 When a service makes use of the authentication and/or authorization 4342 portion of an application, and a user requests access to the network, 4343 the Diameter client issues an auth request to its local server. The 4344 auth request is defined in a service-specific Diameter application 4345 (e.g., NASREQ). The request contains a Session-Id AVP, which is used 4346 in subsequent messages (e.g., subsequent authorization, accounting, 4347 etc) relating to the user's session. The Session-Id AVP is a means 4348 for the client and servers to correlate a Diameter message with a 4349 user session. 4351 When a Diameter server authorizes a user to use network resources for 4352 a finite amount of time, and it is willing to extend the 4353 authorization via a future request, it MUST add the Authorization- 4354 Lifetime AVP to the answer message. The Authorization-Lifetime AVP 4355 defines the maximum number of seconds a user MAY make use of the 4356 resources before another authorization request is expected by the 4357 server. The Auth-Grace-Period AVP contains the number of seconds 4358 following the expiration of the Authorization-Lifetime, after which 4359 the server will release all state information related to the user's 4360 session. Note that if payment for services is expected by the 4361 serving realm from the user's home realm, the Authorization-Lifetime 4362 AVP, combined with the Auth-Grace-Period AVP, implies the maximum 4363 length of the session the home realm is willing to be fiscally 4364 responsible for. Services provided past the expiration of the 4365 Authorization-Lifetime and Auth-Grace-Period AVPs are the 4366 responsibility of the access device. Of course, the actual cost of 4367 services rendered is clearly outside the scope of the protocol. 4369 An access device that does not expect to send a re-authorization or a 4370 session termination request to the server MAY include the Auth- 4371 Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint 4372 to the server. If the server accepts the hint, it agrees that since 4373 no session termination message will be received once service to the 4374 user is terminated, it cannot maintain state for the session. If the 4375 answer message from the server contains a different value in the 4376 Auth-Session-State AVP (or the default value if the AVP is absent), 4377 the access device MUST follow the server's directives. Note that the 4378 value NO_STATE_MAINTAINED MUST NOT be set in subsequent re- 4379 authorization requests and answers. 4381 The base protocol does not include any authorization request 4382 messages, since these are largely application-specific and are 4383 defined in a Diameter application document. However, the base 4384 protocol does define a set of messages that are used to terminate 4385 user sessions. These are used to allow servers that maintain state 4386 information to free resources. 4388 When a service only makes use of the Accounting portion of the 4389 Diameter protocol, even in combination with an application, the 4390 Session-Id is still used to identify user sessions. However, the 4391 session termination messages are not used, since a session is 4392 signaled as being terminated by issuing an accounting stop message. 4394 Diameter may also be used for services that cannot be easily 4395 categorized as authentication, authorization or accounting (e.g., 4396 certain 3GPP IMS interfaces). In such cases, the finite state 4397 machine defined in subsequent sections may not be applicable. 4398 Therefore, the applications itself MAY need to define its own finite 4399 state machine. However, such application-specific state machines 4400 SHOULD follow the general state machine framework outlined in this 4401 document such as the use of Session-Id AVPs and the use of STR/STA, 4402 ASR/ASA messages for stateful sessions. 4404 8.1. Authorization Session State Machine 4406 This section contains a set of finite state machines, representing 4407 the life cycle of Diameter sessions, and which MUST be observed by 4408 all Diameter implementations that make use of the authentication 4409 and/or authorization portion of a Diameter application. The term 4410 Service-Specific below refers to a message defined in a Diameter 4411 application (e.g., Mobile IPv4, NASREQ). 4413 There are four different authorization session state machines 4414 supported in the Diameter base protocol. The first two describe a 4415 session in which the server is maintaining session state, indicated 4416 by the value of the Auth-Session-State AVP (or its absence). One 4417 describes the session from a client perspective, the other from a 4418 server perspective. The second two state machines are used when the 4419 server does not maintain session state. Here again, one describes 4420 the session from a client perspective, the other from a server 4421 perspective. 4423 When a session is moved to the Idle state, any resources that were 4424 allocated for the particular session must be released. Any event not 4425 listed in the state machines MUST be considered as an error 4426 condition, and an answer, if applicable, MUST be returned to the 4427 originator of the message. 4429 In the case that an application does not support re-auth, the state 4430 transitions related to server-initiated re-auth when both client and 4431 server sessions maintains state (e.g., Send RAR, Pending, Receive 4432 RAA) MAY be ignored. 4434 In the state table, the event 'Failure to send X' means that the 4435 Diameter agent is unable to send command X to the desired 4436 destination. This could be due to the peer being down, or due to the 4437 peer sending back a transient failure or temporary protocol error 4438 notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the 4439 Result-Code AVP of the corresponding Answer command. The event 'X 4440 successfully sent' is the complement of 'Failure to send X'. 4442 The following state machine is observed by a client when state is 4443 maintained on the server: 4445 CLIENT, STATEFUL 4446 State Event Action New State 4447 ------------------------------------------------------------- 4448 Idle Client or Device Requests Send Pending 4449 access service 4450 specific 4451 auth req 4453 Idle ASR Received Send ASA Idle 4454 for unknown session with 4455 Result-Code 4456 = UNKNOWN_ 4457 SESSION_ID 4459 Idle RAR Received Send RAA Idle 4460 for unknown session with 4461 Result-Code 4462 = UNKNOWN_ 4463 SESSION_ID 4465 Pending Successful Service-specific Grant Open 4466 authorization answer Access 4467 received with default 4468 Auth-Session-State value 4470 Pending Successful Service-specific Sent STR Discon 4471 authorization answer received 4472 but service not provided 4474 Pending Error processing successful Sent STR Discon 4475 Service-specific authorization 4476 answer 4478 Pending Failed Service-specific Cleanup Idle 4479 authorization answer received 4481 Open User or client device Send Open 4482 requests access to service service 4483 specific 4484 auth req 4486 Open Successful Service-specific Provide Open 4487 authorization answer received Service 4489 Open Failed Service-specific Discon. Idle 4490 authorization answer user/device 4491 received. 4493 Open RAR received and client will Send RAA Open 4494 perform subsequent re-auth with 4495 Result-Code 4496 = SUCCESS 4498 Open RAR received and client will Send RAA Idle 4499 not perform subsequent with 4500 re-auth Result-Code 4501 != SUCCESS, 4502 Discon. 4503 user/device 4505 Open Session-Timeout Expires on Send STR Discon 4506 Access Device 4508 Open ASR Received, Send ASA Discon 4509 client will comply with with 4510 request to end the session Result-Code 4511 = SUCCESS, 4512 Send STR. 4514 Open ASR Received, Send ASA Open 4515 client will not comply with with 4516 request to end the session Result-Code 4517 != SUCCESS 4519 Open Authorization-Lifetime + Send STR Discon 4520 Auth-Grace-Period expires on 4521 access device 4523 Discon ASR Received Send ASA Discon 4525 Discon STA Received Discon. Idle 4526 user/device 4528 The following state machine is observed by a server when it is 4529 maintaining state for the session: 4531 SERVER, STATEFUL 4532 State Event Action New State 4533 ------------------------------------------------------------- 4534 Idle Service-specific authorization Send Open 4535 request received, and successful 4536 user is authorized serv. 4537 specific 4538 answer 4540 Idle Service-specific authorization Send Idle 4541 request received, and failed serv. 4542 user is not authorized specific 4543 answer 4545 Open Service-specific authorization Send Open 4546 request received, and user successful 4547 is authorized serv. specific 4548 answer 4550 Open Service-specific authorization Send Idle 4551 request received, and user failed serv. 4552 is not authorized specific 4553 answer, 4554 Cleanup 4556 Open Home server wants to confirm Send RAR Pending 4557 authentication and/or 4558 authorization of the user 4560 Pending Received RAA with a failed Cleanup Idle 4561 Result-Code 4563 Pending Received RAA with Result-Code Update Open 4564 = SUCCESS session 4566 Open Home server wants to Send ASR Discon 4567 terminate the service 4569 Open Authorization-Lifetime (and Cleanup Idle 4570 Auth-Grace-Period) expires 4571 on home server. 4573 Open Session-Timeout expires on Cleanup Idle 4574 home server 4576 Discon Failure to send ASR Wait, Discon 4577 resend ASR 4579 Discon ASR successfully sent and Cleanup Idle 4580 ASA Received with Result-Code 4582 Not ASA Received None No Change. 4583 Discon 4585 Any STR Received Send STA, Idle 4586 Cleanup. 4588 The following state machine is observed by a client when state is not 4589 maintained on the server: 4591 CLIENT, STATELESS 4592 State Event Action New State 4593 ------------------------------------------------------------- 4594 Idle Client or Device Requests Send Pending 4595 access service 4596 specific 4597 auth req 4599 Pending Successful Service-specific Grant Open 4600 authorization answer Access 4601 received with Auth-Session- 4602 State set to 4603 NO_STATE_MAINTAINED 4605 Pending Failed Service-specific Cleanup Idle 4606 authorization answer 4607 received 4609 Open Session-Timeout Expires on Discon. Idle 4610 Access Device user/device 4612 Open Service to user is terminated Discon. Idle 4613 user/device 4615 The following state machine is observed by a server when it is not 4616 maintaining state for the session: 4618 SERVER, STATELESS 4619 State Event Action New State 4620 ------------------------------------------------------------- 4621 Idle Service-specific authorization Send serv. Idle 4622 request received, and specific 4623 successfully processed answer 4625 8.2. Accounting Session State Machine 4627 The following state machines MUST be supported for applications that 4628 have an accounting portion or that require only accounting services. 4629 The first state machine is to be observed by clients. 4631 See Section 9.7 for Accounting Command Codes and Section 9.8 for 4632 Accounting AVPs. 4634 The server side in the accounting state machine depends in some cases 4635 on the particular application. The Diameter base protocol defines a 4636 default state machine that MUST be followed by all applications that 4637 have not specified other state machines. This is the second state 4638 machine in this section described below. 4640 The default server side state machine requires the reception of 4641 accounting records in any order and at any time, and does not place 4642 any standards requirement on the processing of these records. 4643 Implementations of Diameter may perform checking, ordering, 4644 correlation, fraud detection, and other tasks based on these records. 4645 AVPs may need to be inspected as a part of these tasks. The tasks 4646 can happen either immediately after record reception or in a post- 4647 processing phase. However, as these tasks are typically application 4648 or even policy dependent, they are not standardized by the Diameter 4649 specifications. Applications MAY define requirements on when to 4650 accept accounting records based on the used value of Accounting- 4651 Realtime-Required AVP, credit limits checks, and so on. 4653 However, the Diameter base protocol defines one optional server side 4654 state machine that MAY be followed by applications that require 4655 keeping track of the session state at the accounting server. Note 4656 that such tracking is incompatible with the ability to sustain long 4657 duration connectivity problems. Therefore, the use of this state 4658 machine is recommended only in applications where the value of the 4659 Accounting-Realtime-Required AVP is DELIVER_AND_GRANT, and hence 4660 accounting connectivity problems are required to cause the serviced 4661 user to be disconnected. Otherwise, records produced by the client 4662 may be lost by the server which no longer accepts them after the 4663 connectivity is re-established. This state machine is the third 4664 state machine in this section. The state machine is supervised by a 4665 supervision session timer Ts, which the value should be reasonably 4666 higher than the Acct_Interim_Interval value. Ts MAY be set to two 4667 times the value of the Acct_Interim_Interval so as to avoid the 4668 accounting session in the Diameter server to change to Idle state in 4669 case of short transient network failure. 4671 Any event not listed in the state machines MUST be considered as an 4672 error condition, and a corresponding answer, if applicable, MUST be 4673 returned to the originator of the message. 4675 In the state table, the event 'Failure to send' means that the 4676 Diameter client is unable to communicate with the desired 4677 destination. This could be due to the peer being down, or due to the 4678 peer sending back a transient failure or temporary protocol error 4679 notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or 4680 DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting 4681 Answer command. 4683 The event 'Failed answer' means that the Diameter client received a 4684 non-transient failure notification in the Accounting Answer command. 4686 Note that the action 'Disconnect user/dev' MUST have an effect also 4687 to the authorization session state table, e.g., cause the STR message 4688 to be sent, if the given application has both authentication/ 4689 authorization and accounting portions. 4691 The states PendingS, PendingI, PendingL, PendingE and PendingB stand 4692 for pending states to wait for an answer to an accounting request 4693 related to a Start, Interim, Stop, Event or buffered record, 4694 respectively. 4696 CLIENT, ACCOUNTING 4697 State Event Action New State 4698 ------------------------------------------------------------- 4699 Idle Client or device requests Send PendingS 4700 access accounting 4701 start req. 4703 Idle Client or device requests Send PendingE 4704 a one-time service accounting 4705 event req 4707 Idle Records in storage Send PendingB 4708 record 4710 PendingS Successful accounting Open 4711 start answer received 4713 PendingS Failure to send and buffer Store Open 4714 space available and realtime Start 4715 not equal to DELIVER_AND_GRANT Record 4717 PendingS Failure to send and no buffer Open 4718 space available and realtime 4719 equal to GRANT_AND_LOSE 4721 PendingS Failure to send and no buffer Disconnect Idle 4722 space available and realtime user/dev 4723 not equal to 4724 GRANT_AND_LOSE 4726 PendingS Failed accounting start answer Open 4727 received and realtime equal 4728 to GRANT_AND_LOSE 4730 PendingS Failed accounting start answer Disconnect Idle 4731 received and realtime not user/dev 4732 equal to GRANT_AND_LOSE 4734 PendingS User service terminated Store PendingS 4735 stop 4736 record 4738 Open Interim interval elapses Send PendingI 4739 accounting 4740 interim 4741 record 4742 Open User service terminated Send PendingL 4743 accounting 4744 stop req. 4746 PendingI Successful accounting interim Open 4747 answer received 4749 PendingI Failure to send and (buffer Store Open 4750 space available or old record interim 4751 can be overwritten) and record 4752 realtime not equal to 4753 DELIVER_AND_GRANT 4755 PendingI Failure to send and no buffer Open 4756 space available and realtime 4757 equal to GRANT_AND_LOSE 4759 PendingI Failure to send and no buffer Disconnect Idle 4760 space available and realtime user/dev 4761 not equal to GRANT_AND_LOSE 4763 PendingI Failed accounting interim Open 4764 answer received and realtime 4765 equal to GRANT_AND_LOSE 4767 PendingI Failed accounting interim Disconnect Idle 4768 answer received and realtime user/dev 4769 not equal to GRANT_AND_LOSE 4771 PendingI User service terminated Store PendingI 4772 stop 4773 record 4774 PendingE Successful accounting Idle 4775 event answer received 4777 PendingE Failure to send and buffer Store Idle 4778 space available event 4779 record 4781 PendingE Failure to send and no buffer Idle 4782 space available 4784 PendingE Failed accounting event answer Idle 4785 received 4787 PendingB Successful accounting answer Delete Idle 4788 received record 4790 PendingB Failure to send Idle 4792 PendingB Failed accounting answer Delete Idle 4793 received record 4795 PendingL Successful accounting Idle 4796 stop answer received 4798 PendingL Failure to send and buffer Store Idle 4799 space available stop 4800 record 4802 PendingL Failure to send and no buffer Idle 4803 space available 4805 PendingL Failed accounting stop answer Idle 4806 received 4807 SERVER, STATELESS ACCOUNTING 4808 State Event Action New State 4809 ------------------------------------------------------------- 4811 Idle Accounting start request Send Idle 4812 received, and successfully accounting 4813 processed. start 4814 answer 4816 Idle Accounting event request Send Idle 4817 received, and successfully accounting 4818 processed. event 4819 answer 4821 Idle Interim record received, Send Idle 4822 and successfully processed. accounting 4823 interim 4824 answer 4826 Idle Accounting stop request Send Idle 4827 received, and successfully accounting 4828 processed stop answer 4830 Idle Accounting request received, Send Idle 4831 no space left to store accounting 4832 records answer, 4833 Result-Code 4834 = OUT_OF_ 4835 SPACE 4837 SERVER, STATEFUL ACCOUNTING 4838 State Event Action New State 4839 ------------------------------------------------------------- 4841 Idle Accounting start request Send Open 4842 received, and successfully accounting 4843 processed. start 4844 answer, 4845 Start Ts 4847 Idle Accounting event request Send Idle 4848 received, and successfully accounting 4849 processed. event 4850 answer 4852 Idle Accounting request received, Send Idle 4853 no space left to store accounting 4854 records answer, 4855 Result-Code 4856 = OUT_OF_ 4857 SPACE 4859 Open Interim record received, Send Open 4860 and successfully processed. accounting 4861 interim 4862 answer, 4863 Restart Ts 4865 Open Accounting stop request Send Idle 4866 received, and successfully accounting 4867 processed stop answer, 4868 Stop Ts 4870 Open Accounting request received, Send Idle 4871 no space left to store accounting 4872 records answer, 4873 Result-Code 4874 = OUT_OF_ 4875 SPACE, 4876 Stop Ts 4878 Open Session supervision timer Ts Stop Ts Idle 4879 expired 4881 8.3. Server-Initiated Re-Auth 4883 A Diameter server may initiate a re-authentication and/or re- 4884 authorization service for a particular session by issuing a Re-Auth- 4885 Request (RAR). 4887 For example, for pre-paid services, the Diameter server that 4888 originally authorized a session may need some confirmation that the 4889 user is still using the services. 4891 An access device that receives a RAR message with Session-Id equal to 4892 a currently active session MUST initiate a re-auth towards the user, 4893 if the service supports this particular feature. Each Diameter 4894 application MUST state whether server-initiated re-auth is supported, 4895 since some applications do not allow access devices to prompt the 4896 user for re-auth. 4898 8.3.1. Re-Auth-Request 4900 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258 4901 and the message flags' 'R' bit set, may be sent by any server to the 4902 access device that is providing session service, to request that the 4903 user be re-authenticated and/or re-authorized. 4905 Message Format 4907 ::= < Diameter Header: 258, REQ, PXY > 4908 < Session-Id > 4909 { Origin-Host } 4910 { Origin-Realm } 4911 { Destination-Realm } 4912 { Destination-Host } 4913 { Auth-Application-Id } 4914 { Re-Auth-Request-Type } 4915 [ User-Name ] 4916 [ Origin-State-Id ] 4917 * [ Proxy-Info ] 4918 * [ Route-Record ] 4919 * [ AVP ] 4921 8.3.2. Re-Auth-Answer 4923 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258 4924 and the message flags' 'R' bit clear, is sent in response to the RAR. 4925 The Result-Code AVP MUST be present, and indicates the disposition of 4926 the request. 4928 A successful RAA message MUST be followed by an application-specific 4929 authentication and/or authorization message. 4931 Message Format 4933 ::= < Diameter Header: 258, PXY > 4934 < Session-Id > 4935 { Result-Code } 4936 { Origin-Host } 4937 { Origin-Realm } 4938 [ User-Name ] 4939 [ Origin-State-Id ] 4940 [ Error-Message ] 4941 [ Error-Reporting-Host ] 4942 [ Failed-AVP ] 4943 * [ Redirect-Host ] 4944 [ Redirect-Host-Usage ] 4945 [ Redirect-Max-Cache-Time ] 4946 * [ Proxy-Info ] 4947 * [ AVP ] 4949 8.4. Session Termination 4951 It is necessary for a Diameter server that authorized a session, for 4952 which it is maintaining state, to be notified when that session is no 4953 longer active, both for tracking purposes as well as to allow 4954 stateful agents to release any resources that they may have provided 4955 for the user's session. For sessions whose state is not being 4956 maintained, this section is not used. 4958 When a user session that required Diameter authorization terminates, 4959 the access device that provided the service MUST issue a Session- 4960 Termination-Request (STR) message to the Diameter server that 4961 authorized the service, to notify it that the session is no longer 4962 active. An STR MUST be issued when a user session terminates for any 4963 reason, including user logoff, expiration of Session-Timeout, 4964 administrative action, termination upon receipt of an Abort-Session- 4965 Request (see below), orderly shutdown of the access device, etc. 4967 The access device also MUST issue an STR for a session that was 4968 authorized but never actually started. This could occur, for 4969 example, due to a sudden resource shortage in the access device, or 4970 because the access device is unwilling to provide the type of service 4971 requested in the authorization, or because the access device does not 4972 support a mandatory AVP returned in the authorization, etc. 4974 It is also possible that a session that was authorized is never 4975 actually started due to action of a proxy. For example, a proxy may 4976 modify an authorization answer, converting the result from success to 4977 failure, prior to forwarding the message to the access device. If 4978 the answer did not contain an Auth-Session-State AVP with the value 4979 NO_STATE_MAINTAINED, a proxy that causes an authorized session not to 4980 be started MUST issue an STR to the Diameter server that authorized 4981 the session, since the access device has no way of knowing that the 4982 session had been authorized. 4984 A Diameter server that receives an STR message MUST clean up 4985 resources (e.g., session state) associated with the Session-Id 4986 specified in the STR, and return a Session-Termination-Answer. 4988 A Diameter server also MUST clean up resources when the Session- 4989 Timeout expires, or when the Authorization-Lifetime and the Auth- 4990 Grace-Period AVPs expires without receipt of a re-authorization 4991 request, regardless of whether an STR for that session is received. 4992 The access device is not expected to provide service beyond the 4993 expiration of these timers; thus, expiration of either of these 4994 timers implies that the access device may have unexpectedly shut 4995 down. 4997 8.4.1. Session-Termination-Request 4999 The Session-Termination-Request (STR), indicated by the Command-Code 5000 set to 275 and the Command Flags' 'R' bit set, is sent by a Diameter 5001 client or by a Diameter proxy to inform the Diameter Server that an 5002 authenticated and/or authorized session is being terminated. 5004 Message Format 5006 ::= < Diameter Header: 275, REQ, PXY > 5007 < Session-Id > 5008 { Origin-Host } 5009 { Origin-Realm } 5010 { Destination-Realm } 5011 { Auth-Application-Id } 5012 { Termination-Cause } 5013 [ User-Name ] 5014 [ Destination-Host ] 5015 * [ Class ] 5016 [ Origin-State-Id ] 5017 * [ Proxy-Info ] 5018 * [ Route-Record ] 5019 * [ AVP ] 5021 8.4.2. Session-Termination-Answer 5023 The Session-Termination-Answer (STA), indicated by the Command-Code 5024 set to 275 and the message flags' 'R' bit clear, is sent by the 5025 Diameter Server to acknowledge the notification that the session has 5026 been terminated. The Result-Code AVP MUST be present, and MAY 5027 contain an indication that an error occurred while servicing the STR. 5029 Upon sending or receipt of the STA, the Diameter Server MUST release 5030 all resources for the session indicated by the Session-Id AVP. Any 5031 intermediate server in the Proxy-Chain MAY also release any 5032 resources, if necessary. 5034 Message Format 5036 ::= < Diameter Header: 275, PXY > 5037 < Session-Id > 5038 { Result-Code } 5039 { Origin-Host } 5040 { Origin-Realm } 5041 [ User-Name ] 5042 * [ Class ] 5043 [ Error-Message ] 5044 [ Error-Reporting-Host ] 5045 [ Failed-AVP ] 5046 [ Origin-State-Id ] 5047 * [ Redirect-Host ] 5048 [ Redirect-Host-Usage ] 5049 [ Redirect-Max-Cache-Time ] 5050 * [ Proxy-Info ] 5051 * [ AVP ] 5053 8.5. Aborting a Session 5055 A Diameter server may request that the access device stop providing 5056 service for a particular session by issuing an Abort-Session-Request 5057 (ASR). 5059 For example, the Diameter server that originally authorized the 5060 session may be required to cause that session to be stopped for lack 5061 of credit or other reasons that were not anticipated when the session 5062 was first authorized. 5064 An access device that receives an ASR with Session-ID equal to a 5065 currently active session MAY stop the session. Whether the access 5066 device stops the session or not is implementation- and/or 5067 configuration-dependent. For example, an access device may honor 5068 ASRs from certain agents only. In any case, the access device MUST 5069 respond with an Abort-Session-Answer, including a Result-Code AVP to 5070 indicate what action it took. 5072 8.5.1. Abort-Session-Request 5074 The Abort-Session-Request (ASR), indicated by the Command-Code set to 5075 274 and the message flags' 'R' bit set, may be sent by any Diameter 5076 server or any Diameter proxy to the access device that is providing 5077 session service, to request that the session identified by the 5078 Session-Id be stopped. 5080 Message Format 5082 ::= < Diameter Header: 274, REQ, PXY > 5083 < Session-Id > 5084 { Origin-Host } 5085 { Origin-Realm } 5086 { Destination-Realm } 5087 { Destination-Host } 5088 { Auth-Application-Id } 5089 [ User-Name ] 5090 [ Origin-State-Id ] 5091 * [ Proxy-Info ] 5092 * [ Route-Record ] 5093 * [ AVP ] 5095 8.5.2. Abort-Session-Answer 5097 The Abort-Session-Answer (ASA), indicated by the Command-Code set to 5098 274 and the message flags' 'R' bit clear, is sent in response to the 5099 ASR. The Result-Code AVP MUST be present, and indicates the 5100 disposition of the request. 5102 If the session identified by Session-Id in the ASR was successfully 5103 terminated, Result-Code is set to DIAMETER_SUCCESS. If the session 5104 is not currently active, Result-Code is set to 5105 DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the 5106 session for any other reason, Result-Code is set to 5107 DIAMETER_UNABLE_TO_COMPLY. 5109 Message Format 5111 ::= < Diameter Header: 274, PXY > 5112 < Session-Id > 5113 { Result-Code } 5114 { Origin-Host } 5115 { Origin-Realm } 5116 [ User-Name ] 5117 [ Origin-State-Id ] 5118 [ Error-Message ] 5119 [ Error-Reporting-Host ] 5120 [ Failed-AVP ] 5121 * [ Redirect-Host ] 5122 [ Redirect-Host-Usage ] 5123 [ Redirect-Max-Cache-Time ] 5124 * [ Proxy-Info ] 5125 * [ AVP ] 5127 8.6. Inferring Session Termination from Origin-State-Id 5129 The Origin-State-Id is used to allow detection of terminated sessions 5130 for which no STR would have been issued, due to unanticipated 5131 shutdown of an access device. 5133 A Diameter client or access device increments the value of the 5134 Origin-State-Id every time it is started or powered-up. The new 5135 Origin-State-Id is then sent in the CER/CEA message immediately upon 5136 connection to the server. The Diameter server receiving the new 5137 Origin-State-Id can determine whether the sending Diameter client had 5138 abruptly shutdown by comparing the old value of the Origin-State-Id 5139 it has kept for that specific client is less than the new value and 5140 whether it has un-terminated sessions originating from that client. 5142 An access device can also include the Origin-State-Id in request 5143 messages other than CER if there are relays or proxies in between the 5144 access device and the server. In this case, however, the server 5145 cannot discover that the access device has been restarted unless and 5146 until it receives a new request from it. Therefore this mechanism is 5147 more opportunistic across proxies and relays. 5149 The Diameter server may assume that all sessions that were active 5150 prior to detection of a client restart have been terminated. The 5151 Diameter server MAY clean up all session state associated with such 5152 lost sessions, and MAY also issues STRs for all such lost sessions 5153 that were authorized on upstream servers, to allow session state to 5154 be cleaned up globally. 5156 8.7. Auth-Request-Type AVP 5158 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is 5159 included in application-specific auth requests to inform the peers 5160 whether a user is to be authenticated only, authorized only or both. 5161 Note any value other than both MAY cause RADIUS interoperability 5162 issues. The following values are defined: 5164 AUTHENTICATE_ONLY 1 5166 The request being sent is for authentication only, and MUST 5167 contain the relevant application specific authentication AVPs that 5168 are needed by the Diameter server to authenticate the user. 5170 AUTHORIZE_ONLY 2 5172 The request being sent is for authorization only, and MUST contain 5173 the application-specific authorization AVPs that are necessary to 5174 identify the service being requested/offered. 5176 AUTHORIZE_AUTHENTICATE 3 5178 The request contains a request for both authentication and 5179 authorization. The request MUST include both the relevant 5180 application-specific authentication information, and authorization 5181 information necessary to identify the service being requested/ 5182 offered. 5184 8.8. Session-Id AVP 5186 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used 5187 to identify a specific session (see Section 8). All messages 5188 pertaining to a specific session MUST include only one Session-Id AVP 5189 and the same value MUST be used throughout the life of a session. 5190 When present, the Session-Id SHOULD appear immediately following the 5191 Diameter Header (see Section 3). 5193 The Session-Id MUST be globally and eternally unique, as it is meant 5194 to uniquely identify a user session without reference to any other 5195 information, and may be needed to correlate historical authentication 5196 information with accounting information. The Session-Id includes a 5197 mandatory portion and an implementation-defined portion; a 5198 recommended format for the implementation-defined portion is outlined 5199 below. 5201 The Session-Id MUST begin with the sender's identity encoded in the 5202 DiameterIdentity type (see Section 4.4). The remainder of the 5203 Session-Id is delimited by a ";" character, and MAY be any sequence 5204 that the client can guarantee to be eternally unique; however, the 5205 following format is recommended, (square brackets [] indicate an 5206 optional element): 5208 ;;[;] 5210 and are decimal representations of the 5211 high and low 32 bits of a monotonically increasing 64-bit value. The 5212 64-bit value is rendered in two part to simplify formatting by 32-bit 5213 processors. At startup, the high 32 bits of the 64-bit value MAY be 5214 initialized to the time in NTP format [RFC4330], and the low 32 bits 5215 MAY be initialized to zero. This will for practical purposes 5216 eliminate the possibility of overlapping Session-Ids after a reboot, 5217 assuming the reboot process takes longer than a second. 5218 Alternatively, an implementation MAY keep track of the increasing 5219 value in non-volatile memory. 5221 is implementation specific but may include a modem's 5222 device Id, a layer 2 address, timestamp, etc. 5224 Example, in which there is no optional value: 5226 accesspoint7.example.com;1876543210;523 5228 Example, in which there is an optional value: 5230 accesspoint7.example.com;1876543210;523;mobile@200.1.1.88 5232 The Session-Id is created by the Diameter application initiating the 5233 session, which in most cases is done by the client. Note that a 5234 Session-Id MAY be used for both the authentication, authorization and 5235 accounting commands of a given application. 5237 8.9. Authorization-Lifetime AVP 5239 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 5240 and contains the maximum number of seconds of service to be provided 5241 to the user before the user is to be re-authenticated and/or re- 5242 authorized. Care should be taken when the Authorization- Lifetime 5243 value is determined, since a low, non-zero, value could create 5244 significant Diameter traffic, which could congest both the network 5245 and the agents. 5247 A value of zero (0) means that immediate re-auth is necessary by the 5248 access device. The absence of this AVP, or a value of all ones 5249 (meaning all bits in the 32 bit field are set to one) means no re- 5250 auth is expected. 5252 If both this AVP and the Session-Timeout AVP are present in a 5253 message, the value of the latter MUST NOT be smaller than the 5254 Authorization-Lifetime AVP. 5256 An Authorization-Lifetime AVP MAY be present in re-authorization 5257 messages, and contains the number of seconds the user is authorized 5258 to receive service from the time the re-auth answer message is 5259 received by the access device. 5261 This AVP MAY be provided by the client as a hint of the maximum 5262 lifetime that it is willing to accept. The server MUST return a 5263 value that is equal to, or smaller, than the one provided by the 5264 client. 5266 8.10. Auth-Grace-Period AVP 5268 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and 5269 contains the number of seconds the Diameter server will wait 5270 following the expiration of the Authorization-Lifetime AVP before 5271 cleaning up resources for the session. 5273 8.11. Auth-Session-State AVP 5275 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and 5276 specifies whether state is maintained for a particular session. The 5277 client MAY include this AVP in requests as a hint to the server, but 5278 the value in the server's answer message is binding. The following 5279 values are supported: 5281 STATE_MAINTAINED 0 5283 This value is used to specify that session state is being 5284 maintained, and the access device MUST issue a session termination 5285 message when service to the user is terminated. This is the 5286 default value. 5288 NO_STATE_MAINTAINED 1 5290 This value is used to specify that no session termination messages 5291 will be sent by the access device upon expiration of the 5292 Authorization-Lifetime. 5294 8.12. Re-Auth-Request-Type AVP 5296 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and 5297 is included in application-specific auth answers to inform the client 5298 of the action expected upon expiration of the Authorization-Lifetime. 5299 If the answer message contains an Authorization-Lifetime AVP with a 5300 positive value, the Re-Auth-Request-Type AVP MUST be present in an 5301 answer message. The following values are defined: 5303 AUTHORIZE_ONLY 0 5305 An authorization only re-auth is expected upon expiration of the 5306 Authorization-Lifetime. This is the default value if the AVP is 5307 not present in answer messages that include the Authorization- 5308 Lifetime. 5310 AUTHORIZE_AUTHENTICATE 1 5312 An authentication and authorization re-auth is expected upon 5313 expiration of the Authorization-Lifetime. 5315 8.13. Session-Timeout AVP 5317 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32 5318 and contains the maximum number of seconds of service to be provided 5319 to the user before termination of the session. When both the 5320 Session-Timeout and the Authorization-Lifetime AVPs are present in an 5321 answer message, the former MUST be equal to or greater than the value 5322 of the latter. 5324 A session that terminates on an access device due to the expiration 5325 of the Session-Timeout MUST cause an STR to be issued, unless both 5326 the access device and the home server had previously agreed that no 5327 session termination messages would be sent (see Section 8.11). 5329 A Session-Timeout AVP MAY be present in a re-authorization answer 5330 message, and contains the remaining number of seconds from the 5331 beginning of the re-auth. 5333 A value of zero, or the absence of this AVP, means that this session 5334 has an unlimited number of seconds before termination. 5336 This AVP MAY be provided by the client as a hint of the maximum 5337 timeout that it is willing to accept. However, the server MAY return 5338 a value that is equal to, or smaller, than the one provided by the 5339 client. 5341 8.14. User-Name AVP 5343 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which 5344 contains the User-Name, in a format consistent with the NAI 5345 specification [RFC4282]. 5347 8.15. Termination-Cause AVP 5349 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and 5350 is used to indicate the reason why a session was terminated on the 5351 access device. The following values are defined: 5353 DIAMETER_LOGOUT 1 5355 The user initiated a disconnect 5357 DIAMETER_SERVICE_NOT_PROVIDED 2 5359 This value is used when the user disconnected prior to the receipt 5360 of the authorization answer message. 5362 DIAMETER_BAD_ANSWER 3 5364 This value indicates that the authorization answer received by the 5365 access device was not processed successfully. 5367 DIAMETER_ADMINISTRATIVE 4 5369 The user was not granted access, or was disconnected, due to 5370 administrative reasons, such as the receipt of a Abort-Session- 5371 Request message. 5373 DIAMETER_LINK_BROKEN 5 5375 The communication to the user was abruptly disconnected. 5377 DIAMETER_AUTH_EXPIRED 6 5379 The user's access was terminated since its authorized session time 5380 has expired. 5382 DIAMETER_USER_MOVED 7 5384 The user is receiving services from another access device. 5386 DIAMETER_SESSION_TIMEOUT 8 5388 The user's session has timed out, and service has been terminated. 5390 8.16. Origin-State-Id AVP 5392 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a 5393 monotonically increasing value that is advanced whenever a Diameter 5394 entity restarts with loss of previous state, for example upon reboot. 5395 Origin-State-Id MAY be included in any Diameter message, including 5396 CER. 5398 A Diameter entity issuing this AVP MUST create a higher value for 5399 this AVP each time its state is reset. A Diameter entity MAY set 5400 Origin-State-Id to the time of startup, or it MAY use an incrementing 5401 counter retained in non-volatile memory across restarts. 5403 The Origin-State-Id, if present, MUST reflect the state of the entity 5404 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST 5405 either remove Origin-State-Id or modify it appropriately as well. 5406 Typically, Origin-State-Id is used by an access device that always 5407 starts up with no active sessions; that is, any session active prior 5408 to restart will have been lost. By including Origin-State-Id in a 5409 message, it allows other Diameter entities to infer that sessions 5410 associated with a lower Origin-State-Id are no longer active. If an 5411 access device does not intend for such inferences to be made, it MUST 5412 either not include Origin-State-Id in any message, or set its value 5413 to 0. 5415 8.17. Session-Binding AVP 5417 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY 5418 be present in application-specific authorization answer messages. If 5419 present, this AVP MAY inform the Diameter client that all future 5420 application-specific re-auth and Session-Termination-Request messages 5421 for this session MUST be sent to the same authorization server. 5423 This field is a bit mask, and the following bits have been defined: 5425 RE_AUTH 1 5427 When set, future re-auth messages for this session MUST NOT 5428 include the Destination-Host AVP. When cleared, the default 5429 value, the Destination-Host AVP MUST be present in all re-auth 5430 messages for this session. 5432 STR 2 5434 When set, the STR message for this session MUST NOT include the 5435 Destination-Host AVP. When cleared, the default value, the 5436 Destination-Host AVP MUST be present in the STR message for this 5437 session. 5439 ACCOUNTING 4 5441 When set, all accounting messages for this session MUST NOT 5442 include the Destination-Host AVP. When cleared, the default 5443 value, the Destination-Host AVP, if known, MUST be present in all 5444 accounting messages for this session. 5446 8.18. Session-Server-Failover AVP 5448 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated, 5449 and MAY be present in application-specific authorization answer 5450 messages that either do not include the Session-Binding AVP or 5451 include the Session-Binding AVP with any of the bits set to a zero 5452 value. If present, this AVP MAY inform the Diameter client that if a 5453 re-auth or STR message fails due to a delivery problem, the Diameter 5454 client SHOULD issue a subsequent message without the Destination-Host 5455 AVP. When absent, the default value is REFUSE_SERVICE. 5457 The following values are supported: 5459 REFUSE_SERVICE 0 5461 If either the re-auth or the STR message delivery fails, terminate 5462 service with the user, and do not attempt any subsequent attempts. 5464 TRY_AGAIN 1 5466 If either the re-auth or the STR message delivery fails, resend 5467 the failed message without the Destination-Host AVP present. 5469 ALLOW_SERVICE 2 5471 If re-auth message delivery fails, assume that re-authorization 5472 succeeded. If STR message delivery fails, terminate the session. 5474 TRY_AGAIN_ALLOW_SERVICE 3 5476 If either the re-auth or the STR message delivery fails, resend 5477 the failed message without the Destination-Host AVP present. If 5478 the second delivery fails for re-auth, assume re-authorization 5479 succeeded. If the second delivery fails for STR, terminate the 5480 session. 5482 8.19. Multi-Round-Time-Out AVP 5484 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32, 5485 and SHOULD be present in application-specific authorization answer 5486 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. 5487 This AVP contains the maximum number of seconds that the access 5488 device MUST provide the user in responding to an authentication 5489 request. 5491 8.20. Class AVP 5493 The Class AVP (AVP Code 25) is of type OctetString and is used by 5494 Diameter servers to return state information to the access device. 5495 When one or more Class AVPs are present in application-specific 5496 authorization answer messages, they MUST be present in subsequent re- 5497 authorization, session termination and accounting messages. Class 5498 AVPs found in a re-authorization answer message override the ones 5499 found in any previous authorization answer message. Diameter server 5500 implementations SHOULD NOT return Class AVPs that require more than 5501 4096 bytes of storage on the Diameter client. A Diameter client that 5502 receives Class AVPs whose size exceeds local available storage MUST 5503 terminate the session. 5505 8.21. Event-Timestamp AVP 5507 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be 5508 included in an Accounting-Request and Accounting-Answer messages to 5509 record the time that the reported event occurred, in seconds since 5510 January 1, 1900 00:00 UTC. 5512 9. Accounting 5514 This accounting protocol is based on a server directed model with 5515 capabilities for real-time delivery of accounting information. 5516 Several fault resilience methods [RFC2975] have been built in to the 5517 protocol in order minimize loss of accounting data in various fault 5518 situations and under different assumptions about the capabilities of 5519 the used devices. 5521 9.1. Server Directed Model 5523 The server directed model means that the device generating the 5524 accounting data gets information from either the authorization server 5525 (if contacted) or the accounting server regarding the way accounting 5526 data shall be forwarded. This information includes accounting record 5527 timeliness requirements. 5529 As discussed in [RFC2975], real-time transfer of accounting records 5530 is a requirement, such as the need to perform credit limit checks and 5531 fraud detection. Note that batch accounting is not a requirement, 5532 and is therefore not supported by Diameter. Should batched 5533 accounting be required in the future, a new Diameter application will 5534 need to be created, or it could be handled using another protocol. 5535 Note, however, that even if at the Diameter layer accounting requests 5536 are processed one by one, transport protocols used under Diameter 5537 typically batch several requests in the same packet under heavy 5538 traffic conditions. This may be sufficient for many applications. 5540 The authorization server (chain) directs the selection of proper 5541 transfer strategy, based on its knowledge of the user and 5542 relationships of roaming partnerships. The server (or agents) uses 5543 the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to 5544 control the operation of the Diameter peer operating as a client. 5545 The Acct-Interim-Interval AVP, when present, instructs the Diameter 5546 node acting as a client to produce accounting records continuously 5547 even during a session. Accounting-Realtime-Required AVP is used to 5548 control the behavior of the client when the transfer of accounting 5549 records from the Diameter client is delayed or unsuccessful. 5551 The Diameter accounting server MAY override the interim interval or 5552 the realtime requirements by including the Acct-Interim-Interval or 5553 Accounting-Realtime-Required AVP in the Accounting-Answer message. 5554 When one of these AVPs is present, the latest value received SHOULD 5555 be used in further accounting activities for the same session. 5557 9.2. Protocol Messages 5559 A Diameter node that receives a successful authentication and/or 5560 authorization messages from the Diameter server SHOULD collect 5561 accounting information for the session. The Accounting-Request 5562 message is used to transmit the accounting information to the 5563 Diameter server, which MUST reply with the Accounting-Answer message 5564 to confirm reception. The Accounting-Answer message includes the 5565 Result-Code AVP, which MAY indicate that an error was present in the 5566 accounting message. The value of the Accounting-Realtime-Required 5567 AVP received earlier for the session in question may indicate that 5568 the user's session has to be terminated when a rejected Accounting- 5569 Request message was received. 5571 9.3. Accounting Application Extension and Requirements 5573 Each Diameter application (e.g., NASREQ, MobileIP), SHOULD define 5574 their Service-Specific AVPs that MUST be present in the Accounting- 5575 Request message in a section entitled "Accounting AVPs". The 5576 application MUST assume that the AVPs described in this document will 5577 be present in all Accounting messages, so only their respective 5578 service-specific AVPs need to be defined in that section. 5580 Applications have the option of using one or both of the following 5581 accounting application extension models: 5583 Split Accounting Service 5585 The accounting message will carry the Application Id of the 5586 Diameter base accounting application (see Section 2.4). 5587 Accounting messages maybe routed to Diameter nodes other than the 5588 corresponding Diameter application. These nodes might be 5589 centralized accounting servers that provide accounting service for 5590 multiple different Diameter applications. These nodes MUST 5591 advertise the Diameter base accounting Application Id during 5592 capabilities exchange. 5594 Coupled Accounting Service 5596 The accounting messages will carry the Application Id of the 5597 application that is using it. The application itself will process 5598 the received accounting records or forward them to an accounting 5599 server. There is no accounting application advertisement required 5600 during capabilities exchange and the accounting messages will be 5601 routed the same as any of the other application messages. 5603 In cases where an application does not define its own accounting 5604 service, it is preferred that the split accounting model be used. 5606 9.4. Fault Resilience 5608 Diameter Base protocol mechanisms are used to overcome small message 5609 loss and network faults of temporary nature. 5611 Diameter peers acting as clients MUST implement the use of failover 5612 to guard against server failures and certain network failures. 5613 Diameter peers acting as agents or related off-line processing 5614 systems MUST detect duplicate accounting records caused by the 5615 sending of same record to several servers and duplication of messages 5616 in transit. This detection MUST be based on the inspection of the 5617 Session-Id and Accounting-Record-Number AVP pairs. Appendix C 5618 discusses duplicate detection needs and implementation issues. 5620 Diameter clients MAY have non-volatile memory for the safe storage of 5621 accounting records over reboots or extended network failures, network 5622 partitions, and server failures. If such memory is available, the 5623 client SHOULD store new accounting records there as soon as the 5624 records are created and until a positive acknowledgement of their 5625 reception from the Diameter Server has been received. Upon a reboot, 5626 the client MUST starting sending the records in the non-volatile 5627 memory to the accounting server with appropriate modifications in 5628 termination cause, session length, and other relevant information in 5629 the records. 5631 A further application of this protocol may include AVPs to control 5632 how many accounting records may at most be stored in the Diameter 5633 client without committing them to the non-volatile memory or 5634 transferring them to the Diameter server. 5636 The client SHOULD NOT remove the accounting data from any of its 5637 memory areas before the correct Accounting-Answer has been received. 5638 The client MAY remove oldest, undelivered or yet unacknowledged 5639 accounting data if it runs out of resources such as memory. It is an 5640 implementation dependent matter for the client to accept new sessions 5641 under this condition. 5643 9.5. Accounting Records 5645 In all accounting records, the Session-Id AVP MUST be present; the 5646 User-Name AVP MUST be present if it is available to the Diameter 5647 client. 5649 Different types of accounting records are sent depending on the 5650 actual type of accounted service and the authorization server's 5651 directions for interim accounting. If the accounted service is a 5652 one-time event, meaning that the start and stop of the event are 5653 simultaneous, then the Accounting-Record-Type AVP MUST be present and 5654 set to the value EVENT_RECORD. 5656 If the accounted service is of a measurable length, then the AVP MUST 5657 use the values START_RECORD, STOP_RECORD, and possibly, 5658 INTERIM_RECORD. If the authorization server has not directed interim 5659 accounting to be enabled for the session, two accounting records MUST 5660 be generated for each service of type session. When the initial 5661 Accounting-Request for a given session is sent, the Accounting- 5662 Record-Type AVP MUST be set to the value START_RECORD. When the last 5663 Accounting-Request is sent, the value MUST be STOP_RECORD. 5665 If the authorization server has directed interim accounting to be 5666 enabled, the Diameter client MUST produce additional records between 5667 the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The 5668 production of these records is directed by Acct-Interim-Interval as 5669 well as any re-authentication or re-authorization of the session. 5670 The Diameter client MUST overwrite any previous interim accounting 5671 records that are locally stored for delivery, if a new record is 5672 being generated for the same session. This ensures that only one 5673 pending interim record can exist on an access device for any given 5674 session. 5676 A particular value of Accounting-Sub-Session-Id MUST appear only in 5677 one sequence of accounting records from a DIAMETER client, except for 5678 the purposes of retransmission. The one sequence that is sent MUST 5679 be either one record with Accounting-Record-Type AVP set to the value 5680 EVENT_RECORD, or several records starting with one having the value 5681 START_RECORD, followed by zero or more INTERIM_RECORD and a single 5682 STOP_RECORD. A particular Diameter application specification MUST 5683 define the type of sequences that MUST be used. 5685 9.6. Correlation of Accounting Records 5687 If an application uses accounting messages, it can correlate 5688 accounting records with a specific application session by using the 5689 Session-Id of the particular application session in the accounting 5690 messages. Accounting messages MAY also use a different Session-Id 5691 from that of the application sessions in which case other session 5692 related information is needed to perform correlation. 5694 In cases where an application requires multiple accounting sub- 5695 session, an Accounting-Sub-Session-Id AVP is used to differentiate 5696 each sub-session. The Session-Id would remain constant for all sub- 5697 sessions and is be used to correlate all the sub-sessions to a 5698 particular application session. Note that receiving a STOP_RECORD 5699 with no Accounting-Sub-Session-Id AVP when sub-sessions were 5700 originally used in the START_RECORD messages implies that all sub- 5701 sessions are terminated. 5703 There are also cases where an application needs to correlate multiple 5704 application sessions into a single accounting record; the accounting 5705 record may span multiple different Diameter applications and sessions 5706 used by the same user at a given time. In such cases, the Acct- 5707 Multi-Session- Id AVP is used. The Acct-Multi-Session-Id AVP SHOULD 5708 be signaled by the server to the access device (typically during 5709 authorization) when it determines that a request belongs to an 5710 existing session. The access device MUST then include the Acct- 5711 Multi-Session-Id AVP in all subsequent accounting messages. 5713 The Acct-Multi-Session-Id AVP MAY include the value of the original 5714 Session-Id. It's contents are implementation specific, but MUST be 5715 globally unique across other Acct-Multi-Session-Id, and MUST NOT 5716 change during the life of a session. 5718 A Diameter application document MUST define the exact concept of a 5719 session that is being accounted, and MAY define the concept of a 5720 multi-session. For instance, the NASREQ DIAMETER application treats 5721 a single PPP connection to a Network Access Server as one session, 5722 and a set of Multilink PPP sessions as one multi-session. 5724 9.7. Accounting Command-Codes 5726 This section defines Command-Code values that MUST be supported by 5727 all Diameter implementations that provide Accounting services. 5729 9.7.1. Accounting-Request 5731 The Accounting-Request (ACR) command, indicated by the Command-Code 5732 field set to 271 and the Command Flags' 'R' bit set, is sent by a 5733 Diameter node, acting as a client, in order to exchange accounting 5734 information with a peer. 5736 The AVP listed below SHOULD include service-specific accounting AVPs, 5737 as described in Section 9.3. 5739 Message Format 5741 ::= < Diameter Header: 271, REQ, PXY > 5742 < Session-Id > 5743 { Origin-Host } 5744 { Origin-Realm } 5745 { Destination-Realm } 5746 { Accounting-Record-Type } 5747 { Accounting-Record-Number } 5748 [ Acct-Application-Id ] 5749 [ Vendor-Specific-Application-Id ] 5750 [ User-Name ] 5751 [ Destination-Host ] 5752 [ Accounting-Sub-Session-Id ] 5753 [ Acct-Session-Id ] 5754 [ Acct-Multi-Session-Id ] 5755 [ Acct-Interim-Interval ] 5756 [ Accounting-Realtime-Required ] 5757 [ Origin-State-Id ] 5758 [ Event-Timestamp ] 5759 * [ Proxy-Info ] 5760 * [ Route-Record ] 5761 * [ AVP ] 5763 9.7.2. Accounting-Answer 5765 The Accounting-Answer (ACA) command, indicated by the Command-Code 5766 field set to 271 and the Command Flags' 'R' bit cleared, is used to 5767 acknowledge an Accounting-Request command. The Accounting-Answer 5768 command contains the same Session-Id as the corresponding request. 5770 Only the target Diameter Server, known as the home Diameter Server, 5771 SHOULD respond with the Accounting-Answer command. 5773 The AVP listed below SHOULD include service-specific accounting AVPs, 5774 as described in Section 9.3. 5776 Message Format 5778 ::= < Diameter Header: 271, PXY > 5779 < Session-Id > 5780 { Result-Code } 5781 { Origin-Host } 5782 { Origin-Realm } 5783 { Accounting-Record-Type } 5784 { Accounting-Record-Number } 5785 [ Acct-Application-Id ] 5786 [ Vendor-Specific-Application-Id ] 5787 [ User-Name ] 5788 [ Accounting-Sub-Session-Id ] 5789 [ Acct-Session-Id ] 5790 [ Acct-Multi-Session-Id ] 5791 [ Error-Message ] 5792 [ Error-Reporting-Host ] 5793 [ Failed-AVP ] 5794 [ Acct-Interim-Interval ] 5795 [ Accounting-Realtime-Required ] 5796 [ Origin-State-Id ] 5797 [ Event-Timestamp ] 5798 * [ Proxy-Info ] 5799 * [ AVP ] 5801 9.8. Accounting AVPs 5803 This section contains AVPs that describe accounting usage information 5804 related to a specific session. 5806 9.8.1. Accounting-Record-Type AVP 5808 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated 5809 and contains the type of accounting record being sent. The following 5810 values are currently defined for the Accounting-Record-Type AVP: 5812 EVENT_RECORD 1 5814 An Accounting Event Record is used to indicate that a one-time 5815 event has occurred (meaning that the start and end of the event 5816 are simultaneous). This record contains all information relevant 5817 to the service, and is the only record of the service. 5819 START_RECORD 2 5821 An Accounting Start, Interim, and Stop Records are used to 5822 indicate that a service of a measurable length has been given. An 5823 Accounting Start Record is used to initiate an accounting session, 5824 and contains accounting information that is relevant to the 5825 initiation of the session. 5827 INTERIM_RECORD 3 5829 An Interim Accounting Record contains cumulative accounting 5830 information for an existing accounting session. Interim 5831 Accounting Records SHOULD be sent every time a re-authentication 5832 or re-authorization occurs. Further, additional interim record 5833 triggers MAY be defined by application-specific Diameter 5834 applications. The selection of whether to use INTERIM_RECORD 5835 records is done by the Acct-Interim-Interval AVP. 5837 STOP_RECORD 4 5839 An Accounting Stop Record is sent to terminate an accounting 5840 session and contains cumulative accounting information relevant to 5841 the existing session. 5843 9.8.2. Acct-Interim-Interval AVP 5845 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and 5846 is sent from the Diameter home authorization server to the Diameter 5847 client. The client uses information in this AVP to decide how and 5848 when to produce accounting records. With different values in this 5849 AVP, service sessions can result in one, two, or two+N accounting 5850 records, based on the needs of the home-organization. The following 5851 accounting record production behavior is directed by the inclusion of 5852 this AVP: 5854 1. The omission of the Acct-Interim-Interval AVP or its inclusion 5855 with Value field set to 0 means that EVENT_RECORD, START_RECORD, 5856 and STOP_RECORD are produced, as appropriate for the service. 5858 2. The inclusion of the AVP with Value field set to a non-zero value 5859 means that INTERIM_RECORD records MUST be produced between the 5860 START_RECORD and STOP_RECORD records. The Value field of this 5861 AVP is the nominal interval between these records in seconds. 5863 The Diameter node that originates the accounting information, 5864 known as the client, MUST produce the first INTERIM_RECORD record 5865 roughly at the time when this nominal interval has elapsed from 5866 the START_RECORD, the next one again as the interval has elapsed 5867 once more, and so on until the session ends and a STOP_RECORD 5868 record is produced. 5870 The client MUST ensure that the interim record production times 5871 are randomized so that large accounting message storms are not 5872 created either among records or around a common service start 5873 time. 5875 9.8.3. Accounting-Record-Number AVP 5877 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 5878 and identifies this record within one session. As Session-Id AVPs 5879 are globally unique, the combination of Session-Id and Accounting- 5880 Record-Number AVPs is also globally unique, and can be used in 5881 matching accounting records with confirmations. An easy way to 5882 produce unique numbers is to set the value to 0 for records of type 5883 EVENT_RECORD and START_RECORD, and set the value to 1 for the first 5884 INTERIM_RECORD, 2 for the second, and so on until the value for 5885 STOP_RECORD is one more than for the last INTERIM_RECORD. 5887 9.8.4. Acct-Session-Id AVP 5889 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only 5890 used when RADIUS/Diameter translation occurs. This AVP contains the 5891 contents of the RADIUS Acct-Session-Id attribute. 5893 9.8.5. Acct-Multi-Session-Id AVP 5895 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String, 5896 following the format specified in Section 8.8. The Acct-Multi- 5897 Session-Id AVP is used to link together multiple related accounting 5898 sessions, where each session would have a unique Session-Id, but the 5899 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the 5900 Diameter server in an authorization answer, and MUST be used in all 5901 accounting messages for the given session. 5903 9.8.6. Accounting-Sub-Session-Id AVP 5905 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type 5906 Unsigned64 and contains the accounting sub-session identifier. The 5907 combination of the Session-Id and this AVP MUST be unique per sub- 5908 session, and the value of this AVP MUST be monotonically increased by 5909 one for all new sub-sessions. The absence of this AVP implies no 5910 sub-sessions are in use, with the exception of an Accounting-Request 5911 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD 5912 message with no Accounting-Sub-Session-Id AVP present will signal the 5913 termination of all sub-sessions for a given Session-Id. 5915 9.8.7. Accounting-Realtime-Required AVP 5917 The Accounting-Realtime-Required AVP (AVP Code 483) is of type 5918 Enumerated and is sent from the Diameter home authorization server to 5919 the Diameter client or in the Accounting-Answer from the accounting 5920 server. The client uses information in this AVP to decide what to do 5921 if the sending of accounting records to the accounting server has 5922 been temporarily prevented due to, for instance, a network problem. 5924 DELIVER_AND_GRANT 1 5926 The AVP with Value field set to DELIVER_AND_GRANT means that the 5927 service MUST only be granted as long as there is a connection to 5928 an accounting server. Note that the set of alternative accounting 5929 servers are treated as one server in this sense. Having to move 5930 the accounting record stream to a backup server is not a reason to 5931 discontinue the service to the user. 5933 GRANT_AND_STORE 2 5935 The AVP with Value field set to GRANT_AND_STORE means that service 5936 SHOULD be granted if there is a connection, or as long as records 5937 can still be stored as described in Section 9.4. 5939 This is the default behavior if the AVP isn't included in the 5940 reply from the authorization server. 5942 GRANT_AND_LOSE 3 5944 The AVP with Value field set to GRANT_AND_LOSE means that service 5945 SHOULD be granted even if the records cannot be delivered or 5946 stored. 5948 10. AVP Occurrence Table 5950 The following tables presents the AVPs defined in this document, and 5951 specifies in which Diameter messages they MAY be present or not. 5952 AVPs that occur only inside a Grouped AVP are not shown in this 5953 table. 5955 The table uses the following symbols: 5957 0 The AVP MUST NOT be present in the message. 5959 0+ Zero or more instances of the AVP MAY be present in the 5960 message. 5962 0-1 Zero or one instance of the AVP MAY be present in the message. 5963 It is considered an error if there are more than one instance of 5964 the AVP. 5966 1 One instance of the AVP MUST be present in the message. 5968 1+ At least one instance of the AVP MUST be present in the 5969 message. 5971 10.1. Base Protocol Command AVP Table 5973 The table in this section is limited to the non-accounting Command 5974 Codes defined in this specification. 5976 +-----------------------------------------------+ 5977 | Command-Code | 5978 +---+---+---+---+---+---+---+---+---+---+---+---+ 5979 Attribute Name |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA| 5980 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 5981 Acct-Interim- |0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5982 Interval | | | | | | | | | | | | | 5983 Accounting-Realtime-|0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 5984 Required | | | | | | | | | | | | | 5985 Acct-Application-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5986 Auth-Application-Id |0+ |0+ |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5987 Auth-Grace-Period |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5988 Auth-Request-Type |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5989 Auth-Session-State |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5990 Authorization- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5991 Lifetime | | | | | | | | | | | | | 5992 Class |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0+ |0+ | 5993 Destination-Host |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0-1|0 | 5994 Destination-Realm |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 5995 Disconnect-Cause |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 5996 Error-Message |0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1| 5997 Error-Reporting-Host|0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 5998 Failed-AVP |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ | 5999 Firmware-Revision |0-1|0-1|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6000 Host-IP-Address |1+ |1+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6001 Inband-Security-Id |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6002 Multi-Round-Time-Out|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6003 Origin-Host |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6004 Origin-Realm |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6005 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| 6006 Product-Name |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6007 Proxy-Info |0 |0 |0 |0 |0 |0 |0+ |0+ |0+ |0+ |0+ |0+ | 6008 Redirect-Host |0 |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ | 6009 Redirect-Host-Usage |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6010 Redirect-Max-Cache- |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6011 Time | | | | | | | | | | | | | 6012 Result-Code |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 | 6013 Re-Auth-Request-Type|0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 | 6014 Route-Record |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |0 | 6015 Session-Binding |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6016 Session-Id |0 |0 |0 |0 |0 |0 |1 |1 |1 |1 |1 |1 | 6017 Session-Server- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6018 Failover | | | | | | | | | | | | | 6019 Session-Timeout |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6020 Supported-Vendor-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6021 Termination-Cause |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |1 |0 | 6022 User-Name |0 |0 |0 |0 |0 |0 |0-1|0-1|0-1|0-1|0-1|0-1| 6023 Vendor-Id |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6024 Vendor-Specific- |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6025 Application-Id | | | | | | | | | | | | | 6026 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 6028 10.2. Accounting AVP Table 6030 The table in this section is used to represent which AVPs defined in 6031 this document are to be present in the Accounting messages. These 6032 AVP occurrence requirements are guidelines, which may be expanded, 6033 and/or overridden by application-specific requirements in the 6034 Diameter applications documents. 6036 +-----------+ 6037 | Command | 6038 | Code | 6039 +-----+-----+ 6040 Attribute Name | ACR | ACA | 6041 ------------------------------+-----+-----+ 6042 Acct-Interim-Interval | 0-1 | 0-1 | 6043 Acct-Multi-Session-Id | 0-1 | 0-1 | 6044 Accounting-Record-Number | 1 | 1 | 6045 Accounting-Record-Type | 1 | 1 | 6046 Acct-Session-Id | 0-1 | 0-1 | 6047 Accounting-Sub-Session-Id | 0-1 | 0-1 | 6048 Accounting-Realtime-Required | 0-1 | 0-1 | 6049 Acct-Application-Id | 0-1 | 0-1 | 6050 Auth-Application-Id | 0 | 0 | 6051 Class | 0+ | 0+ | 6052 Destination-Host | 0-1 | 0 | 6053 Destination-Realm | 1 | 0 | 6054 Error-Reporting-Host | 0 | 0+ | 6055 Event-Timestamp | 0-1 | 0-1 | 6056 Origin-Host | 1 | 1 | 6057 Origin-Realm | 1 | 1 | 6058 Proxy-Info | 0+ | 0+ | 6059 Route-Record | 0+ | 0 | 6060 Result-Code | 0 | 1 | 6061 Session-Id | 1 | 1 | 6062 Termination-Cause | 0 | 0 | 6063 User-Name | 0-1 | 0-1 | 6064 Vendor-Specific-Application-Id| 0-1 | 0-1 | 6065 ------------------------------+-----+-----+ 6067 11. IANA Considerations 6069 This section provides guidance to the Internet Assigned Numbers 6070 Authority (IANA) regarding registration of values related to the 6071 Diameter protocol, in accordance with BCP 26 [RFC5226]. The 6072 following policies are used here with the meanings defined in BCP 26: 6073 "Private Use", "First Come First Served", "Expert Review", 6074 "Specification Required", "IETF Review", "Standards Action". 6076 This section explains the criteria to be used by the IANA for 6077 assignment of numbers within namespaces defined within this document. 6079 For registration requests where a Designated Expert should be 6080 consulted, the responsible IESG area director should appoint the 6081 Designated Expert. For Designated Expert with Specification 6082 Required, the request is posted to the DIME WG mailing list (or, if 6083 it has been disbanded, a successor designated by the Area Director) 6084 for comment and review, and MUST include a pointer to a public 6085 specification. Before a period of 30 days has passed, the Designated 6086 Expert will either approve or deny the registration request and 6087 publish a notice of the decision to the DIME WG mailing list or its 6088 successor. A denial notice MUST be justified by an explanation and, 6089 in the cases where it is possible, concrete suggestions on how the 6090 request can be modified so as to become acceptable. 6092 11.1. AVP Header 6094 As defined in Section 4, the AVP header contains three fields that 6095 requires IANA namespace management; the AVP Code, Vendor-ID and Flags 6096 field. 6098 11.1.1. AVP Codes 6100 The AVP Code namespace is used to identify attributes. There are 6101 multiple namespaces. Vendors can have their own AVP Codes namespace 6102 which will be identified by their Vendor-ID (also known as 6103 Enterprise-Number) and they control the assignments of their vendor- 6104 specific AVP codes within their own namespace. The absence of a 6105 Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA 6106 controlled AVP Codes namespace. The AVP Codes and sometimes also 6107 possible values in an AVP are controlled and maintained by IANA. 6109 AVP Code 0 is not used. AVP Codes 1-255 are managed separately as 6110 RADIUS Attribute Types [RADTYPE]. This document defines the AVP 6111 Codes 257-274, 276-285, 287, 291-300, 480, 483 and 485-486. See 6112 Section 4.5 for the assignment of the namespace in this 6113 specification. 6115 AVPs may be allocated following Designated Expert with Specification 6116 Required [RFC5226]. Release of blocks of AVPs (more than 3 at a time 6117 for a given purpose) should require IETF Review. 6119 Note that Diameter defines a mechanism for Vendor-Specific AVPs, 6120 where the Vendor-Id field in the AVP header is set to a non-zero 6121 value. Vendor-Specific AVPs codes are for Private Use and should be 6122 encouraged instead of allocation of global attribute types, for 6123 functions specific only to one vendor's implementation of Diameter, 6124 where no interoperability is deemed useful. Where a Vendor-Specific 6125 AVP is implemented by more than one vendor, allocation of global AVPs 6126 should be encouraged instead. 6128 11.1.2. AVP Flags 6130 There are 8 bits in the AVP Flags field of the AVP header, defined in 6131 Section 4. This document assigns bit 0 ('V'endor Specific), bit 1 6132 ('M'andatory) and bit 2 ('P'rotected). The remaining bits should 6133 only be assigned via a Standards Action [RFC5226]. 6135 11.2. Diameter Header 6137 As defined in Section 3, the Diameter header contains two fields that 6138 require IANA namespace management; Command Code and Command Flags. 6140 11.2.1. Command Codes 6142 The Command Code namespace is used to identify Diameter commands. 6143 The values 0-255 (0x00-0xff) are reserved for RADIUS backward 6144 compatibility, and are defined as "RADIUS Packet Type Codes" in 6145 [RADTYPE]. Values 256 - 8,388,607 (0x100 to 0x7fffff) are for 6146 permanent, standard commands, allocated by IETF Review [RFC5226]. 6147 This document defines the Command Codes 257, 258, 271, 274-275, 280 6148 and 282. See Section 3.1 for the assignment of the namespace in this 6149 specification. 6151 The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved 6152 for vendor-specific command codes, to be allocated on a First Come, 6153 First Served basis by IANA [RFC5226]. The request to IANA for a 6154 Vendor-Specific Command Code SHOULD include a reference to a publicly 6155 available specification which documents the command in sufficient 6156 detail to aid in interoperability between independent 6157 implementations. If the specification cannot be made publicly 6158 available, the request for a vendor-specific command code MUST 6159 include the contact information of persons and/or entities 6160 responsible for authoring and maintaining the command. 6162 The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe - 6163 0xffffff) are reserved for experimental commands. As these codes are 6164 only for experimental and testing purposes, no guarantee is made for 6165 interoperability between Diameter peers using experimental commands, 6166 as outlined in [IANA-EXP]. 6168 11.2.2. Command Flags 6170 There are eight bits in the Command Flags field of the Diameter 6171 header. This document assigns bit 0 ('R'equest), bit 1 ('P'roxy), 6172 bit 2 ('E'rror) and bit 3 ('T'). Bits 4 through 7 MUST only be 6173 assigned via a Standards Action [RFC5226]. 6175 11.3. Application Identifiers 6177 As defined in Section 2.4, the Application Id is used to identify a 6178 specific Diameter Application. There are standards-track Application 6179 Ids and vendor specific Application Ids. 6181 IANA [RFC5226] has assigned the range 0x00000001 to 0x00ffffff for 6182 standards-track applications; and 0x01000000 - 0xfffffffe for vendor 6183 specific applications, on a first-come, first-served basis. The 6184 following values are allocated. 6186 Diameter Common Messages 0 6187 Diameter Base Accounting 3 6188 Relay 0xffffffff 6190 Assignment of standards-track Application Ids are by Designated 6191 Expert with Specification Required [RFC5226]. 6193 Both Auth-Application-Id and Acct-Application-Id AVPs use the same 6194 Application Id space. A Diameter node advertising itself as a relay 6195 agent MUST set either Application-Id or Acct-Application-Id to 6196 0xffffffff. 6198 Vendor-Specific Application Ids, are for Private Use. Vendor-Specific 6199 Application Ids are assigned on a First Come, First Served basis by 6200 IANA. 6202 11.4. AVP Values 6204 Certain AVPs in Diameter define a list of values with various 6205 meanings. This section lists such attributes in the Diameter base 6206 protocol and their IANA allocation rules. 6208 Allocation of Application Ids was discussed in Section 2.4. Other 6209 attributes in the base protocol do not take enumerated values or bit 6210 masks or employ existing name spaces such as SMI Network Management 6211 Private Enterprise Codes [RFC3232] or IP addresses. The allocation 6212 of new values for these existing name spaces is done in accordance 6213 with the rules already defined for them. 6215 11.4.1. Result-Code AVP Values 6217 As defined in Section 7.1, the Result-Code AVP (AVP Code 268) defines 6218 the values 1001, 2001-2002, 3001-3012, 4001-4003 and 5001-5021. 6220 All remaining values are available for assignment via IETF Review 6221 [RFC5226]. 6223 11.4.2. Experimental-Result-Code AVP 6225 Values for this AVP are purely local to the indicated vendor, and no 6226 IANA registry is maintained for them. 6228 11.4.3. Accounting-Record-Type AVP Values 6230 As defined in Section 9.8.1, the Accounting-Record-Type AVP (AVP Code 6231 480) defines the values 1-4. All remaining values are available for 6232 assignment via IETF Review [RFC5226]. 6234 11.4.4. Termination-Cause AVP Values 6236 As defined in Section 8.15, the Termination-Cause AVP (AVP Code 295) 6237 defines the values 1-8. All remaining values are available for 6238 assignment via IETF Review [RFC5226]. 6240 11.4.5. Redirect-Host-Usage AVP Values 6242 As defined in Section 6.13, the Redirect-Host-Usage AVP (AVP Code 6243 261) defines the values 0-5. All remaining values are available for 6244 assignment via IETF Review [RFC5226]. 6246 11.4.6. Session-Server-Failover AVP Values 6248 As defined in Section 8.18, the Session-Server-Failover AVP (AVP Code 6249 271) defines the values 0-3. All remaining values are available for 6250 assignment via IETF Review [RFC5226]. 6252 11.4.7. Session-Binding AVP Values 6254 As defined in Section 8.17, the Session-Binding AVP (AVP Code 270) 6255 defines the bits 1-4. All remaining bits are available for 6256 assignment via IETF Review [RFC5226]. 6258 11.4.8. Disconnect-Cause AVP Values 6260 As defined in Section 5.4.3, the Disconnect-Cause AVP (AVP Code 273) 6261 defines the values 0-2. All remaining values are available for 6262 assignment via IETF Review [RFC5226]. 6264 11.4.9. Auth-Request-Type AVP Values 6266 As defined in Section 8.7, the Auth-Request-Type AVP (AVP Code 274) 6267 defines the values 1-3. All remaining values are available for 6268 assignment via IETF Review [RFC5226]. 6270 11.4.10. Auth-Session-State AVP Values 6272 As defined in Section 8.11, the Auth-Session-State AVP (AVP Code 277) 6273 defines the values 0-1. All remaining values are available for 6274 assignment via IETF Review [RFC5226]. 6276 11.4.11. Re-Auth-Request-Type AVP Values 6278 As defined in Section 8.12, the Re-Auth-Request-Type AVP (AVP Code 6279 285) defines the values 0-1. All remaining values are available for 6280 assignment via IETF Review [RFC5226]. 6282 11.4.12. Accounting-Realtime-Required AVP Values 6284 As defined in Section 9.8.7, the Accounting-Realtime-Required AVP 6285 (AVP Code 483) defines the values 1-3. All remaining values are 6286 available for assignment via IETF Review [RFC5226]. 6288 11.4.13. Inband-Security-Id AVP (code 299) 6290 As defined in Section 6.10, the Inband-Security-Id AVP (AVP Code 299) 6291 defines the values 0-1. All remaining values are available for 6292 assignment via IETF Review. [RFC5226]. 6294 11.5. Diameter TCP, SCTP and TLS/TCP Port Numbers 6296 The IANA has assigned port number 3868 for TCP and SCTP. The port 6297 number [TBD] has been assigned for TLS/TCP. 6299 11.6. S-NAPTR Parameters 6301 This document registers a S-NAPTR Application Service Tag value of 6302 "aaa". 6304 This document also registers the following S-NAPTR Application 6305 Protocol Tags: 6307 Tag | Protocol 6308 -------------------|--------- 6309 diameter.tcp | TCP 6310 diameter.sctp | SCTP 6311 diameter.tls.tcp | TLS/TCP 6313 12. Diameter protocol related configurable parameters 6315 This section contains the configurable parameters that are found 6316 throughout this document: 6318 Diameter Peer 6320 A Diameter entity MAY communicate with peers that are statically 6321 configured. A statically configured Diameter peer would require 6322 that either the IP address or the fully qualified domain name 6323 (FQDN) be supplied, which would then be used to resolve through 6324 DNS. 6326 Routing Table 6328 A Diameter proxy server routes messages based on the realm portion 6329 of a Network Access Identifier (NAI). The server MUST have a 6330 table of Realm Names, and the address of the peer to which the 6331 message must be forwarded to. The routing table MAY also include 6332 a "default route", which is typically used for all messages that 6333 cannot be locally processed. 6335 Tc timer 6337 The Tc timer controls the frequency that transport connection 6338 attempts are done to a peer with whom no active transport 6339 connection exists. The recommended value is 30 seconds. 6341 13. Security Considerations 6343 The Diameter base protocol messages SHOULD be secured by using TLS 6344 [RFC5246]. Additional security mechanisms such as IPsec [RFC4301] 6345 MAY also be deployed to secure connections between peers. However, 6346 all Diameter base protocol implementations MUST support the use of 6347 TLS and the Diameter protocol MUST NOT be used without any security 6348 mechanism. 6350 If a Diameter connection is to be protected via TLS or IPsec, then 6351 TLS or IPsec handshake SHOULD begin prior to any Diameter message 6352 exchange. All security parameters for TLS or IPsec are configured 6353 independent of the Diameter protocol. All Diameter message will be 6354 sent through the TLS or IPsec connection after a successful setup. 6356 For TLS connections to be established in the open state, the CER/CEA 6357 exchange MUST include an Inband-Security-ID AVP with a value of TLS. 6358 The TLS handshake will begin when both ends successfully reached the 6359 open state, after completion of the CER/CEA exchange. If the TLS 6360 handshake is successful, all further messages will be sent via TLS. 6361 If the handshake fails, both ends move to the closed state. See 6362 Sections 13.1 for more details. 6364 13.1. TLS Usage 6366 Diameter nodes using TLS for security MUST mutually authenticate as 6367 part of TLS session establishment. In order to ensure mutual 6368 authentication, the Diameter node acting as TLS server MUST request a 6369 certificate from the Diameter node acting as TLS client, and the 6370 Diameter node acting as TLS client MUST be prepared to supply a 6371 certificate on request. 6373 Diameter nodes MUST be able to negotiate the following TLS cipher 6374 suites: 6376 TLS_RSA_WITH_RC4_128_MD5 6377 TLS_RSA_WITH_RC4_128_SHA 6378 TLS_RSA_WITH_3DES_EDE_CBC_SHA 6380 Diameter nodes SHOULD be able to negotiate the following TLS cipher 6381 suite: 6383 TLS_RSA_WITH_AES_128_CBC_SHA 6385 Diameter nodes MAY negotiate other TLS cipher suites. 6387 13.2. Peer-to-Peer Considerations 6389 As with any peer-to-peer protocol, proper configuration of the trust 6390 model within a Diameter peer is essential to security. When 6391 certificates are used, it is necessary to configure the root 6392 certificate authorities trusted by the Diameter peer. These root CAs 6393 are likely to be unique to Diameter usage and distinct from the root 6394 CAs that might be trusted for other purposes such as Web browsing. 6395 In general, it is expected that those root CAs will be configured so 6396 as to reflect the business relationships between the organization 6397 hosting the Diameter peer and other organizations. As a result, a 6398 Diameter peer will typically not be configured to allow connectivity 6399 with any arbitrary peer. With certificate authentication, Diameter 6400 peers may not be known beforehand and therefore peer discovery may be 6401 required. 6403 14. References 6405 14.1. Normative References 6407 [FLOATPOINT] 6408 Institute of Electrical and Electronics Engineers, "IEEE 6409 Standard for Binary Floating-Point Arithmetic, ANSI/IEEE 6410 Standard 754-1985", August 1985. 6412 [IANAADFAM] 6413 IANA,, "Address Family Numbers", 6414 http://www.iana.org/assignments/address-family-numbers. 6416 [RADTYPE] IANA,, "RADIUS Types", 6417 http://www.iana.org/assignments/radius-types. 6419 [RFC791] Postel, J., "Internet Protocol", RFC 791, September 1981. 6421 [RFC793] Postel, J., "Transmission Control Protocol", RFC 793, 6422 January 1981. 6424 [RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and 6425 Accounting (AAA) Transport Profile", RFC 3539, June 2003. 6427 [RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and 6428 P. McCann, "Diameter Mobile IPv4 Application", RFC 4004, 6429 August 2005. 6431 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton, 6432 "Diameter Network Access Server Application", RFC 4005, 6433 August 2005. 6435 [RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J. 6436 Loughney, "Diameter Credit-Control Application", RFC 4006, 6437 August 2005. 6439 [RFC4072] Eronen, P., Hiller, T., and G. Zorn, "Diameter Extensible 6440 Authentication Protocol (EAP) Application", RFC 4072, 6441 August 2005. 6443 [RFC4740] Garcia-Martin, M., Belinchon, M., Pallares-Lopez, M., 6444 Canales-Valenzuela, C., and K. Tammi, "Diameter Session 6445 Initiation Protocol (SIP) Application", RFC 4740, 6446 November 2006. 6448 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 6449 Specifications: ABNF", STD 68, RFC 5234, January 2008. 6451 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J. 6452 Arkko, "Diameter Base Protocol", RFC 3588, September 2003. 6454 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 6455 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 6456 May 2008. 6458 [RFC4306] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol", 6459 RFC 4306, December 2005. 6461 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 6462 Architecture", RFC 4291, February 2006. 6464 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 6465 Requirement Levels", BCP 14, RFC 2119, March 1997. 6467 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The 6468 Network Access Identifier", RFC 4282, December 2005. 6470 [RFC3403] Mealling, M., "Dynamic Delegation Discovery System (DDDS) 6471 Part Three: The Domain Name System (DNS) Database", 6472 RFC 3403, October 2002. 6474 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 6475 Requirements for Security", BCP 106, RFC 4086, June 2005. 6477 [RFC4960] Stewart, R., "Stream Control Transmission Protocol", 6478 RFC 4960, September 2007. 6480 [RFC3958] Daigle, L. and A. Newton, "Domain-Based Application 6481 Service Location Using SRV RRs and the Dynamic Delegation 6482 Discovery Service (DDDS)", RFC 3958, January 2005. 6484 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 6485 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 6487 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 6488 Resource Identifier (URI): Generic Syntax", STD 66, 6489 RFC 3986, January 2005. 6491 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 6492 10646", STD 63, RFC 3629, November 2003. 6494 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 6495 Housley, R., and W. Polk, "Internet X.509 Public Key 6496 Infrastructure Certificate and Certificate Revocation List 6497 (CRL) Profile", RFC 5280, May 2008. 6499 [RFC3490] Faltstrom, P., Hoffman, P., and A. Costello, 6500 "Internationalizing Domain Names in Applications (IDNA)", 6501 RFC 3490, March 2003. 6503 [RFC3491] Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep 6504 Profile for Internationalized Domain Names (IDN)", 6505 RFC 3491, March 2003. 6507 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 6508 for Internationalized Domain Names in Applications 6509 (IDNA)", RFC 3492, March 2003. 6511 14.2. Informational References 6513 [RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P., 6514 Shiino, H., Zorn, G., Dommety, G., C.Perkins, B.Patil, 6515 D.Mitton, S.Manning, M.Beadles, P.Walsh, X.Chen, 6516 S.Sivalingham, A.Hameed, M.Munson, S.Jacobs, B.Lim, 6517 B.Hirschman, R.Hsu, Y.Xu, E.Campell, S.Baba, and E.Jaques, 6518 "Criteria for Evaluating AAA Protocols for Network 6519 Access", RFC 2989, November 2000. 6521 [RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to 6522 Accounting Management", RFC 2975, October 2000. 6524 [RFC3232] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by 6525 an On-line Database", RFC 3232, January 2002. 6527 [RFC5176] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B. 6528 Aboba, "Dynamic Authorization Extensions to Remote 6529 Authentication Dial In User Service (RADIUS)", RFC 5176, 6530 January 2008. 6532 [RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, 6533 RFC 1661, July 1994. 6535 [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000. 6537 [RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS 6538 Extensions", RFC 2869, June 2000. 6540 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, 6541 "Remote Authentication Dial In User Service (RADIUS)", 6542 RFC 2865, June 2000. 6544 [RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6", 6545 RFC 3162, August 2001. 6547 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 6548 Internet Protocol", RFC 4301, December 2005. 6550 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 6551 A., Peterson, J., Sparks, R., Handley, M., and E. 6552 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 6553 June 2002. 6555 [RFC4330] Mills, D., "Simple Network Time Protocol (SNTP) Version 4 6556 for IPv4, IPv6 and OSI", RFC 4330, January 2006. 6558 [RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called 6559 TACACS", RFC 1492, July 1993. 6561 [RFC4690] Klensin, J., Faltstrom, P., Karp, C., and IAB, "Review and 6562 Recommendations for Internationalized Domain Names 6563 (IDNs)", RFC 4690, September 2006. 6565 [RFC5461] Gont, F., "TCP's Reaction to Soft Errors", RFC 5461, 6566 February 2009. 6568 [I-D.ietf-tcpm-icmp-attacks] 6569 Gont, F., "ICMP attacks against TCP", 6570 draft-ietf-tcpm-icmp-attacks-04 (work in progress), 6571 October 2008. 6573 [IANA-EXP] 6574 Narten, T., "Assigning Experimental and Testing Numbers 6575 Considered Useful, Work in Progress.". 6577 Appendix A. Acknowledgements 6579 A.1. RFC3588bis 6581 The authors would like to thank the following people that have 6582 provided proposals and contributions to this document: 6584 To Vishnu Ram and Satendra Gera for their contributions on 6585 Capabilities Updates, Predictive Loop Avoidance as well as many other 6586 technical proposals. To Tolga Asveren for his insights and 6587 contributions on almost all of the proposed solutions incorporated 6588 into this document. To Timothy Smith for helping on the Capabilities 6589 Updates and other topics. To Tony Zhang for providing fixes to loop 6590 holes on composing Failed-AVPs as well as many other issues and 6591 topics. To Jan Nordqvist for clearly stating the usage of 6592 Application Ids. To Anders Kristensen for providing needed technical 6593 opinions. To David Frascone for providing invaluable review of the 6594 document. To Mark Jones for providing clarifying text on vendor 6595 command codes and other vendor specific indicators. 6597 Special thanks to the Diameter extensibility design team which helped 6598 resolve the tricky question of mandatory AVPs and ABNF semantics. 6599 The members of this team are as follows: 6601 Avi Lior, Jari Arkko, Glen Zorn, Lionel Morand, Mark Jones, Tolga 6602 Asveren Jouni Korhonen, Glenn McGregor. 6604 Special thanks also to people who have provided invaluable comments 6605 and inputs especially in resolving controversial issues: 6607 Glen Zorn, Yoshihiro Ohba, Marco Stura, and Pasi Eronen. 6609 Finally, we would like to thank the original authors of this 6610 document: 6612 Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman and Glen Zorn. 6614 Their invaluable knowledge and experience has given us a robust and 6615 flexible AAA protocol that many people have seen great value in 6616 adopting. We greatly appreciate their support and stewardship for 6617 the continued improvements of Diameter as a protocol. We would also 6618 like to extend our gratitude to folks aside from the authors who have 6619 assisted and contributed to the original version of this document. 6620 Their efforts significantly contributed to the success of Diameter. 6622 A.2. RFC3588 6624 The authors would like to thank Nenad Trifunovic, Tony Johansson and 6625 Pankaj Patel for their participation in the pre-IETF Document Reading 6626 Party. Allison Mankin, Jonathan Wood and Bernard Aboba provided 6627 invaluable assistance in working out transport issues, and similarly 6628 with Steven Bellovin in the security area. 6630 Paul Funk and David Mitton were instrumental in getting the Peer 6631 State Machine correct, and our deep thanks go to them for their time. 6633 Text in this document was also provided by Paul Funk, Mark Eklund, 6634 Mark Jones and Dave Spence. Jacques Caron provided many great 6635 comments as a result of a thorough review of the spec. 6637 The authors would also like to acknowledge the following people for 6638 their contribution in the development of the Diameter protocol: 6640 Allan C. Rubens, Haseeb Akhtar, William Bulley, Stephen Farrell, 6641 David Frascone, Daniel C. Fox, Lol Grant, Ignacio Goyret, Nancy 6642 Greene, Peter Heitman, Fredrik Johansson, Mark Jones, Martin Julien, 6643 Bob Kopacz, Paul Krumviede, Fergal Ladley, Ryan Moats, Victor Muslin, 6644 Kenneth Peirce, John Schnizlein, Sumit Vakil, John R. Vollbrecht and 6645 Jeff Weisberg. 6647 Finally, Pat Calhoun would like to thank Sun Microsystems since most 6648 of the effort put into this document was done while he was in their 6649 employ. 6651 Appendix B. S-NAPTR Example 6653 As an example, consider a client that wishes to resolve aaa: 6654 example1.com. The client performs a NAPTR query for that domain, and 6655 the following NAPTR records are returned: 6657 ;; order pref flags service regexp replacement 6658 IN NAPTR 50 50 "s" "aaa:diameter.tls.tcp" "" _diameter._tls.example1.com 6659 IN NAPTR 100 50 "s" "aaa:diameter.tcp" "" _aaa._tcp.example1.com 6660 IN NAPTR 150 50 "s" "aaa:diameter.sctp" "" _diameter._sctp.example1.com 6662 This indicates that the server supports TLS, TCP and SCTP in that 6663 order. If the client supports TLS, TLS will be used, targeted to a 6664 host determined by an SRV lookup of _diameter._tls.example1.com. 6665 That lookup would return: 6667 ;; Priority Weight Port Target 6668 IN SRV 0 1 5060 server1.example1.com 6669 IN SRV 0 2 5060 server2.example1.com 6671 As an alternative example, a client that wishes to resolve aaa: 6672 example2.com. The client performs a NAPTR query for that domain, and 6673 the following NAPTR records are returned: 6675 ;; order pref flags service regexp replacement 6676 IN NAPTR 150 50 "a" "aaa:diameter.tls.tcp" "" server1.example2.com 6677 IN NAPTR 150 50 "a" "aaa:diameter.tls.tcp" "" server2.example2.com 6679 This indicates that the server supports TCP available at the returned 6680 host names. 6682 Appendix C. Duplicate Detection 6684 As described in Section 9.4, accounting record duplicate detection is 6685 based on session identifiers. Duplicates can appear for various 6686 reasons: 6688 o Failover to an alternate server. Where close to real-time 6689 performance is required, failover thresholds need to be kept low 6690 and this may lead to an increased likelihood of duplicates. 6691 Failover can occur at the client or within Diameter agents. 6693 o Failure of a client or agent after sending of a record from non- 6694 volatile memory, but prior to receipt of an application layer ACK 6695 and deletion of the record. record to be sent. This will result 6696 in retransmission of the record soon after the client or agent has 6697 rebooted. 6699 o Duplicates received from RADIUS gateways. Since the 6700 retransmission behavior of RADIUS is not defined within [RFC2865], 6701 the likelihood of duplication will vary according to the 6702 implementation. 6704 o Implementation problems and misconfiguration. 6706 The T flag is used as an indication of an application layer 6707 retransmission event, e.g., due to failover to an alternate server. 6708 It is defined only for request messages sent by Diameter clients or 6709 agents. For instance, after a reboot, a client may not know whether 6710 it has already tried to send the accounting records in its non- 6711 volatile memory before the reboot occurred. Diameter servers MAY use 6712 the T flag as an aid when processing requests and detecting duplicate 6713 messages. However, servers that do this MUST ensure that duplicates 6714 are found even when the first transmitted request arrives at the 6715 server after the retransmitted request. It can be used only in cases 6716 where no answer has been received from the Server for a request and 6717 the request is sent again, (e.g., due to a failover to an alternate 6718 peer, due to a recovered primary peer or due to a client re-sending a 6719 stored record from non-volatile memory such as after reboot of a 6720 client or agent). 6722 In some cases the Diameter accounting server can delay the duplicate 6723 detection and accounting record processing until a post-processing 6724 phase takes place. At that time records are likely to be sorted 6725 according to the included User-Name and duplicate elimination is easy 6726 in this case. In other situations it may be necessary to perform 6727 real-time duplicate detection, such as when credit limits are imposed 6728 or real-time fraud detection is desired. 6730 In general, only generation of duplicates due to failover or re- 6731 sending of records in non-volatile storage can be reliably detected 6732 by Diameter clients or agents. In such cases the Diameter client or 6733 agents can mark the message as possible duplicate by setting the T 6734 flag. Since the Diameter server is responsible for duplicate 6735 detection, it can choose to make use of the T flag or not, in order 6736 to optimize duplicate detection. Since the T flag does not affect 6737 interoperability, and may not be needed by some servers, generation 6738 of the T flag is REQUIRED for Diameter clients and agents, but MAY be 6739 implemented by Diameter servers. 6741 As an example, it can be usually be assumed that duplicates appear 6742 within a time window of longest recorded network partition or device 6743 fault, perhaps a day. So only records within this time window need 6744 to be looked at in the backward direction. Secondly, hashing 6745 techniques or other schemes, such as the use of the T flag in the 6746 received messages, may be used to eliminate the need to do a full 6747 search even in this set except for rare cases. 6749 The following is an example of how the T flag may be used by the 6750 server to detect duplicate requests. 6752 A Diameter server MAY check the T flag of the received message to 6753 determine if the record is a possible duplicate. If the T flag is 6754 set in the request message, the server searches for a duplicate 6755 within a configurable duplication time window backward and 6756 forward. This limits database searching to those records where 6757 the T flag is set. In a well run network, network partitions and 6758 device faults will presumably be rare events, so this approach 6759 represents a substantial optimization of the duplicate detection 6760 process. During failover, it is possible for the original record 6761 to be received after the T flag marked record, due to differences 6762 in network delays experienced along the path by the original and 6763 duplicate transmissions. The likelihood of this occurring 6764 increases as the failover interval is decreased. In order to be 6765 able to detect out of order duplicates, the Diameter server should 6766 use backward and forward time windows when performing duplicate 6767 checking for the T flag marked request. For example, in order to 6768 allow time for the original record to exit the network and be 6769 recorded by the accounting server, the Diameter server can delay 6770 processing records with the T flag set until a time period 6771 TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing 6772 of the original transport connection. After this time period has 6773 expired, then it may check the T flag marked records against the 6774 database with relative assurance that the original records, if 6775 sent, have been received and recorded. 6777 Appendix D. Internationalized Domain Names 6779 To be compatible with the existing DNS infrastructure and simplify 6780 host and domain name comparison, Diameter identities (FQDNs) are 6781 represented in ASCII form. This allows the Diameter protocol to fall 6782 in-line with the DNS strategy of being transparent from the effects 6783 of Internationalized Domain Names (IDNs) by following the 6784 recommendations in [RFC4690] and [RFC3490]. Applications that 6785 provide support for IDNs outside of the Diameter protocol but 6786 interacting with it SHOULD use the representation and conversion 6787 framework described in [RFC3490], [RFC3491] and [RFC3492]. 6789 Authors' Addresses 6791 Victor Fajardo (editor) 6792 Telcordia Technologies 6793 One Telcordia Drive, 1S-222 6794 Piscataway, NJ 08854 6795 USA 6797 Phone: 1 908-421-1845 6798 Email: vf0213@gmail.com 6800 Jari Arkko 6801 Ericsson Research 6802 02420 Jorvas 6803 Finland 6805 Phone: +358 40 5079256 6806 Email: jari.arkko@ericsson.com 6808 John Loughney 6809 Nokia Research Center 6810 955 Page Mill Road 6811 Palo Alto, CA 94304 6812 US 6814 Phone: 1-650-283-8068 6815 Email: john.loughney@nokia.com 6817 Glenn Zorn 6818 Network Zen 6819 1310 East Thomas Street 6820 Seattle, WA 98102 6821 US 6823 Phone: 6824 Email: gwz@net-zen.net