idnits 2.17.1 draft-ietf-dime-rfc3588bis-17.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** The document seems to lack a License Notice according IETF Trust Provisions of 28 Dec 2009, Section 6.b.i or Provisions of 12 Sep 2009 Section 6.b -- however, there's a paragraph with a matching beginning. Boilerplate error? (You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Feb 2009 rather than one of the newer Notices. See https://trustee.ietf.org/license-info/.) Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-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 4553 has weird spacing: '...ly with wit...' == Line 4760 has weird spacing: '...ealtime user...' == Line 4788 has weird spacing: '... record inter...' == Line 4798 has weird spacing: '...ealtime user...' == Line 4806 has weird spacing: '...ealtime user...' == (1 more instance...) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (May 6, 2009) is 5469 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 1002, but not defined == Missing Reference: 'PXY' is mentioned on line 4266, but not defined == Unused Reference: 'RFC4306' is defined on line 6506, but no explicit reference was found in the text == Unused Reference: 'RFC5280' is defined on line 6538, 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 (~~), 13 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 Toshiba America Research 4 Obsoletes: 3588 (if approved) J. Arkko 5 Intended status: Standards Track Ericsson Research 6 Expires: November 7, 2009 J. Loughney 7 Nokia Research Center 8 G. Zorn 9 NetCube 10 May 6, 2009 12 Diameter Base Protocol 13 draft-ietf-dime-rfc3588bis-17.txt 15 Status of this Memo 17 This Internet-Draft is submitted to IETF in full conformance with the 18 provisions of BCP 78 and BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF), its areas, and its working groups. Note that 22 other groups may also distribute working documents as Internet- 23 Drafts. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 The list of current Internet-Drafts can be accessed at 31 http://www.ietf.org/ietf/1id-abstracts.txt. 33 The list of Internet-Draft Shadow Directories can be accessed at 34 http://www.ietf.org/shadow.html. 36 This Internet-Draft will expire on November 7, 2009. 38 Copyright Notice 40 Copyright (c) 2009 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents in effect on the date of 45 publication of this document (http://trustee.ietf.org/license-info). 46 Please review these documents carefully, as they describe your rights 47 and restrictions with respect to this document. 49 Abstract 51 The Diameter base protocol is intended to provide an Authentication, 52 Authorization and Accounting (AAA) framework for applications such as 53 network access or IP mobility in both local and roaming situations. 54 This document specifies the message format, transport, error 55 reporting, accounting and security services used by all Diameter 56 applications. The Diameter base protocol as defined in this document 57 must be supported by all Diameter implementations. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 62 1.1. Diameter Protocol . . . . . . . . . . . . . . . . . . . . 9 63 1.1.1. Description of the Document Set . . . . . . . . . . 10 64 1.1.2. Conventions Used in This Document . . . . . . . . . 11 65 1.1.3. Changes from RFC3588 . . . . . . . . . . . . . . . . 12 66 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 13 67 1.3. Approach to Extensibility . . . . . . . . . . . . . . . . 19 68 1.3.1. Defining New AVP Values . . . . . . . . . . . . . . 19 69 1.3.2. Creating New AVPs . . . . . . . . . . . . . . . . . 19 70 1.3.3. Creating New Commands . . . . . . . . . . . . . . . 20 71 1.3.4. Creating New Diameter Applications . . . . . . . . . 20 72 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 22 73 2.1. Transport . . . . . . . . . . . . . . . . . . . . . . . . 23 74 2.1.1. SCTP Guidelines . . . . . . . . . . . . . . . . . . 24 75 2.2. Securing Diameter Messages . . . . . . . . . . . . . . . 24 76 2.3. Diameter Application Compliance . . . . . . . . . . . . . 24 77 2.4. Application Identifiers . . . . . . . . . . . . . . . . . 25 78 2.5. Connections vs. Sessions . . . . . . . . . . . . . . . . 25 79 2.6. Peer Table . . . . . . . . . . . . . . . . . . . . . . . 26 80 2.7. Routing Table . . . . . . . . . . . . . . . . . . . . . . 27 81 2.8. Role of Diameter Agents . . . . . . . . . . . . . . . . . 29 82 2.8.1. Relay Agents . . . . . . . . . . . . . . . . . . . . 30 83 2.8.2. Proxy Agents . . . . . . . . . . . . . . . . . . . . 31 84 2.8.3. Redirect Agents . . . . . . . . . . . . . . . . . . 31 85 2.8.4. Translation Agents . . . . . . . . . . . . . . . . . 32 86 2.9. Diameter Path Authorization . . . . . . . . . . . . . . . 33 87 3. Diameter Header . . . . . . . . . . . . . . . . . . . . . . . 35 88 3.1. Command Codes . . . . . . . . . . . . . . . . . . . . . . 38 89 3.2. Command Code ABNF specification . . . . . . . . . . . . . 38 90 3.3. Diameter Command Naming Conventions . . . . . . . . . . . 41 91 4. Diameter AVPs . . . . . . . . . . . . . . . . . . . . . . . . 42 92 4.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 42 93 4.1.1. Optional Header Elements . . . . . . . . . . . . . . 43 94 4.2. Basic AVP Data Formats . . . . . . . . . . . . . . . . . 44 95 4.3. Derived AVP Data Formats . . . . . . . . . . . . . . . . 45 96 4.4. Grouped AVP Values . . . . . . . . . . . . . . . . . . . 52 97 4.4.1. Example AVP with a Grouped Data type . . . . . . . . 53 98 4.5. Diameter Base Protocol AVPs . . . . . . . . . . . . . . . 56 99 5. Diameter Peers . . . . . . . . . . . . . . . . . . . . . . . 59 100 5.1. Peer Connections . . . . . . . . . . . . . . . . . . . . 59 101 5.2. Diameter Peer Discovery . . . . . . . . . . . . . . . . . 59 102 5.3. Capabilities Exchange . . . . . . . . . . . . . . . . . . 62 103 5.3.1. Capabilities-Exchange-Request . . . . . . . . . . . 63 104 5.3.2. Capabilities-Exchange-Answer . . . . . . . . . . . . 64 105 5.3.3. Vendor-Id AVP . . . . . . . . . . . . . . . . . . . 65 106 5.3.4. Firmware-Revision AVP . . . . . . . . . . . . . . . 65 107 5.3.5. Host-IP-Address AVP . . . . . . . . . . . . . . . . 65 108 5.3.6. Supported-Vendor-Id AVP . . . . . . . . . . . . . . 65 109 5.3.7. Product-Name AVP . . . . . . . . . . . . . . . . . . 65 110 5.4. Disconnecting Peer connections . . . . . . . . . . . . . 66 111 5.4.1. Disconnect-Peer-Request . . . . . . . . . . . . . . 66 112 5.4.2. Disconnect-Peer-Answer . . . . . . . . . . . . . . . 66 113 5.4.3. Disconnect-Cause AVP . . . . . . . . . . . . . . . . 67 114 5.5. Transport Failure Detection . . . . . . . . . . . . . . . 67 115 5.5.1. Device-Watchdog-Request . . . . . . . . . . . . . . 67 116 5.5.2. Device-Watchdog-Answer . . . . . . . . . . . . . . . 68 117 5.5.3. Transport Failure Algorithm . . . . . . . . . . . . 68 118 5.5.4. Failover and Failback Procedures . . . . . . . . . . 68 119 5.6. Peer State Machine . . . . . . . . . . . . . . . . . . . 69 120 5.6.1. Incoming connections . . . . . . . . . . . . . . . . 72 121 5.6.2. Events . . . . . . . . . . . . . . . . . . . . . . . 72 122 5.6.3. Actions . . . . . . . . . . . . . . . . . . . . . . 73 123 5.6.4. The Election Process . . . . . . . . . . . . . . . . 75 124 6. Diameter message processing . . . . . . . . . . . . . . . . . 76 125 6.1. Diameter Request Routing Overview . . . . . . . . . . . . 76 126 6.1.1. Originating a Request . . . . . . . . . . . . . . . 77 127 6.1.2. Sending a Request . . . . . . . . . . . . . . . . . 77 128 6.1.3. Receiving Requests . . . . . . . . . . . . . . . . . 78 129 6.1.4. Processing Local Requests . . . . . . . . . . . . . 78 130 6.1.5. Request Forwarding . . . . . . . . . . . . . . . . . 78 131 6.1.6. Request Routing . . . . . . . . . . . . . . . . . . 78 132 6.1.7. Predictive Loop Avoidance . . . . . . . . . . . . . 79 133 6.1.8. Redirecting Requests . . . . . . . . . . . . . . . . 79 134 6.1.9. Relaying and Proxying Requests . . . . . . . . . . . 80 135 6.2. Diameter Answer Processing . . . . . . . . . . . . . . . 82 136 6.2.1. Processing received Answers . . . . . . . . . . . . 82 137 6.2.2. Relaying and Proxying Answers . . . . . . . . . . . 82 138 6.3. Origin-Host AVP . . . . . . . . . . . . . . . . . . . . . 83 139 6.4. Origin-Realm AVP . . . . . . . . . . . . . . . . . . . . 83 140 6.5. Destination-Host AVP . . . . . . . . . . . . . . . . . . 83 141 6.6. Destination-Realm AVP . . . . . . . . . . . . . . . . . . 84 142 6.7. Routing AVPs . . . . . . . . . . . . . . . . . . . . . . 84 143 6.7.1. Route-Record AVP . . . . . . . . . . . . . . . . . . 84 144 6.7.2. Proxy-Info AVP . . . . . . . . . . . . . . . . . . . 84 145 6.7.3. Proxy-Host AVP . . . . . . . . . . . . . . . . . . . 85 146 6.7.4. Proxy-State AVP . . . . . . . . . . . . . . . . . . 85 147 6.8. Auth-Application-Id AVP . . . . . . . . . . . . . . . . . 85 148 6.9. Acct-Application-Id AVP . . . . . . . . . . . . . . . . . 85 149 6.10. Inband-Security-Id AVP . . . . . . . . . . . . . . . . . 85 150 6.11. Vendor-Specific-Application-Id AVP . . . . . . . . . . . 86 151 6.12. Redirect-Host AVP . . . . . . . . . . . . . . . . . . . . 87 152 6.13. Redirect-Host-Usage AVP . . . . . . . . . . . . . . . . . 87 153 6.14. Redirect-Max-Cache-Time AVP . . . . . . . . . . . . . . . 88 154 7. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 90 155 7.1. Result-Code AVP . . . . . . . . . . . . . . . . . . . . . 92 156 7.1.1. Informational . . . . . . . . . . . . . . . . . . . 92 157 7.1.2. Success . . . . . . . . . . . . . . . . . . . . . . 93 158 7.1.3. Protocol Errors . . . . . . . . . . . . . . . . . . 93 159 7.1.4. Transient Failures . . . . . . . . . . . . . . . . . 94 160 7.1.5. Permanent Failures . . . . . . . . . . . . . . . . . 95 161 7.2. Error Bit . . . . . . . . . . . . . . . . . . . . . . . . 98 162 7.3. Error-Message AVP . . . . . . . . . . . . . . . . . . . . 99 163 7.4. Error-Reporting-Host AVP . . . . . . . . . . . . . . . . 99 164 7.5. Failed-AVP AVP . . . . . . . . . . . . . . . . . . . . . 99 165 7.6. Experimental-Result AVP . . . . . . . . . . . . . . . . . 100 166 7.7. Experimental-Result-Code AVP . . . . . . . . . . . . . . 100 167 8. Diameter User Sessions . . . . . . . . . . . . . . . . . . . 101 168 8.1. Authorization Session State Machine . . . . . . . . . . . 102 169 8.2. Accounting Session State Machine . . . . . . . . . . . . 107 170 8.3. Server-Initiated Re-Auth . . . . . . . . . . . . . . . . 112 171 8.3.1. Re-Auth-Request . . . . . . . . . . . . . . . . . . 112 172 8.3.2. Re-Auth-Answer . . . . . . . . . . . . . . . . . . . 113 173 8.4. Session Termination . . . . . . . . . . . . . . . . . . . 114 174 8.4.1. Session-Termination-Request . . . . . . . . . . . . 115 175 8.4.2. Session-Termination-Answer . . . . . . . . . . . . . 115 176 8.5. Aborting a Session . . . . . . . . . . . . . . . . . . . 116 177 8.5.1. Abort-Session-Request . . . . . . . . . . . . . . . 116 178 8.5.2. Abort-Session-Answer . . . . . . . . . . . . . . . . 117 179 8.6. Inferring Session Termination from Origin-State-Id . . . 118 180 8.7. Auth-Request-Type AVP . . . . . . . . . . . . . . . . . . 118 181 8.8. Session-Id AVP . . . . . . . . . . . . . . . . . . . . . 119 182 8.9. Authorization-Lifetime AVP . . . . . . . . . . . . . . . 120 183 8.10. Auth-Grace-Period AVP . . . . . . . . . . . . . . . . . . 121 184 8.11. Auth-Session-State AVP . . . . . . . . . . . . . . . . . 121 185 8.12. Re-Auth-Request-Type AVP . . . . . . . . . . . . . . . . 121 186 8.13. Session-Timeout AVP . . . . . . . . . . . . . . . . . . . 122 187 8.14. User-Name AVP . . . . . . . . . . . . . . . . . . . . . . 122 188 8.15. Termination-Cause AVP . . . . . . . . . . . . . . . . . . 122 189 8.16. Origin-State-Id AVP . . . . . . . . . . . . . . . . . . . 124 190 8.17. Session-Binding AVP . . . . . . . . . . . . . . . . . . . 124 191 8.18. Session-Server-Failover AVP . . . . . . . . . . . . . . . 125 192 8.19. Multi-Round-Time-Out AVP . . . . . . . . . . . . . . . . 126 193 8.20. Class AVP . . . . . . . . . . . . . . . . . . . . . . . . 126 194 8.21. Event-Timestamp AVP . . . . . . . . . . . . . . . . . . . 126 195 9. Accounting . . . . . . . . . . . . . . . . . . . . . . . . . 127 196 9.1. Server Directed Model . . . . . . . . . . . . . . . . . . 127 197 9.2. Protocol Messages . . . . . . . . . . . . . . . . . . . . 128 198 9.3. Accounting Application Extension and Requirements . . . . 128 199 9.4. Fault Resilience . . . . . . . . . . . . . . . . . . . . 129 200 9.5. Accounting Records . . . . . . . . . . . . . . . . . . . 129 201 9.6. Correlation of Accounting Records . . . . . . . . . . . . 130 202 9.7. Accounting Command-Codes . . . . . . . . . . . . . . . . 131 203 9.7.1. Accounting-Request . . . . . . . . . . . . . . . . . 131 204 9.7.2. Accounting-Answer . . . . . . . . . . . . . . . . . 132 205 9.8. Accounting AVPs . . . . . . . . . . . . . . . . . . . . . 133 206 9.8.1. Accounting-Record-Type AVP . . . . . . . . . . . . . 133 207 9.8.2. Acct-Interim-Interval AVP . . . . . . . . . . . . . 134 208 9.8.3. Accounting-Record-Number AVP . . . . . . . . . . . . 135 209 9.8.4. Acct-Session-Id AVP . . . . . . . . . . . . . . . . 135 210 9.8.5. Acct-Multi-Session-Id AVP . . . . . . . . . . . . . 135 211 9.8.6. Accounting-Sub-Session-Id AVP . . . . . . . . . . . 135 212 9.8.7. Accounting-Realtime-Required AVP . . . . . . . . . . 136 213 10. AVP Occurrence Table . . . . . . . . . . . . . . . . . . . . 137 214 10.1. Base Protocol Command AVP Table . . . . . . . . . . . . . 137 215 10.2. Accounting AVP Table . . . . . . . . . . . . . . . . . . 138 216 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 140 217 11.1. AVP Header . . . . . . . . . . . . . . . . . . . . . . . 140 218 11.1.1. AVP Codes . . . . . . . . . . . . . . . . . . . . . 140 219 11.1.2. AVP Flags . . . . . . . . . . . . . . . . . . . . . 141 220 11.2. Diameter Header . . . . . . . . . . . . . . . . . . . . . 141 221 11.2.1. Command Codes . . . . . . . . . . . . . . . . . . . 141 222 11.2.2. Command Flags . . . . . . . . . . . . . . . . . . . 142 223 11.3. Application Identifiers . . . . . . . . . . . . . . . . . 142 224 11.4. AVP Values . . . . . . . . . . . . . . . . . . . . . . . 142 225 11.4.1. Result-Code AVP Values . . . . . . . . . . . . . . . 143 226 11.4.2. Experimental-Result-Code AVP . . . . . . . . . . . . 143 227 11.4.3. Accounting-Record-Type AVP Values . . . . . . . . . 143 228 11.4.4. Termination-Cause AVP Values . . . . . . . . . . . . 143 229 11.4.5. Redirect-Host-Usage AVP Values . . . . . . . . . . . 143 230 11.4.6. Session-Server-Failover AVP Values . . . . . . . . . 143 231 11.4.7. Session-Binding AVP Values . . . . . . . . . . . . . 143 232 11.4.8. Disconnect-Cause AVP Values . . . . . . . . . . . . 144 233 11.4.9. Auth-Request-Type AVP Values . . . . . . . . . . . . 144 234 11.4.10. Auth-Session-State AVP Values . . . . . . . . . . . 144 235 11.4.11. Re-Auth-Request-Type AVP Values . . . . . . . . . . 144 236 11.4.12. Accounting-Realtime-Required AVP Values . . . . . . 144 237 11.4.13. Inband-Security-Id AVP (code 299) . . . . . . . . . 144 238 11.5. Diameter TCP, SCTP and TLS/TCP Port Numbers . . . . . . . 144 239 11.6. NAPTR Service Fields . . . . . . . . . . . . . . . . . . 144 241 12. Diameter protocol related configurable parameters . . . . . . 146 242 13. Security Considerations . . . . . . . . . . . . . . . . . . . 147 243 13.1. TLS Usage . . . . . . . . . . . . . . . . . . . . . . . . 147 244 13.2. Peer-to-Peer Considerations . . . . . . . . . . . . . . . 148 245 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 149 246 14.1. Normative References . . . . . . . . . . . . . . . . . . 149 247 14.2. Informational References . . . . . . . . . . . . . . . . 151 248 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 153 249 A.1. RFC3588bis . . . . . . . . . . . . . . . . . . . . . . . 153 250 A.2. RFC3588 . . . . . . . . . . . . . . . . . . . . . . . . . 154 251 Appendix B. NAPTR Example . . . . . . . . . . . . . . . . . . . 155 252 Appendix C. Duplicate Detection . . . . . . . . . . . . . . . . 156 253 Appendix D. Internationalized Domain Names . . . . . . . . . . . 158 254 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 159 256 1. Introduction 258 Authentication, Authorization and Accounting (AAA) protocols such as 259 TACACS [RFC1492] and RADIUS [RFC2865] were initially deployed to 260 provide dial-up PPP [RFC1661] and terminal server access. Over time, 261 AAA was needed on many new access technologies, the scale and 262 complexity of AAA networks grew, and AAA was also used on new 263 applications (such as voice over IP). This lead to new demands on 264 AAA protocols. 266 Network access requirements for AAA protocols are summarized in 267 [RFC2989]. These include: 269 Failover 271 [RFC2865] does not define failover mechanisms, and as a result, 272 failover behavior differs between implementations. In order to 273 provide well-defined failover behavior, Diameter supports 274 application-layer acknowledgements, and defines failover 275 algorithms and the associated state machine. This is described in 276 Section 5.5 and [RFC3539]. 278 Transmission-level security 280 [RFC2865] defines an application-layer authentication and 281 integrity scheme that is required only for use with Response 282 packets. While [RFC2869] defines an additional authentication and 283 integrity mechanism, use is only required during Extensible 284 Authentication Protocol (EAP) sessions. While attribute-hiding is 285 supported, [RFC2865] does not provide support for per-packet 286 confidentiality. In accounting, [RFC2866] assumes that replay 287 protection is provided by the backend billing server, rather than 288 within the protocol itself. 290 While [RFC3162] defines the use of IPsec with RADIUS, support for 291 IPsec is not required. In order to provide universal support for 292 transmission-level security, and enable both intra- and inter- 293 domain AAA deployments, Diameter provides support for TLS. 294 Security is discussed in Section 13. 296 Reliable transport 298 RADIUS runs over UDP, and does not define retransmission behavior; 299 as a result, reliability varies between implementations. As 300 described in [RFC2975], this is a major issue in accounting, where 301 packet loss may translate directly into revenue loss. In order to 302 provide well defined transport behavior, Diameter runs over 303 reliable transport mechanisms (TCP, SCTP) as defined in [RFC3539]. 305 Agent support 307 [RFC2865] does not provide for explicit support for agents, 308 including Proxies, Redirects and Relays. Since the expected 309 behavior is not defined, it varies between implementations. 310 Diameter defines agent behavior explicitly; this is described in 311 Section 2.8. 313 Server-initiated messages 315 While RADIUS server-initiated messages are defined in [RFC5176], 316 support is optional. This makes it difficult to implement 317 features such as unsolicited disconnect or reauthentication/ 318 reauthorization on demand across a heterogeneous deployment. 319 Support for server-initiated messages is mandatory in 321 Transition support 323 While Diameter does not share a common protocol data unit (PDU) 324 with RADIUS, considerable effort has been expended in enabling 325 backward compatibility with RADIUS, so that the two protocols may 326 be deployed in the same network. Initially, it is expected that 327 Diameter will be deployed within new network devices, as well as 328 within gateways enabling communication between legacy RADIUS 329 devices and Diameter agents. This capability, described in 330 [RFC4005], enables Diameter support to be added to legacy 331 networks, by addition of a gateway or server speaking both RADIUS 332 and Diameter. 334 In addition to addressing the above requirements, Diameter also 335 provides support for the following: 337 Capability negotiation 339 RADIUS does not support error messages, capability negotiation, or 340 a mandatory/non-mandatory flag for attributes. Since RADIUS 341 clients and servers are not aware of each other's capabilities, 342 they may not be able to successfully negotiate a mutually 343 acceptable service, or in some cases, even be aware of what 344 service has been implemented. Diameter includes support for error 345 handling (Section 7), capability negotiation (Section 5.3), and 346 mandatory/non-mandatory attribute-value pairs (AVPs) (Section 347 4.1). 349 Peer discovery and configuration 351 RADIUS implementations typically require that the name or address 352 of servers or clients be manually configured, along with the 353 corresponding shared secrets. This results in a large 354 administrative burden, and creates the temptation to reuse the 355 RADIUS shared secret, which can result in major security 356 vulnerabilities if the Request Authenticator is not globally and 357 temporally unique as required in [RFC2865]. Through DNS, Diameter 358 enables dynamic discovery of peers. Derivation of dynamic session 359 keys is enabled via transmission-level security. 361 Over time, the capabilities of Network Access Server (NAS) devices 362 have increased substantially. As a result, while Diameter is a 363 considerably more sophisticated protocol than RADIUS, it remains 364 feasible to implement it within embedded devices. 366 1.1. Diameter Protocol 368 The Diameter base protocol provides the following facilities: 370 o Ability to exchange messages and deliver Attribute Value Pairs 371 (AVPs) 373 o Capabilities negotiation 375 o Error notification 377 o Extensibility, through addition of new applications, commands and 378 AVPs (required in [RFC2989]). 380 o Basic services necessary for applications, such as handling of 381 user sessions or accounting 383 All data delivered by the protocol is in the form of an AVPs. Some 384 of these AVP values are used by the Diameter protocol itself, while 385 others deliver data associated with particular applications that 386 employ Diameter. AVPs may be added arbitrarily to Diameter messages, 387 so long as the requirements of the message's ABNF (Section 3.2) are 388 met. AVPs are used by the base Diameter protocol to support the 389 following required features: 391 o Transporting of user authentication information, for the purposes 392 of enabling the Diameter server to authenticate the user. 394 o Transporting of service specific authorization information, 395 between client and servers, allowing the peers to decide whether a 396 user's access request should be granted. 398 o Exchanging resource usage information, which may be used for 399 accounting purposes, capacity planning, etc. 401 o Routing, relaying, proxying and redirecting of Diameter messages 402 through a server hierarchy. 404 The Diameter base protocol provides the minimum requirements needed 405 for a AAA protocol, as required by [RFC2989]. The base protocol may 406 be used by itself for accounting purposes only, or it may be used 407 with a Diameter application, such as Mobile IPv4 [RFC4004], or 408 network access [RFC4005]. It is also possible for the base protocol 409 to be extended for use in new applications, via the addition of new 410 commands or AVPs. The initial focus of Diameter was network access 411 and accounting applications. A truly generic AAA protocol used by 412 many applications might provide functionality not provided by 413 Diameter. Therefore, it is imperative that the designers of new 414 applications understand their requirements before using Diameter. 415 See Section 2.4 for more information on Diameter applications. 417 Any node can initiate a request. In that sense, Diameter is a peer- 418 to-peer protocol. In this document, a Diameter Client is a device at 419 the edge of the network that performs access control, such as a 420 Network Access Server (NAS) or a Foreign Agent (FA). A Diameter 421 client generates Diameter messages to request authentication, 422 authorization, and accounting services for the user. A Diameter 423 agent is a node that does not provide local user authentication or 424 authorization services; agents include proxies, redirects and relay 425 agents. A Diameter server performs authentication and/or 426 authorization of the user. A Diameter node may act as an agent for 427 certain requests while acting as a server for others. 429 The Diameter protocol also supports server-initiated messages, such 430 as a request to abort service to a particular user. 432 1.1.1. Description of the Document Set 434 Currently, the Diameter specification consists of an updated version 435 of the base protocol specification (this document), Transport Profile 436 [RFC3539] and applications: Mobile IPv4 [RFC4004], NASREQ [RFC4005], 437 Credit Control [RFC4006], EAP [RFC4072] and SIP [RFC4740]. Note that 438 this document obsoletes [RFC3588]. A summary of the base protocol 439 updates included in this document can be found in Section 1.1.3. 441 The Transport Profile document [RFC3539] discusses transport layer 442 issues that arise with AAA protocols and recommendations on how to 443 overcome these issues. This document also defines the Diameter 444 failover algorithm and state machine. 446 The Mobile IPv4 [RFC4004] application defines a Diameter application 447 that allows a Diameter server to perform AAA functions for Mobile 448 IPv4 services to a mobile node. 450 The NASREQ [RFC4005] application defines a Diameter Application that 451 allows a Diameter server to be used in a PPP/SLIP Dial-Up and 452 Terminal Server Access environment. Consideration was given for 453 servers that need to perform protocol conversion between Diameter and 454 RADIUS. 456 The Credit Control [RFC4006] application defines a Diameter 457 Application that can be used to implement real-time credit-control 458 for a variety of end-user services such as network access, SIP 459 services, messaging services, and download services. It provides a 460 general solution to real-time cost and credit-control. 462 The EAP [RFC4072] application defines a Diameter Application that can 463 be used to carry EAP packets between the Network Access Server (NAS) 464 working as an EAP authenticator and a back-end authentication server. 465 The Diameter EAP application is based on NASREQ and intended for a 466 similar environment. 468 The SIP [RFC4740] application defines a Diameter Application that 469 allows a Diameter client to request authentication and authorization 470 information from a Diameter server for SIP-based IP multimedia 471 services (see SIP [RFC3261]). 473 In summary, this document defines the base protocol specification for 474 AAA, which includes support for accounting. The applications 475 documents describe applications that use this base specification for 476 Authentication, Authorization and Accounting. 478 1.1.2. Conventions Used in This Document 480 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 481 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 482 document are to be interpreted as described in [RFC2119]. 484 1.1.3. Changes from RFC3588 486 This document deprecates [RFC3588] but is fully backward compatible 487 with that document. The changes introduced in this document focuses 488 on fixing issues that have surfaced during implementation of 489 [RFC3588]. An overview of some the major changes are shown below. 491 o Deprecated the use of Inband-Security AVP for negotiating 492 transport layer security. It has been generally considered that 493 bootstrapping of TLS via Inband-Security AVP exposes certain 494 security risk because it does not completely protect the 495 information carried in the CER/CEA. This version of Diameter 496 adopted a common approach of defining a well-known secured port 497 that peers should use when communicating via TLS. This new 498 approach augments the existing Inband-Security negotiation but 499 does not completely replace it. The old method is kept for 500 backwards compatibility reasons. 502 o Deprecated the exchange of CER/CEA messages in the open state. 503 This feature was implied in the peer state machine table of 504 [RFC3588] but it was not clearly defined anywhere else in that 505 document. As work on this document progressed, it became clear 506 that the multiplicity of meaning and use of Application Id AVPs in 507 the CER/CEA messages (and the messages themselves) is seen as an 508 abuse of the Diameter extensibility rules and thus required 509 simplification. It is assumed that the capabilities exchange in 510 the open state will be re-introduced in a separate specification 511 which clearly defines new commands for this feature. 513 o Simplified Security Requirements. The use of a secured transport 514 for exchanging Diameter messages remains mandatory. However, TLS 515 has become the primary method of securing Diameter and IPsec is a 516 secondary alternative. See Section 13 for details. The support 517 for the End-to-End security framework (E2ESequence AVP and 'P'-bit 518 in the AVP header) has also been deprecated. 520 o Diameter Extensibility Changes. This includes fixes to the 521 Diameter extensibility description (Section 1.3 and others) to 522 better aid Diameter application designers; in addition, the new 523 specification relaxes the policy with respect to the allocation of 524 command codes for vendor-specific uses. The new specification 525 relaxes the allocation of command codes for vendor specific uses. 526 See Section 11.2.1 for details. 528 o Application Id Usage. Clarify the proper use of Application Id 529 information which can be found in multiple places within a 530 Diameter message. This includes correlating Application Ids found 531 in the message headers and AVPs. These changes also clearly 532 specify the proper Application Id value to use for specific base 533 protocol messages (ASR/ASA, STR/STA) as well as clarifying the 534 content and use of Vendor-Specific-Application-Id. 536 o Routing Fixes. This document more clearly specifies what 537 information (AVPs and Application Id) can be used for making 538 general routing decisions. A rule for the prioritization of 539 redirect routing criteria when multiple route entries are found 540 via redirects has also been added (See Section 6.13 for details). 542 o Simplification of Diameter Peer Discovery. The Diameter discovery 543 process now supports only widely used discovery schemes. The rest 544 has been deprecated. (See Section 5.2 for details). 546 There are many other many miscellaneous fixes that have been 547 introduced in this document that may not be considered significant 548 but they are important nonetheless. Examples are removal of obsolete 549 types, fixes to command ABNFs, fixes to the state machine, 550 clarification on election process, message validation, fixes to 551 Failed-AVP and Result-Code AVP values etc. A comprehensive list of 552 changes is not shown here for practical reasons. 554 1.2. Terminology 556 AAA 558 Authentication, Authorization and Accounting. 560 ABNF 562 Abstracted Backus-Naur Form [RFC5234]. A metalanguage with its 563 own formal syntax and rules. It is based on the Backus-Naur Form 564 and is used to define message exchanges in a bi-directional 565 communications protocol. 567 Accounting 569 The act of collecting information on resource usage for the 570 purpose of capacity planning, auditing, billing or cost 571 allocation. 573 Accounting Record 575 An accounting record represents a summary of the resource 576 consumption of a user over the entire session. Accounting servers 577 creating the accounting record may do so by processing interim 578 accounting events or accounting events from several devices 579 serving the same user. 581 Authentication 583 The act of verifying the identity of an entity (subject). 585 Authorization 587 The act of determining whether a requesting entity (subject) will 588 be allowed access to a resource (object). 590 AVP 592 The Diameter protocol consists of a header followed by one or more 593 Attribute-Value-Pairs (AVPs). An AVP includes a header and is 594 used to encapsulate protocol-specific data (e.g., routing 595 information) as well as authentication, authorization or 596 accounting information. 598 Diameter Agent 600 A Diameter Agent is a Diameter node that provides either relay, 601 proxy, redirect or translation services. 603 Diameter Client 605 A Diameter Client is a device at the edge of the network that 606 performs access control. An example of a Diameter client is a 607 Network Access Server (NAS) or a Foreign Agent (FA). By its very 608 nature, a Diameter Client must support Diameter client 609 applications in addition to the base protocol. 611 Diameter Node 613 A Diameter node is a host process that implements the Diameter 614 protocol, and acts either as a Client, Agent or Server. 616 Diameter Peer 618 A Diameter Peer is a Diameter Node to which a given Diameter Node 619 has a direct transport connection. 621 Diameter Server 623 A Diameter Server is one that handles authentication, 624 authorization and accounting requests for a particular realm. By 625 its very nature, a Diameter Server must support Diameter server 626 applications in addition to the base protocol. 628 Downstream 630 Downstream is used to identify the direction of a particular 631 Diameter message from the home server towards the access device. 633 Home Realm 635 A Home Realm is the administrative domain with which the user 636 maintains an account relationship. 638 Home Server 640 A Diameter Server which serves the Home Realm. 642 Interim accounting 644 An interim accounting message provides a snapshot of usage during 645 a user's session. It is typically implemented in order to provide 646 for partial accounting of a user's session in the case of a device 647 reboot or other network problem prevents the reception of a 648 session summary message or session record. 650 Local Realm 652 A local realm is the administrative domain providing services to a 653 user. An administrative domain may act as a local realm for 654 certain users, while being a home realm for others. 656 Multi-session 658 A multi-session represents a logical linking of several sessions. 659 Multi-sessions are tracked by using the Acct-Multi-Session-Id. An 660 example of a multi-session would be a Multi-link PPP bundle. Each 661 leg of the bundle would be a session while the entire bundle would 662 be a multi-session. 664 Network Access Identifier 666 The Network Access Identifier, or NAI [RFC4282], is used in the 667 Diameter protocol to extract a user's identity and realm. The 668 identity is used to identify the user during authentication and/or 669 authorization, while the realm is used for message routing 670 purposes. 672 Proxy Agent or Proxy 674 In addition to forwarding requests and responses, proxies make 675 policy decisions relating to resource usage and provisioning. 676 This is typically accomplished by tracking the state of NAS 677 devices. While proxies typically do not respond to client 678 Requests prior to receiving a Response from the server, they may 679 originate Reject messages in cases where policies are violated. 680 As a result, proxies need to understand the semantics of the 681 messages passing through them, and may not support all Diameter 682 applications. 684 Realm 686 The string in the NAI that immediately follows the '@' character. 687 NAI realm names are required to be unique, and are piggybacked on 688 the administration of the DNS namespace. Diameter makes use of 689 the realm, also loosely referred to as domain, to determine 690 whether messages can be satisfied locally, or whether they must be 691 routed or redirected. In RADIUS, realm names are not necessarily 692 piggybacked on the DNS namespace but may be independent of it. 694 Real-time Accounting 696 Real-time accounting involves the processing of information on 697 resource usage within a defined time window. Time constraints are 698 typically imposed in order to limit financial risk. The Diameter 699 Credit Control Application [RFC4006] is the application that 700 defines real-time accounting functionality. 702 Relay Agent or Relay 704 Relays forward requests and responses based on routing-related 705 AVPs and routing table entries. Since relays do not make policy 706 decisions, they do not examine or alter non-routing AVPs. As a 707 result, relays never originate messages, do not need to understand 708 the semantics of messages or non-routing AVPs, and are capable of 709 handling any Diameter application or message type. Since relays 710 make decisions based on information in routing AVPs and realm 711 forwarding tables they do not keep state on NAS resource usage or 712 sessions in progress. 714 Redirect Agent 716 Rather than forwarding requests and responses between clients and 717 servers, redirect agents refer clients to servers and allow them 718 to communicate directly. Since redirect agents do not sit in the 719 forwarding path, they do not alter any AVPs transiting between 720 client and server. Redirect agents do not originate messages and 721 are capable of handling any message type, although they may be 722 configured only to redirect messages of certain types, while 723 acting as relay or proxy agents for other types. As with proxy 724 agents, redirect agents do not keep state with respect to sessions 725 or NAS resources. 727 Session 729 A session is a related progression of events devoted to a 730 particular activity. Diameter application documents provide 731 guidelines as to when a session begins and ends. All Diameter 732 packets with the same Session-Id are considered to be part of the 733 same session. 735 Session state 737 A stateful agent is one that maintains session state information, 738 by keeping track of all authorized active sessions. Each 739 authorized session is bound to a particular service, and its state 740 is considered active either until it is notified otherwise, or by 741 expiration. 743 Sub-session 745 A sub-session represents a distinct service (e.g., QoS or data 746 characteristics) provided to a given session. These services may 747 happen concurrently (e.g., simultaneous voice and data transfer 748 during the same session) or serially. These changes in sessions 749 are tracked with the Accounting-Sub-Session-Id. 751 Transaction state 753 The Diameter protocol requires that agents maintain transaction 754 state, which is used for failover purposes. Transaction state 755 implies that upon forwarding a request, the Hop-by-Hop identifier 756 is saved; the field is replaced with a locally unique identifier, 757 which is restored to its original value when the corresponding 758 answer is received. The request's state is released upon receipt 759 of the answer. A stateless agent is one that only maintains 760 transaction state. 762 Translation Agent 764 A translation agent is a stateful Diameter node that performs 765 protocol translation between Diameter and another AAA protocol, 766 such as RADIUS. 768 Transport Connection 770 A transport connection is a TCP or SCTP connection existing 771 directly between two Diameter peers, otherwise known as a Peer-to- 772 Peer Connection. 774 Upstream 776 Upstream is used to identify the direction of a particular 777 Diameter message from the access device towards the home server. 779 User 781 The entity or client device requesting or using some resource, in 782 support of which a Diameter client has generated a request. 784 1.3. Approach to Extensibility 786 The Diameter protocol is designed to be extensible, using several 787 mechanisms, including: 789 o Defining new AVP values 791 o Creating new AVPs 793 o Creating new commands 795 o Creating new applications 797 From the point of extensibility Diameter authentication, 798 authorization and accounting applications are treated in the same 799 way. 801 Note: Protocol designer should try to re-use existing functionality, 802 namely AVP values, AVPs, commands, and Diameter applications. Reuse 803 simplifies standardization and implementation. To avoid potential 804 interoperability issues it is important to ensure that the semantics 805 of the re-used features are well understood. Given that Diameter can 806 also carry RADIUS attributes as Diameter AVPs, such re-use 807 considerations apply also to existing RADIUS attributes that may be 808 useful in a Diameter application. 810 1.3.1. Defining New AVP Values 812 In order to allocate a new AVP value for AVPs defined in the Diameter 813 Base protocol, the IETF needs to approve a new RFC that describes the 814 AVP value. IANA considerations for these AVP values are discussed in 815 Section 11.4. 817 The allocation of AVP values for other AVPs is guided by the IANA 818 considerations of the documents that defines those AVPs. Typically, 819 allocation of new values for an AVP defined in an IETF RFC should 820 require IETF Review [RFC5226], where as values for vendor-specific 821 AVPs can be allocated by the vendor. 823 1.3.2. Creating New AVPs 825 A new AVP being defined MUST use one of the data types listed in 826 Section 4.2 or Section 4.3. If an appropriate derived data type is 827 already defined, it SHOULD be used instead of the base data type to 828 encourage reusability and good design practice. 830 In the event that a logical grouping of AVPs is necessary, and 831 multiple "groups" are possible in a given command, it is recommended 832 that a Grouped AVP be used (see Section 4.4). 834 The creation of new AVPs can happen in various ways. The recommended 835 approach is to define a new general-purpose AVP in a standards track 836 RFC approved by the IETF. However, as described in Section 11.1.1 837 there are also other mechanisms. 839 1.3.3. Creating New Commands 841 A new Command Code MUST be allocated when new required AVPs (those 842 indicated as {AVP}) are added, deleted or are redefined (for example 843 by changing a required AVP into an optional one). 845 Furthermore, when a command is modified with respect to the number of 846 round trips then a new Command Code has to be registered. 848 A change to the ABNF of a command, such as described above, MUST 849 result in the definition of a new Command Code. This subsequently 850 leads to the need to define a new Diameter Application for any 851 application that will use that new Command. 853 The IANA considerations for commands are discussed in Section 11.2.1. 855 1.3.4. Creating New Diameter Applications 857 Every Diameter application specification MUST have an IANA assigned 858 Application Id (see Section 2.4 and Section 11.3). The managed 859 Application Id space is flat and there is no relationship between 860 different Diameter applications with respect to their Application 861 Ids. As such, there is no versioning support provided by these 862 application Ids itself; every Diameter application is a standalone 863 application. If the application has a relationship with other 864 Diameter applications, such a relationship is not known to Diameter. 866 Before describing the rules for creating new Diameter applications it 867 is important to discuss the semantics of the AVPs occurrences as 868 stated in the ABNF and the M-bit flag (Section 4.1) for an AVP. 869 There is no relationship imposed between the two; they are set 870 independently. 872 o The ABNF indicates what AVPs are placed into a Diameter Command by 873 the sender of that Command. Often, since there are multiple modes 874 of protocol interactions many of the AVPs are indicated as 875 optional. 877 o The M-bit allows the sender to indicate to the receiver whether 878 the semantics of an AVP and it's content has to be understood 879 mandatorily or not. If the M-bit is set by the sender and the 880 receiver does not understand the AVP or the values carried within 881 that AVP then a failure is generated (see Section 7). 883 It is the decision of the protocol designer when to develop a new 884 Diameter application rather than extending Diameter in other ways. 885 However, a new Diameter application MUST be created when one or more 886 of the following criteria are met: 888 M-bit Setting 890 Adding an AVP with the M-bit in the MUST column of the AVP flag 891 table to an existing Command/Application requires a new Diameter 892 Application Id to be assigned to that Application. 894 Adding an AVP with the M-bit in the MAY column of the AVP flag 895 table to an existing Command/Application requires a new Diameter 896 Application Id to be assigned to that Application. 898 Note: The M-bit setting for a given AVP is relevant to an 899 Application and each command within that application which 900 includes the AVP. That is, if an AVP appears in two commands for 901 application Foo and the M-bit settings are different in each 902 command, then there should be two AVP flag tables describing when 903 to set the M-bit. 905 Commands 907 A new command is used within the existing application either 908 because an additional command is added, an existing command has 909 been modified so that a new Command Code had to be registered, or 910 a command has been deleted. 912 An implementation MAY add arbitrary optional AVPs with the M-bit 913 cleared to a command defined in an application, including vendor- 914 specific AVPs without needing to define a new application. This can 915 be done if the commands ABNF allows for it. Please refer to Section 916 11.1.1 for details. 918 2. Protocol Overview 920 The base Diameter protocol concerns itself with establishing 921 connections to peers, capabilities negotiation, how messages are sent 922 and routed through peers, and how the connections are eventually torn 923 down. The base protocol also defines certain rules that apply to all 924 message exchanges between Diameter nodes. 926 Communication between Diameter peers begins with one peer sending a 927 message to another Diameter peer. The set of AVPs included in the 928 message is determined by a particular Diameter application. One AVP 929 that is included to reference a user's session is the Session-Id. 931 The initial request for authentication and/or authorization of a user 932 would include the Session-Id AVP. The Session-Id is then used in all 933 subsequent messages to identify the user's session (see Section 8 for 934 more information). The communicating party may accept the request, 935 or reject it by returning an answer message with the Result-Code AVP 936 set to indicate an error occurred. The specific behavior of the 937 Diameter server or client receiving a request depends on the Diameter 938 application employed. 940 Session state (associated with a Session-Id) MUST be freed upon 941 receipt of the Session-Termination-Request, Session-Termination- 942 Answer, expiration of authorized service time in the Session-Timeout 943 AVP, and according to rules established in a particular Diameter 944 application. 946 The base Diameter protocol may be used by itself for accounting 947 applications. For authentication and authorization, it is always 948 extended for a particular application. 950 Diameter Clients MUST support the base protocol, which includes 951 accounting. In addition, they MUST fully support each Diameter 952 application that is needed to implement the client's service, e.g., 953 NASREQ and/or Mobile IPv4. A Diameter Client that does not support 954 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 955 Client" where X is the application which it supports, and not a 956 "Diameter Client". 958 Diameter Servers MUST support the base protocol, which includes 959 accounting. In addition, they MUST fully support each Diameter 960 application that is needed to implement the intended service, e.g., 961 NASREQ and/or Mobile IPv4. A Diameter Server that does not support 962 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 963 Server" where X is the application which it supports, and not a 964 "Diameter Server". 966 Diameter Relays and redirect agents are transparent to the Diameter 967 applications but they MUST support the Diameter base protocol, which 968 includes accounting, and all Diameter applications. 970 Diameter proxies MUST support the base protocol, which includes 971 accounting. In addition, they MUST fully support each Diameter 972 application that is needed to implement proxied services, e.g., 973 NASREQ and/or Mobile IPv4. A Diameter proxy which does not support 974 both NASREQ and Mobile IPv4, MUST be referred to as "Diameter X 975 Proxy" where X is the application which it supports, and not a 976 "Diameter Proxy". 978 2.1. Transport 980 The Diameter Transport profile is defined in [RFC3539]. 982 The base Diameter protocol is run on port 3868 for both TCP [RFC793] 983 and SCTP [RFC4960]. For TLS [RFC5246], a Diameter node that initiate 984 a TLS connection prior to any message exchanges MUST run on port 985 [TBD]. It is assumed that TLS is run on top of TCP when it is used. 986 The remainder of this document uses the term TLS to abbreviate the 987 use of TLS over TCP. 989 If the Diameter peer does not support receiving TLS connections on 990 port [TBD], i.e. the peer complies only with [RFC3588], then the 991 initiator MAY revert to using TCP or SCTP and on port 3868. Note 992 that this scheme is kept for backwards compatibility purpose only and 993 that there are inherent security vulnerabilities when the initial 994 CER/CEA messages are sent un-protected (see Section 5.6). 996 Diameter clients MUST support either TCP or SCTP, while agents and 997 servers SHOULD support both. 999 A Diameter node MAY initiate connections from a source port other 1000 than the one that it declares it accepts incoming connections on, and 1001 MUST be prepared to receive connections on port 3868 for TCP or SCTP 1002 and port [TBD] for TLS connections. A given Diameter instance of the 1003 peer state machine MUST NOT use more than one transport connection to 1004 communicate with a given peer, unless multiple instances exist on the 1005 peer in which case a separate connection per process is allowed. 1007 When no transport connection exists with a peer, an attempt to 1008 connect SHOULD be periodically made. This behavior is handled via 1009 the Tc timer, whose recommended value is 30 seconds. There are 1010 certain exceptions to this rule, such as when a peer has terminated 1011 the transport connection stating that it does not wish to 1012 communicate. 1014 When connecting to a peer and either zero or more transports are 1015 specified, TLS SHOULD be tried first, followed by TCP, then by SCTP. 1016 See Section 5.2 for more information on peer discovery. 1018 Diameter implementations SHOULD be able to interpret ICMP protocol 1019 port unreachable messages as explicit indications that the server is 1020 not reachable, subject to security policy on trusting such messages. 1021 Further guidance regarding the treatment of ICMP errors can be found 1022 in [I-D.ietf-tcpm-icmp-attacks] and [RFC5461]. Diameter 1023 implementations SHOULD also be able to interpret a reset from the 1024 transport and timed-out connection attempts. If Diameter receives 1025 data up from TCP that cannot be parsed or identified as a Diameter 1026 error made by the peer, the stream is compromised and cannot be 1027 recovered. The transport connection MUST be closed using a RESET 1028 call (send a TCP RST bit) or an SCTP ABORT message (graceful closure 1029 is compromised). 1031 2.1.1. SCTP Guidelines 1033 The following are guidelines for Diameter implementations that 1034 support SCTP: 1036 1. For interoperability: All Diameter nodes MUST be prepared to 1037 receive Diameter messages on any SCTP stream in the association. 1039 2. To prevent blocking: All Diameter nodes SHOULD utilize all SCTP 1040 streams available to the association to prevent head-of-the-line 1041 blocking. 1043 2.2. Securing Diameter Messages 1045 Connections between Diameter peers SHOULD be protected by TLS. All 1046 Diameter base protocol implementations MUST support the use of TLS. 1047 If desired, alternative security mechanisms that are independent of 1048 Diameter, such as IPsec [RFC4301], can be deployed to secure 1049 connections between peers. The Diameter protocol MUST NOT be used 1050 without any security mechanism. 1052 2.3. Diameter Application Compliance 1054 Application Ids are advertised during the capabilities exchange phase 1055 (see Section 5.3). For a given application, advertising support of 1056 an application implies that the sender supports the functionality 1057 specified in the respective Diameter application specification. 1059 An implementation MAY add arbitrary optional AVPs with the M-bit 1060 cleared to a command defined in an application, including vendor- 1061 specific AVPs only if the commands ABNF allows for it. Please refer 1062 to Section 11.1.1 for details. 1064 2.4. Application Identifiers 1066 Each Diameter application MUST have an IANA assigned Application Id 1067 (see Section 11.3). The base protocol does not require an 1068 Application Id since its support is mandatory. During the 1069 capabilities exchange, Diameter nodes inform their peers of locally 1070 supported applications. Furthermore, all Diameter messages contain 1071 an Application Id, which is used in the message forwarding process. 1073 The following Application Id values are defined: 1075 Diameter Common Messages 0 1076 Diameter Base Accounting 3 1077 Relay 0xffffffff 1079 Relay and redirect agents MUST advertise the Relay Application 1080 Identifier, while all other Diameter nodes MUST advertise locally 1081 supported applications. The receiver of a Capabilities Exchange 1082 message advertising Relay service MUST assume that the sender 1083 supports all current and future applications. 1085 Diameter relay and proxy agents are responsible for finding an 1086 upstream server that supports the application of a particular 1087 message. If none can be found, an error message is returned with the 1088 Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1090 2.5. Connections vs. Sessions 1092 This section attempts to provide the reader with an understanding of 1093 the difference between connection and session, which are terms used 1094 extensively throughout this document. 1096 A connection refers to a transport level connection between two peers 1097 that is used to send and receive Diameter messages. A session is a 1098 logical concept at the application layer, it spawns from the Diameter 1099 client to the Diameter server and is identified via the Session-Id 1100 AVP. 1102 +--------+ +-------+ +--------+ 1103 | Client | | Relay | | Server | 1104 +--------+ +-------+ +--------+ 1105 <----------> <----------> 1106 peer connection A peer connection B 1108 <-----------------------------> 1109 User session x 1111 Figure 1: Diameter connections and sessions 1113 In the example provided in Figure 1, peer connection A is established 1114 between the Client and the Relay. Peer connection B is established 1115 between the Relay and the Server. User session X spans from the 1116 Client via the Relay to the Server. Each "user" of a service causes 1117 an auth request to be sent, with a unique session identifier. Once 1118 accepted by the server, both the client and the server are aware of 1119 the session. 1121 It is important to note that there is no relationship between a 1122 connection and a session, and that Diameter messages for multiple 1123 sessions are all multiplexed through a single connection. Also note 1124 that Diameter messages pertaining to the session, both application 1125 specific and those that are defined in this document such as ASR/ASA, 1126 RAR/RAA and STR/STA MUST carry the Application Id of the application. 1127 Diameter messages pertaining to peer connection establishment and 1128 maintenance such as CER/CEA, DWR/DWA and DPR/DPA MUST carry an 1129 Application Id of zero (0). 1131 2.6. Peer Table 1133 The Diameter Peer Table is used in message forwarding, and referenced 1134 by the Routing Table. A Peer Table entry contains the following 1135 fields: 1137 Host identity 1139 Following the conventions described for the DiameterIdentity 1140 derived AVP data format in Section 4.4. This field contains the 1141 contents of the Origin-Host (Section 6.3) AVP found in the CER or 1142 CEA message. 1144 StatusT 1146 This is the state of the peer entry, and MUST match one of the 1147 values listed in Section 5.6. 1149 Static or Dynamic 1151 Specifies whether a peer entry was statically configured, or 1152 dynamically discovered. 1154 Expiration time 1156 Specifies the time at which dynamically discovered peer table 1157 entries are to be either refreshed, or expired. 1159 TLS Enabled 1161 Specifies whether TLS is to be used when communicating with the 1162 peer. 1164 Additional security information, when needed (e.g., keys, 1165 certificates) 1167 2.7. Routing Table 1169 All Realm-Based routing lookups are performed against what is 1170 commonly known as the Routing Table (see Section 12). A Routing 1171 Table Entry contains the following fields: 1173 Realm Name 1175 This is the field that is MUST be used as a primary key in the 1176 routing table lookups. Note that some implementations perform 1177 their lookups based on longest-match-from-the-right on the realm 1178 rather than requiring an exact match. 1180 Application Identifier 1182 An application is identified by an Application Id. A route entry 1183 can have a different destination based on the Application Id in 1184 the message header. This field MUST be used as a secondary key 1185 field in routing table lookups. 1187 Local Action 1189 The Local Action field is used to identify how a message should be 1190 treated. The following actions are supported: 1192 1. LOCAL - Diameter messages that can be satisfied locally, and 1193 do not need to be routed to another Diameter entity. 1195 2. RELAY - All Diameter messages that fall within this category 1196 MUST be routed to a next hop Diameter entity that is indicated 1197 by the identifier described below. Routing is done without 1198 modifying any non-routing AVPs. See Section 6.1.9 for 1199 relaying guidelines 1201 3. PROXY - All Diameter messages that fall within this category 1202 MUST be routed to a next Diameter entity that is indicated by 1203 the identifier described below. The local server MAY apply 1204 its local policies to the message by including new AVPs to the 1205 message prior to routing. See Section 6.1.9 for proxying 1206 guidelines. 1208 4. REDIRECT - Diameter messages that fall within this category 1209 MUST have the identity of the home Diameter server(s) 1210 appended, and returned to the sender of the message. See 1211 Section 6.1.9 for redirect guidelines. 1213 Server Identifier 1215 One or more servers the message is to be routed to. These servers 1216 MUST also be present in the Peer table. When the Local Action is 1217 set to RELAY or PROXY, this field contains the identity of the 1218 server(s) the message MUST be routed to. When the Local Action 1219 field is set to REDIRECT, this field contains the identity of one 1220 or more servers the message MUST be redirected to. 1222 Static or Dynamic 1224 Specifies whether a route entry was statically configured, or 1225 dynamically discovered. 1227 Expiration time 1229 Specifies the time which a dynamically discovered route table 1230 entry expires. 1232 It is important to note that Diameter agents MUST support at least 1233 one of the LOCAL, RELAY, PROXY or REDIRECT modes of operation. 1234 Agents do not need to support all modes of operation in order to 1235 conform with the protocol specification, but MUST follow the protocol 1236 compliance guidelines in Section 2. Relay agents and proxies MUST 1237 NOT reorder AVPs. 1239 The routing table MAY include a default entry that MUST be used for 1240 any requests not matching any of the other entries. The routing 1241 table MAY consist of only such an entry. 1243 When a request is routed, the target server MUST have advertised the 1244 Application Id (see Section 2.4) for the given message, or have 1245 advertised itself as a relay or proxy agent. Otherwise, an error is 1246 returned with the Result-Code AVP set to DIAMETER_UNABLE_TO_DELIVER. 1248 2.8. Role of Diameter Agents 1250 In addition to client and servers, the Diameter protocol introduces 1251 relay, proxy, redirect, and translation agents, each of which is 1252 defined in Section 1.3. These Diameter agents are useful for several 1253 reasons: 1255 o They can distribute administration of systems to a configurable 1256 grouping, including the maintenance of security associations. 1258 o They can be used for concentration of requests from an number of 1259 co-located or distributed NAS equipment sets to a set of like user 1260 groups. 1262 o They can do value-added processing to the requests or responses. 1264 o They can be used for load balancing. 1266 o A complex network will have multiple authentication sources, they 1267 can sort requests and forward towards the correct target. 1269 The Diameter protocol requires that agents maintain transaction 1270 state, which is used for failover purposes. Transaction state 1271 implies that upon forwarding a request, its Hop-by-Hop identifier is 1272 saved; the field is replaced with a locally unique identifier, which 1273 is restored to its original value when the corresponding answer is 1274 received. The request's state is released upon receipt of the 1275 answer. A stateless agent is one that only maintains transaction 1276 state. 1278 The Proxy-Info AVP allows stateless agents to add local state to a 1279 Diameter request, with the guarantee that the same state will be 1280 present in the answer. However, the protocol's failover procedures 1281 require that agents maintain a copy of pending requests. 1283 A stateful agent is one that maintains session state information; by 1284 keeping track of all authorized active sessions. Each authorized 1285 session is bound to a particular service, and its state is considered 1286 active either until it is notified otherwise, or by expiration. Each 1287 authorized session has an expiration, which is communicated by 1288 Diameter servers via the Session-Timeout AVP. 1290 Maintaining session state may be useful in certain applications, such 1291 as: 1293 o Protocol translation (e.g., RADIUS <-> Diameter) 1295 o Limiting resources authorized to a particular user 1297 o Per user or transaction auditing 1299 A Diameter agent MAY act in a stateful manner for some requests and 1300 be stateless for others. A Diameter implementation MAY act as one 1301 type of agent for some requests, and as another type of agent for 1302 others. 1304 2.8.1. Relay Agents 1306 Relay Agents are Diameter agents that accept requests and route 1307 messages to other Diameter nodes based on information found in the 1308 messages (e.g., Destination-Realm). This routing decision is 1309 performed using a list of supported realms, and known peers. This is 1310 known as the Routing Table, as is defined further in Section 2.7. 1312 Relays may, for example, be used to aggregate requests from multiple 1313 Network Access Servers (NASes) within a common geographical area 1314 (POP). The use of Relays is advantageous since it eliminates the 1315 need for NASes to be configured with the necessary security 1316 information they would otherwise require to communicate with Diameter 1317 servers in other realms. Likewise, this reduces the configuration 1318 load on Diameter servers that would otherwise be necessary when NASes 1319 are added, changed or deleted. 1321 Relays modify Diameter messages by inserting and removing routing 1322 information, but do not modify any other portion of a message. 1323 Relays SHOULD NOT maintain session state but MUST maintain 1324 transaction state. 1326 +------+ ---------> +------+ ---------> +------+ 1327 | | 1. Request | | 2. Request | | 1328 | NAS | | DRL | | HMS | 1329 | | 4. Answer | | 3. Answer | | 1330 +------+ <--------- +------+ <--------- +------+ 1331 example.net example.net example.com 1333 Figure 2: Relaying of Diameter messages 1335 The example provided in Figure 2 depicts a request issued from NAS, 1336 which is an access device, for the user bob@example.com. Prior to 1337 issuing the request, NAS performs a Diameter route lookup, using 1338 "example.com" as the key, and determines that the message is to be 1339 relayed to DRL, which is a Diameter Relay. DRL performs the same 1340 route lookup as NAS, and relays the message to HMS, which is 1341 example.com's Home Diameter Server. HMS identifies that the request 1342 can be locally supported (via the realm), processes the 1343 authentication and/or authorization request, and replies with an 1344 answer, which is routed back to NAS using saved transaction state. 1346 Since Relays do not perform any application level processing, they 1347 provide relaying services for all Diameter applications, and 1348 therefore MUST advertise the Relay Application Id. 1350 2.8.2. Proxy Agents 1352 Similarly to relays, proxy agents route Diameter messages using the 1353 Diameter Routing Table. However, they differ since they modify 1354 messages to implement policy enforcement. This requires that proxies 1355 maintain the state of their downstream peers (e.g., access devices) 1356 to enforce resource usage, provide admission control, and 1357 provisioning. 1359 Proxies may, for example, be used in call control centers or access 1360 ISPs that provide outsourced connections, they can monitor the number 1361 and types of ports in use, and make allocation and admission 1362 decisions according to their configuration. 1364 Since enforcing policies requires an understanding of the service 1365 being provided, Proxies MUST only advertise the Diameter applications 1366 they support. 1368 2.8.3. Redirect Agents 1370 Redirect agents are useful in scenarios where the Diameter routing 1371 configuration needs to be centralized. An example is a redirect 1372 agent that provides services to all members of a consortium, but does 1373 not wish to be burdened with relaying all messages between realms. 1374 This scenario is advantageous since it does not require that the 1375 consortium provide routing updates to its members when changes are 1376 made to a member's infrastructure. 1378 Since redirect agents do not relay messages, and only return an 1379 answer with the information necessary for Diameter agents to 1380 communicate directly, they do not modify messages. Since redirect 1381 agents do not receive answer messages, they cannot maintain session 1382 state. 1384 The example provided in Figure 3 depicts a request issued from the 1385 access device, NAS, for the user bob@example.com. The message is 1386 forwarded by the NAS to its relay, DRL, which does not have a routing 1387 entry in its Diameter Routing Table for example.com. DRL has a 1388 default route configured to DRD, which is a redirect agent that 1389 returns a redirect notification to DRL, as well as HMS' contact 1390 information. Upon receipt of the redirect notification, DRL 1391 establishes a transport connection with HMS, if one doesn't already 1392 exist, and forwards the request to it. 1394 +------+ 1395 | | 1396 | DRD | 1397 | | 1398 +------+ 1399 ^ | 1400 2. Request | | 3. Redirection 1401 | | Notification 1402 | v 1403 +------+ ---------> +------+ ---------> +------+ 1404 | | 1. Request | | 4. Request | | 1405 | NAS | | DRL | | HMS | 1406 | | 6. Answer | | 5. Answer | | 1407 +------+ <--------- +------+ <--------- +------+ 1408 example.net example.net example.com 1410 Figure 3: Redirecting a Diameter Message 1412 Since redirect agents do not perform any application level 1413 processing, they provide relaying services for all Diameter 1414 applications, and therefore MUST advertise the Relay Application 1415 Identifier. 1417 2.8.4. Translation Agents 1419 A translation agent is a device that provides translation between two 1420 protocols (e.g., RADIUS<->Diameter, TACACS+<->Diameter). Translation 1421 agents are likely to be used as aggregation servers to communicate 1422 with a Diameter infrastructure, while allowing for the embedded 1423 systems to be migrated at a slower pace. 1425 Given that the Diameter protocol introduces the concept of long-lived 1426 authorized sessions, translation agents MUST be session stateful and 1427 MUST maintain transaction state. 1429 Translation of messages can only occur if the agent recognizes the 1430 application of a particular request, and therefore translation agents 1431 MUST only advertise their locally supported applications. 1433 +------+ ---------> +------+ ---------> +------+ 1434 | | RADIUS Request | | Diameter Request | | 1435 | NAS | | TLA | | HMS | 1436 | | RADIUS Answer | | Diameter Answer | | 1437 +------+ <--------- +------+ <--------- +------+ 1438 example.net example.net example.com 1440 Figure 4: Translation of RADIUS to Diameter 1442 2.9. Diameter Path Authorization 1444 As noted in Section 2.2, Diameter provides transmission level 1445 security for each connection using TLS. Therefore, each connection 1446 can be authenticated, replay and integrity protected. 1448 In addition to authenticating each connection, each connection as 1449 well as the entire session MUST also be authorized. Before 1450 initiating a connection, a Diameter Peer MUST check that its peers 1451 are authorized to act in their roles. For example, a Diameter peer 1452 may be authentic, but that does not mean that it is authorized to act 1453 as a Diameter Server advertising a set of Diameter applications. 1455 Prior to bringing up a connection, authorization checks are performed 1456 at each connection along the path. Diameter capabilities negotiation 1457 (CER/CEA) also MUST be carried out, in order to determine what 1458 Diameter applications are supported by each peer. Diameter sessions 1459 MUST be routed only through authorized nodes that have advertised 1460 support for the Diameter application required by the session. 1462 As noted in Section 6.1.9, a relay or proxy agent MUST append a 1463 Route-Record AVP to all requests forwarded. The AVP contains the 1464 identity of the peer the request was received from. 1466 The home Diameter server, prior to authorizing a session, MUST check 1467 the Route-Record AVPs to make sure that the route traversed by the 1468 request is acceptable. For example, administrators within the home 1469 realm may not wish to honor requests that have been routed through an 1470 untrusted realm. By authorizing a request, the home Diameter server 1471 is implicitly indicating its willingness to engage in the business 1472 transaction as specified by the contractual relationship between the 1473 server and the previous hop. A DIAMETER_AUTHORIZATION_REJECTED error 1474 message (see Section 7.1.5) is sent if the route traversed by the 1475 request is unacceptable. 1477 A home realm may also wish to check that each accounting request 1478 message corresponds to a Diameter response authorizing the session. 1479 Accounting requests without corresponding authorization responses 1480 SHOULD be subjected to further scrutiny, as should accounting 1481 requests indicating a difference between the requested and provided 1482 service. 1484 Forwarding of an authorization response is considered evidence of a 1485 willingness to take on financial risk relative to the session. A 1486 local realm may wish to limit this exposure, for example, by 1487 establishing credit limits for intermediate realms and refusing to 1488 accept responses which would violate those limits. By issuing an 1489 accounting request corresponding to the authorization response, the 1490 local realm implicitly indicates its agreement to provide the service 1491 indicated in the authorization response. If the service cannot be 1492 provided by the local realm, then a DIAMETER_UNABLE_TO_COMPLY error 1493 message MUST be sent within the accounting request; a Diameter client 1494 receiving an authorization response for a service that it cannot 1495 perform MUST NOT substitute an alternate service, and then send 1496 accounting requests for the alternate service instead. 1498 3. Diameter Header 1500 A summary of the Diameter header format is shown below. The fields 1501 are transmitted in network byte order. 1503 0 1 2 3 1504 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 1505 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1506 | Version | Message Length | 1507 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1508 | command flags | Command-Code | 1509 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1510 | Application-ID | 1511 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1512 | Hop-by-Hop Identifier | 1513 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1514 | End-to-End Identifier | 1515 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1516 | AVPs ... 1517 +-+-+-+-+-+-+-+-+-+-+-+-+- 1519 Version 1521 This Version field MUST be set to 1 to indicate Diameter Version 1522 1. 1524 Message Length 1526 The Message Length field is three octets and indicates the length 1527 of the Diameter message including the header fields. 1529 Command Flags 1531 The Command Flags field is eight bits. The following bits are 1532 assigned: 1534 0 1 2 3 4 5 6 7 1535 +-+-+-+-+-+-+-+-+ 1536 |R P E T r r r r| 1537 +-+-+-+-+-+-+-+-+ 1539 R(equest) 1541 If set, the message is a request. If cleared, the message is 1542 an answer. 1544 P(roxiable) 1546 If set, the message MAY be proxied, relayed or redirected. If 1547 cleared, the message MUST be locally processed. 1549 E(rror) 1551 If set, the message contains a protocol error, and the message 1552 will not conform to the ABNF described for this command. 1553 Messages with the 'E' bit set are commonly referred to as error 1554 messages. This bit MUST NOT be set in request messages. See 1555 Section 7.2. 1557 T(Potentially re-transmitted message) 1559 This flag is set after a link failover procedure, to aid the 1560 removal of duplicate requests. It is set when resending 1561 requests not yet acknowledged, as an indication of a possible 1562 duplicate due to a link failure. This bit MUST be cleared when 1563 sending a request for the first time, otherwise the sender MUST 1564 set this flag. Diameter agents only need to be concerned about 1565 the number of requests they send based on a single received 1566 request; retransmissions by other entities need not be tracked. 1567 Diameter agents that receive a request with the T flag set, 1568 MUST keep the T flag set in the forwarded request. This flag 1569 MUST NOT be set if an error answer message (e.g., a protocol 1570 error) has been received for the earlier message. It can be 1571 set only in cases where no answer has been received from the 1572 server for a request and the request is sent again. This flag 1573 MUST NOT be set in answer messages. 1575 r(eserved) 1577 These flag bits are reserved for future use, and MUST be set to 1578 zero, and ignored by the receiver. 1580 Command-Code 1582 The Command-Code field is three octets, and is used in order to 1583 communicate the command associated with the message. The 24-bit 1584 address space is managed by IANA (see Section 11.2.1). 1586 Command-Code values 16,777,214 and 16,777,215 (hexadecimal values 1587 FFFFFE -FFFFFF) are reserved for experimental use (See Section 1588 11.3). 1590 Application-ID 1592 Application-ID is four octets and is used to identify to which 1593 application the message is applicable for. The application can be 1594 an authentication application, an accounting application or a 1595 vendor specific application. See Section 11.3 for the possible 1596 values that the application-id may use. 1598 The value of the application-id field in the header MUST be the 1599 same as any relevant application-id AVPs contained in the message. 1601 Hop-by-Hop Identifier 1603 The Hop-by-Hop Identifier is an unsigned 32-bit integer field (in 1604 network byte order) and aids in matching requests and replies. 1605 The sender MUST ensure that the Hop-by-Hop identifier in a request 1606 is unique on a given connection at any given time, and MAY attempt 1607 to ensure that the number is unique across reboots. The sender of 1608 an Answer message MUST ensure that the Hop-by-Hop Identifier field 1609 contains the same value that was found in the corresponding 1610 request. The Hop-by-Hop identifier is normally a monotonically 1611 increasing number, whose start value was randomly generated. An 1612 answer message that is received with an unknown Hop-by-Hop 1613 Identifier MUST be discarded. 1615 End-to-End Identifier 1617 The End-to-End Identifier is an unsigned 32-bit integer field (in 1618 network byte order) and is used to detect duplicate messages. 1619 Upon reboot implementations MAY set the high order 12 bits to 1620 contain the low order 12 bits of current time, and the low order 1621 20 bits to a random value. Senders of request messages MUST 1622 insert a unique identifier on each message. The identifier MUST 1623 remain locally unique for a period of at least 4 minutes, even 1624 across reboots. The originator of an Answer message MUST ensure 1625 that the End-to-End Identifier field contains the same value that 1626 was found in the corresponding request. The End-to-End Identifier 1627 MUST NOT be modified by Diameter agents of any kind. The 1628 combination of the Origin-Host (see Section 6.3) and this field is 1629 used to detect duplicates. Duplicate requests SHOULD cause the 1630 same answer to be transmitted (modulo the hop-by-hop Identifier 1631 field and any routing AVPs that may be present), and MUST NOT 1632 affect any state that was set when the original request was 1633 processed. Duplicate answer messages that are to be locally 1634 consumed (see Section 6.2) SHOULD be silently discarded. 1636 AVPs 1638 AVPs are a method of encapsulating information relevant to the 1639 Diameter message. See Section 4 for more information on AVPs. 1641 3.1. Command Codes 1643 Each command Request/Answer pair is assigned a command code, and the 1644 sub-type (i.e., request or answer) is identified via the 'R' bit in 1645 the Command Flags field of the Diameter header. 1647 Every Diameter message MUST contain a command code in its header's 1648 Command-Code field, which is used to determine the action that is to 1649 be taken for a particular message. The following Command Codes are 1650 defined in the Diameter base protocol: 1652 Command-Name Abbrev. Code Reference 1653 -------------------------------------------------------- 1654 Abort-Session-Request ASR 274 8.5.1 1655 Abort-Session-Answer ASA 274 8.5.2 1656 Accounting-Request ACR 271 9.7.1 1657 Accounting-Answer ACA 271 9.7.2 1658 Capabilities-Exchange- CER 257 5.3.1 1659 Request 1660 Capabilities-Exchange- CEA 257 5.3.2 1661 Answer 1662 Device-Watchdog-Request DWR 280 5.5.1 1663 Device-Watchdog-Answer DWA 280 5.5.2 1664 Disconnect-Peer-Request DPR 282 5.4.1 1665 Disconnect-Peer-Answer DPA 282 5.4.2 1666 Re-Auth-Request RAR 258 8.3.1 1667 Re-Auth-Answer RAA 258 8.3.2 1668 Session-Termination- STR 275 8.4.1 1669 Request 1670 Session-Termination- STA 275 8.4.2 1671 Answer 1673 3.2. Command Code ABNF specification 1675 Every Command Code defined MUST include a corresponding ABNF 1676 specification, which is used to define the AVPs that MUST or MAY be 1677 present when sending the message. The following format is used in 1678 the definition: 1680 command-def = command-name "::=" diameter-message 1682 command-name = diameter-name 1683 diameter-name = ALPHA *(ALPHA / DIGIT / "-") 1685 diameter-message = header [ *fixed] [ *required] [ *optional] 1687 header = "<" "Diameter Header:" command-id 1688 [r-bit] [p-bit] [e-bit] [application-id] ">" 1690 application-id = 1*DIGIT 1692 command-id = 1*DIGIT 1693 ; The Command Code assigned to the command 1695 r-bit = ", REQ" 1696 ; If present, the 'R' bit in the Command 1697 ; Flags is set, indicating that the message 1698 ; is a request, as opposed to an answer. 1700 p-bit = ", PXY" 1701 ; If present, the 'P' bit in the Command 1702 ; Flags is set, indicating that the message 1703 ; is proxiable. 1705 e-bit = ", ERR" 1706 ; If present, the 'E' bit in the Command 1707 ; Flags is set, indicating that the answer 1708 ; message contains a Result-Code AVP in 1709 ; the "protocol error" class. 1711 fixed = [qual] "<" avp-spec ">" 1712 ; Defines the fixed position of an AVP 1714 required = [qual] "{" avp-spec "}" 1715 ; The AVP MUST be present and can appear 1716 ; anywhere in the message. 1718 optional = [qual] "[" avp-name "]" 1719 ; The avp-name in the 'optional' rule cannot 1720 ; evaluate to any AVP Name which is included 1721 ; in a fixed or required rule. The AVP can 1722 ; appear anywhere in the message. 1724 qual = [min] "*" [max] 1725 ; See ABNF conventions, RFC 5234 Section 6.6. 1726 ; The absence of any qualifiers depends on 1727 ; whether it precedes a fixed, required, or 1728 ; optional rule. If a fixed or required rule has 1729 ; no qualifier, then exactly one such AVP MUST 1730 ; be present. If an optional rule has no 1731 ; qualifier, then 0 or 1 such AVP may be 1732 ; present. If an optional rule has a qualifier, 1733 ; then the value of min MUST be 0 if present. 1734 ; 1735 ; NOTE: "[" and "]" have a different meaning 1736 ; than in ABNF (see the optional rule, above). 1737 ; These braces cannot be used to express 1738 ; optional fixed rules (such as an optional 1739 ; ICV at the end). To do this, the convention 1740 ; is '0*1fixed'. 1742 min = 1*DIGIT 1743 ; The minimum number of times the element may 1744 ; be present. The default value is zero for 1745 ; fixed and optional rules. The default value 1746 ; is one for required rules. The value of zero 1747 ; is not allowed for required rules. 1749 max = 1*DIGIT 1750 ; The maximum number of times the element may 1751 ; be present. The default value is infinity. A 1752 ; value of zero implies the AVP MUST NOT be 1753 ; present. 1755 avp-spec = diameter-name 1756 ; The avp-spec has to be an AVP Name, defined 1757 ; in the base or extended Diameter 1758 ; specifications. 1760 avp-name = avp-spec / "AVP" 1761 ; The string "AVP" stands for *any* arbitrary AVP 1762 ; Name, not otherwise listed in that command code 1763 ; definition. Addition this AVP is recommended for 1764 ; all command ABNFs to allow for extensibility. 1766 The following is a definition of a fictitious command code: 1768 Example-Request ::= < Diameter Header: 9999999, REQ, PXY > 1769 { User-Name } 1770 * { Origin-Host } 1771 * [ AVP ] 1773 3.3. Diameter Command Naming Conventions 1775 Diameter command names typically includes one or more English words 1776 followed by the verb Request or Answer. Each English word is 1777 delimited by a hyphen. A three-letter acronym for both the request 1778 and answer is also normally provided. 1780 An example is a message set used to terminate a session. The command 1781 name is Session-Terminate-Request and Session-Terminate-Answer, while 1782 the acronyms are STR and STA, respectively. 1784 Both the request and the answer for a given command share the same 1785 command code. The request is identified by the R(equest) bit in the 1786 Diameter header set to one (1), to ask that a particular action be 1787 performed, such as authorizing a user or terminating a session. Once 1788 the receiver has completed the request it issues the corresponding 1789 answer, which includes a result code that communicates one of the 1790 following: 1792 o The request was successful 1794 o The request failed 1796 o An additional request has to be sent to provide information the 1797 peer requires prior to returning a successful or failed answer. 1799 o The receiver could not process the request, but provides 1800 information about a Diameter peer that is able to satisfy the 1801 request, known as redirect. 1803 Additional information, encoded within AVPs, may also be included in 1804 answer messages. 1806 4. Diameter AVPs 1808 Diameter AVPs carry specific authentication, accounting, 1809 authorization and routing information as well as configuration 1810 details for the request and reply. 1812 Each AVP of type OctetString MUST be padded to align on a 32-bit 1813 boundary, while other AVP types align naturally. A number of zero- 1814 valued bytes are added to the end of the AVP Data field till a word 1815 boundary is reached. The length of the padding is not reflected in 1816 the AVP Length field. 1818 4.1. AVP Header 1820 The fields in the AVP header MUST be sent in network byte order. The 1821 format of the header is: 1823 0 1 2 3 1824 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 1825 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1826 | AVP Code | 1827 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1828 |V M P r r r r r| AVP Length | 1829 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1830 | Vendor-ID (opt) | 1831 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1832 | Data ... 1833 +-+-+-+-+-+-+-+-+ 1835 AVP Code 1837 The AVP Code, combined with the Vendor-Id field, identifies the 1838 attribute uniquely. AVP numbers 1 through 255 are reserved for 1839 backward compatibility with RADIUS, without setting the Vendor-Id 1840 field. AVP numbers 256 and above are used for Diameter, which are 1841 allocated by IANA (see Section 11.1). 1843 AVP Flags 1845 The AVP Flags field informs the receiver how each attribute must 1846 be handled. The 'r' (reserved) bits are unused and SHOULD be set 1847 to 0. Note that subsequent Diameter applications MAY define 1848 additional bits within the AVP Header, and an unrecognized bit 1849 SHOULD be considered an error. The 'P' bit has been reserved for 1850 future usage of end-to-end security. At the time of writing there 1851 are no end-to-end security mechanisms specified therefore the 'P' 1852 bit SHOULD be set to 0. 1854 The 'M' Bit, known as the Mandatory bit, indicates whether the 1855 receiver of the AVP MUST parse and understand the semantic of the 1856 AVP including its content. The receiving entity MUST return an 1857 appropriate error message if it receives an AVP that has the M-bit 1858 set but does not understand it. An exception applies when the AVP 1859 is embedded within a Grouped AVP. See Section 4.4 for details. 1860 Diameter Relay and redirect agents MUST NOT reject messages with 1861 unrecognized AVPs. 1863 The 'M' bit MUST be set according to the rules defined in the 1864 application specification which introduces or re-uses this AVP. 1865 Within a given application, the M-bit setting for an AVP is either 1866 defined for all command types or for each command type. 1868 AVPs with the 'M' bit cleared are informational only and a 1869 receiver that receives a message with such an AVP that is not 1870 supported, or whose value is not supported, MAY simply ignore the 1871 AVP. 1873 The 'V' bit, known as the Vendor-Specific bit, indicates whether 1874 the optional Vendor-ID field is present in the AVP header. When 1875 set the AVP Code belongs to the specific vendor code address 1876 space. 1878 AVP Length 1880 The AVP Length field is three octets, and indicates the number of 1881 octets in this AVP including the AVP Code, AVP Length, AVP Flags, 1882 Vendor-ID field (if present) and the AVP data. If a message is 1883 received with an invalid attribute length, the message MUST be 1884 rejected. 1886 4.1.1. Optional Header Elements 1888 The AVP Header contains one optional field. This field is only 1889 present if the respective bit-flag is enabled. 1891 Vendor-ID 1893 The Vendor-ID field is present if the 'V' bit is set in the AVP 1894 Flags field. The optional four-octet Vendor-ID field contains the 1895 IANA assigned "SMI Network Management Private Enterprise Codes" 1896 [RFC3232] value, encoded in network byte order. Any vendor or 1897 standardization organization that are also treated like vendors in 1898 the IANA managed "SMI Network Management Private Enterprise Codes" 1899 space wishing to implement a vendor-specific Diameter AVP MUST use 1900 their own Vendor-ID along with their privately managed AVP address 1901 space, guaranteeing that they will not collide with any other 1902 vendor's vendor-specific AVP(s), nor with future IETF AVPs. 1904 A vendor ID value of zero (0) corresponds to the IETF adopted AVP 1905 values, as managed by the IANA. Since the absence of the vendor 1906 ID field implies that the AVP in question is not vendor specific, 1907 implementations MUST NOT use the zero (0) vendor ID. 1909 4.2. Basic AVP Data Formats 1911 The Data field is zero or more octets and contains information 1912 specific to the Attribute. The format and length of the Data field 1913 is determined by the AVP Code and AVP Length fields. The format of 1914 the Data field MUST be one of the following base data types or a data 1915 type derived from the base data types. In the event that a new Basic 1916 AVP Data Format is needed, a new version of this RFC MUST be created. 1918 OctetString 1920 The data contains arbitrary data of variable length. Unless 1921 otherwise noted, the AVP Length field MUST be set to at least 8 1922 (12 if the 'V' bit is enabled). AVP Values of this type that are 1923 not a multiple of four-octets in length is followed by the 1924 necessary padding so that the next AVP (if any) will start on a 1925 32-bit boundary. 1927 Integer32 1929 32 bit signed value, in network byte order. The AVP Length field 1930 MUST be set to 12 (16 if the 'V' bit is enabled). 1932 Integer64 1934 64 bit signed value, in network byte order. The AVP Length field 1935 MUST be set to 16 (20 if the 'V' bit is enabled). 1937 Unsigned32 1939 32 bit unsigned value, in network byte order. The AVP Length 1940 field MUST be set to 12 (16 if the 'V' bit is enabled). 1942 Unsigned64 1944 64 bit unsigned value, in network byte order. The AVP Length 1945 field MUST be set to 16 (20 if the 'V' bit is enabled). 1947 Float32 1949 This represents floating point values of single precision as 1950 described by [FLOATPOINT]. The 32-bit value is transmitted in 1951 network byte order. The AVP Length field MUST be set to 12 (16 if 1952 the 'V' bit is enabled). 1954 Float64 1956 This represents floating point values of double precision as 1957 described by [FLOATPOINT]. The 64-bit value is transmitted in 1958 network byte order. The AVP Length field MUST be set to 16 (20 if 1959 the 'V' bit is enabled). 1961 Grouped 1963 The Data field is specified as a sequence of AVPs. Each of these 1964 AVPs follows - in the order in which they are specified - 1965 including their headers and padding. The AVP Length field is set 1966 to 8 (12 if the 'V' bit is enabled) plus the total length of all 1967 included AVPs, including their headers and padding. Thus the AVP 1968 length field of an AVP of type Grouped is always a multiple of 4. 1970 4.3. Derived AVP Data Formats 1972 In addition to using the Basic AVP Data Formats, applications may 1973 define data formats derived from the Basic AVP Data Formats. An 1974 application that defines new AVP Derived Data Formats MUST include 1975 them in a section entitled "AVP Derived Data Formats", using the same 1976 format as the definitions below. Each new definition MUST be either 1977 defined or listed with a reference to the RFC that defines the 1978 format. 1980 The below AVP Derived Data Formats are commonly used by applications. 1982 Address 1984 The Address format is derived from the OctetString AVP Base 1985 Format. It is a discriminated union, representing, for example a 1986 32-bit (IPv4) [RFC791] or 128-bit (IPv6) [RFC4291] address, most 1987 significant octet first. The first two octets of the Address AVP 1988 represents the AddressType, which contains an Address Family 1989 defined in [IANAADFAM]. The AddressType is used to discriminate 1990 the content and format of the remaining octets. 1992 Time 1994 The Time format is derived from the OctetString AVP Base Format. 1995 The string MUST contain four octets, in the same format as the 1996 first four bytes are in the NTP timestamp format. The NTP 1997 Timestamp format is defined in Chapter 3 of [RFC4330]. 1999 This represents the number of seconds since 0h on 1 January 1900 2000 with respect to the Coordinated Universal Time (UTC). 2002 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow. 2003 SNTP [RFC4330] describes a procedure to extend the time to 2104. 2004 This procedure MUST be supported by all Diameter nodes. 2006 UTF8String 2008 The UTF8String format is derived from the OctetString AVP Base 2009 Format. This is a human readable string represented using the 2010 ISO/IEC IS 10646-1 character set, encoded as an OctetString using 2011 the UTF-8 [RFC3629] transformation format described in RFC 3629. 2013 Since additional code points are added by amendments to the 10646 2014 standard from time to time, implementations MUST be prepared to 2015 encounter any code point from 0x00000001 to 0x7fffffff. Byte 2016 sequences that do not correspond to the valid encoding of a code 2017 point into UTF-8 charset or are outside this range are prohibited. 2019 The use of control codes SHOULD be avoided. When it is necessary 2020 to represent a new line, the control code sequence CR LF SHOULD be 2021 used. 2023 The use of leading or trailing white space SHOULD be avoided. 2025 For code points not directly supported by user interface hardware 2026 or software, an alternative means of entry and display, such as 2027 hexadecimal, MAY be provided. 2029 For information encoded in 7-bit US-ASCII, the UTF-8 charset is 2030 identical to the US-ASCII charset. 2032 UTF-8 may require multiple bytes to represent a single character / 2033 code point; thus the length of an UTF8String in octets may be 2034 different from the number of characters encoded. 2036 Note that the AVP Length field of an UTF8String is measured in 2037 octets, not characters. 2039 DiameterIdentity 2041 The DiameterIdentity format is derived from the OctetString AVP 2042 Base Format. 2044 DiameterIdentity = FQDN/Realm 2046 DiameterIdentity value is used to uniquely identify either: 2048 * A Diameter node for purposes of duplicate connection and 2049 routing loop detection. 2051 * A Realm to determine whether messages can be satisfied locally, 2052 or whether they must be routed or redirected. 2054 When a DiameterIdentity is used to identify a Diameter node the 2055 contents of the string MUST be the FQDN of the Diameter node. If 2056 multiple Diameter nodes run on the same host, each Diameter node 2057 MUST be assigned a unique DiameterIdentity. If a Diameter node 2058 can be identified by several FQDNs, a single FQDN should be picked 2059 at startup, and used as the only DiameterIdentity for that node, 2060 whatever the connection it is sent on. Note that in this 2061 document, DiameterIdentity is in ASCII form in order to be 2062 compatible with existing DNS infrastructure. See Appendix D for 2063 interactions between the Diameter protocol and Internationalized 2064 Domain Name (IDNs). 2066 DiameterURI 2068 The DiameterURI MUST follow the Uniform Resource Identifiers (URI) 2069 syntax [RFC3986] rules specified below: 2071 "aaa://" FQDN [ port ] [ transport ] [ protocol ] 2073 ; No transport security 2075 "aaas://" FQDN [ port ] [ transport ] [ protocol ] 2077 ; Transport security used 2079 FQDN = Fully Qualified Host Name 2081 port = ":" 1*DIGIT 2083 ; One of the ports used to listen for 2084 ; incoming connections. 2085 ; If absent, the default Diameter port 2086 ; (3868) is assumed if no transport 2087 ; security is used and port (TBD) when 2088 ; transport security (TLS) is used. 2090 transport = ";transport=" transport-protocol 2092 ; One of the transports used to listen 2093 ; for incoming connections. If absent, 2094 ; the default protocol is assumed to be TCP. 2095 ; UDP MUST NOT be used when the aaa-protocol 2096 ; field is set to diameter. 2098 transport-protocol = ( "tcp" / "sctp" / "udp" ) 2100 protocol = ";protocol=" aaa-protocol 2102 ; If absent, the default AAA protocol 2103 ; is Diameter. 2105 aaa-protocol = ( "diameter" / "radius" / "tacacs+" ) 2107 The following are examples of valid Diameter host identities: 2109 aaa://host.example.com;transport=tcp 2110 aaa://host.example.com:6666;transport=tcp 2111 aaa://host.example.com;protocol=diameter 2112 aaa://host.example.com:6666;protocol=diameter 2113 aaa://host.example.com:6666;transport=tcp;protocol=diameter 2114 aaa://host.example.com:1813;transport=udp;protocol=radius 2116 Enumerated 2118 Enumerated is derived from the Integer32 AVP Base Format. The 2119 definition contains a list of valid values and their 2120 interpretation and is described in the Diameter application 2121 introducing the AVP. 2123 IPFilterRule 2125 The IPFilterRule format is derived from the OctetString AVP Base 2126 Format and uses the ASCII charset. The rule syntax is a modified 2127 subset of ipfw(8) from FreeBSD. Packets may be filtered based on 2128 the following information that is associated with it: 2130 Direction (in or out) 2131 Source and destination IP address (possibly masked) 2132 Protocol 2133 Source and destination port (lists or ranges) 2134 TCP flags 2135 IP fragment flag 2136 IP options 2137 ICMP types 2139 Rules for the appropriate direction are evaluated in order, with 2140 the first matched rule terminating the evaluation. Each packet is 2141 evaluated once. If no rule matches, the packet is dropped if the 2142 last rule evaluated was a permit, and passed if the last rule was 2143 a deny. 2145 IPFilterRule filters MUST follow the format: 2147 action dir proto from src to dst [options] 2149 action permit - Allow packets that match the rule. 2150 deny - Drop packets that match the rule. 2152 dir "in" is from the terminal, "out" is to the 2153 terminal. 2155 proto An IP protocol specified by number. The "ip" 2156 keyword means any protocol will match. 2158 src and dst
[ports] 2160 The
may be specified as: 2161 ipno An IPv4 or IPv6 number in dotted- 2162 quad or canonical IPv6 form. Only 2163 this exact IP number will match the 2164 rule. 2165 ipno/bits An IP number as above with a mask 2166 width of the form 1.2.3.4/24. In 2167 this case, all IP numbers from 2168 1.2.3.0 to 1.2.3.255 will match. 2169 The bit width MUST be valid for the 2170 IP version and the IP number MUST 2171 NOT have bits set beyond the mask. 2172 For a match to occur, the same IP 2173 version must be present in the 2174 packet that was used in describing 2175 the IP address. To test for a 2176 particular IP version, the bits part 2177 can be set to zero. The keyword 2178 "any" is 0.0.0.0/0 or the IPv6 2179 equivalent. The keyword "assigned" 2180 is the address or set of addresses 2181 assigned to the terminal. For IPv4, 2182 a typical first rule is often "deny 2183 in ip! assigned" 2185 The sense of the match can be inverted by 2186 preceding an address with the not modifier (!), 2187 causing all other addresses to be matched 2188 instead. This does not affect the selection of 2189 port numbers. 2191 With the TCP, UDP and SCTP protocols, optional 2192 ports may be specified as: 2194 {port/port-port}[,ports[,...]] 2196 The '-' notation specifies a range of ports 2197 (including boundaries). 2199 Fragmented packets that have a non-zero offset 2200 (i.e., not the first fragment) will never match 2201 a rule that has one or more port 2202 specifications. See the frag option for 2203 details on matching fragmented packets. 2205 options: 2206 frag Match if the packet is a fragment and this is not 2207 the first fragment of the datagram. frag may not 2208 be used in conjunction with either tcpflags or 2209 TCP/UDP port specifications. 2211 ipoptions spec 2212 Match if the IP header contains the comma 2213 separated list of options specified in spec. The 2214 supported IP options are: 2216 ssrr (strict source route), lsrr (loose source 2217 route), rr (record packet route) and ts 2218 (timestamp). The absence of a particular option 2219 may be denoted with a '!'. 2221 tcpoptions spec 2222 Match if the TCP header contains the comma 2223 separated list of options specified in spec. The 2224 supported TCP options are: 2226 mss (maximum segment size), window (tcp window 2227 advertisement), sack (selective ack), ts (rfc1323 2228 timestamp) and cc (rfc1644 t/tcp connection 2229 count). The absence of a particular option may 2230 be denoted with a '!'. 2232 established 2233 TCP packets only. Match packets that have the RST 2234 or ACK bits set. 2236 setup TCP packets only. Match packets that have the SYN 2237 bit set but no ACK bit. 2239 tcpflags spec 2240 TCP packets only. Match if the TCP header 2241 contains the comma separated list of flags 2242 specified in spec. The supported TCP flags are: 2244 fin, syn, rst, psh, ack and urg. The absence of a 2245 particular flag may be denoted with a '!'. A rule 2246 that contains a tcpflags specification can never 2247 match a fragmented packet that has a non-zero 2248 offset. See the frag option for details on 2249 matching fragmented packets. 2251 icmptypes types 2252 ICMP packets only. Match if the ICMP type is in 2253 the list types. The list may be specified as any 2254 combination of ranges or individual types 2255 separated by commas. Both the numeric values and 2256 the symbolic values listed below can be used. The 2257 supported ICMP types are: 2259 echo reply (0), destination unreachable (3), 2260 source quench (4), redirect (5), echo request 2261 (8), router advertisement (9), router 2262 solicitation (10), time-to-live exceeded (11), IP 2263 header bad (12), timestamp request (13), 2264 timestamp reply (14), information request (15), 2265 information reply (16), address mask request (17) 2266 and address mask reply (18). 2268 There is one kind of packet that the access device MUST always 2269 discard, that is an IP fragment with a fragment offset of one. 2270 This is a valid packet, but it only has one use, to try to 2271 circumvent firewalls. 2273 An access device that is unable to interpret or apply a deny rule 2274 MUST terminate the session. An access device that is unable to 2275 interpret or apply a permit rule MAY apply a more restrictive 2276 rule. An access device MAY apply deny rules of its own before the 2277 supplied rules, for example to protect the access device owner's 2278 infrastructure. 2280 4.4. Grouped AVP Values 2282 The Diameter protocol allows AVP values of type 'Grouped'. This 2283 implies that the Data field is actually a sequence of AVPs. It is 2284 possible to include an AVP with a Grouped type within a Grouped type, 2285 that is, to nest them. AVPs within an AVP of type Grouped have the 2286 same padding requirements as non-Grouped AVPs, as defined in Section 2287 4. 2289 The AVP Code numbering space of all AVPs included in a Grouped AVP is 2290 the same as for non-grouped AVPs. Receivers of a Grouped AVP that 2291 does not have the 'M' (mandatory) bit set and one or more of the 2292 encapsulated AVPs within the group has the 'M' (mandatory) bit set 2293 MAY simply be ignored if the Grouped AVP itself is unrecognized. The 2294 rule applies even if the encapsulated AVP with its 'M' (mandatory) 2295 bit set is further encapsulated within other sub-groups; i.e. other 2296 Grouped AVPs embedded within the Grouped AVP. 2298 Every Grouped AVP defined MUST include a corresponding grammar, using 2299 ABNF [RFC5234] (with modifications), as defined below. 2301 grouped-avp-def = name "::=" avp 2303 name-fmt = ALPHA *(ALPHA / DIGIT / "-") 2305 name = name-fmt 2306 ; The name has to be the name of an AVP, 2307 ; defined in the base or extended Diameter 2308 ; specifications. 2310 avp = header [ *fixed] [ *required] [ *optional] 2312 header = "<" "AVP-Header:" avpcode [vendor] ">" 2314 avpcode = 1*DIGIT 2315 ; The AVP Code assigned to the Grouped AVP 2317 vendor = 1*DIGIT 2318 ; The Vendor-ID assigned to the Grouped AVP. 2319 ; If absent, the default value of zero is 2320 ; used. 2322 4.4.1. Example AVP with a Grouped Data type 2324 The Example-AVP (AVP Code 999999) is of type Grouped and is used to 2325 clarify how Grouped AVP values work. The Grouped Data field has the 2326 following ABNF grammar: 2328 Example-AVP ::= < AVP Header: 999999 > 2329 { Origin-Host } 2330 1*{ Session-Id } 2331 *[ AVP ] 2333 An Example-AVP with Grouped Data follows. 2335 The Origin-Host AVP is required (Section 6.3). In this case: 2337 Origin-Host = "example.com". 2339 One or more Session-Ids must follow. Here there are two: 2341 Session-Id = 2342 "grump.example.com:33041;23432;893;0AF3B81" 2344 Session-Id = 2345 "grump.example.com:33054;23561;2358;0AF3B82" 2347 optional AVPs included are 2349 Recovery-Policy = 2350 2163bc1d0ad82371f6bc09484133c3f09ad74a0dd5346d54195a7cf0b35 2351 2cabc881839a4fdcfbc1769e2677a4c1fb499284c5f70b48f58503a45c5 2352 c2d6943f82d5930f2b7c1da640f476f0e9c9572a50db8ea6e51e1c2c7bd 2353 f8bb43dc995144b8dbe297ac739493946803e1cee3e15d9b765008a1b2a 2354 cf4ac777c80041d72c01e691cf751dbf86e85f509f3988e5875dc905119 2355 26841f00f0e29a6d1ddc1a842289d440268681e052b30fb638045f7779c 2356 1d873c784f054f688f5001559ecff64865ef975f3e60d2fd7966b8c7f92 2358 Futuristic-Acct-Record = 2359 fe19da5802acd98b07a5b86cb4d5d03f0314ab9ef1ad0b67111ff3b90a0 2360 57fe29620bf3585fd2dd9fcc38ce62f6cc208c6163c008f4258d1bc88b8 2361 17694a74ccad3ec69269461b14b2e7a4c111fb239e33714da207983f58c 2362 41d018d56fe938f3cbf089aac12a912a2f0d1923a9390e5f789cb2e5067 2363 d3427475e49968f841 2365 The data for the optional AVPs is represented in hex since the format 2366 of these AVPs is neither known at the time of definition of the 2367 Example-AVP group, nor (likely) at the time when the example instance 2368 of this AVP is interpreted - except by Diameter implementations which 2369 support the same set of AVPs. The encoding example illustrates how 2370 padding is used and how length fields are calculated. Also note that 2371 AVPs may be present in the Grouped AVP value which the receiver 2372 cannot interpret (here, the Recover-Policy and Futuristic-Acct-Record 2373 AVPs). The length of the Example-AVP is the sum of all the length of 2374 the member AVPs including their padding plus the Example-AVP header 2375 size. 2377 This AVP would be encoded as follows: 2379 0 1 2 3 4 5 6 7 2380 +-------+-------+-------+-------+-------+-------+-------+-------+ 2381 0 | Example AVP Header (AVP Code = 999999), Length = 496 | 2382 +-------+-------+-------+-------+-------+-------+-------+-------+ 2383 8 | Origin-Host AVP Header (AVP Code = 264), Length = 19 | 2384 +-------+-------+-------+-------+-------+-------+-------+-------+ 2385 16 | 'e' | 'x' | 'a' | 'm' | 'p' | 'l' | 'e' | '.' | 2386 +-------+-------+-------+-------+-------+-------+-------+-------+ 2387 24 | 'c' | 'o' | 'm' |Padding| Session-Id AVP Header | 2388 +-------+-------+-------+-------+-------+-------+-------+-------+ 2389 32 | (AVP Code = 263), Length = 49 | 'g' | 'r' | 'u' | 'm' | 2390 +-------+-------+-------+-------+-------+-------+-------+-------+ 2391 . . . 2392 +-------+-------+-------+-------+-------+-------+-------+-------+ 2393 72 | 'F' | '3' | 'B' | '8' | '1' |Padding|Padding|Padding| 2394 +-------+-------+-------+-------+-------+-------+-------+-------+ 2395 80 | Session-Id AVP Header (AVP Code = 263), Length = 50 | 2396 +-------+-------+-------+-------+-------+-------+-------+-------+ 2397 88 | 'g' | 'r' | 'u' | 'm' | 'p' | '.' | 'e' | 'x' | 2398 +-------+-------+-------+-------+-------+-------+-------+-------+ 2399 . . . 2400 +-------+-------+-------+-------+-------+-------+-------+-------+ 2401 120| '5' | '8' | ';' | '0' | 'A' | 'F' | '3' | 'B' | 2402 +-------+-------+-------+-------+-------+-------+-------+-------+ 2403 128| '8' | '2' |Padding|Padding| Recovery-Policy Header (AVP | 2404 +-------+-------+-------+-------+-------+-------+-------+-------+ 2405 136| Code = 8341), Length = 223 | 0x21 | 0x63 | 0xbc | 0x1d | 2406 +-------+-------+-------+-------+-------+-------+-------+-------+ 2407 144| 0x0a | 0xd8 | 0x23 | 0x71 | 0xf6 | 0xbc | 0x09 | 0x48 | 2408 +-------+-------+-------+-------+-------+-------+-------+-------+ 2409 . . . 2410 +-------+-------+-------+-------+-------+-------+-------+-------+ 2411 352| 0x8c | 0x7f | 0x92 |Padding| Futuristic-Acct-Record Header | 2412 +-------+-------+-------+-------+-------+-------+-------+-------+ 2413 328|(AVP Code = 15930),Length = 137| 0xfe | 0x19 | 0xda | 0x58 | 2414 +-------+-------+-------+-------+-------+-------+-------+-------+ 2415 336| 0x02 | 0xac | 0xd9 | 0x8b | 0x07 | 0xa5 | 0xb8 | 0xc6 | 2416 +-------+-------+-------+-------+-------+-------+-------+-------+ 2417 . . . 2418 +-------+-------+-------+-------+-------+-------+-------+-------+ 2419 488| 0xe4 | 0x99 | 0x68 | 0xf8 | 0x41 |Padding|Padding|Padding| 2420 +-------+-------+-------+-------+-------+-------+-------+-------+ 2422 4.5. Diameter Base Protocol AVPs 2424 The following table describes the Diameter AVPs defined in the base 2425 protocol, their AVP Code values, types, possible flag values. 2427 Due to space constraints, the short form DiamIdent is used to 2428 represent DiameterIdentity. 2430 +----------+ 2431 | AVP Flag | 2432 | rules | 2433 |----+-----| 2434 AVP Section | |MUST | 2435 Attribute Name Code Defined Data Type |MUST| NOT | 2436 -----------------------------------------|----+-----| 2437 Acct- 85 9.8.2 Unsigned32 | M | V | 2438 Interim-Interval | | | 2439 Accounting- 483 9.8.7 Enumerated | M | V | 2440 Realtime-Required | | | 2441 Acct- 50 9.8.5 UTF8String | M | V | 2442 Multi-Session-Id | | | 2443 Accounting- 485 9.8.3 Unsigned32 | M | V | 2444 Record-Number | | | 2445 Accounting- 480 9.8.1 Enumerated | M | V | 2446 Record-Type | | | 2447 Accounting- 44 9.8.4 OctetString| M | V | 2448 Session-Id | | | 2449 Accounting- 287 9.8.6 Unsigned64 | M | V | 2450 Sub-Session-Id | | | 2451 Acct- 259 6.9 Unsigned32 | M | V | 2452 Application-Id | | | 2453 Auth- 258 6.8 Unsigned32 | M | V | 2454 Application-Id | | | 2455 Auth-Request- 274 8.7 Enumerated | M | V | 2456 Type | | | 2457 Authorization- 291 8.9 Unsigned32 | M | V | 2458 Lifetime | | | 2459 Auth-Grace- 276 8.10 Unsigned32 | M | V | 2460 Period | | | 2461 Auth-Session- 277 8.11 Enumerated | M | V | 2462 State | | | 2463 Re-Auth-Request- 285 8.12 Enumerated | M | V | 2464 Type | | | 2465 Class 25 8.20 OctetString| M | V | 2466 Destination-Host 293 6.5 DiamIdent | M | V | 2467 Destination- 283 6.6 DiamIdent | M | V | 2468 Realm | | | 2469 Disconnect-Cause 273 5.4.3 Enumerated | M | V | 2470 Error-Message 281 7.3 UTF8String | | V,M | 2471 Error-Reporting- 294 7.4 DiamIdent | | V,M | 2472 Host | | | 2473 Event-Timestamp 55 8.21 Time | M | V | 2474 Experimental- 297 7.6 Grouped | M | V | 2475 Result | | | 2476 -----------------------------------------|----+-----| 2477 +----------+ 2478 | AVP Flag | 2479 | rules | 2480 |----+-----| 2481 AVP Section | |MUST | 2482 Attribute Name Code Defined Data Type |MUST| NOT | 2483 -----------------------------------------|----+-----| 2484 Experimental- 298 7.7 Unsigned32 | M | V | 2485 Result-Code | | | 2486 Failed-AVP 279 7.5 Grouped | M | V | 2487 Firmware- 267 5.3.4 Unsigned32 | | V,M | 2488 Revision | | | 2489 Host-IP-Address 257 5.3.5 Address | M | V | 2490 Inband-Security | M | V | 2491 -Id 299 6.10 Unsigned32 | | | 2492 Multi-Round- 272 8.19 Unsigned32 | M | V | 2493 Time-Out | | | 2494 Origin-Host 264 6.3 DiamIdent | M | V | 2495 Origin-Realm 296 6.4 DiamIdent | M | V | 2496 Origin-State-Id 278 8.16 Unsigned32 | M | V | 2497 Product-Name 269 5.3.7 UTF8String | | V,M | 2498 Proxy-Host 280 6.7.3 DiamIdent | M | V | 2499 Proxy-Info 284 6.7.2 Grouped | M | V | 2500 Proxy-State 33 6.7.4 OctetString| M | V | 2501 Redirect-Host 292 6.12 DiamURI | M | V | 2502 Redirect-Host- 261 6.13 Enumerated | M | V | 2503 Usage | | | 2504 Redirect-Max- 262 6.14 Unsigned32 | M | V | 2505 Cache-Time | | | 2506 Result-Code 268 7.1 Unsigned32 | M | V | 2507 Route-Record 282 6.7.1 DiamIdent | M | V | 2508 Session-Id 263 8.8 UTF8String | M | V | 2509 Session-Timeout 27 8.13 Unsigned32 | M | V | 2510 Session-Binding 270 8.17 Unsigned32 | M | V | 2511 Session-Server- 271 8.18 Enumerated | M | V | 2512 Failover | | | 2513 Supported- 265 5.3.6 Unsigned32 | M | V | 2514 Vendor-Id | | | 2515 Termination- 295 8.15 Enumerated | M | V | 2516 Cause | | | 2517 User-Name 1 8.14 UTF8String | M | V | 2518 Vendor-Id 266 5.3.3 Unsigned32 | M | V | 2519 Vendor-Specific- 260 6.11 Grouped | M | V | 2520 Application-Id | | | 2521 -----------------------------------------|----+-----| 2523 5. Diameter Peers 2525 This section describes how Diameter nodes establish connections and 2526 communicate with peers. 2528 5.1. Peer Connections 2530 Although a Diameter node may have many possible peers that it is able 2531 to communicate with, it may not be economical to have an established 2532 connection to all of them. At a minimum, a Diameter node SHOULD have 2533 an established connection with two peers per realm, known as the 2534 primary and secondary peers. Of course, a node MAY have additional 2535 connections, if it is deemed necessary. Typically, all messages for 2536 a realm are sent to the primary peer, but in the event that failover 2537 procedures are invoked, any pending requests are sent to the 2538 secondary peer. However, implementations are free to load balance 2539 requests between a set of peers. 2541 Note that a given peer MAY act as a primary for a given realm, while 2542 acting as a secondary for another realm. 2544 When a peer is deemed suspect, which could occur for various reasons, 2545 including not receiving a DWA within an allotted timeframe, no new 2546 requests should be forwarded to the peer, but failover procedures are 2547 invoked. When an active peer is moved to this mode, additional 2548 connections SHOULD be established to ensure that the necessary number 2549 of active connections exists. 2551 There are two ways that a peer is removed from the suspect peer list: 2553 1. The peer is no longer reachable, causing the transport connection 2554 to be shutdown. The peer is moved to the closed state. 2556 2. Three watchdog messages are exchanged with accepted round trip 2557 times, and the connection to the peer is considered stabilized. 2559 In the event the peer being removed is either the primary or 2560 secondary, an alternate peer SHOULD replace the deleted peer, and 2561 assume the role of either primary or secondary. 2563 5.2. Diameter Peer Discovery 2565 Allowing for dynamic Diameter agent discovery will make it possible 2566 for simpler and more robust deployment of Diameter services. In 2567 order to promote interoperable implementations of Diameter peer 2568 discovery, the following mechanisms are described. These are based 2569 on existing IETF standards. The first option (manual configuration) 2570 MUST be supported by all Diameter nodes, while the latter option 2571 (DNS) MAY be supported. 2573 There are two cases where Diameter peer discovery may be performed. 2574 The first is when a Diameter client needs to discover a first-hop 2575 Diameter agent. The second case is when a Diameter agent needs to 2576 discover another agent - for further handling of a Diameter 2577 operation. In both cases, the following 'search order' is 2578 recommended: 2580 1. The Diameter implementation consults its list of static 2581 (manually) configured Diameter agent locations. These will be 2582 used if they exist and respond. 2584 2. The Diameter implementation performs a NAPTR query for a server 2585 in a particular realm. The Diameter implementation has to know 2586 in advance which realm to look for a Diameter agent in. This 2587 could be deduced, for example, from the 'realm' in a NAI that a 2588 Diameter implementation needed to perform a Diameter operation 2589 on. 2591 * The services relevant for the task of transport protocol 2592 selection are those with NAPTR service fields with values 2593 "AAA+D2x", where x is a letter that corresponds to a transport 2594 protocol supported by the domain. This specification defines 2595 D2T for TCP, D2S for SCTP and D2L for TLS. An IANA registry 2596 for NAPTR service name to transport protocol mappings is 2597 defined in Section 11.6. 2599 These NAPTR records provide a mapping from a domain, to the 2600 SRV record for contacting a server with the specific transport 2601 protocol in the NAPTR services field. The resource record 2602 will contain an empty regular expression and the replacement 2603 value will contain the SRV record for that particular 2604 transport protocol. If the server supports multiple transport 2605 protocols, there will be multiple NAPTR records, each with a 2606 different service value. As per [RFC3403], the client 2607 discards any records whose services fields are not applicable. 2608 For the purposes of this specification, several rules are 2609 defined. 2611 * A client MUST discard any service fields that identify a 2612 resolution service whose value is not "D2X", for values of X 2613 that indicate transport protocols supported by the client. 2614 The NAPTR processing as described in [RFC3403] will result in 2615 discovery of the most preferred transport protocol of the 2616 server that is supported by the client, as well as an SRV 2617 record for the server. 2619 The domain suffixes in the NAPTR replacement field SHOULD 2620 match the domain of the original query. 2622 3. If no NAPTR records are found, the requester directly queries for 2623 SRV records '_diameter._sctp'.realm, '_diameter._tcp'.realm and 2624 '_diameter._tls'.realm depending on the requesters network 2625 protocol capabilities. If SRV records are found then the 2626 requester can perform address record query (A RR's and/or AAAA 2627 RR's) for the target hostname specified in the SRV records. If 2628 no SRV records are found, the requester gives up. 2630 If the server is using a site certificate, the domain name in the 2631 NAPTR query and the domain name in the replacement field MUST both be 2632 valid based on the site certificate handed out by the server in the 2633 TLS or IKE exchange. Similarly, the domain name in the SRV query and 2634 the domain name in the target in the SRV record MUST both be valid 2635 based on the same site certificate. Otherwise, an attacker could 2636 modify the DNS records to contain replacement values in a different 2637 domain, and the client could not validate that this was the desired 2638 behavior, or the result of an attack. 2640 Also, the Diameter Peer MUST check to make sure that the discovered 2641 peers are authorized to act in its role. Authentication via IKE or 2642 TLS, or validation of DNS RRs via DNSSEC is not sufficient to 2643 conclude this. For example, a web server may have obtained a valid 2644 TLS certificate, and secured RRs may be included in the DNS, but this 2645 does not imply that it is authorized to act as a Diameter Server. 2647 Authorization can be achieved for example, by configuration of a 2648 Diameter Server CA. Alternatively this can be achieved by definition 2649 of OIDs within TLS or IKE certificates so as to signify Diameter 2650 Server authorization. 2652 A dynamically discovered peer causes an entry in the Peer Table (see 2653 Section 2.6) to be created. Note that entries created via DNS MUST 2654 expire (or be refreshed) within the DNS TTL. If a peer is discovered 2655 outside of the local realm, a routing table entry (see Section 2.7) 2656 for the peer's realm is created. The routing table entry's 2657 expiration MUST match the peer's expiration value. 2659 5.3. Capabilities Exchange 2661 When two Diameter peers establish a transport connection, they MUST 2662 exchange the Capabilities Exchange messages, as specified in the peer 2663 state machine (see Section 5.6). This message allows the discovery 2664 of a peer's identity and its capabilities (protocol version number, 2665 supported Diameter applications, security mechanisms, etc.) 2667 The receiver only issues commands to its peers that have advertised 2668 support for the Diameter application that defines the command. A 2669 Diameter node MUST cache the supported applications in order to 2670 ensure that unrecognized commands and/or AVPs are not unnecessarily 2671 sent to a peer. 2673 A receiver of a Capabilities-Exchange-Req (CER) message that does not 2674 have any applications in common with the sender MUST return a 2675 Capabilities-Exchange-Answer (CEA) with the Result-Code AVP set to 2676 DIAMETER_NO_COMMON_APPLICATION, and SHOULD disconnect the transport 2677 layer connection. Note that receiving a CER or CEA from a peer 2678 advertising itself as a Relay (see Section 2.4) MUST be interpreted 2679 as having common applications with the peer. 2681 The receiver of the Capabilities-Exchange-Request (CER) MUST 2682 determine common applications by computing the intersection of its 2683 own set of supported Application Id against all of the application 2684 identifier AVPs (Auth-Application-Id, Acct-Application-Id and Vendor- 2685 Specific-Application-Id) present in the CER. The value of the 2686 Vendor-Id AVP in the Vendor-Specific-Application-Id MUST NOT be used 2687 during computation. The sender of the Capabilities-Exchange-Answer 2688 (CEA) SHOULD include all of its supported applications as a hint to 2689 the receiver regarding all of its application capabilities. 2691 Diameter implementations SHOULD first attempt to establish a TLS 2692 connection prior to the CER/CEA exchange. This protects the 2693 capabilities information of both peers. To support older Diameter 2694 implementations that do not fully conform to this document, the 2695 transport security MAY still be negotiated via Inband-Security AVP. 2696 In this case, the receiver of a Capabilities-Exchange-Req (CER) 2697 message that does not have any security mechanisms in common with the 2698 sender MUST return a Capabilities-Exchange-Answer (CEA) with the 2699 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY, and SHOULD 2700 disconnect the transport layer connection. 2702 CERs received from unknown peers MAY be silently discarded, or a CEA 2703 MAY be issued with the Result-Code AVP set to DIAMETER_UNKNOWN_PEER. 2704 In both cases, the transport connection is closed. If the local 2705 policy permits receiving CERs from unknown hosts, a successful CEA 2706 MAY be returned. If a CER from an unknown peer is answered with a 2707 successful CEA, the lifetime of the peer entry is equal to the 2708 lifetime of the transport connection. In case of a transport 2709 failure, all the pending transactions destined to the unknown peer 2710 can be discarded. 2712 The CER and CEA messages MUST NOT be proxied, redirected or relayed. 2714 Since the CER/CEA messages cannot be proxied, it is still possible 2715 that an upstream agent receives a message for which it has no 2716 available peers to handle the application that corresponds to the 2717 Command-Code. In such instances, the 'E' bit is set in the answer 2718 message (see Section 7.) with the Result-Code AVP set to 2719 DIAMETER_UNABLE_TO_DELIVER to inform the downstream to take action 2720 (e.g., re-routing request to an alternate peer). 2722 With the exception of the Capabilities-Exchange-Request message, a 2723 message of type Request that includes the Auth-Application-Id or 2724 Acct-Application-Id AVPs, or a message with an application-specific 2725 command code, MAY only be forwarded to a host that has explicitly 2726 advertised support for the application (or has advertised the Relay 2727 Application Id). 2729 5.3.1. Capabilities-Exchange-Request 2731 The Capabilities-Exchange-Request (CER), indicated by the Command- 2732 Code set to 257 and the Command Flags' 'R' bit set, is sent to 2733 exchange local capabilities. Upon detection of a transport failure, 2734 this message MUST NOT be sent to an alternate peer. 2736 When Diameter is run over SCTP [RFC4960], which allows for 2737 connections to span multiple interfaces and multiple IP addresses, 2738 the Capabilities-Exchange-Request message MUST contain one Host-IP- 2739 Address AVP for each potential IP address that MAY be locally used 2740 when transmitting Diameter messages. 2742 Message Format 2744 ::= < Diameter Header: 257, REQ > 2745 { Origin-Host } 2746 { Origin-Realm } 2747 1* { Host-IP-Address } 2748 { Vendor-Id } 2749 { Product-Name } 2750 [ Origin-State-Id ] 2751 * [ Supported-Vendor-Id ] 2752 * [ Auth-Application-Id ] 2753 * [ Inband-Security-Id ] 2754 * [ Acct-Application-Id ] 2755 * [ Vendor-Specific-Application-Id ] 2756 [ Firmware-Revision ] 2757 * [ AVP ] 2759 5.3.2. Capabilities-Exchange-Answer 2761 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code 2762 set to 257 and the Command Flags' 'R' bit cleared, is sent in 2763 response to a CER message. 2765 When Diameter is run over SCTP [RFC4960], which allows connections to 2766 span multiple interfaces, hence, multiple IP addresses, the 2767 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address 2768 AVP for each potential IP address that MAY be locally used when 2769 transmitting Diameter messages. 2771 Message Format 2773 ::= < Diameter Header: 257 > 2774 { Result-Code } 2775 { Origin-Host } 2776 { Origin-Realm } 2777 1* { Host-IP-Address } 2778 { Vendor-Id } 2779 { Product-Name } 2780 [ Origin-State-Id ] 2781 [ Error-Message ] 2782 [ Failed-AVP ] 2783 * [ Supported-Vendor-Id ] 2784 * [ Auth-Application-Id ] 2785 * [ Inband-Security-Id ] 2786 * [ Acct-Application-Id ] 2787 * [ Vendor-Specific-Application-Id ] 2788 [ Firmware-Revision ] 2789 * [ AVP ] 2791 5.3.3. Vendor-Id AVP 2793 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains 2794 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232] 2795 value assigned to the vendor of the Diameter device. It is 2796 envisioned that the combination of the Vendor-Id, Product-Name 2797 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may 2798 provide useful debugging information. 2800 A Vendor-Id value of zero in the CER or CEA messages is reserved and 2801 indicates that this field is ignored. 2803 5.3.4. Firmware-Revision AVP 2805 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is 2806 used to inform a Diameter peer of the firmware revision of the 2807 issuing device. 2809 For devices that do not have a firmware revision (general purpose 2810 computers running Diameter software modules, for instance), the 2811 revision of the Diameter software module may be reported instead. 2813 5.3.5. Host-IP-Address AVP 2815 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used 2816 to inform a Diameter peer of the sender's IP address. All source 2817 addresses that a Diameter node expects to use with SCTP [RFC4960] 2818 MUST be advertised in the CER and CEA messages by including a Host- 2819 IP-Address AVP for each address. 2821 5.3.6. Supported-Vendor-Id AVP 2823 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and 2824 contains the IANA "SMI Network Management Private Enterprise Codes" 2825 [RFC3232] value assigned to a vendor other than the device vendor but 2826 including the application vendor. This is used in the CER and CEA 2827 messages in order to inform the peer that the sender supports (a 2828 subset of) the vendor-specific AVPs defined by the vendor identified 2829 in this AVP. The value of this AVP MUST NOT be set to zero. 2830 Multiple instances of this AVP containing the same value SHOULD NOT 2831 be sent. 2833 5.3.7. Product-Name AVP 2835 The Product-Name AVP (AVP Code 269) is of type UTF8String, and 2836 contains the vendor assigned name for the product. The Product-Name 2837 AVP SHOULD remain constant across firmware revisions for the same 2838 product. 2840 5.4. Disconnecting Peer connections 2842 When a Diameter node disconnects one of its transport connections, 2843 its peer cannot know the reason for the disconnect, and will most 2844 likely assume that a connectivity problem occurred, or that the peer 2845 has rebooted. In these cases, the peer may periodically attempt to 2846 reconnect, as stated in Section 2.1. In the event that the 2847 disconnect was a result of either a shortage of internal resources, 2848 or simply that the node in question has no intentions of forwarding 2849 any Diameter messages to the peer in the foreseeable future, a 2850 periodic connection request would not be welcomed. The 2851 Disconnection-Reason AVP contains the reason the Diameter node issued 2852 the Disconnect-Peer-Request message. 2854 The Disconnect-Peer-Request message is used by a Diameter node to 2855 inform its peer of its intent to disconnect the transport layer, and 2856 that the peer shouldn't reconnect unless it has a valid reason to do 2857 so (e.g., message to be forwarded). Upon receipt of the message, the 2858 Disconnect-Peer-Answer is returned, which SHOULD contain an error if 2859 messages have recently been forwarded, and are likely in flight, 2860 which would otherwise cause a race condition. 2862 The receiver of the Disconnect-Peer-Answer initiates the transport 2863 disconnect. The sender of the Disconnect-Peer-Answer should be able 2864 to detect the transport closure and cleanup the connection. 2866 5.4.1. Disconnect-Peer-Request 2868 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set 2869 to 282 and the Command Flags' 'R' bit set, is sent to a peer to 2870 inform its intentions to shutdown the transport connection. Upon 2871 detection of a transport failure, this message MUST NOT be sent to an 2872 alternate peer. 2874 Message Format 2876 ::= < Diameter Header: 282, REQ > 2877 { Origin-Host } 2878 { Origin-Realm } 2879 { Disconnect-Cause } 2880 * [ AVP ] 2882 5.4.2. Disconnect-Peer-Answer 2884 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set 2885 to 282 and the Command Flags' 'R' bit cleared, is sent as a response 2886 to the Disconnect-Peer-Request message. Upon receipt of this 2887 message, the transport connection is shutdown. 2889 Message Format 2891 ::= < Diameter Header: 282 > 2892 { Result-Code } 2893 { Origin-Host } 2894 { Origin-Realm } 2895 [ Error-Message ] 2896 [ Failed-AVP ] 2897 * [ AVP ] 2899 5.4.3. Disconnect-Cause AVP 2901 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A 2902 Diameter node MUST include this AVP in the Disconnect-Peer-Request 2903 message to inform the peer of the reason for its intention to 2904 shutdown the transport connection. The following values are 2905 supported: 2907 REBOOTING 0 2908 A scheduled reboot is imminent. Receiver of DPR with above result 2909 code MAY attempt reconnection. 2911 BUSY 1 2912 The peer's internal resources are constrained, and it has 2913 determined that the transport connection needs to be closed. 2914 Receiver of DPR with above result code SHOULD NOT attempt 2915 reconnection. 2917 DO_NOT_WANT_TO_TALK_TO_YOU 2 2918 The peer has determined that it does not see a need for the 2919 transport connection to exist, since it does not expect any 2920 messages to be exchanged in the near future. Receiver of DPR 2921 with above result code SHOULD NOT attempt reconnection. 2923 5.5. Transport Failure Detection 2925 Given the nature of the Diameter protocol, it is recommended that 2926 transport failures be detected as soon as possible. Detecting such 2927 failures will minimize the occurrence of messages sent to unavailable 2928 agents, resulting in unnecessary delays, and will provide better 2929 failover performance. The Device-Watchdog-Request and Device- 2930 Watchdog-Answer messages, defined in this section, are used to pro- 2931 actively detect transport failures. 2933 5.5.1. Device-Watchdog-Request 2935 The Device-Watchdog-Request (DWR), indicated by the Command-Code set 2936 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no 2937 traffic has been exchanged between two peers (see Section 5.5.3). 2938 Upon detection of a transport failure, this message MUST NOT be sent 2939 to an alternate peer. 2941 Message Format 2943 ::= < Diameter Header: 280, REQ > 2944 { Origin-Host } 2945 { Origin-Realm } 2946 [ Origin-State-Id ] 2947 * [ AVP ] 2949 5.5.2. Device-Watchdog-Answer 2951 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set 2952 to 280 and the Command Flags' 'R' bit cleared, is sent as a response 2953 to the Device-Watchdog-Request message. 2955 Message Format 2957 ::= < Diameter Header: 280 > 2958 { Result-Code } 2959 { Origin-Host } 2960 { Origin-Realm } 2961 [ Error-Message ] 2962 [ Failed-AVP ] 2963 [ Origin-State-Id ] 2964 * [ AVP ] 2966 5.5.3. Transport Failure Algorithm 2968 The transport failure algorithm is defined in [RFC3539]. All 2969 Diameter implementations MUST support the algorithm defined in the 2970 specification in order to be compliant to the Diameter base protocol. 2972 5.5.4. Failover and Failback Procedures 2974 In the event that a transport failure is detected with a peer, it is 2975 necessary for all pending request messages to be forwarded to an 2976 alternate agent, if possible. This is commonly referred to as 2977 failover. 2979 In order for a Diameter node to perform failover procedures, it is 2980 necessary for the node to maintain a pending message queue for a 2981 given peer. When an answer message is received, the corresponding 2982 request is removed from the queue. The Hop-by-Hop Identifier field 2983 is used to match the answer with the queued request. 2985 When a transport failure is detected, if possible all messages in the 2986 queue are sent to an alternate agent with the T flag set. On booting 2987 a Diameter client or agent, the T flag is also set on any records 2988 still remaining to be transmitted in non-volatile storage. An 2989 example of a case where it is not possible to forward the message to 2990 an alternate server is when the message has a fixed destination, and 2991 the unavailable peer is the message's final destination (see 2992 Destination-Host AVP). Such an error requires that the agent return 2993 an answer message with the 'E' bit set and the Result-Code AVP set to 2994 DIAMETER_UNABLE_TO_DELIVER. 2996 It is important to note that multiple identical requests or answers 2997 MAY be received as a result of a failover. The End-to-End Identifier 2998 field in the Diameter header along with the Origin-Host AVP MUST be 2999 used to identify duplicate messages. 3001 As described in Section 2.1, a connection request should be 3002 periodically attempted with the failed peer in order to re-establish 3003 the transport connection. Once a connection has been successfully 3004 established, messages can once again be forwarded to the peer. This 3005 is commonly referred to as failback. 3007 5.6. Peer State Machine 3009 This section contains a finite state machine that MUST be observed by 3010 all Diameter implementations. Each Diameter node MUST follow the 3011 state machine described below when communicating with each peer. 3012 Multiple actions are separated by commas, and may continue on 3013 succeeding lines, as space requires. Similarly, state and next state 3014 may also span multiple lines, as space requires. 3016 This state machine is closely coupled with the state machine 3017 described in [RFC3539], which is used to open, close, failover, 3018 probe, and reopen transport connections. Note in particular that 3019 [RFC3539] requires the use of watchdog messages to probe connections. 3020 For Diameter, DWR and DWA messages are to be used. 3022 I- is used to represent the initiator (connecting) connection, while 3023 the R- is used to represent the responder (listening) connection. 3024 The lack of a prefix indicates that the event or action is the same 3025 regardless of the connection on which the event occurred. 3027 The stable states that a state machine may be in are Closed, I-Open 3028 and R-Open; all other states are intermediate. Note that I-Open and 3029 R-Open are equivalent except for whether the initiator or responder 3030 transport connection is used for communication. 3032 A CER message is always sent on the initiating connection immediately 3033 after the connection request is successfully completed. In the case 3034 of an election, one of the two connections will shut down. The 3035 responder connection will survive if the Origin-Host of the local 3036 Diameter entity is higher than that of the peer; the initiator 3037 connection will survive if the peer's Origin-Host is higher. All 3038 subsequent messages are sent on the surviving connection. Note that 3039 the results of an election on one peer are guaranteed to be the 3040 inverse of the results on the other. 3042 For TLS usage, TLS handshake SHOULD begin when both ends are in the 3043 closed state prior to any Diameter message exchanges. The TLS 3044 connection SHOULD be established before sending any CER or CEA 3045 message to secure and protect the capabilities information of both 3046 peers. The TLS connection SHOULD be disconnected when the state 3047 machine moves to the closed state. When connecting to responders 3048 that do not conform to this document (i.e. older Diameter 3049 implementations that are not prepared to received TLS connections in 3050 the closed state), the initial TLS connection attempt will fail. The 3051 initiator MAY then attempt to connect via TCP or SCTP and initiate 3052 the TLS handshake when both ends are in the open state. If the 3053 handshake is successful, all further messages will be sent via TLS. 3054 If the handshake fails, both ends moves to the closed state. 3056 The state machine constrains only the behavior of a Diameter 3057 implementation as seen by Diameter peers through events on the wire. 3059 Any implementation that produces equivalent results is considered 3060 compliant. 3062 state event action next state 3063 ----------------------------------------------------------------- 3064 Closed Start I-Snd-Conn-Req Wait-Conn-Ack 3065 R-Conn-CER R-Accept, R-Open 3066 Process-CER, 3067 R-Snd-CEA 3069 Wait-Conn-Ack I-Rcv-Conn-Ack I-Snd-CER Wait-I-CEA 3070 I-Rcv-Conn-Nack Cleanup Closed 3071 R-Conn-CER R-Accept, Wait-Conn-Ack/ 3072 Process-CER Elect 3073 Timeout Error Closed 3075 Wait-I-CEA I-Rcv-CEA Process-CEA I-Open 3076 R-Conn-CER R-Accept, Wait-Returns 3077 Process-CER, 3078 Elect 3079 I-Peer-Disc I-Disc Closed 3080 I-Rcv-Non-CEA Error Closed 3081 Timeout Error Closed 3083 Wait-Conn-Ack/ I-Rcv-Conn-Ack I-Snd-CER,Elect Wait-Returns 3084 Elect I-Rcv-Conn-Nack R-Snd-CEA R-Open 3085 R-Peer-Disc R-Disc Wait-Conn-Ack 3086 R-Conn-CER R-Reject Wait-Conn-Ack/ 3087 Elect 3088 Timeout Error Closed 3090 Wait-Returns Win-Election I-Disc,R-Snd-CEA R-Open 3091 I-Peer-Disc I-Disc, R-Open 3092 R-Snd-CEA 3093 I-Rcv-CEA R-Disc I-Open 3094 R-Peer-Disc R-Disc Wait-I-CEA 3095 R-Conn-CER R-Reject Wait-Returns 3096 Timeout Error Closed 3098 R-Open Send-Message R-Snd-Message R-Open 3099 R-Rcv-Message Process R-Open 3100 R-Rcv-DWR Process-DWR, R-Open 3101 R-Snd-DWA 3102 R-Rcv-DWA Process-DWA R-Open 3103 R-Conn-CER R-Reject R-Open 3104 Stop R-Snd-DPR Closing 3105 R-Rcv-DPR R-Snd-DPA, Closed 3106 R-Disc 3107 R-Peer-Disc R-Disc Closed 3109 I-Open Send-Message I-Snd-Message I-Open 3110 I-Rcv-Message Process I-Open 3111 I-Rcv-DWR Process-DWR, I-Open 3112 I-Snd-DWA 3113 I-Rcv-DWA Process-DWA I-Open 3114 R-Conn-CER R-Reject I-Open 3115 Stop I-Snd-DPR Closing 3116 I-Rcv-DPR I-Snd-DPA, Closed 3117 I-Disc 3118 I-Peer-Disc I-Disc Closed 3120 Closing I-Rcv-DPA I-Disc Closed 3121 R-Rcv-DPA R-Disc Closed 3122 Timeout Error Closed 3123 I-Peer-Disc I-Disc Closed 3124 R-Peer-Disc R-Disc Closed 3126 5.6.1. Incoming connections 3128 When a connection request is received from a Diameter peer, it is 3129 not, in the general case, possible to know the identity of that peer 3130 until a CER is received from it. This is because host and port 3131 determine the identity of a Diameter peer; and the source port of an 3132 incoming connection is arbitrary. Upon receipt of CER, the identity 3133 of the connecting peer can be uniquely determined from Origin-Host. 3135 For this reason, a Diameter peer must employ logic separate from the 3136 state machine to receive connection requests, accept them, and await 3137 CER. Once CER arrives on a new connection, the Origin-Host that 3138 identifies the peer is used to locate the state machine associated 3139 with that peer, and the new connection and CER are passed to the 3140 state machine as an R-Conn-CER event. 3142 The logic that handles incoming connections SHOULD close and discard 3143 the connection if any message other than CER arrives, or if an 3144 implementation-defined timeout occurs prior to receipt of CER. 3146 Because handling of incoming connections up to and including receipt 3147 of CER requires logic, separate from that of any individual state 3148 machine associated with a particular peer, it is described separately 3149 in this section rather than in the state machine above. 3151 5.6.2. Events 3153 Transitions and actions in the automaton are caused by events. In 3154 this section, we will ignore the -I and -R prefix, since the actual 3155 event would be identical, but would occur on one of two possible 3156 connections. 3158 Start The Diameter application has signaled that a 3159 connection should be initiated with the peer. 3161 R-Conn-CER An acknowledgement is received stating that the 3162 transport connection has been established, and the 3163 associated CER has arrived. 3165 Rcv-Conn-Ack A positive acknowledgement is received confirming that 3166 the transport connection is established. 3168 Rcv-Conn-Nack A negative acknowledgement was received stating that 3169 the transport connection was not established. 3171 Timeout An application-defined timer has expired while waiting 3172 for some event. 3174 Rcv-CER A CER message from the peer was received. 3176 Rcv-CEA A CEA message from the peer was received. 3178 Rcv-Non-CEA A message other than CEA from the peer was received. 3180 Peer-Disc A disconnection indication from the peer was received. 3182 Rcv-DPR A DPR message from the peer was received. 3184 Rcv-DPA A DPA message from the peer was received. 3186 Win-Election An election was held, and the local node was the 3187 winner. 3189 Send-Message A message is to be sent. 3191 Rcv-Message A message other than CER, CEA, DPR, DPA, DWR or DWA 3192 was received. 3194 Stop The Diameter application has signaled that a 3195 connection should be terminated (e.g., on system 3196 shutdown). 3198 5.6.3. Actions 3200 Actions in the automaton are caused by events and typically indicate 3201 the transmission of packets and/or an action to be taken on the 3202 connection. In this section we will ignore the I- and R-prefix, 3203 since the actual action would be identical, but would occur on one of 3204 two possible connections. 3206 Snd-Conn-Req A transport connection is initiated with the peer. 3208 Accept The incoming connection associated with the R-Conn-CER 3209 is accepted as the responder connection. 3211 Reject The incoming connection associated with the R-Conn-CER 3212 is disconnected. 3214 Process-CER The CER associated with the R-Conn-CER is processed. 3215 Snd-CER A CER message is sent to the peer. 3217 Snd-CEA A CEA message is sent to the peer. 3219 Cleanup If necessary, the connection is shutdown, and any 3220 local resources are freed. 3222 Error The transport layer connection is disconnected, 3223 either politely or abortively, in response to 3224 an error condition. Local resources are freed. 3226 Process-CEA A received CEA is processed. 3228 Snd-DPR A DPR message is sent to the peer. 3230 Snd-DPA A DPA message is sent to the peer. 3232 Disc The transport layer connection is disconnected, 3233 and local resources are freed. 3235 Elect An election occurs (see Section 5.6.4 for more 3236 information). 3238 Snd-Message A message is sent. 3240 Snd-DWR A DWR message is sent. 3242 Snd-DWA A DWA message is sent. 3244 Process-DWR The DWR message is serviced. 3246 Process-DWA The DWA message is serviced. 3248 Process A message is serviced. 3250 5.6.4. The Election Process 3252 The election is performed on the responder. The responder compares 3253 the Origin-Host received in the CER with its own Origin-Host as two 3254 streams of octets. If the local Origin-Host lexicographically 3255 succeeds the received Origin-Host a Win-Election event is issued 3256 locally. Diameter identities are in ASCII form therefore the lexical 3257 comparison is consistent with DNS case insensitivity where octets 3258 that fall in the ASCII range 'a' through 'z' MUST compare equally to 3259 their upper-case counterparts between 'A' and 'Z'. See Appendix D 3260 for interactions between the Diameter protocol and Internationalized 3261 Domain Name (IDNs). 3263 The winner of the election MUST close the connection it initiated. 3264 Historically, maintaining the responder side of a connection was more 3265 efficient than maintaining the initiator side. However, current 3266 practices makes this distinction irrelevant. 3268 6. Diameter message processing 3270 This section describes how Diameter requests and answers are created 3271 and processed. 3273 6.1. Diameter Request Routing Overview 3275 A request is sent towards its final destination using a combination 3276 of the Destination-Realm and Destination-Host AVPs, in one of these 3277 three combinations: 3279 o a request that is not able to be proxied (such as CER) MUST NOT 3280 contain either Destination-Realm or Destination-Host AVPs. 3282 o a request that needs to be sent to a home server serving a 3283 specific realm, but not to a specific server (such as the first 3284 request of a series of round-trips), MUST contain a Destination- 3285 Realm AVP, but MUST NOT contain a Destination-Host AVP. For 3286 Diameter clients, the value of the Destination-Realm AVP MAY be 3287 extracted from the User-Name AVP, or other methods. 3289 o otherwise, a request that needs to be sent to a specific home 3290 server among those serving a given realm, MUST contain both the 3291 Destination-Realm and Destination-Host AVPs. 3293 The Destination-Host AVP is used as described above when the 3294 destination of the request is fixed, which includes: 3296 o Authentication requests that span multiple round trips 3298 o A Diameter message that uses a security mechanism that makes use 3299 of a pre-established session key shared between the source and the 3300 final destination of the message. 3302 o Server initiated messages that MUST be received by a specific 3303 Diameter client (e.g., access device), such as the Abort-Session- 3304 Request message, which is used to request that a particular user's 3305 session be terminated. 3307 Note that an agent can forward a request to a host described in the 3308 Destination-Host AVP only if the host in question is included in its 3309 peer table (see Section 2.7). Otherwise, the request is routed based 3310 on the Destination-Realm only (see Sections 6.1.6). 3312 When a message is received, the message is processed in the following 3313 order: 3315 o If the message is destined for the local host, the procedures 3316 listed in Section 6.1.4 are followed. 3318 o If the message is intended for a Diameter peer with whom the local 3319 host is able to directly communicate, the procedures listed in 3320 Section 6.1.5 are followed. This is known as Request Forwarding. 3322 o The procedures listed in Section 6.1.6 are followed, which is 3323 known as Request Routing. 3325 o If none of the above is successful, an answer is returned with the 3326 Result-Code set to DIAMETER_UNABLE_TO_DELIVER, with the E-bit set. 3328 For routing of Diameter messages to work within an administrative 3329 domain, all Diameter nodes within the realm MUST be peers. 3331 Note the processing rules contained in this section are intended to 3332 be used as general guidelines to Diameter developers. Certain 3333 implementations MAY use different methods than the ones described 3334 here, and still comply with the protocol specification. See Section 3335 7 for more detail on error handling. 3337 6.1.1. Originating a Request 3339 When creating a request, in addition to any other procedures 3340 described in the application definition for that specific request, 3341 the following procedures MUST be followed: 3343 o the Command-Code is set to the appropriate value 3345 o the 'R' bit is set 3347 o the End-to-End Identifier is set to a locally unique value 3349 o the Origin-Host and Origin-Realm AVPs MUST be set to the 3350 appropriate values, used to identify the source of the message 3352 o the Destination-Host and Destination-Realm AVPs MUST be set to the 3353 appropriate values as described in Section 6.1. 3355 6.1.2. Sending a Request 3357 When sending a request, originated either locally, or as the result 3358 of a forwarding or routing operation, the following procedures SHOULD 3359 be followed: 3361 o The Hop-by-Hop Identifier SHOULD be set to a locally unique value. 3363 o The message SHOULD be saved in the list of pending requests. 3365 Other actions to perform on the message based on the particular role 3366 the agent is playing are described in the following sections. 3368 6.1.3. Receiving Requests 3370 A relay or proxy agent MUST check for forwarding loops when receiving 3371 requests. A loop is detected if the server finds its own identity in 3372 a Route-Record AVP. When such an event occurs, the agent MUST answer 3373 with the Result-Code AVP set to DIAMETER_LOOP_DETECTED. 3375 6.1.4. Processing Local Requests 3377 A request is known to be for local consumption when one of the 3378 following conditions occur: 3380 o The Destination-Host AVP contains the local host's identity, 3382 o The Destination-Host AVP is not present, the Destination-Realm AVP 3383 contains a realm the server is configured to process locally, and 3384 the Diameter application is locally supported, or 3386 o Both the Destination-Host and the Destination-Realm are not 3387 present. 3389 When a request is locally processed, the rules in Section 6.2 should 3390 be used to generate the corresponding answer. 3392 6.1.5. Request Forwarding 3394 Request forwarding is done using the Diameter Peer Table. The 3395 Diameter peer table contains all of the peers that the local node is 3396 able to directly communicate with. 3398 When a request is received, and the host encoded in the Destination- 3399 Host AVP is one that is present in the peer table, the message SHOULD 3400 be forwarded to the peer. 3402 6.1.6. Request Routing 3404 Diameter request message routing is done via realms and application 3405 identifiers. A Diameter message that may be forwarded by Diameter 3406 agents (proxies, redirect or relay agents) MUST include the target 3407 realm in the Destination-Realm AVP. Request routing SHOULD rely on 3408 the Destination-Realm AVP and the Application Id present in the 3409 request message header to aid in the routing decision. The realm MAY 3410 be retrieved from the User-Name AVP, which is in the form of a 3411 Network Access Identifier (NAI). The realm portion of the NAI is 3412 inserted in the Destination-Realm AVP. 3414 Diameter agents MAY have a list of locally supported realms and 3415 applications, and MAY have a list of externally supported realms and 3416 applications. When a request is received that includes a realm 3417 and/or application that is not locally supported, the message is 3418 routed to the peer configured in the Routing Table (see Section 2.7). 3420 Realm names and Application Ids are the minimum supported routing 3421 criteria, additional information may be needed to support redirect 3422 semantics. 3424 6.1.7. Predictive Loop Avoidance 3426 Before forwarding or routing a request, Diameter agents, in addition 3427 to processing done in Section 6.1.3, SHOULD check for the presence of 3428 candidate route's peer identity in any of the Route-Record AVPs. In 3429 an event of the agent detecting the presence of a candidate route's 3430 peer identity in a Route-Record AVP, the agent MUST ignore such route 3431 for the Diameter request message and attempt alternate routes if any. 3432 In case all the candidate routes are eliminated by the above 3433 criteria, the agent SHOULD return DIAMETER_UNABLE_TO_DELIVER message. 3435 6.1.8. Redirecting Requests 3437 When a redirect agent receives a request whose routing entry is set 3438 to REDIRECT, it MUST reply with an answer message with the 'E' bit 3439 set, while maintaining the Hop-by-Hop Identifier in the header, and 3440 include the Result-Code AVP to DIAMETER_REDIRECT_INDICATION. Each of 3441 the servers associated with the routing entry are added in separate 3442 Redirect-Host AVP. 3444 +------------------+ 3445 | Diameter | 3446 | Redirect Agent | 3447 +------------------+ 3448 ^ | 2. command + 'E' bit 3449 1. Request | | Result-Code = 3450 joe@example.com | | DIAMETER_REDIRECT_INDICATION + 3451 | | Redirect-Host AVP(s) 3452 | v 3453 +-------------+ 3. Request +-------------+ 3454 | example.com |------------->| example.net | 3455 | Relay | | Diameter | 3456 | Agent |<-------------| Server | 3457 +-------------+ 4. Answer +-------------+ 3458 Figure 5: Diameter Redirect Agent 3460 The receiver of the answer message with the 'E' bit set, and the 3461 Result-Code AVP set to DIAMETER_REDIRECT_INDICATION uses the hop-by- 3462 hop field in the Diameter header to identify the request in the 3463 pending message queue (see Section 5.3) that is to be redirected. If 3464 no transport connection exists with the new agent, one is created, 3465 and the request is sent directly to it. 3467 Multiple Redirect-Host AVPs are allowed. The receiver of the answer 3468 message with the 'E' bit set selects exactly one of these hosts as 3469 the destination of the redirected message. 3471 When the Redirect-Host-Usage AVP included in the answer message has a 3472 non-zero value, a route entry for the redirect indications is created 3473 and cached by the receiver. The redirect usage for such route entry 3474 is set by the value of Redirect-Host-Usage AVP and the lifetime of 3475 the cached route entry is set by Redirect-Max-Cache-Time AVP value. 3477 It is possible that multiple redirect indications can create multiple 3478 cached route entries differing only in their redirect usage and the 3479 peer to forward messages to. As an example, two(2) route entries 3480 that are created by two(2) redirect indications results in two(2) 3481 cached routes for the same realm and Application Id. However, one 3482 has a redirect usage of ALL_SESSION where matching request will be 3483 forwarded to one peer and the other has a redirect usage of ALL_REALM 3484 where request are forwarded to another peer. Therefore, an incoming 3485 request that matches the realm and Application Id of both routes will 3486 need additional resolution. In such a case, a routing precedence 3487 rule MUST be used against the redirect usage value to resolve the 3488 contention. The precedence rule can be found in Section 6.13. 3490 6.1.9. Relaying and Proxying Requests 3492 A relay or proxy agent MUST append a Route-Record AVP to all requests 3493 forwarded. The AVP contains the identity of the peer the request was 3494 received from. 3496 The Hop-by-Hop identifier in the request is saved, and replaced with 3497 a locally unique value. The source of the request is also saved, 3498 which includes the IP address, port and protocol. 3500 A relay or proxy agent MAY include the Proxy-Info AVP in requests if 3501 it requires access to any local state information when the 3502 corresponding response is received. The Proxy-Info AVP has security 3503 implications as state information is distribute to other entities. 3504 As such, it is RECOMMMENDED to protect the content of the Proxy-Info 3505 AVP with cryptographic mechanisms, for example by using a keyed 3506 message digest. Such a mechanism, however, requires the management 3507 of keys, although only locally at the Diameter server. Still, a full 3508 description of the management of the keys used to protect the Proxy- 3509 Info AVP is beyond the scope of this document. Below is a list of 3510 commonly recommended: 3512 o The keys should be generated securely following the randomness 3513 recommendations in [RFC4086]. 3515 o The keys and cryptographic protection algorithms should be at 3516 least 128 bits in strength. 3518 o The keys should not be used for any other purpose than generating 3519 and verifying tickets. 3521 o The keys should be changed regularly. 3523 o The keys should be changed if the ticket format or cryptographic 3524 protection algorithms change. 3526 The message is then forwarded to the next hop, as identified in the 3527 Routing Table. 3529 Figure 6 provides an example of message routing using the procedures 3530 listed in these sections. 3532 (Origin-Host=nas.mno.net) (Origin-Host=nas.mno.net) 3533 (Origin-Realm=mno.net) (Origin-Realm=mno.net) 3534 (Destination-Realm=example.com) (Destination- 3535 Realm=example.com) 3536 (Route-Record=nas.example.net) 3537 +------+ ------> +------+ ------> +------+ 3538 | | (Request) | | (Request) | | 3539 | NAS +-------------------+ DRL +-------------------+ HMS | 3540 | | | | | | 3541 +------+ <------ +------+ <------ +------+ 3542 example.net (Answer) example.net (Answer) example.com 3543 (Origin-Host=hms.example.com) (Origin-Host=hms.example.com) 3544 (Origin-Realm=example.com) (Origin-Realm=example.com) 3546 Figure 6: Routing of Diameter messages 3548 Relay and proxy agents are not required to perform full inspection of 3549 incoming messages. At a minimum, validation of the message header 3550 and relevant routing AVPs has to be done when relaying messages. 3551 Proxy agents may optionally perform more in-depth message validation 3552 for applications it is interested in. 3554 6.2. Diameter Answer Processing 3556 When a request is locally processed, the following procedures MUST be 3557 applied to create the associated answer, in addition to any 3558 additional procedures that MAY be discussed in the Diameter 3559 application defining the command: 3561 o The same Hop-by-Hop identifier in the request is used in the 3562 answer. 3564 o The local host's identity is encoded in the Origin-Host AVP. 3566 o The Destination-Host and Destination-Realm AVPs MUST NOT be 3567 present in the answer message. 3569 o The Result-Code AVP is added with its value indicating success or 3570 failure. 3572 o If the Session-Id is present in the request, it MUST be included 3573 in the answer. 3575 o Any Proxy-Info AVPs in the request MUST be added to the answer 3576 message, in the same order they were present in the request. 3578 o The 'P' bit is set to the same value as the one in the request. 3580 o The same End-to-End identifier in the request is used in the 3581 answer. 3583 Note that the error messages (see Section 7.3) are also subjected to 3584 the above processing rules. 3586 6.2.1. Processing received Answers 3588 A Diameter client or proxy MUST match the Hop-by-Hop Identifier in an 3589 answer received against the list of pending requests. The 3590 corresponding message should be removed from the list of pending 3591 requests. It SHOULD ignore answers received that do not match a 3592 known Hop-by-Hop Identifier. 3594 6.2.2. Relaying and Proxying Answers 3596 If the answer is for a request which was proxied or relayed, the 3597 agent MUST restore the original value of the Diameter header's Hop- 3598 by-Hop Identifier field. 3600 If the last Proxy-Info AVP in the message is targeted to the local 3601 Diameter server, the AVP MUST be removed before the answer is 3602 forwarded. 3604 If a relay or proxy agent receives an answer with a Result-Code AVP 3605 indicating a failure, it MUST NOT modify the contents of the AVP. 3606 Any additional local errors detected SHOULD be logged, but not 3607 reflected in the Result-Code AVP. If the agent receives an answer 3608 message with a Result-Code AVP indicating success, and it wishes to 3609 modify the AVP to indicate an error, it MUST modify the Result-Code 3610 AVP to contain the appropriate error in the message destined towards 3611 the access device as well as include the Error-Reporting-Host AVP and 3612 it MUST issue an STR on behalf of the access device towards the 3613 Diameter server. 3615 The agent MUST then send the answer to the host that it received the 3616 original request from. 3618 6.3. Origin-Host AVP 3620 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and 3621 MUST be present in all Diameter messages. This AVP identifies the 3622 endpoint that originated the Diameter message. Relay agents MUST NOT 3623 modify this AVP. 3625 The value of the Origin-Host AVP is guaranteed to be unique within a 3626 single host. 3628 Note that the Origin-Host AVP may resolve to more than one address as 3629 the Diameter peer may support more than one address. 3631 This AVP SHOULD be placed as close to the Diameter header as 3632 possible. 3634 6.4. Origin-Realm AVP 3636 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity. 3637 This AVP contains the Realm of the originator of any Diameter message 3638 and MUST be present in all messages. 3640 This AVP SHOULD be placed as close to the Diameter header as 3641 possible. 3643 6.5. Destination-Host AVP 3645 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. 3646 This AVP MUST be present in all unsolicited agent initiated messages, 3647 MAY be present in request messages, and MUST NOT be present in Answer 3648 messages. 3650 The absence of the Destination-Host AVP will cause a message to be 3651 sent to any Diameter server supporting the application within the 3652 realm specified in Destination-Realm AVP. 3654 This AVP SHOULD be placed as close to the Diameter header as 3655 possible. 3657 6.6. Destination-Realm AVP 3659 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity, 3660 and contains the realm the message is to be routed to. The 3661 Destination-Realm AVP MUST NOT be present in Answer messages. 3662 Diameter Clients insert the realm portion of the User-Name AVP. 3663 Diameter servers initiating a request message use the value of the 3664 Origin-Realm AVP from a previous message received from the intended 3665 target host (unless it is known a priori). When present, the 3666 Destination-Realm AVP is used to perform message routing decisions. 3668 An ABNF for a request message that includes the Destination-Realm AVP 3669 SHOULD list the Destination-Realm AVP as a required AVP (an AVP 3670 indicated as {AVP}) otherwise the message is inherently a non- 3671 routable messages. 3673 This AVP SHOULD be placed as close to the Diameter header as 3674 possible. 3676 6.7. Routing AVPs 3678 The AVPs defined in this section are Diameter AVPs used for routing 3679 purposes. These AVPs change as Diameter messages are processed by 3680 agents. 3682 6.7.1. Route-Record AVP 3684 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The 3685 identity added in this AVP MUST be the same as the one received in 3686 the Origin-Host of the Capabilities Exchange message. 3688 6.7.2. Proxy-Info AVP 3690 The Proxy-Info AVP (AVP Code 284) is of type Grouped. This AVP 3691 contains the identity and local state information of Diameter node 3692 that creates and adds it to a message. The Grouped Data field has 3693 the following ABNF grammar: 3695 Proxy-Info ::= < AVP Header: 284 > 3696 { Proxy-Host } 3697 { Proxy-State } 3699 * [ AVP ] 3701 6.7.3. Proxy-Host AVP 3703 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This 3704 AVP contains the identity of the host that added the Proxy-Info AVP. 3706 6.7.4. Proxy-State AVP 3708 The Proxy-State AVP (AVP Code 33) is of type OctetString. It 3709 contains state information that would otherwise be stored at the 3710 Diameter entity that created it. As such, this AVP MUST be treated 3711 as opaque data by entities other Diameter entities. 3713 6.8. Auth-Application-Id AVP 3715 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and 3716 is used in order to advertise support of the Authentication and 3717 Authorization portion of an application (see Section 2.4). If 3718 present in a message other than CER and CEA, the value of the Auth- 3719 Application-Id AVP MUST match the Application Id present in the 3720 Diameter message header. 3722 6.9. Acct-Application-Id AVP 3724 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and 3725 is used in order to advertise support of the Accounting portion of an 3726 application (see Section 2.4). If present in a message other than 3727 CER and CEA, the value of the Acct-Application-Id AVP MUST match the 3728 Application Id present in the Diameter message header. 3730 6.10. Inband-Security-Id AVP 3732 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and 3733 is used in order to advertise support of the security portion of the 3734 application. The use of this AVP in CER and CEA messages is no 3735 longer recommended. Instead, discovery of a Diameter entities 3736 security capabilities can be done either through static configuration 3737 or via Diameter Peer Discovery described in Section 5.2. 3739 The following values are supported: 3741 NO_INBAND_SECURITY 0 3743 This peer does not support TLS. This is the default value, if the 3744 AVP is omitted. 3746 TLS 1 3748 This node supports TLS security, as defined by [RFC5246]. 3750 6.11. Vendor-Specific-Application-Id AVP 3752 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type 3753 Grouped and is used to advertise support of a vendor-specific 3754 Diameter Application. Exactly one instance of either Auth- 3755 Application-Id or Acct-Application-Id AVP MUST be present. The 3756 Application Id carried by either Auth-Application-Id or Acct- 3757 Application-Id AVP MUST comply with vendor specific Application Id 3758 assignment described in Sec 11.3. It MUST also match the Application 3759 Id present in the Diameter header except when used in a CER or CEA 3760 messages. 3762 The Vendor-Id AVP is an informational AVP pertaining to the vendor 3763 who may have authorship of the vendor-specific Diameter application. 3764 It MUST NOT be used as a means of defining a completely separate 3765 vendor-specific Application Id space. 3767 The Vendor-Specific-Application-Id AVP SHOULD be placed as close to 3768 the Diameter header as possible. 3770 AVP Format 3772 ::= < AVP Header: 260 > 3773 { Vendor-Id } 3774 [ Auth-Application-Id ] 3775 [ Acct-Application-Id ] 3777 A Vendor-Specific-Application-Id AVP MUST contain exactly one of 3778 either Auth-Application-Id or Acct-Application-Id. If a Vendor- 3779 Specific-Application-Id is received without any of these two AVPs, 3780 then the recipient SHOULD issue an answer with a Result-Code set to 3781 DIAMETER_MISSING_AVP. The answer SHOULD also include a Failed-AVP 3782 which MUST contain an example of an Auth-Application-Id AVP and an 3783 Acct-Application-Id AVP. 3785 If a Vendor-Specific-Application-Id is received that contains both 3786 Auth-Application-Id and Acct-Application-Id, then the recipient MUST 3787 issue an answer with Result-Code set to 3788 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. The answer MUST also include a 3789 Failed-AVP which MUST contain the received Auth-Application-Id AVP 3790 and Acct-Application-Id AVP. 3792 6.12. Redirect-Host AVP 3794 The Redirect-Host AVP (AVP Code 292) is of type DiameterURI. One or 3795 more of instances of this AVP MUST be present if the answer message's 3796 'E' bit is set and the Result-Code AVP is set to 3797 DIAMETER_REDIRECT_INDICATION. 3799 Upon receiving the above, the receiving Diameter node SHOULD forward 3800 the request directly to one of the hosts identified in these AVPs. 3801 The server contained in the selected Redirect-Host AVP SHOULD be used 3802 for all messages matching the criteria set by the Redirect-Host-Usage 3803 AVP. 3805 6.13. Redirect-Host-Usage AVP 3807 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated. 3808 This AVP MAY be present in answer messages whose 'E' bit is set and 3809 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION. 3811 When present, this AVP provides a hints about how the routing entry 3812 resulting from the Redirect-Host is to be used. The following values 3813 are supported: 3815 DONT_CACHE 0 3817 The host specified in the Redirect-Host AVP SHOULD NOT be cached. 3818 This is the default value. 3820 ALL_SESSION 1 3822 All messages within the same session, as defined by the same value 3823 of the Session-ID AVP SHOULD be sent to the host specified in the 3824 Redirect-Host AVP. 3826 ALL_REALM 2 3828 All messages destined for the realm requested SHOULD be sent to 3829 the host specified in the Redirect-Host AVP. 3831 REALM_AND_APPLICATION 3 3833 All messages for the application requested to the realm specified 3834 SHOULD be sent to the host specified in the Redirect-Host AVP. 3836 ALL_APPLICATION 4 3838 All messages for the application requested SHOULD be sent to the 3839 host specified in the Redirect-Host AVP. 3841 ALL_HOST 5 3843 All messages that would be sent to the host that generated the 3844 Redirect-Host SHOULD be sent to the host specified in the 3845 Redirect- Host AVP. 3847 ALL_USER 6 3849 All messages for the user requested SHOULD be sent to the host 3850 specified in the Redirect-Host AVP. 3852 When multiple cached routes are created by redirect indications and 3853 they differ only in redirect usage and peers to forward requests to 3854 (see Section 6.1.8), a precedence rule MUST be applied to the 3855 redirect usage values of the cached routes during normal routing to 3856 resolve contentions that may occur. The precedence rule is the order 3857 that dictate which redirect usage should be considered before any 3858 other as they appear. The order is as follows: 3860 1. ALL_SESSION 3862 2. ALL_USER 3864 3. REALM_AND_APPLICATION 3866 4. ALL_REALM 3868 5. ALL_APPLICATION 3870 6. ALL_HOST 3872 6.14. Redirect-Max-Cache-Time AVP 3874 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. 3875 This AVP MUST be present in answer messages whose 'E' bit is set, the 3876 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the 3877 Redirect-Host-Usage AVP set to a non-zero value. 3879 This AVP contains the maximum number of seconds the peer and route 3880 table entries, created as a result of the Redirect-Host, SHOULD be 3881 cached. Note that once a host is no longer reachable, any associated 3882 cache, peer and routing table entries MUST be deleted. 3884 7. Error Handling 3886 There are two different types of errors in Diameter; protocol and 3887 application errors. A protocol error is one that occurs at the base 3888 protocol level, and MAY require per hop attention (e.g., message 3889 routing error). Application errors, on the other hand, generally 3890 occur due to a problem with a function specified in a Diameter 3891 application (e.g., user authentication, missing AVP). 3893 Result-Code AVP values that are used to report protocol errors MUST 3894 only be present in answer messages whose 'E' bit is set. When a 3895 request message is received that causes a protocol error, an answer 3896 message is returned with the 'E' bit set, and the Result-Code AVP is 3897 set to the appropriate protocol error value. As the answer is sent 3898 back towards the originator of the request, each proxy or relay agent 3899 MAY take action on the message. 3901 1. Request +---------+ Link Broken 3902 +-------------------------->|Diameter |----///----+ 3903 | +---------------------| | v 3904 +------+--+ | 2. answer + 'E' set | Relay 2 | +--------+ 3905 |Diameter |<-+ (Unable to Forward) +---------+ |Diameter| 3906 | | | Home | 3907 | Relay 1 |--+ +---------+ | Server | 3908 +---------+ | 3. Request |Diameter | +--------+ 3909 +-------------------->| | ^ 3910 | Relay 3 |-----------+ 3911 +---------+ 3913 Figure 7: Example of Protocol Error causing answer message 3915 Figure 7 provides an example of a message forwarded upstream by a 3916 Diameter relay. When the message is received by Relay 2, and it 3917 detects that it cannot forward the request to the home server, an 3918 answer message is returned with the 'E' bit set and the Result-Code 3919 AVP set to DIAMETER_UNABLE_TO_DELIVER. Given that this error falls 3920 within the protocol error category, Relay 1 would take special 3921 action, and given the error, attempt to route the message through its 3922 alternate Relay 3. 3924 +---------+ 1. Request +---------+ 2. Request +---------+ 3925 | Access |------------>|Diameter |------------>|Diameter | 3926 | | | | | Home | 3927 | Device |<------------| Relay |<------------| Server | 3928 +---------+ 4. Answer +---------+ 3. Answer +---------+ 3929 (Missing AVP) (Missing AVP) 3931 Figure 8: Example of Application Error Answer message 3933 Figure 8 provides an example of a Diameter message that caused an 3934 application error. When application errors occur, the Diameter 3935 entity reporting the error clears the 'R' bit in the Command Flags, 3936 and adds the Result-Code AVP with the proper value. Application 3937 errors do not require any proxy or relay agent involvement, and 3938 therefore the message would be forwarded back to the originator of 3939 the request. 3941 In the case where the answer message itself contains errors, any 3942 related session SHOULD be terminated by sending an STR or ASR 3943 message. The Termination-Cause AVP in the STR MAY be filled with the 3944 appropriate value to indicate the cause of the error. An application 3945 MAY also send an application specific request instead of STR or ASR 3946 to signal the error in the case where no state is maintained or to 3947 allow for some form of error recovery with the corresponding Diameter 3948 entity. 3950 There are certain Result-Code AVP application errors that require 3951 additional AVPs to be present in the answer. In these cases, the 3952 Diameter node that sets the Result-Code AVP to indicate the error 3953 MUST add the AVPs. Examples are: 3955 o A request with an unrecognized AVP is received with the 'M' bit 3956 (Mandatory bit) set, causes an answer to be sent with the Result- 3957 Code AVP set to DIAMETER_AVP_UNSUPPORTED, and the Failed-AVP AVP 3958 containing the offending AVP. 3960 o A request with an AVP that is received with an unrecognized value 3961 causes an answer to be returned with the Result-Code AVP set to 3962 DIAMETER_INVALID_AVP_VALUE, with the Failed-AVP AVP containing the 3963 AVP causing the error. 3965 o A command is received that is missing AVP(s) that are defined as 3966 required in the commands ABNF; examples are AVPs indicated as 3967 {AVP}. The receiver issues an answer with the Result-Code set to 3968 DIAMETER_MISSING_AVP, and creates an AVP with the AVP Code and 3969 other fields set as expected in the missing AVP. The created AVP 3970 is then added to the Failed- AVP AVP. 3972 The Result-Code AVP describes the error that the Diameter node 3973 encountered in its processing. In case there are multiple errors, 3974 the Diameter node MUST report only the first error it encountered 3975 (detected possibly in some implementation dependent order). The 3976 specific errors that can be described by this AVP are described in 3977 the following section. 3979 7.1. Result-Code AVP 3981 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and 3982 indicates whether a particular request was completed successfully or 3983 whether an error occurred. All Diameter answer messages in IETF 3984 defined Diameter application specification MUST include one Result- 3985 Code AVP. A non-successful Result-Code AVP (one containing a non 3986 2xxx value other than DIAMETER_REDIRECT_INDICATION) MUST include the 3987 Error-Reporting-Host AVP if the host setting the Result-Code AVP is 3988 different from the identity encoded in the Origin-Host AVP. 3990 The Result-Code data field contains an IANA-managed 32-bit address 3991 space representing errors (see Section 11.4). Diameter provides the 3992 following classes of errors, all identified by the thousands digit in 3993 the decimal notation: 3995 o 1xxx (Informational) 3997 o 2xxx (Success) 3999 o 3xxx (Protocol Errors) 4001 o 4xxx (Transient Failures) 4003 o 5xxx (Permanent Failure) 4005 A non-recognized class (one whose first digit is not defined in this 4006 section) MUST be handled as a permanent failure. 4008 7.1.1. Informational 4010 Errors that fall within this category are used to inform the 4011 requester that a request could not be satisfied, and additional 4012 action is required on its part before access is granted. 4014 DIAMETER_MULTI_ROUND_AUTH 1001 4016 This informational error is returned by a Diameter server to 4017 inform the access device that the authentication mechanism being 4018 used requires multiple round trips, and a subsequent request needs 4019 to be issued in order for access to be granted. 4021 7.1.2. Success 4023 Errors that fall within the Success category are used to inform a 4024 peer that a request has been successfully completed. 4026 DIAMETER_SUCCESS 2001 4028 The request was successfully completed. 4030 DIAMETER_LIMITED_SUCCESS 2002 4032 When returned, the request was successfully completed, but 4033 additional processing is required by the application in order to 4034 provide service to the user. 4036 7.1.3. Protocol Errors 4038 Errors that fall within the Protocol Error category SHOULD be treated 4039 on a per-hop basis, and Diameter proxies MAY attempt to correct the 4040 error, if it is possible. Note that these errors MUST only be used 4041 in answer messages whose 'E' bit is set. This document omits some 4042 error codes defined in [RFC3588]. To provide backward compatibility 4043 with [RFC3588] implementations these error code values are not re- 4044 used and hence the error codes values enumerated below are non- 4045 sequential. 4047 DIAMETER_UNABLE_TO_DELIVER 3002 4049 This error is given when Diameter can not deliver the message to 4050 the destination, either because no host within the realm 4051 supporting the required application was available to process the 4052 request, or because Destination-Host AVP was given without the 4053 associated Destination-Realm AVP. 4055 DIAMETER_REALM_NOT_SERVED 3003 4057 The intended realm of the request is not recognized. 4059 DIAMETER_TOO_BUSY 3004 4061 When returned, a Diameter node SHOULD attempt to send the message 4062 to an alternate peer. This error MUST only be used when a 4063 specific server is requested, and it cannot provide the requested 4064 service. 4066 DIAMETER_LOOP_DETECTED 3005 4068 An agent detected a loop while trying to get the message to the 4069 intended recipient. The message MAY be sent to an alternate peer, 4070 if one is available, but the peer reporting the error has 4071 identified a configuration problem. 4073 DIAMETER_REDIRECT_INDICATION 3006 4075 A redirect agent has determined that the request could not be 4076 satisfied locally and the initiator of the request SHOULD direct 4077 the request directly to the server, whose contact information has 4078 been added to the response. When set, the Redirect-Host AVP MUST 4079 be present. 4081 DIAMETER_APPLICATION_UNSUPPORTED 3007 4083 A request was sent for an application that is not supported. 4085 DIAMETER_INVALID_BIT_IN_HEADER 3011 4087 This error is returned when a reserved bit in the Diameter header 4088 is set to one (1) or the bits in the Diameter header defined in 4089 Section 3 are set incorrectly. 4091 DIAMETER_INVALID_MESSAGE_LENGTH 3012 4093 This error is returned when a request is received with an invalid 4094 message length. 4096 7.1.4. Transient Failures 4098 Errors that fall within the transient failures category are used to 4099 inform a peer that the request could not be satisfied at the time it 4100 was received, but MAY be able to satisfy the request in the future. 4101 Note that these errors MUST be used in answer messages whose 'E' bit 4102 is not set. 4104 DIAMETER_AUTHENTICATION_REJECTED 4001 4106 The authentication process for the user failed, most likely due to 4107 an invalid password used by the user. Further attempts MUST only 4108 be tried after prompting the user for a new password. 4110 DIAMETER_OUT_OF_SPACE 4002 4112 A Diameter node received the accounting request but was unable to 4113 commit it to stable storage due to a temporary lack of space. 4115 ELECTION_LOST 4003 4117 The peer has determined that it has lost the election process and 4118 has therefore disconnected the transport connection. 4120 7.1.5. Permanent Failures 4122 Errors that fall within the permanent failures category are used to 4123 inform the peer that the request failed, and should not be attempted 4124 again. Note that these errors SHOULD be used in answer messages 4125 whose 'E' bit is not set. In error conditions where it is not 4126 possible or efficient to compose application specific answer grammar 4127 then answer messages with E-bit set and complying to the grammar 4128 described in 7.2 MAY also be used for permanent errors. 4130 To provide backward compatibility with existing implementations that 4131 follow [RFC3588], some of the error values that have previously been 4132 used in this category by [RFC3588] will not be re-used. Therefore 4133 the error values enumerated here maybe non-sequential. 4135 DIAMETER_AVP_UNSUPPORTED 5001 4137 The peer received a message that contained an AVP that is not 4138 recognized or supported and was marked with the Mandatory bit. A 4139 Diameter message with this error MUST contain one or more Failed- 4140 AVP AVP containing the AVPs that caused the failure. 4142 DIAMETER_UNKNOWN_SESSION_ID 5002 4144 The request contained an unknown Session-Id. 4146 DIAMETER_AUTHORIZATION_REJECTED 5003 4148 A request was received for which the user could not be authorized. 4149 This error could occur if the service requested is not permitted 4150 to the user. 4152 DIAMETER_INVALID_AVP_VALUE 5004 4154 The request contained an AVP with an invalid value in its data 4155 portion. A Diameter message indicating this error MUST include 4156 the offending AVPs within a Failed-AVP AVP. 4158 DIAMETER_MISSING_AVP 5005 4160 The request did not contain an AVP that is required by the Command 4161 Code definition. If this value is sent in the Result-Code AVP, a 4162 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP 4163 AVP MUST contain an example of the missing AVP complete with the 4164 Vendor-Id if applicable. The value field of the missing AVP 4165 should be of correct minimum length and contain zeroes. 4167 DIAMETER_RESOURCES_EXCEEDED 5006 4169 A request was received that cannot be authorized because the user 4170 has already expended allowed resources. An example of this error 4171 condition is a user that is restricted to one dial-up PPP port, 4172 attempts to establish a second PPP connection. 4174 DIAMETER_CONTRADICTING_AVPS 5007 4176 The Home Diameter server has detected AVPs in the request that 4177 contradicted each other, and is not willing to provide service to 4178 the user. The Failed-AVP AVPs MUST be present which contains the 4179 AVPs that contradicted each other. 4181 DIAMETER_AVP_NOT_ALLOWED 5008 4183 A message was received with an AVP that MUST NOT be present. The 4184 Failed-AVP AVP MUST be included and contain a copy of the 4185 offending AVP. 4187 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES 5009 4189 A message was received that included an AVP that appeared more 4190 often than permitted in the message definition. The Failed-AVP 4191 AVP MUST be included and contain a copy of the first instance of 4192 the offending AVP that exceeded the maximum number of occurrences 4194 DIAMETER_NO_COMMON_APPLICATION 5010 4196 This error is returned by a Diameter node that receives a CER 4197 whereby no applications are common between the CER sending peer 4198 and the CER receiving peer. 4200 DIAMETER_UNSUPPORTED_VERSION 5011 4202 This error is returned when a request was received, whose version 4203 number is unsupported. 4205 DIAMETER_UNABLE_TO_COMPLY 5012 4207 This error is returned when a request is rejected for unspecified 4208 reasons. 4210 DIAMETER_INVALID_AVP_LENGTH 5014 4212 The request contained an AVP with an invalid length. A Diameter 4213 message indicating this error MUST include the offending AVPs 4214 within a Failed-AVP AVP. In cases where the erroneous avp length 4215 value exceeds the message length or is less than the minimum AVP 4216 header length, it is sufficient to include the offending AVP 4217 header and a zero filled payload of the minimum required length 4218 for the payloads data type. If the AVP is a grouped AVP, the 4219 grouped AVP header with an empty payload would be sufficient to 4220 indicate the offending AVP. In the case where the offending AVP 4221 header cannot be fully decoded when the AVP length is less than 4222 the minimum AVP header length, it is sufficient to include an 4223 offending AVP header that is formulated by padding the incomplete 4224 AVP header with zero up to the minimum AVP header length. 4226 DIAMETER_NO_COMMON_SECURITY 5017 4228 This error is returned when a CER message is received, and there 4229 are no common security mechanisms supported between the peers. A 4230 Capabilities-Exchange-Answer (CEA) MUST be returned with the 4231 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY. 4233 DIAMETER_UNKNOWN_PEER 5018 4235 A CER was received from an unknown peer. 4237 DIAMETER_COMMAND_UNSUPPORTED 5019 4239 This error code is used when a Diameter entity receives a message 4240 with a Command Code that it does not support. 4242 DIAMETER_INVALID_HDR_BITS 5020 4244 A request was received whose bits in the Diameter header were 4245 either set to an invalid combination, or to a value that is 4246 inconsistent with the command code's definition. 4248 DIAMETER_INVALID_AVP_BITS 5021 4250 A request was received that included an AVP whose flag bits are 4251 set to an unrecognized value, or that is inconsistent with the 4252 AVP's definition. 4254 7.2. Error Bit 4256 The 'E' (Error Bit) in the Diameter header is set when the request 4257 caused a protocol-related error (see Section 7.1.3). A message with 4258 the 'E' bit MUST NOT be sent as a response to an answer message. 4259 Note that a message with the 'E' bit set is still subjected to the 4260 processing rules defined in Section 6.2. When set, the answer 4261 message will not conform to the ABNF specification for the command, 4262 and will instead conform to the following ABNF: 4264 Message Format 4266 ::= < Diameter Header: code, ERR [PXY] > 4267 0*1< Session-Id > 4268 { Origin-Host } 4269 { Origin-Realm } 4270 { Result-Code } 4271 [ Origin-State-Id ] 4272 [ Error-Message ] 4273 [ Error-Reporting-Host ] 4274 [ Failed-AVP ] 4275 * [ Proxy-Info ] 4276 * [ AVP ] 4278 Note that the code used in the header is the same than the one found 4279 in the request message, but with the 'R' bit cleared and the 'E' bit 4280 set. The 'P' bit in the header is set to the same value as the one 4281 found in the request message. 4283 7.3. Error-Message AVP 4285 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY 4286 accompany a Result-Code AVP as a human readable error message. The 4287 Error-Message AVP is not intended to be useful in an environment 4288 where error messages are processed automatically. It SHOULD NOT be 4289 expected that the content of this AVP is parsed by network entities. 4291 7.4. Error-Reporting-Host AVP 4293 The Error-Reporting-Host AVP (AVP Code 294) is of type 4294 DiameterIdentity. This AVP contains the identity of the Diameter 4295 host that sent the Result-Code AVP to a value other than 2001 4296 (Success), only if the host setting the Result-Code is different from 4297 the one encoded in the Origin-Host AVP. This AVP is intended to be 4298 used for troubleshooting purposes, and MUST be set when the Result- 4299 Code AVP indicates a failure. 4301 7.5. Failed-AVP AVP 4303 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides 4304 debugging information in cases where a request is rejected or not 4305 fully processed due to erroneous information in a specific AVP. The 4306 value of the Result-Code AVP will provide information on the reason 4307 for the Failed-AVP AVP. A Diameter message SHOULD contain only one 4308 Failed-AVP that corresponds to the error indicated by the Result-Code 4309 AVP. For practical purposes, this Failed-AVP would typically refer 4310 to the first AVP processing error that a Diameter node encounters. 4312 The possible reasons for this AVP are the presence of an improperly 4313 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP 4314 value, the omission of a required AVP, the presence of an explicitly 4315 excluded AVP (see tables in Section 10), or the presence of two or 4316 more occurrences of an AVP which is restricted to 0, 1, or 0-1 4317 occurrences. 4319 A Diameter message SHOULD contain one Failed-AVP AVP, containing the 4320 entire AVP that could not be processed successfully. If the failure 4321 reason is omission of a required AVP, an AVP with the missing AVP 4322 code, the missing vendor id, and a zero filled payload of the minimum 4323 required length for the omitted AVP will be added. If the failure 4324 reason is an invalid AVP length where the reported length is less 4325 than the minimum AVP header length or greater than the reported 4326 message length, a copy of the offending AVP header and a zero filled 4327 payload of the minimum required length SHOULD be added. 4329 In the case where the offending AVP is embedded within a grouped AVP, 4330 the Failed-AVP MAY contain the grouped AVP which in turn contains the 4331 single offending AVP. The same method MAY be employed if the grouped 4332 AVP itself is embedded in yet another grouped AVP and so on. In this 4333 case, the Failed-AVP MAY contain the grouped AVP hierarchy up to the 4334 single offending AVP. This enables the recipient to detect the 4335 location of the offending AVP when embedded in a group. 4337 AVP Format 4339 ::= < AVP Header: 279 > 4340 1* {AVP} 4342 7.6. Experimental-Result AVP 4344 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and 4345 indicates whether a particular vendor-specific request was completed 4346 successfully or whether an error occurred. This AVP has the 4347 following structure: 4349 AVP Format 4351 Experimental-Result ::= < AVP Header: 297 > 4352 { Vendor-Id } 4353 { Experimental-Result-Code } 4355 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies 4356 the vendor responsible for the assignment of the result code which 4357 follows. All Diameter answer messages defined in vendor-specific 4358 applications MUST include either one Result-Code AVP or one 4359 Experimental-Result AVP. 4361 7.7. Experimental-Result-Code AVP 4363 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 4364 and contains a vendor-assigned value representing the result of 4365 processing the request. 4367 It is recommended that vendor-specific result codes follow the same 4368 conventions given for the Result-Code AVP regarding the different 4369 types of result codes and the handling of errors (for non 2xxx 4370 values). 4372 8. Diameter User Sessions 4374 In general, Diameter can provide two different types of services to 4375 applications. The first involves authentication and authorization, 4376 and can optionally make use of accounting. The second only makes use 4377 of accounting. 4379 When a service makes use of the authentication and/or authorization 4380 portion of an application, and a user requests access to the network, 4381 the Diameter client issues an auth request to its local server. The 4382 auth request is defined in a service specific Diameter application 4383 (e.g., NASREQ). The request contains a Session-Id AVP, which is used 4384 in subsequent messages (e.g., subsequent authorization, accounting, 4385 etc) relating to the user's session. The Session-Id AVP is a means 4386 for the client and servers to correlate a Diameter message with a 4387 user session. 4389 When a Diameter server authorizes a user to use network resources for 4390 a finite amount of time, and it is willing to extend the 4391 authorization via a future request, it MUST add the Authorization- 4392 Lifetime AVP to the answer message. The Authorization-Lifetime AVP 4393 defines the maximum number of seconds a user MAY make use of the 4394 resources before another authorization request is expected by the 4395 server. The Auth-Grace-Period AVP contains the number of seconds 4396 following the expiration of the Authorization-Lifetime, after which 4397 the server will release all state information related to the user's 4398 session. Note that if payment for services is expected by the 4399 serving realm from the user's home realm, the Authorization-Lifetime 4400 AVP, combined with the Auth-Grace-Period AVP, implies the maximum 4401 length of the session the home realm is willing to be fiscally 4402 responsible for. Services provided past the expiration of the 4403 Authorization-Lifetime and Auth-Grace-Period AVPs are the 4404 responsibility of the access device. Of course, the actual cost of 4405 services rendered is clearly outside the scope of the protocol. 4407 An access device that does not expect to send a re-authorization or a 4408 session termination request to the server MAY include the Auth- 4409 Session-State AVP with the value set to NO_STATE_MAINTAINED as a hint 4410 to the server. If the server accepts the hint, it agrees that since 4411 no session termination message will be received once service to the 4412 user is terminated, it cannot maintain state for the session. If the 4413 answer message from the server contains a different value in the 4414 Auth-Session-State AVP (or the default value if the AVP is absent), 4415 the access device MUST follow the server's directives. Note that the 4416 value NO_STATE_MAINTAINED MUST NOT be set in subsequent re- 4417 authorization requests and answers. 4419 The base protocol does not include any authorization request 4420 messages, since these are largely application-specific and are 4421 defined in a Diameter application document. However, the base 4422 protocol does define a set of messages that are used to terminate 4423 user sessions. These are used to allow servers that maintain state 4424 information to free resources. 4426 When a service only makes use of the Accounting portion of the 4427 Diameter protocol, even in combination with an application, the 4428 Session-Id is still used to identify user sessions. However, the 4429 session termination messages are not used, since a session is 4430 signaled as being terminated by issuing an accounting stop message. 4432 Diameter may also be used for services that cannot be easily 4433 categorized as authentication, authorization or accounting (e.g., 4434 certain 3GPP IMS interfaces). In such cases, the finite state 4435 machine defined in subsequent sections may not be applicable. 4436 Therefore, the applications itself MAY need to define its own finite 4437 state machine. However, such application specific state machines 4438 SHOULD follow the general state machine framework outlined in this 4439 document such as the use of Session-Id AVPs and the use of STR/STA, 4440 ASR/ASA messages for stateful sessions. 4442 8.1. Authorization Session State Machine 4444 This section contains a set of finite state machines, representing 4445 the life cycle of Diameter sessions, and which MUST be observed by 4446 all Diameter implementations that make use of the authentication 4447 and/or authorization portion of a Diameter application. The term 4448 Service-Specific below refers to a message defined in a Diameter 4449 application (e.g., Mobile IPv4, NASREQ). 4451 There are four different authorization session state machines 4452 supported in the Diameter base protocol. The first two describe a 4453 session in which the server is maintaining session state, indicated 4454 by the value of the Auth-Session-State AVP (or its absence). One 4455 describes the session from a client perspective, the other from a 4456 server perspective. The second two state machines are used when the 4457 server does not maintain session state. Here again, one describes 4458 the session from a client perspective, the other from a server 4459 perspective. 4461 When a session is moved to the Idle state, any resources that were 4462 allocated for the particular session must be released. Any event not 4463 listed in the state machines MUST be considered as an error 4464 condition, and an answer, if applicable, MUST be returned to the 4465 originator of the message. 4467 In the case that an application does not support re-auth, the state 4468 transitions related to server-initiated re-auth when both client and 4469 server sessions maintains state (e.g., Send RAR, Pending, Receive 4470 RAA) MAY be ignored. 4472 In the state table, the event 'Failure to send X' means that the 4473 Diameter agent is unable to send command X to the desired 4474 destination. This could be due to the peer being down, or due to the 4475 peer sending back a transient failure or temporary protocol error 4476 notification DIAMETER_TOO_BUSY or DIAMETER_LOOP_DETECTED in the 4477 Result-Code AVP of the corresponding Answer command. The event 'X 4478 successfully sent' is the complement of 'Failure to send X'. 4480 The following state machine is observed by a client when state is 4481 maintained on the server: 4483 CLIENT, STATEFUL 4484 State Event Action New State 4485 ------------------------------------------------------------- 4486 Idle Client or Device Requests Send Pending 4487 access service 4488 specific 4489 auth req 4491 Idle ASR Received Send ASA Idle 4492 for unknown session with 4493 Result-Code 4494 = UNKNOWN_ 4495 SESSION_ID 4497 Idle RAR Received Send RAA Idle 4498 for unknown session with 4499 Result-Code 4500 = UNKNOWN_ 4501 SESSION_ID 4503 Pending Successful Service-specific Grant Open 4504 authorization answer Access 4505 received with default 4506 Auth-Session-State value 4508 Pending Successful Service-specific Sent STR Discon 4509 authorization answer received 4510 but service not provided 4512 Pending Error processing successful Sent STR Discon 4513 Service-specific authorization 4514 answer 4516 Pending Failed Service-specific Cleanup Idle 4517 authorization answer received 4519 Open User or client device Send Open 4520 requests access to service service 4521 specific 4522 auth req 4524 Open Successful Service-specific Provide Open 4525 authorization answer received Service 4527 Open Failed Service-specific Discon. Idle 4528 authorization answer user/device 4529 received. 4531 Open RAR received and client will Send RAA Open 4532 perform subsequent re-auth with 4533 Result-Code 4534 = SUCCESS 4536 Open RAR received and client will Send RAA Idle 4537 not perform subsequent with 4538 re-auth Result-Code 4539 != SUCCESS, 4540 Discon. 4541 user/device 4543 Open Session-Timeout Expires on Send STR Discon 4544 Access Device 4546 Open ASR Received, Send ASA Discon 4547 client will comply with with 4548 request to end the session Result-Code 4549 = SUCCESS, 4550 Send STR. 4552 Open ASR Received, Send ASA Open 4553 client will not comply with with 4554 request to end the session Result-Code 4555 != SUCCESS 4557 Open Authorization-Lifetime + Send STR Discon 4558 Auth-Grace-Period expires on 4559 access device 4561 Discon ASR Received Send ASA Discon 4563 Discon STA Received Discon. Idle 4564 user/device 4566 The following state machine is observed by a server when it is 4567 maintaining state for the session: 4569 SERVER, STATEFUL 4570 State Event Action New State 4571 ------------------------------------------------------------- 4572 Idle Service-specific authorization Send Open 4573 request received, and successful 4574 user is authorized serv. 4575 specific 4576 answer 4578 Idle Service-specific authorization Send Idle 4579 request received, and failed serv. 4580 user is not authorized specific 4581 answer 4583 Open Service-specific authorization Send Open 4584 request received, and user successful 4585 is authorized serv. specific 4586 answer 4588 Open Service-specific authorization Send Idle 4589 request received, and user failed serv. 4590 is not authorized specific 4591 answer, 4592 Cleanup 4594 Open Home server wants to confirm Send RAR Pending 4595 authentication and/or 4596 authorization of the user 4598 Pending Received RAA with a failed Cleanup Idle 4599 Result-Code 4601 Pending Received RAA with Result-Code Update Open 4602 = SUCCESS session 4604 Open Home server wants to Send ASR Discon 4605 terminate the service 4607 Open Authorization-Lifetime (and Cleanup Idle 4608 Auth-Grace-Period) expires 4609 on home server. 4611 Open Session-Timeout expires on Cleanup Idle 4612 home server 4614 Discon Failure to send ASR Wait, Discon 4615 resend ASR 4617 Discon ASR successfully sent and Cleanup Idle 4618 ASA Received with Result-Code 4620 Not ASA Received None No Change. 4621 Discon 4623 Any STR Received Send STA, Idle 4624 Cleanup. 4626 The following state machine is observed by a client when state is not 4627 maintained on the server: 4629 CLIENT, STATELESS 4630 State Event Action New State 4631 ------------------------------------------------------------- 4632 Idle Client or Device Requests Send Pending 4633 access service 4634 specific 4635 auth req 4637 Pending Successful Service-specific Grant Open 4638 authorization answer Access 4639 received with Auth-Session- 4640 State set to 4641 NO_STATE_MAINTAINED 4643 Pending Failed Service-specific Cleanup Idle 4644 authorization answer 4645 received 4647 Open Session-Timeout Expires on Discon. Idle 4648 Access Device user/device 4650 Open Service to user is terminated Discon. Idle 4651 user/device 4653 The following state machine is observed by a server when it is not 4654 maintaining state for the session: 4656 SERVER, STATELESS 4657 State Event Action New State 4658 ------------------------------------------------------------- 4659 Idle Service-specific authorization Send serv. Idle 4660 request received, and specific 4661 successfully processed answer 4663 8.2. Accounting Session State Machine 4665 The following state machines MUST be supported for applications that 4666 have an accounting portion or that require only accounting services. 4667 The first state machine is to be observed by clients. 4669 See Section 9.7 for Accounting Command Codes and Section 9.8 for 4670 Accounting AVPs. 4672 The server side in the accounting state machine depends in some cases 4673 on the particular application. The Diameter base protocol defines a 4674 default state machine that MUST be followed by all applications that 4675 have not specified other state machines. This is the second state 4676 machine in this section described below. 4678 The default server side state machine requires the reception of 4679 accounting records in any order and at any time, and does not place 4680 any standards requirement on the processing of these records. 4681 Implementations of Diameter may perform checking, ordering, 4682 correlation, fraud detection, and other tasks based on these records. 4683 AVPs may need to be inspected as a part of these tasks. The tasks 4684 can happen either immediately after record reception or in a post- 4685 processing phase. However, as these tasks are typically application 4686 or even policy dependent, they are not standardized by the Diameter 4687 specifications. Applications MAY define requirements on when to 4688 accept accounting records based on the used value of Accounting- 4689 Realtime-Required AVP, credit limits checks, and so on. 4691 However, the Diameter base protocol defines one optional server side 4692 state machine that MAY be followed by applications that require 4693 keeping track of the session state at the accounting server. Note 4694 that such tracking is incompatible with the ability to sustain long 4695 duration connectivity problems. Therefore, the use of this state 4696 machine is recommended only in applications where the value of the 4697 Accounting-Realtime-Required AVP is DELIVER_AND_GRANT, and hence 4698 accounting connectivity problems are required to cause the serviced 4699 user to be disconnected. Otherwise, records produced by the client 4700 may be lost by the server which no longer accepts them after the 4701 connectivity is re-established. This state machine is the third 4702 state machine in this section. The state machine is supervised by a 4703 supervision session timer Ts, which the value should be reasonably 4704 higher than the Acct_Interim_Interval value. Ts MAY be set to two 4705 times the value of the Acct_Interim_Interval so as to avoid the 4706 accounting session in the Diameter server to change to Idle state in 4707 case of short transient network failure. 4709 Any event not listed in the state machines MUST be considered as an 4710 error condition, and a corresponding answer, if applicable, MUST be 4711 returned to the originator of the message. 4713 In the state table, the event 'Failure to send' means that the 4714 Diameter client is unable to communicate with the desired 4715 destination. This could be due to the peer being down, or due to the 4716 peer sending back a transient failure or temporary protocol error 4717 notification DIAMETER_OUT_OF_SPACE, DIAMETER_TOO_BUSY, or 4718 DIAMETER_LOOP_DETECTED in the Result-Code AVP of the Accounting 4719 Answer command. 4721 The event 'Failed answer' means that the Diameter client received a 4722 non-transient failure notification in the Accounting Answer command. 4724 Note that the action 'Disconnect user/dev' MUST have an effect also 4725 to the authorization session state table, e.g., cause the STR message 4726 to be sent, if the given application has both authentication/ 4727 authorization and accounting portions. 4729 The states PendingS, PendingI, PendingL, PendingE and PendingB stand 4730 for pending states to wait for an answer to an accounting request 4731 related to a Start, Interim, Stop, Event or buffered record, 4732 respectively. 4734 CLIENT, ACCOUNTING 4735 State Event Action New State 4736 ------------------------------------------------------------- 4737 Idle Client or device requests Send PendingS 4738 access accounting 4739 start req. 4741 Idle Client or device requests Send PendingE 4742 a one-time service accounting 4743 event req 4745 Idle Records in storage Send PendingB 4746 record 4748 PendingS Successful accounting Open 4749 start answer received 4751 PendingS Failure to send and buffer Store Open 4752 space available and realtime Start 4753 not equal to DELIVER_AND_GRANT Record 4755 PendingS Failure to send and no buffer Open 4756 space available and realtime 4757 equal to GRANT_AND_LOSE 4759 PendingS Failure to send and no buffer Disconnect Idle 4760 space available and realtime user/dev 4761 not equal to 4762 GRANT_AND_LOSE 4764 PendingS Failed accounting start answer Open 4765 received and realtime equal 4766 to GRANT_AND_LOSE 4768 PendingS Failed accounting start answer Disconnect Idle 4769 received and realtime not user/dev 4770 equal to GRANT_AND_LOSE 4772 PendingS User service terminated Store PendingS 4773 stop 4774 record 4776 Open Interim interval elapses Send PendingI 4777 accounting 4778 interim 4779 record 4780 Open User service terminated Send PendingL 4781 accounting 4782 stop req. 4784 PendingI Successful accounting interim Open 4785 answer received 4787 PendingI Failure to send and (buffer Store Open 4788 space available or old record interim 4789 can be overwritten) and record 4790 realtime not equal to 4791 DELIVER_AND_GRANT 4793 PendingI Failure to send and no buffer Open 4794 space available and realtime 4795 equal to GRANT_AND_LOSE 4797 PendingI Failure to send and no buffer Disconnect Idle 4798 space available and realtime user/dev 4799 not equal to GRANT_AND_LOSE 4801 PendingI Failed accounting interim Open 4802 answer received and realtime 4803 equal to GRANT_AND_LOSE 4805 PendingI Failed accounting interim Disconnect Idle 4806 answer received and realtime user/dev 4807 not equal to GRANT_AND_LOSE 4809 PendingI User service terminated Store PendingI 4810 stop 4811 record 4812 PendingE Successful accounting Idle 4813 event answer received 4815 PendingE Failure to send and buffer Store Idle 4816 space available event 4817 record 4819 PendingE Failure to send and no buffer Idle 4820 space available 4822 PendingE Failed accounting event answer Idle 4823 received 4825 PendingB Successful accounting answer Delete Idle 4826 received record 4828 PendingB Failure to send Idle 4830 PendingB Failed accounting answer Delete Idle 4831 received record 4833 PendingL Successful accounting Idle 4834 stop answer received 4836 PendingL Failure to send and buffer Store Idle 4837 space available stop 4838 record 4840 PendingL Failure to send and no buffer Idle 4841 space available 4843 PendingL Failed accounting stop answer Idle 4844 received 4845 SERVER, STATELESS ACCOUNTING 4846 State Event Action New State 4847 ------------------------------------------------------------- 4849 Idle Accounting start request Send Idle 4850 received, and successfully accounting 4851 processed. start 4852 answer 4854 Idle Accounting event request Send Idle 4855 received, and successfully accounting 4856 processed. event 4857 answer 4859 Idle Interim record received, Send Idle 4860 and successfully processed. accounting 4861 interim 4862 answer 4864 Idle Accounting stop request Send Idle 4865 received, and successfully accounting 4866 processed stop answer 4868 Idle Accounting request received, Send Idle 4869 no space left to store accounting 4870 records answer, 4871 Result-Code 4872 = OUT_OF_ 4873 SPACE 4875 SERVER, STATEFUL ACCOUNTING 4876 State Event Action New State 4877 ------------------------------------------------------------- 4879 Idle Accounting start request Send Open 4880 received, and successfully accounting 4881 processed. start 4882 answer, 4883 Start Ts 4885 Idle Accounting event request Send Idle 4886 received, and successfully accounting 4887 processed. event 4888 answer 4890 Idle Accounting request received, Send Idle 4891 no space left to store accounting 4892 records answer, 4893 Result-Code 4894 = OUT_OF_ 4895 SPACE 4897 Open Interim record received, Send Open 4898 and successfully processed. accounting 4899 interim 4900 answer, 4901 Restart Ts 4903 Open Accounting stop request Send Idle 4904 received, and successfully accounting 4905 processed stop answer, 4906 Stop Ts 4908 Open Accounting request received, Send Idle 4909 no space left to store accounting 4910 records answer, 4911 Result-Code 4912 = OUT_OF_ 4913 SPACE, 4914 Stop Ts 4916 Open Session supervision timer Ts Stop Ts Idle 4917 expired 4919 8.3. Server-Initiated Re-Auth 4921 A Diameter server may initiate a re-authentication and/or re- 4922 authorization service for a particular session by issuing a Re-Auth- 4923 Request (RAR). 4925 For example, for pre-paid services, the Diameter server that 4926 originally authorized a session may need some confirmation that the 4927 user is still using the services. 4929 An access device that receives a RAR message with Session-Id equal to 4930 a currently active session MUST initiate a re-auth towards the user, 4931 if the service supports this particular feature. Each Diameter 4932 application MUST state whether service-initiated re-auth is 4933 supported, since some applications do not allow access devices to 4934 prompt the user for re-auth. 4936 8.3.1. Re-Auth-Request 4938 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258 4939 and the message flags' 'R' bit set, may be sent by any server to the 4940 access device that is providing session service, to request that the 4941 user be re-authenticated and/or re-authorized. 4943 Message Format 4945 ::= < Diameter Header: 258, REQ, PXY > 4946 < Session-Id > 4947 { Origin-Host } 4948 { Origin-Realm } 4949 { Destination-Realm } 4950 { Destination-Host } 4951 { Auth-Application-Id } 4952 { Re-Auth-Request-Type } 4953 [ User-Name ] 4954 [ Origin-State-Id ] 4955 * [ Proxy-Info ] 4956 * [ Route-Record ] 4957 * [ AVP ] 4959 8.3.2. Re-Auth-Answer 4961 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258 4962 and the message flags' 'R' bit clear, is sent in response to the RAR. 4963 The Result-Code AVP MUST be present, and indicates the disposition of 4964 the request. 4966 A successful RAA message MUST be followed by an application-specific 4967 authentication and/or authorization message. 4969 Message Format 4971 ::= < Diameter Header: 258, PXY > 4972 < Session-Id > 4973 { Result-Code } 4974 { Origin-Host } 4975 { Origin-Realm } 4976 [ User-Name ] 4977 [ Origin-State-Id ] 4978 [ Error-Message ] 4979 [ Error-Reporting-Host ] 4980 [ Failed-AVP ] 4981 * [ Redirect-Host ] 4982 [ Redirect-Host-Usage ] 4983 [ Redirect-Max-Cache-Time ] 4984 * [ Proxy-Info ] 4985 * [ AVP ] 4987 8.4. Session Termination 4989 It is necessary for a Diameter server that authorized a session, for 4990 which it is maintaining state, to be notified when that session is no 4991 longer active, both for tracking purposes as well as to allow 4992 stateful agents to release any resources that they may have provided 4993 for the user's session. For sessions whose state is not being 4994 maintained, this section is not used. 4996 When a user session that required Diameter authorization terminates, 4997 the access device that provided the service MUST issue a Session- 4998 Termination-Request (STR) message to the Diameter server that 4999 authorized the service, to notify it that the session is no longer 5000 active. An STR MUST be issued when a user session terminates for any 5001 reason, including user logoff, expiration of Session-Timeout, 5002 administrative action, termination upon receipt of an Abort-Session- 5003 Request (see below), orderly shutdown of the access device, etc. 5005 The access device also MUST issue an STR for a session that was 5006 authorized but never actually started. This could occur, for 5007 example, due to a sudden resource shortage in the access device, or 5008 because the access device is unwilling to provide the type of service 5009 requested in the authorization, or because the access device does not 5010 support a mandatory AVP returned in the authorization, etc. 5012 It is also possible that a session that was authorized is never 5013 actually started due to action of a proxy. For example, a proxy may 5014 modify an authorization answer, converting the result from success to 5015 failure, prior to forwarding the message to the access device. If 5016 the answer did not contain an Auth-Session-State AVP with the value 5017 NO_STATE_MAINTAINED, a proxy that causes an authorized session not to 5018 be started MUST issue an STR to the Diameter server that authorized 5019 the session, since the access device has no way of knowing that the 5020 session had been authorized. 5022 A Diameter server that receives an STR message MUST clean up 5023 resources (e.g., session state) associated with the Session-Id 5024 specified in the STR, and return a Session-Termination-Answer. 5026 A Diameter server also MUST clean up resources when the Session- 5027 Timeout expires, or when the Authorization-Lifetime and the Auth- 5028 Grace-Period AVPs expires without receipt of a re-authorization 5029 request, regardless of whether an STR for that session is received. 5030 The access device is not expected to provide service beyond the 5031 expiration of these timers; thus, expiration of either of these 5032 timers implies that the access device may have unexpectedly shut 5033 down. 5035 8.4.1. Session-Termination-Request 5037 The Session-Termination-Request (STR), indicated by the Command-Code 5038 set to 275 and the Command Flags' 'R' bit set, is sent by a Diameter 5039 client or by a Diameter proxy to inform the Diameter Server that an 5040 authenticated and/or authorized session is being terminated. 5042 Message Format 5044 ::= < Diameter Header: 275, REQ, PXY > 5045 < Session-Id > 5046 { Origin-Host } 5047 { Origin-Realm } 5048 { Destination-Realm } 5049 { Auth-Application-Id } 5050 { Termination-Cause } 5051 [ User-Name ] 5052 [ Destination-Host ] 5053 * [ Class ] 5054 [ Origin-State-Id ] 5055 * [ Proxy-Info ] 5056 * [ Route-Record ] 5057 * [ AVP ] 5059 8.4.2. Session-Termination-Answer 5061 The Session-Termination-Answer (STA), indicated by the Command-Code 5062 set to 275 and the message flags' 'R' bit clear, is sent by the 5063 Diameter Server to acknowledge the notification that the session has 5064 been terminated. The Result-Code AVP MUST be present, and MAY 5065 contain an indication that an error occurred while servicing the STR. 5067 Upon sending or receipt of the STA, the Diameter Server MUST release 5068 all resources for the session indicated by the Session-Id AVP. Any 5069 intermediate server in the Proxy-Chain MAY also release any 5070 resources, if necessary. 5072 Message Format 5074 ::= < Diameter Header: 275, PXY > 5075 < Session-Id > 5076 { Result-Code } 5077 { Origin-Host } 5078 { Origin-Realm } 5079 [ User-Name ] 5080 * [ Class ] 5081 [ Error-Message ] 5082 [ Error-Reporting-Host ] 5083 [ Failed-AVP ] 5084 [ Origin-State-Id ] 5085 * [ Redirect-Host ] 5086 [ Redirect-Host-Usage ] 5087 [ Redirect-Max-Cache-Time ] 5088 * [ Proxy-Info ] 5089 * [ AVP ] 5091 8.5. Aborting a Session 5093 A Diameter server may request that the access device stop providing 5094 service for a particular session by issuing an Abort-Session-Request 5095 (ASR). 5097 For example, the Diameter server that originally authorized the 5098 session may be required to cause that session to be stopped for lack 5099 of credit or other reasons that were not anticipated when the session 5100 was first authorized. 5102 An access device that receives an ASR with Session-ID equal to a 5103 currently active session MAY stop the session. Whether the access 5104 device stops the session or not is implementation- and/or 5105 configuration-dependent. For example, an access device may honor 5106 ASRs from certain agents only. In any case, the access device MUST 5107 respond with an Abort-Session-Answer, including a Result-Code AVP to 5108 indicate what action it took. 5110 8.5.1. Abort-Session-Request 5112 The Abort-Session-Request (ASR), indicated by the Command-Code set to 5113 274 and the message flags' 'R' bit set, may be sent by any Diameter 5114 server or any Diameter proxy to the access device that is providing 5115 session service, to request that the session identified by the 5116 Session-Id be stopped. 5118 Message Format 5120 ::= < Diameter Header: 274, REQ, PXY > 5121 < Session-Id > 5122 { Origin-Host } 5123 { Origin-Realm } 5124 { Destination-Realm } 5125 { Destination-Host } 5126 { Auth-Application-Id } 5127 [ User-Name ] 5128 [ Origin-State-Id ] 5129 * [ Proxy-Info ] 5130 * [ Route-Record ] 5131 * [ AVP ] 5133 8.5.2. Abort-Session-Answer 5135 The Abort-Session-Answer (ASA), indicated by the Command-Code set to 5136 274 and the message flags' 'R' bit clear, is sent in response to the 5137 ASR. The Result-Code AVP MUST be present, and indicates the 5138 disposition of the request. 5140 If the session identified by Session-Id in the ASR was successfully 5141 terminated, Result-Code is set to DIAMETER_SUCCESS. If the session 5142 is not currently active, Result-Code is set to 5143 DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the 5144 session for any other reason, Result-Code is set to 5145 DIAMETER_UNABLE_TO_COMPLY. 5147 Message Format 5149 ::= < Diameter Header: 274, PXY > 5150 < Session-Id > 5151 { Result-Code } 5152 { Origin-Host } 5153 { Origin-Realm } 5154 [ User-Name ] 5155 [ Origin-State-Id ] 5156 [ Error-Message ] 5157 [ Error-Reporting-Host ] 5158 [ Failed-AVP ] 5159 * [ Redirect-Host ] 5160 [ Redirect-Host-Usage ] 5161 [ Redirect-Max-Cache-Time ] 5162 * [ Proxy-Info ] 5163 * [ AVP ] 5165 8.6. Inferring Session Termination from Origin-State-Id 5167 The Origin-State-Id is used to allow detection of terminated sessions 5168 for which no STR would have been issued, due to unanticipated 5169 shutdown of an access device. 5171 A Diameter client or access device increments the value of the 5172 Origin-State-Id every time it is started or powered-up. The new 5173 Origin-State-Id is then sent in the CER/CEA message immediately upon 5174 connection to the server. The Diameter server receiving the new 5175 Origin-State-Id can determine whether the sending Diameter client had 5176 abruptly shutdown by comparing the old value of the Origin-State-Id 5177 it has kept for that specific client is less than the new value and 5178 whether it has un-terminated sessions originating from that client. 5180 An access device can also include the Origin-State-Id in request 5181 messages other than CER if there are relays or proxies in between the 5182 access device and the server. In this case, however, the server 5183 cannot discover that the access device has been restarted unless and 5184 until it receives a new request from it. Therefore this mechanism is 5185 more opportunistic across proxies and relays. 5187 The Diameter server may assume that all sessions that were active 5188 prior to detection of a client restart have been terminated. The 5189 Diameter server MAY clean up all session state associated with such 5190 lost sessions, and MAY also issues STRs for all such lost sessions 5191 that were authorized on upstream servers, to allow session state to 5192 be cleaned up globally. 5194 8.7. Auth-Request-Type AVP 5196 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is 5197 included in application-specific auth requests to inform the peers 5198 whether a user is to be authenticated only, authorized only or both. 5199 Note any value other than both MAY cause RADIUS interoperability 5200 issues. The following values are defined: 5202 AUTHENTICATE_ONLY 1 5204 The request being sent is for authentication only, and MUST 5205 contain the relevant application specific authentication AVPs that 5206 are needed by the Diameter server to authenticate the user. 5208 AUTHORIZE_ONLY 2 5210 The request being sent is for authorization only, and MUST contain 5211 the application specific authorization AVPs that are necessary to 5212 identify the service being requested/offered. 5214 AUTHORIZE_AUTHENTICATE 3 5216 The request contains a request for both authentication and 5217 authorization. The request MUST include both the relevant 5218 application specific authentication information, and authorization 5219 information necessary to identify the service being requested/ 5220 offered. 5222 8.8. Session-Id AVP 5224 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used 5225 to identify a specific session (see Section 8). All messages 5226 pertaining to a specific session MUST include only one Session-Id AVP 5227 and the same value MUST be used throughout the life of a session. 5228 When present, the Session-Id SHOULD appear immediately following the 5229 Diameter Header (see Section 3). 5231 The Session-Id MUST be globally and eternally unique, as it is meant 5232 to uniquely identify a user session without reference to any other 5233 information, and may be needed to correlate historical authentication 5234 information with accounting information. The Session-Id includes a 5235 mandatory portion and an implementation-defined portion; a 5236 recommended format for the implementation-defined portion is outlined 5237 below. 5239 The Session-Id MUST begin with the sender's identity encoded in the 5240 DiameterIdentity type (see Section 4.4). The remainder of the 5241 Session-Id is delimited by a ";" character, and MAY be any sequence 5242 that the client can guarantee to be eternally unique; however, the 5243 following format is recommended, (square brackets [] indicate an 5244 optional element): 5246 ;;[;] 5248 and are decimal representations of the 5249 high and low 32 bits of a monotonically increasing 64-bit value. The 5250 64-bit value is rendered in two part to simplify formatting by 32-bit 5251 processors. At startup, the high 32 bits of the 64-bit value MAY be 5252 initialized to the time in NTP format [RFC4330], and the low 32 bits 5253 MAY be initialized to zero. This will for practical purposes 5254 eliminate the possibility of overlapping Session-Ids after a reboot, 5255 assuming the reboot process takes longer than a second. 5256 Alternatively, an implementation MAY keep track of the increasing 5257 value in non-volatile memory. 5259 is implementation specific but may include a modem's 5260 device Id, a layer 2 address, timestamp, etc. 5262 Example, in which there is no optional value: 5264 accesspoint7.example.com;1876543210;523 5266 Example, in which there is an optional value: 5268 accesspoint7.example.com;1876543210;523;mobile@200.1.1.88 5270 The Session-Id is created by the Diameter application initiating the 5271 session, which in most cases is done by the client. Note that a 5272 Session-Id MAY be used for both the authentication, authorization and 5273 accounting commands of a given application. 5275 8.9. Authorization-Lifetime AVP 5277 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 5278 and contains the maximum number of seconds of service to be provided 5279 to the user before the user is to be re-authenticated and/or re- 5280 authorized. Care should be taken when the Authorization- Lifetime 5281 value is determined, since a low, non-zero, value could create 5282 significant Diameter traffic, which could congest both the network 5283 and the agents. 5285 A value of zero (0) means that immediate re-auth is necessary by the 5286 access device. The absence of this AVP, or a value of all ones 5287 (meaning all bits in the 32 bit field are set to one) means no re- 5288 auth is expected. 5290 If both this AVP and the Session-Timeout AVP are present in a 5291 message, the value of the latter MUST NOT be smaller than the 5292 Authorization-Lifetime AVP. 5294 An Authorization-Lifetime AVP MAY be present in re-authorization 5295 messages, and contains the number of seconds the user is authorized 5296 to receive service from the time the re-auth answer message is 5297 received by the access device. 5299 This AVP MAY be provided by the client as a hint of the maximum 5300 lifetime that it is willing to accept. The server MUST return a 5301 value that is equal to, or smaller, than the one provided by the 5302 client. 5304 8.10. Auth-Grace-Period AVP 5306 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and 5307 contains the number of seconds the Diameter server will wait 5308 following the expiration of the Authorization-Lifetime AVP before 5309 cleaning up resources for the session. 5311 8.11. Auth-Session-State AVP 5313 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and 5314 specifies whether state is maintained for a particular session. The 5315 client MAY include this AVP in requests as a hint to the server, but 5316 the value in the server's answer message is binding. The following 5317 values are supported: 5319 STATE_MAINTAINED 0 5321 This value is used to specify that session state is being 5322 maintained, and the access device MUST issue a session termination 5323 message when service to the user is terminated. This is the 5324 default value. 5326 NO_STATE_MAINTAINED 1 5328 This value is used to specify that no session termination messages 5329 will be sent by the access device upon expiration of the 5330 Authorization-Lifetime. 5332 8.12. Re-Auth-Request-Type AVP 5334 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and 5335 is included in application-specific auth answers to inform the client 5336 of the action expected upon expiration of the Authorization-Lifetime. 5337 If the answer message contains an Authorization-Lifetime AVP with a 5338 positive value, the Re-Auth-Request-Type AVP MUST be present in an 5339 answer message. The following values are defined: 5341 AUTHORIZE_ONLY 0 5343 An authorization only re-auth is expected upon expiration of the 5344 Authorization-Lifetime. This is the default value if the AVP is 5345 not present in answer messages that include the Authorization- 5346 Lifetime. 5348 AUTHORIZE_AUTHENTICATE 1 5350 An authentication and authorization re-auth is expected upon 5351 expiration of the Authorization-Lifetime. 5353 8.13. Session-Timeout AVP 5355 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32 5356 and contains the maximum number of seconds of service to be provided 5357 to the user before termination of the session. When both the 5358 Session-Timeout and the Authorization-Lifetime AVPs are present in an 5359 answer message, the former MUST be equal to or greater than the value 5360 of the latter. 5362 A session that terminates on an access device due to the expiration 5363 of the Session-Timeout MUST cause an STR to be issued, unless both 5364 the access device and the home server had previously agreed that no 5365 session termination messages would be sent (see Section 8.11). 5367 A Session-Timeout AVP MAY be present in a re-authorization answer 5368 message, and contains the remaining number of seconds from the 5369 beginning of the re-auth. 5371 A value of zero, or the absence of this AVP, means that this session 5372 has an unlimited number of seconds before termination. 5374 This AVP MAY be provided by the client as a hint of the maximum 5375 timeout that it is willing to accept. However, the server MAY return 5376 a value that is equal to, or smaller, than the one provided by the 5377 client. 5379 8.14. User-Name AVP 5381 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which 5382 contains the User-Name, in a format consistent with the NAI 5383 specification [RFC4282]. 5385 8.15. Termination-Cause AVP 5387 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and 5388 is used to indicate the reason why a session was terminated on the 5389 access device. The following values are defined: 5391 DIAMETER_LOGOUT 1 5393 The user initiated a disconnect 5395 DIAMETER_SERVICE_NOT_PROVIDED 2 5397 This value is used when the user disconnected prior to the receipt 5398 of the authorization answer message. 5400 DIAMETER_BAD_ANSWER 3 5402 This value indicates that the authorization answer received by the 5403 access device was not processed successfully. 5405 DIAMETER_ADMINISTRATIVE 4 5407 The user was not granted access, or was disconnected, due to 5408 administrative reasons, such as the receipt of a Abort-Session- 5409 Request message. 5411 DIAMETER_LINK_BROKEN 5 5413 The communication to the user was abruptly disconnected. 5415 DIAMETER_AUTH_EXPIRED 6 5417 The user's access was terminated since its authorized session time 5418 has expired. 5420 DIAMETER_USER_MOVED 7 5422 The user is receiving services from another access device. 5424 DIAMETER_SESSION_TIMEOUT 8 5426 The user's session has timed out, and service has been terminated. 5428 8.16. Origin-State-Id AVP 5430 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a 5431 monotonically increasing value that is advanced whenever a Diameter 5432 entity restarts with loss of previous state, for example upon reboot. 5433 Origin-State-Id MAY be included in any Diameter message, including 5434 CER. 5436 A Diameter entity issuing this AVP MUST create a higher value for 5437 this AVP each time its state is reset. A Diameter entity MAY set 5438 Origin-State-Id to the time of startup, or it MAY use an incrementing 5439 counter retained in non-volatile memory across restarts. 5441 The Origin-State-Id, if present, MUST reflect the state of the entity 5442 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST 5443 either remove Origin-State-Id or modify it appropriately as well. 5444 Typically, Origin-State-Id is used by an access device that always 5445 starts up with no active sessions; that is, any session active prior 5446 to restart will have been lost. By including Origin-State-Id in a 5447 message, it allows other Diameter entities to infer that sessions 5448 associated with a lower Origin-State-Id are no longer active. If an 5449 access device does not intend for such inferences to be made, it MUST 5450 either not include Origin-State-Id in any message, or set its value 5451 to 0. 5453 8.17. Session-Binding AVP 5455 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY 5456 be present in application-specific authorization answer messages. If 5457 present, this AVP MAY inform the Diameter client that all future 5458 application-specific re-auth and Session-Termination-Request messages 5459 for this session MUST be sent to the same authorization server. 5461 This field is a bit mask, and the following bits have been defined: 5463 RE_AUTH 1 5465 When set, future re-auth messages for this session MUST NOT 5466 include the Destination-Host AVP. When cleared, the default 5467 value, the Destination-Host AVP MUST be present in all re-auth 5468 messages for this session. 5470 STR 2 5472 When set, the STR message for this session MUST NOT include the 5473 Destination-Host AVP. When cleared, the default value, the 5474 Destination-Host AVP MUST be present in the STR message for this 5475 session. 5477 ACCOUNTING 4 5479 When set, all accounting messages for this session MUST NOT 5480 include the Destination-Host AVP. When cleared, the default 5481 value, the Destination-Host AVP, if known, MUST be present in all 5482 accounting messages for this session. 5484 8.18. Session-Server-Failover AVP 5486 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated, 5487 and MAY be present in application-specific authorization answer 5488 messages that either do not include the Session-Binding AVP or 5489 include the Session-Binding AVP with any of the bits set to a zero 5490 value. If present, this AVP MAY inform the Diameter client that if a 5491 re-auth or STR message fails due to a delivery problem, the Diameter 5492 client SHOULD issue a subsequent message without the Destination-Host 5493 AVP. When absent, the default value is REFUSE_SERVICE. 5495 The following values are supported: 5497 REFUSE_SERVICE 0 5499 If either the re-auth or the STR message delivery fails, terminate 5500 service with the user, and do not attempt any subsequent attempts. 5502 TRY_AGAIN 1 5504 If either the re-auth or the STR message delivery fails, resend 5505 the failed message without the Destination-Host AVP present. 5507 ALLOW_SERVICE 2 5509 If re-auth message delivery fails, assume that re-authorization 5510 succeeded. If STR message delivery fails, terminate the session. 5512 TRY_AGAIN_ALLOW_SERVICE 3 5514 If either the re-auth or the STR message delivery fails, resend 5515 the failed message without the Destination-Host AVP present. If 5516 the second delivery fails for re-auth, assume re-authorization 5517 succeeded. If the second delivery fails for STR, terminate the 5518 session. 5520 8.19. Multi-Round-Time-Out AVP 5522 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32, 5523 and SHOULD be present in application-specific authorization answer 5524 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. 5525 This AVP contains the maximum number of seconds that the access 5526 device MUST provide the user in responding to an authentication 5527 request. 5529 8.20. Class AVP 5531 The Class AVP (AVP Code 25) is of type OctetString and is used by 5532 Diameter servers to return state information to the access device. 5533 When one or more Class AVPs are present in application-specific 5534 authorization answer messages, they MUST be present in subsequent re- 5535 authorization, session termination and accounting messages. Class 5536 AVPs found in a re-authorization answer message override the ones 5537 found in any previous authorization answer message. Diameter server 5538 implementations SHOULD NOT return Class AVPs that require more than 5539 4096 bytes of storage on the Diameter client. A Diameter client that 5540 receives Class AVPs whose size exceeds local available storage MUST 5541 terminate the session. 5543 8.21. Event-Timestamp AVP 5545 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be 5546 included in an Accounting-Request and Accounting-Answer messages to 5547 record the time that the reported event occurred, in seconds since 5548 January 1, 1900 00:00 UTC. 5550 9. Accounting 5552 This accounting protocol is based on a server directed model with 5553 capabilities for real-time delivery of accounting information. 5554 Several fault resilience methods [RFC2975] have been built in to the 5555 protocol in order minimize loss of accounting data in various fault 5556 situations and under different assumptions about the capabilities of 5557 the used devices. 5559 9.1. Server Directed Model 5561 The server directed model means that the device generating the 5562 accounting data gets information from either the authorization server 5563 (if contacted) or the accounting server regarding the way accounting 5564 data shall be forwarded. This information includes accounting record 5565 timeliness requirements. 5567 As discussed in [RFC2975], real-time transfer of accounting records 5568 is a requirement, such as the need to perform credit limit checks and 5569 fraud detection. Note that batch accounting is not a requirement, 5570 and is therefore not supported by Diameter. Should batched 5571 accounting be required in the future, a new Diameter application will 5572 need to be created, or it could be handled using another protocol. 5573 Note, however, that even if at the Diameter layer accounting requests 5574 are processed one by one, transport protocols used under Diameter 5575 typically batch several requests in the same packet under heavy 5576 traffic conditions. This may be sufficient for many applications. 5578 The authorization server (chain) directs the selection of proper 5579 transfer strategy, based on its knowledge of the user and 5580 relationships of roaming partnerships. The server (or agents) uses 5581 the Acct-Interim-Interval and Accounting-Realtime-Required AVPs to 5582 control the operation of the Diameter peer operating as a client. 5583 The Acct-Interim-Interval AVP, when present, instructs the Diameter 5584 node acting as a client to produce accounting records continuously 5585 even during a session. Accounting-Realtime-Required AVP is used to 5586 control the behavior of the client when the transfer of accounting 5587 records from the Diameter client is delayed or unsuccessful. 5589 The Diameter accounting server MAY override the interim interval or 5590 the realtime requirements by including the Acct-Interim-Interval or 5591 Accounting-Realtime-Required AVP in the Accounting-Answer message. 5592 When one of these AVPs is present, the latest value received SHOULD 5593 be used in further accounting activities for the same session. 5595 9.2. Protocol Messages 5597 A Diameter node that receives a successful authentication and/or 5598 authorization messages from the Diameter server SHOULD collect 5599 accounting information for the session. The Accounting-Request 5600 message is used to transmit the accounting information to the 5601 Diameter server, which MUST reply with the Accounting-Answer message 5602 to confirm reception. The Accounting-Answer message includes the 5603 Result-Code AVP, which MAY indicate that an error was present in the 5604 accounting message. The value of the Accounting-Realtime-Required 5605 AVP received earlier for the session in question may indicate that 5606 the user's session has to be terminated when a rejected Accounting- 5607 Request message was received. 5609 9.3. Accounting Application Extension and Requirements 5611 Each Diameter application (e.g., NASREQ, MobileIP), SHOULD define 5612 their Service-Specific AVPs that MUST be present in the Accounting- 5613 Request message in a section entitled "Accounting AVPs". The 5614 application MUST assume that the AVPs described in this document will 5615 be present in all Accounting messages, so only their respective 5616 service-specific AVPs need to be defined in that section. 5618 Applications have the option of using one or both of the following 5619 accounting application extension models: 5621 Split Accounting Service 5623 The accounting message will carry the Application Id of the 5624 Diameter base accounting application (see Section 2.4). 5625 Accounting messages maybe routed to Diameter nodes other than the 5626 corresponding Diameter application. These nodes might be 5627 centralized accounting servers that provide accounting service for 5628 multiple different Diameter applications. These nodes MUST 5629 advertise the Diameter base accounting Application Id during 5630 capabilities exchange. 5632 Coupled Accounting Service 5634 The accounting messages will carry the Application Id of the 5635 application that is using it. The application itself will process 5636 the received accounting records or forward them to an accounting 5637 server. There is no accounting application advertisement required 5638 during capabilities exchange and the accounting messages will be 5639 routed the same as any of the other application messages. 5641 In cases where an application does not define its own accounting 5642 service, it is preferred that the split accounting model be used. 5644 9.4. Fault Resilience 5646 Diameter Base protocol mechanisms are used to overcome small message 5647 loss and network faults of temporary nature. 5649 Diameter peers acting as clients MUST implement the use of failover 5650 to guard against server failures and certain network failures. 5651 Diameter peers acting as agents or related off-line processing 5652 systems MUST detect duplicate accounting records caused by the 5653 sending of same record to several servers and duplication of messages 5654 in transit. This detection MUST be based on the inspection of the 5655 Session-Id and Accounting-Record-Number AVP pairs. Appendix C 5656 discusses duplicate detection needs and implementation issues. 5658 Diameter clients MAY have non-volatile memory for the safe storage of 5659 accounting records over reboots or extended network failures, network 5660 partitions, and server failures. If such memory is available, the 5661 client SHOULD store new accounting records there as soon as the 5662 records are created and until a positive acknowledgement of their 5663 reception from the Diameter Server has been received. Upon a reboot, 5664 the client MUST starting sending the records in the non-volatile 5665 memory to the accounting server with appropriate modifications in 5666 termination cause, session length, and other relevant information in 5667 the records. 5669 A further application of this protocol may include AVPs to control 5670 how many accounting records may at most be stored in the Diameter 5671 client without committing them to the non-volatile memory or 5672 transferring them to the Diameter server. 5674 The client SHOULD NOT remove the accounting data from any of its 5675 memory areas before the correct Accounting-Answer has been received. 5676 The client MAY remove oldest, undelivered or yet unacknowledged 5677 accounting data if it runs out of resources such as memory. It is an 5678 implementation dependent matter for the client to accept new sessions 5679 under this condition. 5681 9.5. Accounting Records 5683 In all accounting records, the Session-Id AVP MUST be present; the 5684 User-Name AVP MUST be present if it is available to the Diameter 5685 client. 5687 Different types of accounting records are sent depending on the 5688 actual type of accounted service and the authorization server's 5689 directions for interim accounting. If the accounted service is a 5690 one-time event, meaning that the start and stop of the event are 5691 simultaneous, then the Accounting-Record-Type AVP MUST be present and 5692 set to the value EVENT_RECORD. 5694 If the accounted service is of a measurable length, then the AVP MUST 5695 use the values START_RECORD, STOP_RECORD, and possibly, 5696 INTERIM_RECORD. If the authorization server has not directed interim 5697 accounting to be enabled for the session, two accounting records MUST 5698 be generated for each service of type session. When the initial 5699 Accounting-Request for a given session is sent, the Accounting- 5700 Record-Type AVP MUST be set to the value START_RECORD. When the last 5701 Accounting-Request is sent, the value MUST be STOP_RECORD. 5703 If the authorization server has directed interim accounting to be 5704 enabled, the Diameter client MUST produce additional records between 5705 the START_RECORD and STOP_RECORD, marked INTERIM_RECORD. The 5706 production of these records is directed by Acct-Interim-Interval as 5707 well as any re-authentication or re-authorization of the session. 5708 The Diameter client MUST overwrite any previous interim accounting 5709 records that are locally stored for delivery, if a new record is 5710 being generated for the same session. This ensures that only one 5711 pending interim record can exist on an access device for any given 5712 session. 5714 A particular value of Accounting-Sub-Session-Id MUST appear only in 5715 one sequence of accounting records from a DIAMETER client, except for 5716 the purposes of retransmission. The one sequence that is sent MUST 5717 be either one record with Accounting-Record-Type AVP set to the value 5718 EVENT_RECORD, or several records starting with one having the value 5719 START_RECORD, followed by zero or more INTERIM_RECORD and a single 5720 STOP_RECORD. A particular Diameter application specification MUST 5721 define the type of sequences that MUST be used. 5723 9.6. Correlation of Accounting Records 5725 If an application uses accounting messages, it can correlate 5726 accounting records with a specific application session by using the 5727 Session-Id of the particular application session in the accounting 5728 messages. Accounting messages MAY also use a different Session-Id 5729 from that of the application sessions in which case other session 5730 related information is needed to perform correlation. 5732 In cases where an application requires multiple accounting sub- 5733 session, an Accounting-Sub-Session-Id AVP is used to differentiate 5734 each sub-session. The Session-Id would remain constant for all sub- 5735 sessions and is be used to correlate all the sub-sessions to a 5736 particular application session. Note that receiving a STOP_RECORD 5737 with no Accounting-Sub-Session-Id AVP when sub-sessions were 5738 originally used in the START_RECORD messages implies that all sub- 5739 sessions are terminated. 5741 There are also cases where an application needs to correlate multiple 5742 application sessions into a single accounting record; the accounting 5743 record may span multiple different Diameter applications and sessions 5744 used by the same user at a given time. In such cases, the Acct- 5745 Multi-Session- Id AVP is used. The Acct-Multi-Session-Id AVP SHOULD 5746 be signaled by the server to the access device (typically during 5747 authorization) when it determines that a request belongs to an 5748 existing session. The access device MUST then include the Acct- 5749 Multi-Session-Id AVP in all subsequent accounting messages. 5751 The Acct-Multi-Session-Id AVP MAY include the value of the original 5752 Session-Id. It's contents are implementation specific, but MUST be 5753 globally unique across other Acct-Multi-Session-Id, and MUST NOT 5754 change during the life of a session. 5756 A Diameter application document MUST define the exact concept of a 5757 session that is being accounted, and MAY define the concept of a 5758 multi-session. For instance, the NASREQ DIAMETER application treats 5759 a single PPP connection to a Network Access Server as one session, 5760 and a set of Multilink PPP sessions as one multi-session. 5762 9.7. Accounting Command-Codes 5764 This section defines Command-Code values that MUST be supported by 5765 all Diameter implementations that provide Accounting services. 5767 9.7.1. Accounting-Request 5769 The Accounting-Request (ACR) command, indicated by the Command-Code 5770 field set to 271 and the Command Flags' 'R' bit set, is sent by a 5771 Diameter node, acting as a client, in order to exchange accounting 5772 information with a peer. 5774 The AVP listed below SHOULD include service specific accounting AVPs, 5775 as described in Section 9.3. 5777 Message Format 5779 ::= < Diameter Header: 271, REQ, PXY > 5780 < Session-Id > 5781 { Origin-Host } 5782 { Origin-Realm } 5783 { Destination-Realm } 5784 { Accounting-Record-Type } 5785 { Accounting-Record-Number } 5786 [ Acct-Application-Id ] 5787 [ Vendor-Specific-Application-Id ] 5788 [ User-Name ] 5789 [ Destination-Host ] 5790 [ Accounting-Sub-Session-Id ] 5791 [ Acct-Session-Id ] 5792 [ Acct-Multi-Session-Id ] 5793 [ Acct-Interim-Interval ] 5794 [ Accounting-Realtime-Required ] 5795 [ Origin-State-Id ] 5796 [ Event-Timestamp ] 5797 * [ Proxy-Info ] 5798 * [ Route-Record ] 5799 * [ AVP ] 5801 9.7.2. Accounting-Answer 5803 The Accounting-Answer (ACA) command, indicated by the Command-Code 5804 field set to 271 and the Command Flags' 'R' bit cleared, is used to 5805 acknowledge an Accounting-Request command. The Accounting-Answer 5806 command contains the same Session-Id as the corresponding request. 5808 Only the target Diameter Server, known as the home Diameter Server, 5809 SHOULD respond with the Accounting-Answer command. 5811 The AVP listed below SHOULD include service specific accounting AVPs, 5812 as described in Section 9.3. 5814 Message Format 5816 ::= < Diameter Header: 271, PXY > 5817 < Session-Id > 5818 { Result-Code } 5819 { Origin-Host } 5820 { Origin-Realm } 5821 { Accounting-Record-Type } 5822 { Accounting-Record-Number } 5823 [ Acct-Application-Id ] 5824 [ Vendor-Specific-Application-Id ] 5825 [ User-Name ] 5826 [ Accounting-Sub-Session-Id ] 5827 [ Acct-Session-Id ] 5828 [ Acct-Multi-Session-Id ] 5829 [ Error-Message ] 5830 [ Error-Reporting-Host ] 5831 [ Failed-AVP ] 5832 [ Acct-Interim-Interval ] 5833 [ Accounting-Realtime-Required ] 5834 [ Origin-State-Id ] 5835 [ Event-Timestamp ] 5836 * [ Proxy-Info ] 5837 * [ AVP ] 5839 9.8. Accounting AVPs 5841 This section contains AVPs that describe accounting usage information 5842 related to a specific session. 5844 9.8.1. Accounting-Record-Type AVP 5846 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated 5847 and contains the type of accounting record being sent. The following 5848 values are currently defined for the Accounting-Record-Type AVP: 5850 EVENT_RECORD 1 5852 An Accounting Event Record is used to indicate that a one-time 5853 event has occurred (meaning that the start and end of the event 5854 are simultaneous). This record contains all information relevant 5855 to the service, and is the only record of the service. 5857 START_RECORD 2 5859 An Accounting Start, Interim, and Stop Records are used to 5860 indicate that a service of a measurable length has been given. An 5861 Accounting Start Record is used to initiate an accounting session, 5862 and contains accounting information that is relevant to the 5863 initiation of the session. 5865 INTERIM_RECORD 3 5867 An Interim Accounting Record contains cumulative accounting 5868 information for an existing accounting session. Interim 5869 Accounting Records SHOULD be sent every time a re-authentication 5870 or re-authorization occurs. Further, additional interim record 5871 triggers MAY be defined by application-specific Diameter 5872 applications. The selection of whether to use INTERIM_RECORD 5873 records is done by the Acct-Interim-Interval AVP. 5875 STOP_RECORD 4 5877 An Accounting Stop Record is sent to terminate an accounting 5878 session and contains cumulative accounting information relevant to 5879 the existing session. 5881 9.8.2. Acct-Interim-Interval AVP 5883 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and 5884 is sent from the Diameter home authorization server to the Diameter 5885 client. The client uses information in this AVP to decide how and 5886 when to produce accounting records. With different values in this 5887 AVP, service sessions can result in one, two, or two+N accounting 5888 records, based on the needs of the home-organization. The following 5889 accounting record production behavior is directed by the inclusion of 5890 this AVP: 5892 1. The omission of the Acct-Interim-Interval AVP or its inclusion 5893 with Value field set to 0 means that EVENT_RECORD, START_RECORD, 5894 and STOP_RECORD are produced, as appropriate for the service. 5896 2. The inclusion of the AVP with Value field set to a non-zero value 5897 means that INTERIM_RECORD records MUST be produced between the 5898 START_RECORD and STOP_RECORD records. The Value field of this 5899 AVP is the nominal interval between these records in seconds. 5901 The Diameter node that originates the accounting information, 5902 known as the client, MUST produce the first INTERIM_RECORD record 5903 roughly at the time when this nominal interval has elapsed from 5904 the START_RECORD, the next one again as the interval has elapsed 5905 once more, and so on until the session ends and a STOP_RECORD 5906 record is produced. 5908 The client MUST ensure that the interim record production times 5909 are randomized so that large accounting message storms are not 5910 created either among records or around a common service start 5911 time. 5913 9.8.3. Accounting-Record-Number AVP 5915 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 5916 and identifies this record within one session. As Session-Id AVPs 5917 are globally unique, the combination of Session-Id and Accounting- 5918 Record-Number AVPs is also globally unique, and can be used in 5919 matching accounting records with confirmations. An easy way to 5920 produce unique numbers is to set the value to 0 for records of type 5921 EVENT_RECORD and START_RECORD, and set the value to 1 for the first 5922 INTERIM_RECORD, 2 for the second, and so on until the value for 5923 STOP_RECORD is one more than for the last INTERIM_RECORD. 5925 9.8.4. Acct-Session-Id AVP 5927 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only 5928 used when RADIUS/Diameter translation occurs. This AVP contains the 5929 contents of the RADIUS Acct-Session-Id attribute. 5931 9.8.5. Acct-Multi-Session-Id AVP 5933 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String, 5934 following the format specified in Section 8.8. The Acct-Multi- 5935 Session-Id AVP is used to link together multiple related accounting 5936 sessions, where each session would have a unique Session-Id, but the 5937 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the 5938 Diameter server in an authorization answer, and MUST be used in all 5939 accounting messages for the given session. 5941 9.8.6. Accounting-Sub-Session-Id AVP 5943 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type 5944 Unsigned64 and contains the accounting sub-session identifier. The 5945 combination of the Session-Id and this AVP MUST be unique per sub- 5946 session, and the value of this AVP MUST be monotonically increased by 5947 one for all new sub-sessions. The absence of this AVP implies no 5948 sub-sessions are in use, with the exception of an Accounting-Request 5949 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD 5950 message with no Accounting-Sub-Session-Id AVP present will signal the 5951 termination of all sub-sessions for a given Session-Id. 5953 9.8.7. Accounting-Realtime-Required AVP 5955 The Accounting-Realtime-Required AVP (AVP Code 483) is of type 5956 Enumerated and is sent from the Diameter home authorization server to 5957 the Diameter client or in the Accounting-Answer from the accounting 5958 server. The client uses information in this AVP to decide what to do 5959 if the sending of accounting records to the accounting server has 5960 been temporarily prevented due to, for instance, a network problem. 5962 DELIVER_AND_GRANT 1 5964 The AVP with Value field set to DELIVER_AND_GRANT means that the 5965 service MUST only be granted as long as there is a connection to 5966 an accounting server. Note that the set of alternative accounting 5967 servers are treated as one server in this sense. Having to move 5968 the accounting record stream to a backup server is not a reason to 5969 discontinue the service to the user. 5971 GRANT_AND_STORE 2 5973 The AVP with Value field set to GRANT_AND_STORE means that service 5974 SHOULD be granted if there is a connection, or as long as records 5975 can still be stored as described in Section 9.4. 5977 This is the default behavior if the AVP isn't included in the 5978 reply from the authorization server. 5980 GRANT_AND_LOSE 3 5982 The AVP with Value field set to GRANT_AND_LOSE means that service 5983 SHOULD be granted even if the records cannot be delivered or 5984 stored. 5986 10. AVP Occurrence Table 5988 The following tables presents the AVPs defined in this document, and 5989 specifies in which Diameter messages they MAY be present or not. 5990 AVPs that occur only inside a Grouped AVP are not shown in this 5991 table. 5993 The table uses the following symbols: 5995 0 The AVP MUST NOT be present in the message. 5997 0+ Zero or more instances of the AVP MAY be present in the 5998 message. 6000 0-1 Zero or one instance of the AVP MAY be present in the message. 6001 It is considered an error if there are more than one instance of 6002 the AVP. 6004 1 One instance of the AVP MUST be present in the message. 6006 1+ At least one instance of the AVP MUST be present in the 6007 message. 6009 10.1. Base Protocol Command AVP Table 6011 The table in this section is limited to the non-accounting Command 6012 Codes defined in this specification. 6014 +-----------------------------------------------+ 6015 | Command-Code | 6016 +---+---+---+---+---+---+---+---+---+---+---+---+ 6017 Attribute Name |CER|CEA|DPR|DPA|DWR|DWA|RAR|RAA|ASR|ASA|STR|STA| 6018 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 6019 Acct-Interim- |0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 6020 Interval | | | | | | | | | | | | | 6021 Accounting-Realtime-|0 |0 |0 |0 |0 |0 |0-1|0 |0 |0 |0 |0 | 6022 Required | | | | | | | | | | | | | 6023 Acct-Application-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6024 Auth-Application-Id |0+ |0+ |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 6025 Auth-Grace-Period |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6026 Auth-Request-Type |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6027 Auth-Session-State |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6028 Authorization- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6029 Lifetime | | | | | | | | | | | | | 6030 Class |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0+ |0+ | 6031 Destination-Host |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0-1|0 | 6032 Destination-Realm |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |1 |0 | 6033 Disconnect-Cause |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6034 Error-Message |0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1|0 |0-1| 6035 Error-Reporting-Host|0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6036 Failed-AVP |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ |0 |0+ | 6037 Firmware-Revision |0-1|0-1|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6038 Host-IP-Address |1+ |1+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6039 Inband-Security-Id |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6040 Multi-Round-Time-Out|0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6041 Origin-Host |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6042 Origin-Realm |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 |1 | 6043 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| 6044 Product-Name |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6045 Proxy-Info |0 |0 |0 |0 |0 |0 |0+ |0+ |0+ |0+ |0+ |0+ | 6046 Redirect-Host |0 |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ | 6047 Redirect-Host-Usage |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6048 Redirect-Max-Cache- |0 |0 |0 |0 |0 |0 |0 |0-1|0 |0-1|0 |0-1| 6049 Time | | | | | | | | | | | | | 6050 Result-Code |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 |0 |1 | 6051 Re-Auth-Request-Type|0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 | 6052 Route-Record |0 |0 |0 |0 |0 |0 |0+ |0 |0+ |0 |0+ |0 | 6053 Session-Binding |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6054 Session-Id |0 |0 |0 |0 |0 |0 |1 |1 |1 |1 |1 |1 | 6055 Session-Server- |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6056 Failover | | | | | | | | | | | | | 6057 Session-Timeout |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6058 Supported-Vendor-Id |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6059 Termination-Cause |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |1 |0 | 6060 User-Name |0 |0 |0 |0 |0 |0 |0-1|0-1|0-1|0-1|0-1|0-1| 6061 Vendor-Id |1 |1 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6062 Vendor-Specific- |0+ |0+ |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | 6063 Application-Id | | | | | | | | | | | | | 6064 --------------------+---+---+---+---+---+---+---+---+---+---+---+---+ 6066 10.2. Accounting AVP Table 6068 The table in this section is used to represent which AVPs defined in 6069 this document are to be present in the Accounting messages. These 6070 AVP occurrence requirements are guidelines, which may be expanded, 6071 and/or overridden by application-specific requirements in the 6072 Diameter applications documents. 6074 +-----------+ 6075 | Command | 6076 | Code | 6077 +-----+-----+ 6078 Attribute Name | ACR | ACA | 6079 ------------------------------+-----+-----+ 6080 Acct-Interim-Interval | 0-1 | 0-1 | 6081 Acct-Multi-Session-Id | 0-1 | 0-1 | 6082 Accounting-Record-Number | 1 | 1 | 6083 Accounting-Record-Type | 1 | 1 | 6084 Acct-Session-Id | 0-1 | 0-1 | 6085 Accounting-Sub-Session-Id | 0-1 | 0-1 | 6086 Accounting-Realtime-Required | 0-1 | 0-1 | 6087 Acct-Application-Id | 0-1 | 0-1 | 6088 Auth-Application-Id | 0 | 0 | 6089 Class | 0+ | 0+ | 6090 Destination-Host | 0-1 | 0 | 6091 Destination-Realm | 1 | 0 | 6092 Error-Reporting-Host | 0 | 0+ | 6093 Event-Timestamp | 0-1 | 0-1 | 6094 Origin-Host | 1 | 1 | 6095 Origin-Realm | 1 | 1 | 6096 Proxy-Info | 0+ | 0+ | 6097 Route-Record | 0+ | 0 | 6098 Result-Code | 0 | 1 | 6099 Session-Id | 1 | 1 | 6100 Termination-Cause | 0 | 0 | 6101 User-Name | 0-1 | 0-1 | 6102 Vendor-Specific-Application-Id| 0-1 | 0-1 | 6103 ------------------------------+-----+-----+ 6105 11. IANA Considerations 6107 This section provides guidance to the Internet Assigned Numbers 6108 Authority (IANA) regarding registration of values related to the 6109 Diameter protocol, in accordance with BCP 26 [RFC5226]. The 6110 following policies are used here with the meanings defined in BCP 26: 6111 "Private Use", "First Come First Served", "Expert Review", 6112 "Specification Required", "IETF Review", "Standards Action". 6114 This section explains the criteria to be used by the IANA for 6115 assignment of numbers within namespaces defined within this document. 6117 For registration requests where a Designated Expert should be 6118 consulted, the responsible IESG area director should appoint the 6119 Designated Expert. For Designated Expert with Specification 6120 Required, the request is posted to the DIME WG mailing list (or, if 6121 it has been disbanded, a successor designated by the Area Director) 6122 for comment and review, and MUST include a pointer to a public 6123 specification. Before a period of 30 days has passed, the Designated 6124 Expert will either approve or deny the registration request and 6125 publish a notice of the decision to the DIME WG mailing list or its 6126 successor. A denial notice MUST be justified by an explanation and, 6127 in the cases where it is possible, concrete suggestions on how the 6128 request can be modified so as to become acceptable. 6130 11.1. AVP Header 6132 As defined in Section 4, the AVP header contains three fields that 6133 requires IANA namespace management; the AVP Code, Vendor-ID and Flags 6134 field. 6136 11.1.1. AVP Codes 6138 The AVP Code namespace is used to identify attributes. There are 6139 multiple namespaces. Vendors can have their own AVP Codes namespace 6140 which will be identified by their Vendor-ID (also known as 6141 Enterprise-Number) and they control the assignments of their vendor- 6142 specific AVP codes within their own namespace. The absence of a 6143 Vendor-ID or a Vendor-ID value of zero (0) identifies the IETF IANA 6144 controlled AVP Codes namespace. The AVP Codes and sometimes also 6145 possible values in an AVP are controlled and maintained by IANA. 6147 AVP Code 0 is not used. AVP Codes 1-255 are managed separately as 6148 RADIUS Attribute Types [RADTYPE]. This document defines the AVP 6149 Codes 257-274, 276-285, 287, 291-300, 480, 483 and 485-486. See 6150 Section 4.5 for the assignment of the namespace in this 6151 specification. 6153 AVPs may be allocated following Designated Expert with Specification 6154 Required [RFC5226]. Release of blocks of AVPs (more than 3 at a time 6155 for a given purpose) should require IETF Review. 6157 Note that Diameter defines a mechanism for Vendor-Specific AVPs, 6158 where the Vendor-Id field in the AVP header is set to a non-zero 6159 value. Vendor-Specific AVPs codes are for Private Use and should be 6160 encouraged instead of allocation of global attribute types, for 6161 functions specific only to one vendor's implementation of Diameter, 6162 where no interoperability is deemed useful. Where a Vendor-Specific 6163 AVP is implemented by more than one vendor, allocation of global AVPs 6164 should be encouraged instead. 6166 11.1.2. AVP Flags 6168 There are 8 bits in the AVP Flags field of the AVP header, defined in 6169 Section 4. This document assigns bit 0 ('V'endor Specific), bit 1 6170 ('M'andatory) and bit 2 ('P'rotected). The remaining bits should 6171 only be assigned via a Standards Action [RFC5226]. 6173 11.2. Diameter Header 6175 As defined in Section 3, the Diameter header contains two fields that 6176 require IANA namespace management; Command Code and Command Flags. 6178 11.2.1. Command Codes 6180 The Command Code namespace is used to identify Diameter commands. 6181 The values 0-255 (0x00-0xff) are reserved for RADIUS backward 6182 compatibility, and are defined as "RADIUS Packet Type Codes" in 6183 [RADTYPE]. Values 256 - 8,388,607 (0x100 to 0x7fffff) are for 6184 permanent, standard commands, allocated by IETF Review [RFC5226]. 6185 This document defines the Command Codes 257, 258, 271, 274-275, 280 6186 and 282. See Section 3.1 for the assignment of the namespace in this 6187 specification. 6189 The values 8,388,608 - 16,777,213 (0x800000 - 0xfffffd) are reserved 6190 for vendor-specific command codes, to be allocated on a First Come, 6191 First Served basis by IANA [RFC5226]. The request to IANA for a 6192 Vendor-Specific Command Code SHOULD include a reference to a publicly 6193 available specification which documents the command in sufficient 6194 detail to aid in interoperability between independent 6195 implementations. If the specification cannot be made publicly 6196 available, the request for a vendor-specific command code MUST 6197 include the contact information of persons and/or entities 6198 responsible for authoring and maintaining the command. 6200 The values 16,777,214 and 16,777,215 (hexadecimal values 0xfffffe - 6201 0xffffff) are reserved for experimental commands. As these codes are 6202 only for experimental and testing purposes, no guarantee is made for 6203 interoperability between Diameter peers using experimental commands, 6204 as outlined in [IANA-EXP]. 6206 11.2.2. Command Flags 6208 There are eight bits in the Command Flags field of the Diameter 6209 header. This document assigns bit 0 ('R'equest), bit 1 ('P'roxy), 6210 bit 2 ('E'rror) and bit 3 ('T'). Bits 4 through 7 MUST only be 6211 assigned via a Standards Action [RFC5226]. 6213 11.3. Application Identifiers 6215 As defined in Section 2.4, the Application Id is used to identify a 6216 specific Diameter Application. There are standards-track Application 6217 Ids and vendor specific Application Ids. 6219 IANA [RFC5226] has assigned the range 0x00000001 to 0x00ffffff for 6220 standards-track applications; and 0x01000000 - 0xfffffffe for vendor 6221 specific applications, on a first-come, first-served basis. The 6222 following values are allocated. 6224 Diameter Common Messages 0 6225 Diameter Base Accounting 3 6226 Relay 0xffffffff 6228 Assignment of standards-track Application Ids are by Designated 6229 Expert with Specification Required [RFC5226]. 6231 Both Auth-Application-Id and Acct-Application-Id AVPs use the same 6232 Application Id space. A Diameter node advertising itself as a relay 6233 agent MUST set either Application-Id or Acct-Application-Id to 6234 0xffffffff. 6236 Vendor-Specific Application Ids, are for Private Use. Vendor-Specific 6237 Application Ids are assigned on a First Come, First Served basis by 6238 IANA. 6240 11.4. AVP Values 6242 Certain AVPs in Diameter define a list of values with various 6243 meanings. This section lists such attributes in the Diameter base 6244 protocol and their IANA allocation rules. 6246 Allocation of Application Ids was discussed in Section 2.4. Other 6247 attributes in the base protocol do not take enumerated values or bit 6248 masks or employ existing name spaces such as SMI Network Management 6249 Private Enterprise Codes [RFC3232] or IP addresses. The allocation 6250 of new values for these existing name spaces is done in accordance 6251 with the rules already defined for them. 6253 11.4.1. Result-Code AVP Values 6255 As defined in Section 7.1, the Result-Code AVP (AVP Code 268) defines 6256 the values 1001, 2001-2002, 3001-3012, 4001-4003 and 5001-5021. 6258 All remaining values are available for assignment via IETF Review 6259 [RFC5226]. 6261 11.4.2. Experimental-Result-Code AVP 6263 Values for this AVP are purely local to the indicated vendor, and no 6264 IANA registry is maintained for them. 6266 11.4.3. Accounting-Record-Type AVP Values 6268 As defined in Section 9.8.1, the Accounting-Record-Type AVP (AVP Code 6269 480) defines the values 1-4. All remaining values are available for 6270 assignment via IETF Review [RFC5226]. 6272 11.4.4. Termination-Cause AVP Values 6274 As defined in Section 8.15, the Termination-Cause AVP (AVP Code 295) 6275 defines the values 1-8. All remaining values are available for 6276 assignment via IETF Review [RFC5226]. 6278 11.4.5. Redirect-Host-Usage AVP Values 6280 As defined in Section 6.13, the Redirect-Host-Usage AVP (AVP Code 6281 261) defines the values 0-5. All remaining values are available for 6282 assignment via IETF Review [RFC5226]. 6284 11.4.6. Session-Server-Failover AVP Values 6286 As defined in Section 8.18, the Session-Server-Failover AVP (AVP Code 6287 271) defines the values 0-3. All remaining values are available for 6288 assignment via IETF Review [RFC5226]. 6290 11.4.7. Session-Binding AVP Values 6292 As defined in Section 8.17, the Session-Binding AVP (AVP Code 270) 6293 defines the bits 1-4. All remaining bits are available for 6294 assignment via IETF Review [RFC5226]. 6296 11.4.8. Disconnect-Cause AVP Values 6298 As defined in Section 5.4.3, the Disconnect-Cause AVP (AVP Code 273) 6299 defines the values 0-2. All remaining values are available for 6300 assignment via IETF Review [RFC5226]. 6302 11.4.9. Auth-Request-Type AVP Values 6304 As defined in Section 8.7, the Auth-Request-Type AVP (AVP Code 274) 6305 defines the values 1-3. All remaining values are available for 6306 assignment via IETF Review [RFC5226]. 6308 11.4.10. Auth-Session-State AVP Values 6310 As defined in Section 8.11, the Auth-Session-State AVP (AVP Code 277) 6311 defines the values 0-1. All remaining values are available for 6312 assignment via IETF Review [RFC5226]. 6314 11.4.11. Re-Auth-Request-Type AVP Values 6316 As defined in Section 8.12, the Re-Auth-Request-Type AVP (AVP Code 6317 285) defines the values 0-1. All remaining values are available for 6318 assignment via IETF Review [RFC5226]. 6320 11.4.12. Accounting-Realtime-Required AVP Values 6322 As defined in Section 9.8.7, the Accounting-Realtime-Required AVP 6323 (AVP Code 483) defines the values 1-3. All remaining values are 6324 available for assignment via IETF Review [RFC5226]. 6326 11.4.13. Inband-Security-Id AVP (code 299) 6328 As defined in Section 6.10, the Inband-Security-Id AVP (AVP Code 299) 6329 defines the values 0-1. All remaining values are available for 6330 assignment via IETF Review. [RFC5226]. 6332 11.5. Diameter TCP, SCTP and TLS/TCP Port Numbers 6334 The IANA has assigned port number 3868 for TCP and SCTP. The IANA is 6335 requested to allocate a port number for TLS/TCP. 6337 11.6. NAPTR Service Fields 6339 The registration in the RFC MUST include the following information: 6341 Service Field: The service field being registered. An example for a 6342 new fictitious transport protocol called NCTP might be "AAA+D2N". 6344 Protocol: The specific transport protocol associated with that 6345 service field. This MUST include the name and acronym for the 6346 protocol, along with reference to a document that describes the 6347 transport protocol. For example - "New Connectionless Transport 6348 Protocol (NCTP), RFC XYZ". 6350 Name and Contact Information: The name, address, email address and 6351 telephone number for the person performing the registration. 6353 The following values have been placed into the registry: 6355 Services Field Protocol 6357 AAA+D2T TCP 6358 AAA+D2S SCTP 6359 AAA+D2L TLS 6361 12. Diameter protocol related configurable parameters 6363 This section contains the configurable parameters that are found 6364 throughout this document: 6366 Diameter Peer 6368 A Diameter entity MAY communicate with peers that are statically 6369 configured. A statically configured Diameter peer would require 6370 that either the IP address or the fully qualified domain name 6371 (FQDN) be supplied, which would then be used to resolve through 6372 DNS. 6374 Routing Table 6376 A Diameter proxy server routes messages based on the realm portion 6377 of a Network Access Identifier (NAI). The server MUST have a 6378 table of Realm Names, and the address of the peer to which the 6379 message must be forwarded to. The routing table MAY also include 6380 a "default route", which is typically used for all messages that 6381 cannot be locally processed. 6383 Tc timer 6385 The Tc timer controls the frequency that transport connection 6386 attempts are done to a peer with whom no active transport 6387 connection exists. The recommended value is 30 seconds. 6389 13. Security Considerations 6391 The Diameter base protocol messages SHOULD be secured by using TLS 6392 [RFC5246]. Additional security mechanisms such as IPsec [RFC4301] 6393 MAY also be deployed to secure connections between peers. However, 6394 all Diameter base protocol implementations MUST support the use of 6395 TLS and the Diameter protocol MUST NOT be used without any security 6396 mechanism. 6398 If a Diameter connection is to be protected via TLS or IPsec, then 6399 TLS or IPsec handshake SHOULD begin prior to any Diameter message 6400 exchange. All security parameters for TLS or IPsec are configured 6401 independent of the Diameter protocol. All Diameter message will be 6402 sent through the TLS or IPsec connection after a successful setup. 6404 For TLS connections to be established in the open state, the CER/CEA 6405 exchange MUST include an Inband-Security-ID AVP with a value of TLS. 6406 The TLS handshake will begin when both ends successfully reached the 6407 open state, after completion of the CER/CEA exchange. If the TLS 6408 handshake is successful, all further messages will be sent via TLS. 6409 If the handshake fails, both ends move to the closed state. See 6410 Sections 13.1 for more details. 6412 13.1. TLS Usage 6414 Diameter nodes using TLS for security MUST mutually authenticate as 6415 part of TLS session establishment. In order to ensure mutual 6416 authentication, the Diameter node acting as TLS server MUST request a 6417 certificate from the Diameter node acting as TLS client, and the 6418 Diameter node acting as TLS client MUST be prepared to supply a 6419 certificate on request. 6421 Diameter nodes MUST be able to negotiate the following TLS cipher 6422 suites: 6424 TLS_RSA_WITH_RC4_128_MD5 6425 TLS_RSA_WITH_RC4_128_SHA 6426 TLS_RSA_WITH_3DES_EDE_CBC_SHA 6428 Diameter nodes SHOULD be able to negotiate the following TLS cipher 6429 suite: 6431 TLS_RSA_WITH_AES_128_CBC_SHA 6433 Diameter nodes MAY negotiate other TLS cipher suites. 6435 13.2. Peer-to-Peer Considerations 6437 As with any peer-to-peer protocol, proper configuration of the trust 6438 model within a Diameter peer is essential to security. When 6439 certificates are used, it is necessary to configure the root 6440 certificate authorities trusted by the Diameter peer. These root CAs 6441 are likely to be unique to Diameter usage and distinct from the root 6442 CAs that might be trusted for other purposes such as Web browsing. 6443 In general, it is expected that those root CAs will be configured so 6444 as to reflect the business relationships between the organization 6445 hosting the Diameter peer and other organizations. As a result, a 6446 Diameter peer will typically not be configured to allow connectivity 6447 with any arbitrary peer. With certificate authentication, Diameter 6448 peers may not be known beforehand and therefore peer discovery may be 6449 required. 6451 14. References 6453 14.1. Normative References 6455 [FLOATPOINT] 6456 Institute of Electrical and Electronics Engineers, "IEEE 6457 Standard for Binary Floating-Point Arithmetic, ANSI/IEEE 6458 Standard 754-1985", August 1985. 6460 [IANAADFAM] 6461 IANA,, "Address Family Numbers", 6462 http://www.iana.org/assignments/address-family-numbers. 6464 [RADTYPE] IANA,, "RADIUS Types", 6465 http://www.iana.org/assignments/radius-types. 6467 [RFC791] Postel, J., "Internet Protocol", RFC 791, September 1981. 6469 [RFC793] Postel, J., "Transmission Control Protocol", RFC 793, 6470 January 1981. 6472 [RFC3539] Aboba, B. and J. Wood, "Authentication, Authorization and 6473 Accounting (AAA) Transport Profile", RFC 3539, June 2003. 6475 [RFC4004] Calhoun, P., Johansson, T., Perkins, C., Hiller, T., and 6476 P. McCann, "Diameter Mobile IPv4 Application", RFC 4004, 6477 August 2005. 6479 [RFC4005] Calhoun, P., Zorn, G., Spence, D., and D. Mitton, 6480 "Diameter Network Access Server Application", RFC 4005, 6481 August 2005. 6483 [RFC4006] Hakala, H., Mattila, L., Koskinen, J-P., Stura, M., and J. 6484 Loughney, "Diameter Credit-Control Application", RFC 4006, 6485 August 2005. 6487 [RFC4072] Eronen, P., Hiller, T., and G. Zorn, "Diameter Extensible 6488 Authentication Protocol (EAP) Application", RFC 4072, 6489 August 2005. 6491 [RFC4740] Garcia-Martin, M., Belinchon, M., Pallares-Lopez, M., 6492 Canales-Valenzuela, C., and K. Tammi, "Diameter Session 6493 Initiation Protocol (SIP) Application", RFC 4740, 6494 November 2006. 6496 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 6497 Specifications: ABNF", STD 68, RFC 5234, January 2008. 6499 [RFC3588] Calhoun, P., Loughney, J., Guttman, E., Zorn, G., and J. 6500 Arkko, "Diameter Base Protocol", RFC 3588, September 2003. 6502 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 6503 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 6504 May 2008. 6506 [RFC4306] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol", 6507 RFC 4306, December 2005. 6509 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 6510 Architecture", RFC 4291, February 2006. 6512 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 6513 Requirement Levels", BCP 14, RFC 2119, March 1997. 6515 [RFC4282] Aboba, B., Beadles, M., Arkko, J., and P. Eronen, "The 6516 Network Access Identifier", RFC 4282, December 2005. 6518 [RFC3403] Mealling, M., "Dynamic Delegation Discovery System (DDDS) 6519 Part Three: The Domain Name System (DNS) Database", 6520 RFC 3403, October 2002. 6522 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 6523 Requirements for Security", BCP 106, RFC 4086, June 2005. 6525 [RFC4960] Stewart, R., "Stream Control Transmission Protocol", 6526 RFC 4960, September 2007. 6528 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 6529 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 6531 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 6532 Resource Identifier (URI): Generic Syntax", STD 66, 6533 RFC 3986, January 2005. 6535 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 6536 10646", STD 63, RFC 3629, November 2003. 6538 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 6539 Housley, R., and W. Polk, "Internet X.509 Public Key 6540 Infrastructure Certificate and Certificate Revocation List 6541 (CRL) Profile", RFC 5280, May 2008. 6543 [RFC3490] Faltstrom, P., Hoffman, P., and A. Costello, 6544 "Internationalizing Domain Names in Applications (IDNA)", 6545 RFC 3490, March 2003. 6547 [RFC3491] Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep 6548 Profile for Internationalized Domain Names (IDN)", 6549 RFC 3491, March 2003. 6551 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 6552 for Internationalized Domain Names in Applications 6553 (IDNA)", RFC 3492, March 2003. 6555 14.2. Informational References 6557 [RFC2989] Aboba, B., Calhoun, P., Glass, S., Hiller, T., McCann, P., 6558 Shiino, H., Zorn, G., Dommety, G., C.Perkins, B.Patil, 6559 D.Mitton, S.Manning, M.Beadles, P.Walsh, X.Chen, 6560 S.Sivalingham, A.Hameed, M.Munson, S.Jacobs, B.Lim, 6561 B.Hirschman, R.Hsu, Y.Xu, E.Campell, S.Baba, and E.Jaques, 6562 "Criteria for Evaluating AAA Protocols for Network 6563 Access", RFC 2989, November 2000. 6565 [RFC2975] Aboba, B., Arkko, J., and D. Harrington, "Introduction to 6566 Accounting Management", RFC 2975, October 2000. 6568 [RFC3232] Reynolds, J., "Assigned Numbers: RFC 1700 is Replaced by 6569 an On-line Database", RFC 3232, January 2002. 6571 [RFC5176] Chiba, M., Dommety, G., Eklund, M., Mitton, D., and B. 6572 Aboba, "Dynamic Authorization Extensions to Remote 6573 Authentication Dial In User Service (RADIUS)", RFC 5176, 6574 January 2008. 6576 [RFC1661] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, 6577 RFC 1661, July 1994. 6579 [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000. 6581 [RFC2869] Rigney, C., Willats, W., and P. Calhoun, "RADIUS 6582 Extensions", RFC 2869, June 2000. 6584 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, 6585 "Remote Authentication Dial In User Service (RADIUS)", 6586 RFC 2865, June 2000. 6588 [RFC3162] Aboba, B., Zorn, G., and D. Mitton, "RADIUS and IPv6", 6589 RFC 3162, August 2001. 6591 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 6592 Internet Protocol", RFC 4301, December 2005. 6594 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 6595 A., Peterson, J., Sparks, R., Handley, M., and E. 6596 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 6597 June 2002. 6599 [RFC4330] Mills, D., "Simple Network Time Protocol (SNTP) Version 4 6600 for IPv4, IPv6 and OSI", RFC 4330, January 2006. 6602 [RFC1492] Finseth, C., "An Access Control Protocol, Sometimes Called 6603 TACACS", RFC 1492, July 1993. 6605 [RFC4690] Klensin, J., Faltstrom, P., Karp, C., and IAB, "Review and 6606 Recommendations for Internationalized Domain Names 6607 (IDNs)", RFC 4690, September 2006. 6609 [RFC5461] Gont, F., "TCP's Reaction to Soft Errors", RFC 5461, 6610 February 2009. 6612 [I-D.ietf-tcpm-icmp-attacks] 6613 Gont, F., "ICMP attacks against TCP", 6614 draft-ietf-tcpm-icmp-attacks-04 (work in progress), 6615 October 2008. 6617 [IANA-EXP] 6618 Narten, T., "Assigning Experimental and Testing Numbers 6619 Considered Useful, Work in Progress.". 6621 Appendix A. Acknowledgements 6623 A.1. RFC3588bis 6625 The authors would like to thank the following people that have 6626 provided proposals and contributions to this document: 6628 To Vishnu Ram and Satendra Gera for their contributions on 6629 Capabilities Updates, Predictive Loop Avoidance as well as many other 6630 technical proposals. To Tolga Asveren for his insights and 6631 contributions on almost all of the proposed solutions incorporated 6632 into this document. To Timothy Smith for helping on the Capabilities 6633 Updates and other topics. To Tony Zhang for providing fixes to loop 6634 holes on composing Failed-AVPs as well as many other issues and 6635 topics. To Jan Nordqvist for clearly stating the usage of 6636 Application Ids. To Anders Kristensen for providing needed technical 6637 opinions. To David Frascone for providing invaluable review of the 6638 document. To Mark Jones for providing clarifying text on vendor 6639 command codes and other vendor specific indicators. 6641 Special thanks to the Diameter extensibility design team which helped 6642 resolve the tricky question of mandatory AVPs and ABNF semantics. 6643 The members of this team are as follows: 6645 Avi Lior, Jari Arkko, Glen Zorn, Lionel Morand, Mark Jones, Tolga 6646 Asveren Jouni Korhonen, Glenn McGregor. 6648 Special thanks also to people who have provided invaluable comments 6649 and inputs especially in resolving controversial issues: 6651 Glen Zorn, Yoshihiro Ohba, Marco Stura, and Pasi Eronen. 6653 Finally, we would like to thank the original authors of this 6654 document: 6656 Pat Calhoun, John Loughney, Jari Arkko, Erik Guttman and Glen Zorn. 6658 Their invaluable knowledge and experience has given us a robust and 6659 flexible AAA protocol that many people have seen great value in 6660 adopting. We greatly appreciate their support and stewardship for 6661 the continued improvements of Diameter as a protocol. We would also 6662 like to extend our gratitude to folks aside from the authors who have 6663 assisted and contributed to the original version of this document. 6664 Their efforts significantly contributed to the success of Diameter. 6666 A.2. RFC3588 6668 The authors would like to thank Nenad Trifunovic, Tony Johansson and 6669 Pankaj Patel for their participation in the pre-IETF Document Reading 6670 Party. Allison Mankin, Jonathan Wood and Bernard Aboba provided 6671 invaluable assistance in working out transport issues, and similarly 6672 with Steven Bellovin in the security area. 6674 Paul Funk and David Mitton were instrumental in getting the Peer 6675 State Machine correct, and our deep thanks go to them for their time. 6677 Text in this document was also provided by Paul Funk, Mark Eklund, 6678 Mark Jones and Dave Spence. Jacques Caron provided many great 6679 comments as a result of a thorough review of the spec. 6681 The authors would also like to acknowledge the following people for 6682 their contribution in the development of the Diameter protocol: 6684 Allan C. Rubens, Haseeb Akhtar, William Bulley, Stephen Farrell, 6685 David Frascone, Daniel C. Fox, Lol Grant, Ignacio Goyret, Nancy 6686 Greene, Peter Heitman, Fredrik Johansson, Mark Jones, Martin Julien, 6687 Bob Kopacz, Paul Krumviede, Fergal Ladley, Ryan Moats, Victor Muslin, 6688 Kenneth Peirce, John Schnizlein, Sumit Vakil, John R. Vollbrecht and 6689 Jeff Weisberg. 6691 Finally, Pat Calhoun would like to thank Sun Microsystems since most 6692 of the effort put into this document was done while he was in their 6693 employ. 6695 Appendix B. NAPTR Example 6697 As an example, consider a client that wishes to resolve aaa: 6698 example.com. The client performs a NAPTR query for that domain, and 6699 the following NAPTR records are returned: 6701 ;; order pref flags service regexp replacement 6702 IN NAPTR 50 50 "s" "AAA+D2L" "" _diameter._tls.example.com 6703 IN NAPTR 100 50 "s" "AAA+D2T" "" _aaa._tcp.example.com 6704 IN NAPTR 150 50 "s" "AAA+D2S" "" _diameter._sctp.example.com 6706 This indicates that the server supports TLS, TCP and SCTP in that 6707 order. If the client supports TLS, TLS will be used, targeted to a 6708 host determined by an SRV lookup of _diameter._tls.example.com. That 6709 lookup would return: 6711 ;; Priority Weight Port Target 6712 IN SRV 0 1 5060 server1.example.com 6713 IN SRV 0 2 5060 server2.example.com 6715 Appendix C. Duplicate Detection 6717 As described in Section 9.4, accounting record duplicate detection is 6718 based on session identifiers. Duplicates can appear for various 6719 reasons: 6721 o Failover to an alternate server. Where close to real-time 6722 performance is required, failover thresholds need to be kept low 6723 and this may lead to an increased likelihood of duplicates. 6724 Failover can occur at the client or within Diameter agents. 6726 o Failure of a client or agent after sending of a record from non- 6727 volatile memory, but prior to receipt of an application layer ACK 6728 and deletion of the record. record to be sent. This will result 6729 in retransmission of the record soon after the client or agent has 6730 rebooted. 6732 o Duplicates received from RADIUS gateways. Since the 6733 retransmission behavior of RADIUS is not defined within [RFC2865], 6734 the likelihood of duplication will vary according to the 6735 implementation. 6737 o Implementation problems and misconfiguration. 6739 The T flag is used as an indication of an application layer 6740 retransmission event, e.g., due to failover to an alternate server. 6741 It is defined only for request messages sent by Diameter clients or 6742 agents. For instance, after a reboot, a client may not know whether 6743 it has already tried to send the accounting records in its non- 6744 volatile memory before the reboot occurred. Diameter servers MAY use 6745 the T flag as an aid when processing requests and detecting duplicate 6746 messages. However, servers that do this MUST ensure that duplicates 6747 are found even when the first transmitted request arrives at the 6748 server after the retransmitted request. It can be used only in cases 6749 where no answer has been received from the Server for a request and 6750 the request is sent again, (e.g., due to a failover to an alternate 6751 peer, due to a recovered primary peer or due to a client re-sending a 6752 stored record from non-volatile memory such as after reboot of a 6753 client or agent). 6755 In some cases the Diameter accounting server can delay the duplicate 6756 detection and accounting record processing until a post-processing 6757 phase takes place. At that time records are likely to be sorted 6758 according to the included User-Name and duplicate elimination is easy 6759 in this case. In other situations it may be necessary to perform 6760 real-time duplicate detection, such as when credit limits are imposed 6761 or real-time fraud detection is desired. 6763 In general, only generation of duplicates due to failover or re- 6764 sending of records in non-volatile storage can be reliably detected 6765 by Diameter clients or agents. In such cases the Diameter client or 6766 agents can mark the message as possible duplicate by setting the T 6767 flag. Since the Diameter server is responsible for duplicate 6768 detection, it can choose to make use of the T flag or not, in order 6769 to optimize duplicate detection. Since the T flag does not affect 6770 interoperability, and may not be needed by some servers, generation 6771 of the T flag is REQUIRED for Diameter clients and agents, but MAY be 6772 implemented by Diameter servers. 6774 As an example, it can be usually be assumed that duplicates appear 6775 within a time window of longest recorded network partition or device 6776 fault, perhaps a day. So only records within this time window need 6777 to be looked at in the backward direction. Secondly, hashing 6778 techniques or other schemes, such as the use of the T flag in the 6779 received messages, may be used to eliminate the need to do a full 6780 search even in this set except for rare cases. 6782 The following is an example of how the T flag may be used by the 6783 server to detect duplicate requests. 6785 A Diameter server MAY check the T flag of the received message to 6786 determine if the record is a possible duplicate. If the T flag is 6787 set in the request message, the server searches for a duplicate 6788 within a configurable duplication time window backward and 6789 forward. This limits database searching to those records where 6790 the T flag is set. In a well run network, network partitions and 6791 device faults will presumably be rare events, so this approach 6792 represents a substantial optimization of the duplicate detection 6793 process. During failover, it is possible for the original record 6794 to be received after the T flag marked record, due to differences 6795 in network delays experienced along the path by the original and 6796 duplicate transmissions. The likelihood of this occurring 6797 increases as the failover interval is decreased. In order to be 6798 able to detect out of order duplicates, the Diameter server should 6799 use backward and forward time windows when performing duplicate 6800 checking for the T flag marked request. For example, in order to 6801 allow time for the original record to exit the network and be 6802 recorded by the accounting server, the Diameter server can delay 6803 processing records with the T flag set until a time period 6804 TIME_WAIT + RECORD_PROCESSING_TIME has elapsed after the closing 6805 of the original transport connection. After this time period has 6806 expired, then it may check the T flag marked records against the 6807 database with relative assurance that the original records, if 6808 sent, have been received and recorded. 6810 Appendix D. Internationalized Domain Names 6812 To be compatible with the existing DNS infrastructure and simplify 6813 host and domain name comparison, Diameter identities (FQDNs) are 6814 represented in ASCII form. This allows the Diameter protocol to fall 6815 in-line with the DNS strategy of being transparent from the effects 6816 of Internationalized Domain Names (IDNs) by following the 6817 recommendations in [RFC4690] and [RFC3490]. Applications that 6818 provide support for IDNs outside of the Diameter protocol but 6819 interacting with it SHOULD use the representation and conversion 6820 framework described in [RFC3490], [RFC3491] and [RFC3492]. 6822 Authors' Addresses 6824 Victor Fajardo (editor) 6825 Toshiba America Research 6826 One Telcordia Drive, 1S-222 6827 Piscataway, NJ 08854 6828 USA 6830 Phone: 1 908-421-1845 6831 Email: vfajardo@tari.toshiba.com 6833 Jari Arkko 6834 Ericsson Research 6835 02420 Jorvas 6836 Finland 6838 Phone: +358 40 5079256 6839 Email: jari.arkko@ericsson.com 6841 John Loughney 6842 Nokia Research Center 6843 955 Page Mill Road 6844 Palo Alto, CA 94304 6845 US 6847 Phone: 1-650-283-8068 6848 Email: john.loughney@nokia.com 6850 Glenn Zorn 6851 NetCube 6852 1310 East Thomas Street, #306 6853 Seattle, WA 98102 6854 US 6856 Phone: 6857 Email: glenzorn@comcast.net